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 CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 13ef9e2915ce6842d0dd7e38ebc3f30d3a61eae2
4
- data.tar.gz: f54c566d1fe9fac2fd0d8acee88e8180ae51820b
5
- SHA512:
6
- metadata.gz: 6a926d4112bd1d096b0e50048c9e7fe9d28a7f15d0a644a647cf5989ac3028b27def66536cf1b22b46232c6b10478f05c5a696581c40dfc57efa370e667ebcf1
7
- data.tar.gz: 28f625b349f8a8720983e21c82ddb76ee0f752fc473e2896f2a5191b1f2476743effafcb1a44a67094beae98a8b667592757f5e707f59f591ebf5f6916352c08
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(*args)
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 = args[0]._name
40
- @_rhs_stream = args[1]._name
41
- options = args[2]
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", self, *args)
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
- loop_back_node = args[0]
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 [](v)
10
- raise "The previous operation did not emit a split stream."
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
- # Ruby magic to automatically call 'method_name' on the last stream we collected
14
- def method_missing(method_name, *args, &block)
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
- return results.map {|stream|
19
- Zillabyte::Harness::StreamBuilder.new(stream)
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
@@ -1,3 +1,3 @@
1
1
  module Zillabyte
2
- VERSION = "0.9.5" unless defined?(VERSION)
2
+ VERSION = "0.9.6" unless defined?(VERSION)
3
3
  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.5
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-29 00:00:00.000000000 Z
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.5
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.5
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.2.2
95
+ rubygems_version: 2.0.7
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: The Official Zillabyte Gem