zillabyte 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/ruby/lib/zillabyte/harness/clump.rb +34 -0
- data/ruby/lib/zillabyte/harness/component.rb +1 -0
- data/ruby/lib/zillabyte/harness/component_stream.rb +3 -2
- data/ruby/lib/zillabyte/harness/helper.rb +65 -3
- data/ruby/lib/zillabyte/harness/live_delegator.rb +1 -1
- data/ruby/lib/zillabyte/harness/stream.rb +257 -15
- data/ruby/lib/zillabyte/version.rb +1 -1
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZGI5MDc1YmU2MzlmNzUxZDBhMzJiMjgxNzVhOGJjMTMxNDUwOGIxMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NzE0NzI4OTU0YzQ4YjVhNjQyMDljOTgyMGY3MjJiNmRhMzMyNzI0Ng==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MTMyMDU4OGRiMjA1ZjIxMTk3MjllNTZkNDA1MDVlOTQyZmM5NzQ2NTdhNWEw
|
10
|
+
YTg3OTU2ZGEwNzY2ZmUzMjI5ZGQwMjJhY2ZkYTcwYWI3MjIyOWQ2N2Q3MzQ3
|
11
|
+
MzY3ZmQ0NzYyY2FhNmNjOWZhMmRiMzNiNmI4ZGRkMTRiZTgxOGI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
N2E5NDEyM2QwYzViODU5ODU1Mzg1YTRlMjVlMDU2YmJiYjAzN2MxMjI0OTRl
|
14
|
+
ZTQ4OTQ4NWQwMjU4ZWExZjc4YjY1MDllYTMyNzc2ZDVkODkwZTA0YTU3MWI1
|
15
|
+
Y2ZkYmZiNjMyMGQxNmI4MTdlMmY5N2FkNDM3OTQ5MzU4NmJiYTU=
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class Zillabyte::Harness::Clump
|
2
|
+
attr_accessor :_name, :_type, :_emits, :_output_format, :_parallelism, :_prepare, :_execute
|
3
|
+
|
4
|
+
def initialize()
|
5
|
+
@_name = "clump_"+Zillabyte::Harness::Counter.get()
|
6
|
+
@_type = "clump"
|
7
|
+
@_output_format = :replace
|
8
|
+
end
|
9
|
+
|
10
|
+
def name(v)
|
11
|
+
@_name = v
|
12
|
+
end
|
13
|
+
|
14
|
+
def emits(*v)
|
15
|
+
@_emits = *v
|
16
|
+
end
|
17
|
+
|
18
|
+
def output_format(v)
|
19
|
+
@_output_format = v
|
20
|
+
end
|
21
|
+
|
22
|
+
def parallelism(v)
|
23
|
+
@_parallelism = v
|
24
|
+
end
|
25
|
+
|
26
|
+
def prepare(&block)
|
27
|
+
@_prepare = block
|
28
|
+
end
|
29
|
+
|
30
|
+
def execute(&block)
|
31
|
+
@_execute = block
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -17,6 +17,7 @@ class Zillabyte::Harness::Component < Zillabyte::Harness::Base
|
|
17
17
|
def inputs(*args, &block)
|
18
18
|
h = Zillabyte::Harness::ComponentSource.new
|
19
19
|
h.instance_eval(&block)
|
20
|
+
h._name ||= "comp_input.#{Zillabyte::Harness::Counter.get()}"
|
20
21
|
Zillabyte::Harness::Helper.check_name("inputs", h._name, @_names)
|
21
22
|
Zillabyte::Harness::Helper.check_component_source(h)
|
22
23
|
|
@@ -2,9 +2,10 @@ require 'zillabyte/harness/stream'
|
|
2
2
|
|
3
3
|
class Zillabyte::Harness::ComponentStream < Zillabyte::Harness::Stream
|
4
4
|
|
5
|
-
def
|
5
|
+
def outputs(*args, &block)
|
6
6
|
h = Zillabyte::Harness::ComponentSink.new
|
7
7
|
h.instance_eval(&block)
|
8
|
+
h._name ||= "comp_output.#{Zillabyte::Harness::Counter.get()}"
|
8
9
|
Zillabyte::Harness::Helper.check_name("outputs", h._name, @_app._names)
|
9
10
|
Zillabyte::Harness::Helper.check_component_sink(h)
|
10
11
|
|
@@ -15,6 +16,6 @@ class Zillabyte::Harness::ComponentStream < Zillabyte::Harness::Stream
|
|
15
16
|
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
16
17
|
end
|
17
18
|
end
|
18
|
-
|
19
|
+
|
19
20
|
|
20
21
|
end
|
@@ -55,7 +55,7 @@ class Zillabyte::Harness::Helper
|
|
55
55
|
ee = "Error in \"#{operation}\" at \"name\": \n\t "
|
56
56
|
|
57
57
|
# \w matchs [a-zA-Z0-9_]
|
58
|
-
if(!(name.is_a?(String) or name.is_a?(Symbol)) or (name =~
|
58
|
+
if(!(name.is_a?(String) or name.is_a?(Symbol)) or (name =~ /^[\w\.]+$/).nil?)
|
59
59
|
msg = "#{ee}\"Name\" must be a non-empty STRING with only alphanumeric and underscore characters at \"#{name}\". Apps and components must have names. The following methods must have names as well: \"sink\", \"inputs\" and \"outputs\"."
|
60
60
|
Zillabyte::Harness::Helper.print_error(msg)
|
61
61
|
end
|
@@ -134,7 +134,7 @@ class Zillabyte::Harness::Helper
|
|
134
134
|
end
|
135
135
|
|
136
136
|
emits.each do |e|
|
137
|
-
if(!e.instance_of?(String) or (e =~
|
137
|
+
if(!e.instance_of?(String) or (e =~ /^[\w\.]+$/).nil?)
|
138
138
|
msg = "#{ee}An \"#{oo}\" stream name must be a non-empty STRING with only alphanumeric and underscore characters in \"#{e}\". #{pp}"
|
139
139
|
Zillabyte::Harness::Helper.print_error(msg)
|
140
140
|
end
|
@@ -182,6 +182,23 @@ class Zillabyte::Harness::Helper
|
|
182
182
|
|
183
183
|
Zillabyte::Harness::Helper.check_output_format("each", each._output_format)
|
184
184
|
end
|
185
|
+
|
186
|
+
def self.check_clump(clump)
|
187
|
+
ee = "Error in \"clump\": \n\t "
|
188
|
+
pp = @@_print_check_clump
|
189
|
+
|
190
|
+
if clump._parallelism && clump._parallelism.to_i <= 0
|
191
|
+
msg = "Parallelism for clump must be positive integer"
|
192
|
+
Zillabyte::Harness::Helper.print_error(msg)
|
193
|
+
end
|
194
|
+
|
195
|
+
if !clump._execute
|
196
|
+
msg = "#{ee}A \"clump\" must contain an \"execute\" block. #{pp}"
|
197
|
+
Zillabyte::Harness::Helper.print_error(msg)
|
198
|
+
end
|
199
|
+
|
200
|
+
Zillabyte::Harness::Helper.check_output_format("clump", clump._output_format)
|
201
|
+
end
|
185
202
|
|
186
203
|
def self.check_group_by(group_by)
|
187
204
|
ee = "Error in \"group_by\": \n\t "
|
@@ -259,7 +276,7 @@ class Zillabyte::Harness::Helper
|
|
259
276
|
Zillabyte::Harness::Helper.print_error(msg)
|
260
277
|
end
|
261
278
|
|
262
|
-
if(!(id.is_a?(String) or id.is_a?(Symbol)) or (id =~
|
279
|
+
if(!(id.is_a?(String) or id.is_a?(Symbol)) or (id =~ /^[\w\.]+$/).nil?)
|
263
280
|
msg = "#{ee}The \"component_id\" must be a non-empty STRING with only alphanumeric and underscore characters in \"#{id}\". #{pp}"
|
264
281
|
Zillabyte::Harness::Helper.print_error(msg)
|
265
282
|
end
|
@@ -361,6 +378,23 @@ class Zillabyte::Harness::Helper
|
|
361
378
|
Zillabyte::Harness::Helper.check_field_format("outputs", pp, cname, ctype, node._name)
|
362
379
|
end
|
363
380
|
end
|
381
|
+
|
382
|
+
def self.get_non_option_args(args)
|
383
|
+
if args.last.is_a?(Hash)
|
384
|
+
return args[0..-2]
|
385
|
+
else
|
386
|
+
return args
|
387
|
+
end
|
388
|
+
end
|
389
|
+
|
390
|
+
def self.get_options(args)
|
391
|
+
if args.last.is_a?(Hash)
|
392
|
+
return args.last
|
393
|
+
else
|
394
|
+
return {}
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
364
398
|
|
365
399
|
# Test helper...
|
366
400
|
def self.argv()
|
@@ -527,4 +561,32 @@ OUTPUT
|
|
527
561
|
* The number of input and output streams specified must match the number listed for the component.
|
528
562
|
OUTPUT
|
529
563
|
|
564
|
+
|
565
|
+
@@_print_check_clump = <<-OUTPUT
|
566
|
+
\n\n"Clump" Syntax:
|
567
|
+
Simplified syntax:
|
568
|
+
stream.clump do |tuples|
|
569
|
+
tuples.each do |tuple|
|
570
|
+
|=block=|
|
571
|
+
end
|
572
|
+
end
|
573
|
+
- This is equivalent to just specifying an \"execute\" block below.
|
574
|
+
- Note that this syntax only works for a single output stream.
|
575
|
+
|
576
|
+
Custom clump:
|
577
|
+
stream.clump do
|
578
|
+
name "name" \t\t\t\t\t => optional
|
579
|
+
emits "stream_1", "stream_2", ... \t\t => optional for single output stream
|
580
|
+
output_format :replace OR :merge \t\t => optional, defaults to :replace
|
581
|
+
prepare |=block=| \t\t\t\t => optional if no initialization needed
|
582
|
+
execute |=block=|
|
583
|
+
end
|
584
|
+
- The allowed output formats are :replace and :merge.
|
585
|
+
* :replace - discards the input tuple values and only emits the specified values. This is the default.
|
586
|
+
* :merge - re-emits the input tuple values along with the specified values.
|
587
|
+
- The "prepare" and "execute" blocks can be in do...end format or {} format.
|
588
|
+
* the "prepare" block is where any setup is done to prepare for tuple processing in the "execute" block.
|
589
|
+
* the "execute" block is where the tuples are actually processed. It must take in a single argument (the "tuple").
|
590
|
+
OUTPUT
|
591
|
+
|
530
592
|
end
|
@@ -15,7 +15,7 @@ module Zillabyte
|
|
15
15
|
module Protocol
|
16
16
|
|
17
17
|
READ_SOFT_TIMEOUT = 20 # Amount of time to wait until we send a 'ping' to the parent
|
18
|
-
DEATH_TIMEOUT = READ_SOFT_TIMEOUT *
|
18
|
+
DEATH_TIMEOUT = READ_SOFT_TIMEOUT * 6 # If no activity from the parent (even response to a ping) time before we kill ourself.
|
19
19
|
|
20
20
|
class << self
|
21
21
|
attr_accessor :mode, :emits, :end_cycle_policy, :pending_commands, :pipe_name, :pipe_to_java, :pipe_from_java
|
@@ -13,7 +13,7 @@ class Zillabyte::Harness::Stream
|
|
13
13
|
@_name
|
14
14
|
end
|
15
15
|
|
16
|
-
def each(&block)
|
16
|
+
def each(options = {}, &block)
|
17
17
|
h = Zillabyte::Harness::Each.new()
|
18
18
|
# Does the block take 0 arguments? If so it's not just an execute block.
|
19
19
|
if(block.arity == 0)
|
@@ -35,7 +35,12 @@ class Zillabyte::Harness::Stream
|
|
35
35
|
|
36
36
|
if(@_app._options[:command] == :info)
|
37
37
|
|
38
|
-
node_hash = {
|
38
|
+
node_hash = {
|
39
|
+
:name => h._name,
|
40
|
+
:type => h._type,
|
41
|
+
:output_format => h._output_format,
|
42
|
+
:config => options
|
43
|
+
}
|
39
44
|
if (h._parallelism)
|
40
45
|
node_hash["parallelism"] = h._parallelism
|
41
46
|
end
|
@@ -57,7 +62,8 @@ class Zillabyte::Harness::Stream
|
|
57
62
|
output_streams
|
58
63
|
end
|
59
64
|
|
60
|
-
|
65
|
+
|
66
|
+
def filter(options = {}, &block)
|
61
67
|
h = Zillabyte::Harness::Filter.new()
|
62
68
|
# Does the block take 0 arguments? If so it's not just a keep block.
|
63
69
|
if(block.arity == 0)
|
@@ -84,7 +90,12 @@ class Zillabyte::Harness::Stream
|
|
84
90
|
end
|
85
91
|
|
86
92
|
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
87
|
-
arc_hash = {
|
93
|
+
arc_hash = {
|
94
|
+
:name => @_name,
|
95
|
+
:origin => @_previous_node_name,
|
96
|
+
:dest => h._name,
|
97
|
+
:config => options
|
98
|
+
}
|
88
99
|
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
89
100
|
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
90
101
|
pipe_name = @_app._options[:pipe]
|
@@ -95,11 +106,14 @@ class Zillabyte::Harness::Stream
|
|
95
106
|
output_stream = self.class.new(h._emits[0], @_app, h._name) # filters only have one output stream
|
96
107
|
output_stream
|
97
108
|
end
|
109
|
+
|
98
110
|
|
99
111
|
def group_by(*args, &block)
|
100
112
|
|
101
113
|
# Init
|
102
|
-
|
114
|
+
group_args = Zillabyte::Harness::Helper.get_non_option_args(args)
|
115
|
+
options = Zillabyte::Harness::Helper.get_options(args)
|
116
|
+
h = Zillabyte::Harness::GroupBy.new(*group_args)
|
103
117
|
|
104
118
|
# Yield
|
105
119
|
h.instance_eval(&block)
|
@@ -119,7 +133,12 @@ class Zillabyte::Harness::Stream
|
|
119
133
|
if(@_app._options[:command] == :info)
|
120
134
|
|
121
135
|
# Info..
|
122
|
-
node_hash = {
|
136
|
+
node_hash = {
|
137
|
+
:name => h._name,
|
138
|
+
:type => h._type,
|
139
|
+
:group_by => h._group_by,
|
140
|
+
:config => options
|
141
|
+
}
|
123
142
|
if(h._parallelism)
|
124
143
|
node_hash["parallelism"] = h._parallelism
|
125
144
|
end
|
@@ -147,10 +166,11 @@ class Zillabyte::Harness::Stream
|
|
147
166
|
|
148
167
|
end
|
149
168
|
|
150
|
-
|
169
|
+
|
170
|
+
def join_with(rhs_stream, options = {}, &block)
|
151
171
|
|
152
172
|
# Init
|
153
|
-
h = Zillabyte::Harness::Join.new(
|
173
|
+
h = Zillabyte::Harness::Join.new(options)
|
154
174
|
|
155
175
|
# Yield
|
156
176
|
throw "programmable joins are not supported at this time" unless block.nil?
|
@@ -172,11 +192,14 @@ class Zillabyte::Harness::Stream
|
|
172
192
|
# Handle incoming command..
|
173
193
|
if(@_app._options[:command] == :info)
|
174
194
|
# Info..
|
175
|
-
node_hash = {
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
195
|
+
node_hash = {
|
196
|
+
:name => h._name,
|
197
|
+
:type => h._type,
|
198
|
+
:lhs_fields => h._lhs_fields,
|
199
|
+
:rhs_fields => h._rhs_fields,
|
200
|
+
:join_type => h._join_type,
|
201
|
+
:config => options
|
202
|
+
}
|
180
203
|
|
181
204
|
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
182
205
|
arc_hash1 = {"name" => @_name, "origin" => @_previous_node_name, "dest" => h._name, "left" => 1}
|
@@ -197,7 +220,7 @@ class Zillabyte::Harness::Stream
|
|
197
220
|
|
198
221
|
end
|
199
222
|
|
200
|
-
def call_component(comp_id = nil, &block)
|
223
|
+
def call_component(comp_id = nil, options = {}, &block)
|
201
224
|
|
202
225
|
h = Zillabyte::Harness::InjectedComponent.new()
|
203
226
|
h.instance_eval(&block) if block_given?
|
@@ -210,7 +233,13 @@ class Zillabyte::Harness::Stream
|
|
210
233
|
@_app._nodes << h
|
211
234
|
|
212
235
|
if(@_app._options[:command] == :info)
|
213
|
-
node_hash = {
|
236
|
+
node_hash = {
|
237
|
+
:name => h._name,
|
238
|
+
:type => h._type,
|
239
|
+
:id => h._id,
|
240
|
+
:output_format => h._output_format,
|
241
|
+
:config => options
|
242
|
+
}
|
214
243
|
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
215
244
|
arc_hash = {"name" => @_name, "origin" => @_previous_node_name, "dest" => h._name}
|
216
245
|
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
@@ -228,6 +257,10 @@ class Zillabyte::Harness::Stream
|
|
228
257
|
output_streams = output_streams[0] if output_streams.size == 1
|
229
258
|
output_streams
|
230
259
|
end
|
260
|
+
alias_method :executes, :call_component
|
261
|
+
alias_method :execute, :call_component
|
262
|
+
|
263
|
+
|
231
264
|
|
232
265
|
def sink(&block)
|
233
266
|
h = Zillabyte::Harness::Sink.new()
|
@@ -243,4 +276,213 @@ class Zillabyte::Harness::Stream
|
|
243
276
|
end
|
244
277
|
end
|
245
278
|
|
279
|
+
|
280
|
+
|
281
|
+
# Unique's a stream. Executed on backend
|
282
|
+
def unique(*args)
|
283
|
+
|
284
|
+
# INIT
|
285
|
+
group_fields = Zillabyte::Harness::Helper.get_non_option_args(args)
|
286
|
+
options = Zillabyte::Harness::Helper.get_options(args)
|
287
|
+
|
288
|
+
if(@_app._options[:command] == :info)
|
289
|
+
|
290
|
+
emits = ["stream_"+Zillabyte::Harness::Counter.get()]
|
291
|
+
node_name = "unique_#{Zillabyte::Harness::Counter.get()}"
|
292
|
+
node_hash = {
|
293
|
+
:name => node_name,
|
294
|
+
:type => "unique",
|
295
|
+
:group_fields => group_fields,
|
296
|
+
:config => options
|
297
|
+
}
|
298
|
+
arc_hash = {
|
299
|
+
:name => @_name,
|
300
|
+
:origin => @_previous_node_name,
|
301
|
+
:dest => node_name
|
302
|
+
}
|
303
|
+
|
304
|
+
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
305
|
+
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
306
|
+
return self.class.new(emits, @_app, node_name)
|
307
|
+
|
308
|
+
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
309
|
+
throw "should not execute in multilang"
|
310
|
+
end
|
311
|
+
|
312
|
+
end
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
# Counts fields. Executed on backend
|
317
|
+
def count(*args)
|
318
|
+
|
319
|
+
# Init
|
320
|
+
group_fields = Zillabyte::Harness::Helper.get_non_option_args(args)
|
321
|
+
options = Zillabyte::Harness::Helper.get_options(args)
|
322
|
+
|
323
|
+
if(@_app._options[:command] == :info)
|
324
|
+
|
325
|
+
emits = ["stream_"+Zillabyte::Harness::Counter.get()]
|
326
|
+
node_name = "count_#{Zillabyte::Harness::Counter.get()}"
|
327
|
+
node_hash = {
|
328
|
+
:name => node_name,
|
329
|
+
:type => "count",
|
330
|
+
:group_fields => group_fields,
|
331
|
+
:config => options
|
332
|
+
}
|
333
|
+
arc_hash = {
|
334
|
+
:name => @_name,
|
335
|
+
:origin => @_previous_node_name,
|
336
|
+
:dest => node_name
|
337
|
+
}
|
338
|
+
|
339
|
+
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
340
|
+
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
341
|
+
return self.class.new(emits, @_app, node_name)
|
342
|
+
|
343
|
+
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
344
|
+
throw "should not execute in multilang"
|
345
|
+
end
|
346
|
+
|
347
|
+
end
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
# Removes fields from the stream.
|
353
|
+
def remove(*args)
|
354
|
+
|
355
|
+
# Init
|
356
|
+
remove_fields = Zillabyte::Harness::Helper.get_non_option_args(args)
|
357
|
+
options = Zillabyte::Harness::Helper.get_options(args)
|
358
|
+
|
359
|
+
if(@_app._options[:command] == :info)
|
360
|
+
|
361
|
+
emits = ["stream_"+Zillabyte::Harness::Counter.get()]
|
362
|
+
node_name = "remove_#{Zillabyte::Harness::Counter.get()}"
|
363
|
+
node_hash = {
|
364
|
+
:name => node_name,
|
365
|
+
:type => "remove",
|
366
|
+
:remove => remove_fields,
|
367
|
+
:config => options
|
368
|
+
}
|
369
|
+
arc_hash = {
|
370
|
+
:name => @_name,
|
371
|
+
:origin => @_previous_node_name,
|
372
|
+
:dest => node_name
|
373
|
+
}
|
374
|
+
|
375
|
+
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
376
|
+
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
377
|
+
return self.class.new(emits, @_app, node_name)
|
378
|
+
|
379
|
+
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
380
|
+
throw "should not execute in multilang"
|
381
|
+
end
|
382
|
+
|
383
|
+
end
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
# Retains fields from the stream and removes everything else
|
388
|
+
def retain(*args)
|
389
|
+
|
390
|
+
# Init
|
391
|
+
retain_fields = Zillabyte::Harness::Helper.get_non_option_args(args)
|
392
|
+
options = Zillabyte::Harness::Helper.get_options(args)
|
393
|
+
|
394
|
+
if(@_app._options[:command] == :info)
|
395
|
+
|
396
|
+
emits = ["stream_"+Zillabyte::Harness::Counter.get()]
|
397
|
+
node_name = "retain_#{Zillabyte::Harness::Counter.get()}"
|
398
|
+
node_hash = {
|
399
|
+
:name => node_name,
|
400
|
+
:type => "retain",
|
401
|
+
:retain => retain_fields,
|
402
|
+
:config => options
|
403
|
+
}
|
404
|
+
arc_hash = {
|
405
|
+
:name => @_name,
|
406
|
+
:origin => @_previous_node_name,
|
407
|
+
:dest => node_name
|
408
|
+
}
|
409
|
+
|
410
|
+
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
411
|
+
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
412
|
+
return self.class.new(emits, @_app, node_name)
|
413
|
+
|
414
|
+
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
415
|
+
throw "should not execute in multilang"
|
416
|
+
end
|
417
|
+
|
418
|
+
end
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
# Groups together N arbitrary tuples (usefull for mini-batch processing)
|
425
|
+
def clump(options = {})
|
426
|
+
|
427
|
+
if(@_app._options[:command] == :info)
|
428
|
+
|
429
|
+
emits = ["stream_"+Zillabyte::Harness::Counter.get()]
|
430
|
+
node_name = "clump_#{Zillabyte::Harness::Counter.get()}"
|
431
|
+
node_hash = {
|
432
|
+
:name => node_name,
|
433
|
+
:type => "clump",
|
434
|
+
:config => options
|
435
|
+
}
|
436
|
+
arc_hash = {
|
437
|
+
:name => @_name,
|
438
|
+
:origin => @_previous_node_name,
|
439
|
+
:dest => node_name
|
440
|
+
}
|
441
|
+
|
442
|
+
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
443
|
+
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
444
|
+
return self.class.new(emits, @_app, node_name)
|
445
|
+
|
446
|
+
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
447
|
+
throw "should not execute in multilang"
|
448
|
+
end
|
449
|
+
|
450
|
+
end
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
# Renames fields..
|
457
|
+
def rename(rename_map)
|
458
|
+
|
459
|
+
if(@_app._options[:command] == :info)
|
460
|
+
|
461
|
+
emits = ["stream_"+Zillabyte::Harness::Counter.get()]
|
462
|
+
node_name = "rename_#{Zillabyte::Harness::Counter.get()}"
|
463
|
+
node_hash = {
|
464
|
+
:name => node_name,
|
465
|
+
:type => "rename",
|
466
|
+
:rename => rename_map
|
467
|
+
}
|
468
|
+
arc_hash = {
|
469
|
+
:name => @_name,
|
470
|
+
:origin => @_previous_node_name,
|
471
|
+
:dest => node_name
|
472
|
+
}
|
473
|
+
|
474
|
+
Zillabyte::Harness::Helper.write_node_to_file(node_hash, @_app._info_file)
|
475
|
+
Zillabyte::Harness::Helper.write_arc_to_file(arc_hash, @_app._info_file)
|
476
|
+
return self.class.new(emits, @_app, node_name)
|
477
|
+
|
478
|
+
elsif(@_app._options[:command] == :execute and @_app._options[:name] == h._name)
|
479
|
+
throw "should not execute in multilang"
|
480
|
+
end
|
481
|
+
|
482
|
+
end
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
246
488
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zillabyte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zillabyte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-12 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: mkfifo
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: zillabyte-cli
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.
|
47
|
+
version: 0.1.31
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.
|
54
|
+
version: 0.1.31
|
55
55
|
description: The Official Zillabyte Gem
|
56
56
|
email:
|
57
57
|
- gem@zillabyte.com
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- ruby/lib/zillabyte/harness.rb
|
65
65
|
- ruby/lib/zillabyte/harness/app.rb
|
66
66
|
- ruby/lib/zillabyte/harness/base.rb
|
67
|
+
- ruby/lib/zillabyte/harness/clump.rb
|
67
68
|
- ruby/lib/zillabyte/harness/component.rb
|
68
69
|
- ruby/lib/zillabyte/harness/component_sink.rb
|
69
70
|
- ruby/lib/zillabyte/harness/component_source.rb
|
@@ -91,12 +92,12 @@ require_paths:
|
|
91
92
|
- ruby/lib
|
92
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
|
-
- -
|
95
|
+
- - ! '>='
|
95
96
|
- !ruby/object:Gem::Version
|
96
97
|
version: '0'
|
97
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
99
|
requirements:
|
99
|
-
- -
|
100
|
+
- - ! '>='
|
100
101
|
- !ruby/object:Gem::Version
|
101
102
|
version: '0'
|
102
103
|
requirements: []
|