zillabyte 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/ruby/lib/zillabyte/harness/join.rb +5 -5
- data/ruby/lib/zillabyte/harness/stream.rb +14 -3
- data/ruby/lib/zillabyte/harness/stream_builder.rb +43 -11
- data/ruby/lib/zillabyte/version.rb +1 -1
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDgzZWY4MDg3YjI5MDg1YzQwZjNiNWNmYWM0M2E4Nzc2MTdkYzFlMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzdhM2IwMzRjYmFjZTdiOGJjOTMxYmExZmJkNTMwODU3OTc1M2Q1MA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTIwNTgyYjZkNGVkNGIyNDVjMjNlYTlhMTI3MGMyYWFjNjFjMjdkZjNmYjY2
|
10
|
+
OWFjNGRhZWE1ODg5NDdjNTgyOTc5MjY1MmExY2Q5NGJmYzI1NjBjOWFhODVj
|
11
|
+
MDI3YjkwNDJjZTQxMDg0NmIyNTM5NzAxNjg2MmY3NTVlMjYwYTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDYyZTFjM2M5MmNmNzY1NDU0ZDIwNmI2YmQwMmJiNmQ0ODZhZDMxNGQwNTM5
|
14
|
+
ZjFiYmNlYzBlODUzYzRmNTEzZmRjMTE5ZDUxMzg5NGVhODA3NDc1OTUxMTQy
|
15
|
+
MjUwN2Q2MGVhNTc4Yjg4NmQ2Njg1NDI2MjQyODQwNDI1ZDA4ZGY=
|
@@ -32,13 +32,13 @@ class Zillabyte::Harness::Join
|
|
32
32
|
class Node
|
33
33
|
attr_accessor :_name, :_type, :_lhs_stream, :_rhs_stream, :_lhs_fields, :_rhs_fields, :_join_type, :_emits
|
34
34
|
|
35
|
-
def initialize(
|
36
|
-
@_name = "join_"+Zillabyte::Harness::Counter.get()
|
35
|
+
def initialize(lhs_stream, rhs_stream, options = {})
|
36
|
+
@_name = options[:name] || "join_"+Zillabyte::Harness::Counter.get()
|
37
37
|
@_type = 'join'
|
38
38
|
@_join_type = :inner
|
39
|
-
@_lhs_stream =
|
40
|
-
@_rhs_stream =
|
41
|
-
|
39
|
+
@_lhs_stream = lhs_stream._name
|
40
|
+
@_rhs_stream = rhs_stream._name
|
41
|
+
@_options = options
|
42
42
|
|
43
43
|
options.symbolize_keys!
|
44
44
|
|
@@ -45,10 +45,20 @@ class Zillabyte::Harness::Stream
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def join_with(*args)
|
48
|
+
|
48
49
|
lhs_stream = self
|
49
50
|
rhs_stream = args[0]
|
51
|
+
options = args[1] || {}
|
52
|
+
|
53
|
+
if rhs_stream.is_a?(Zillabyte::Harness::StreamBuilder)
|
54
|
+
rhs_stream = rhs_stream._last_stream
|
55
|
+
end
|
56
|
+
if lhs_stream.is_a?(Zillabyte::Harness::StreamBuilder)
|
57
|
+
lhs_stream = lhs_stream._last_stream
|
58
|
+
end
|
59
|
+
|
50
60
|
op = Zillabyte::Harness::OperationHandler.new(@_app, self.class)
|
51
|
-
op.build_multilang_operation("join",
|
61
|
+
op.build_multilang_operation("join", lhs_stream, rhs_stream, options)
|
52
62
|
.add_operation_properties_to_info(:name, :type, :lhs_fields, :rhs_fields, :join_type, :lhs_stream, :rhs_stream)
|
53
63
|
.create_arc_info_from_stream(lhs_stream, :left)
|
54
64
|
.create_arc_info_from_stream(rhs_stream, :right)
|
@@ -72,9 +82,10 @@ class Zillabyte::Harness::Stream
|
|
72
82
|
|
73
83
|
def loop_back(*args, &block)
|
74
84
|
# This is not a real operation, just telling the stream to loop back to the previous operation
|
75
|
-
|
85
|
+
@_vector_options, @_options = Zillabyte::Harness::Helper.get_vector_and_hashes(args)
|
86
|
+
loop_back_node = @_vector_options[0]
|
76
87
|
Zillabyte::Harness::Helper.check_loop_back(self, loop_back_node, @_app._nodes)
|
77
|
-
Zillabyte::Harness::Helper.write_arc_to_file({"name" => self._name, "origin" => self._previous_node_name, "dest" => loop_back_node, "loop_back" => 1}, @_app._socket)
|
88
|
+
Zillabyte::Harness::Helper.write_arc_to_file({"name" => (@_options[:name] || self._name), "origin" => self._previous_node_name, "dest" => loop_back_node, "loop_back" => 1}, @_app._socket)
|
78
89
|
end
|
79
90
|
|
80
91
|
def sink(*args, &block)
|
@@ -1,28 +1,60 @@
|
|
1
|
-
class Zillabyte::Harness::StreamBuilder
|
2
|
-
attr_accessor :_name, :_app, :_previous_node_name
|
1
|
+
class Zillabyte::Harness::StreamBuilder < Array
|
3
2
|
|
4
3
|
def initialize(first_stream)
|
5
4
|
@_streams = [first_stream]
|
6
5
|
end
|
7
|
-
|
8
|
-
|
9
|
-
def
|
10
|
-
|
6
|
+
|
7
|
+
# Override these methods explicitly because they are provided by 'Array'
|
8
|
+
def each(*args, &block)
|
9
|
+
_handle_function(:each, *args, &block)
|
10
|
+
end
|
11
|
+
|
12
|
+
def group_by(*args, &block)
|
13
|
+
_handle_function(:group_by, *args, &block)
|
14
|
+
end
|
15
|
+
|
16
|
+
def map(*args, &block)
|
17
|
+
raise "Unsupported"
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
def [](v)
|
23
|
+
if self.size == 0
|
24
|
+
raise "The previous operation did not emit a split stream"
|
25
|
+
else
|
26
|
+
return Zillabyte::Harness::StreamBuilder.new(super)
|
27
|
+
end
|
11
28
|
end
|
12
29
|
|
13
|
-
|
14
|
-
|
30
|
+
def _handle_function(method_name, *args, &block)
|
31
|
+
|
32
|
+
if self.size > 0
|
33
|
+
raise "The previous operation split the stream."
|
34
|
+
end
|
35
|
+
|
15
36
|
results = @_streams.last.send method_name, *args, &block
|
16
37
|
if results.is_a?(Array)
|
17
38
|
# Split stream...
|
18
|
-
|
19
|
-
|
20
|
-
|
39
|
+
results.each_with_index do |stream, i|
|
40
|
+
self[i] = stream
|
41
|
+
end
|
21
42
|
else
|
22
43
|
# Continue this stream...
|
23
44
|
@_streams << results
|
45
|
+
self.clear()
|
24
46
|
end
|
25
47
|
return self
|
26
48
|
end
|
49
|
+
|
50
|
+
|
51
|
+
# Ruby magic to automatically call 'method_name' on the last stream we collected
|
52
|
+
def method_missing(method_name, *args, &block)
|
53
|
+
_handle_function(method_name, *args, &block)
|
54
|
+
end
|
55
|
+
|
56
|
+
def _last_stream()
|
57
|
+
@_streams.last
|
58
|
+
end
|
27
59
|
|
28
60
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zillabyte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zillabyte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: zillabyte-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.9.
|
33
|
+
version: 0.9.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.9.
|
40
|
+
version: 0.9.6
|
41
41
|
description: The Official Zillabyte Gem
|
42
42
|
email:
|
43
43
|
- gem@zillabyte.com
|
@@ -45,9 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- ruby/lib/zillabyte.rb
|
49
48
|
- ruby/lib/zillabyte/common/progress.rb
|
50
|
-
- ruby/lib/zillabyte/harness.rb
|
51
49
|
- ruby/lib/zillabyte/harness/app.rb
|
52
50
|
- ruby/lib/zillabyte/harness/base.rb
|
53
51
|
- ruby/lib/zillabyte/harness/clump.rb
|
@@ -71,7 +69,9 @@ files:
|
|
71
69
|
- ruby/lib/zillabyte/harness/stream.rb
|
72
70
|
- ruby/lib/zillabyte/harness/stream_builder.rb
|
73
71
|
- ruby/lib/zillabyte/harness/tuple.rb
|
72
|
+
- ruby/lib/zillabyte/harness.rb
|
74
73
|
- ruby/lib/zillabyte/version.rb
|
74
|
+
- ruby/lib/zillabyte.rb
|
75
75
|
homepage: http://www.zillabyte.com
|
76
76
|
licenses:
|
77
77
|
- MIT
|
@@ -82,17 +82,17 @@ require_paths:
|
|
82
82
|
- ruby/lib
|
83
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- -
|
85
|
+
- - ! '>='
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- -
|
90
|
+
- - ! '>='
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.0.7
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: The Official Zillabyte Gem
|