norikra 1.3.1-java → 1.4.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 287542701c924a59dd86b206f843168325e7a84f
4
- data.tar.gz: df280e4dbb55bfe37d0432e458855fb3368c44b3
3
+ metadata.gz: 594b7ff8b47b9244aec8b1c1557118398d38cd6f
4
+ data.tar.gz: a175ef83ae11f3253337b3c827b74e96a6cade22
5
5
  SHA512:
6
- metadata.gz: d1932ce34bd6190a92947298516c5ec9b99abc267602d1d87d563e7f51f61e8c02edccdc93b8cc9d5a55cc09363f66e23b629be644ad4dafc2dfd746d15e1d84
7
- data.tar.gz: fc4cf79e10f3b53662969a31719a948b8070a79045d65f3f13baf58169516d1bac1b3d01003542abcc3b97e2b5a2461ca0190a7f972a0c15227760f33f892c97
6
+ metadata.gz: 2157ac962cee967607c357c065039c1b6c8844703a1d5023ffd91415c021741427c442d6689b5de1a6fc2b399c7a4faf5de65ad56b2980ab303c1fadb6af0848
7
+ data.tar.gz: 0cdeb1f5572a3909ecdce291ab3638793db913bacd88ae8e3fceca02ffd47c26c484c0b11d3adcbf447213c713dc757b3c1193e9ce29bc569d88489e3fee4503
@@ -1 +1 @@
1
- jruby-1.7.19
1
+ jruby-1.7.20
data/Changes.md CHANGED
@@ -3,6 +3,11 @@
3
3
  Changes of norikra.
4
4
 
5
5
  ## v1
6
+ * v1.4.0
7
+ * Add `-D` option handling to pass JVM system properties
8
+ * Add `-agentlib` option handling to pass it to JVM
9
+ * Dependency update for msgpack.gem
10
+ * Fix Bug to raise error for queries using irstream
6
11
  * v1.3.1
7
12
  * Fix to enable SO_REUSEPORT for listening ports to help "address already in use" exception in restarts
8
13
  * v1.3.0
data/README.md CHANGED
@@ -64,6 +64,8 @@ See: http://norikra.github.io/
64
64
 
65
65
  ## Changes
66
66
 
67
+ * v1.4
68
+ * Dependency update for msgpack.gem
67
69
  * v1.3
68
70
  * Dynamic plugin reloading by SIGHUP
69
71
  * Esper-5.2 bundle
@@ -152,6 +152,10 @@ module Norikra
152
152
  jruby_options.push('-J-verbose:gc')
153
153
  elsif arg =~ /^-javaagent:(.+)$/
154
154
  jruby_options.push('-J-javaagent:' + $1)
155
+ elsif arg =~ /^-agentlib:(.+)$/
156
+ jruby_options.push('-J-agentlib:' + $1)
157
+ elsif arg =~ /^-D(.+)$/
158
+ jruby_options.push('-J-D' + $1)
155
159
  else
156
160
  argv.push(arg)
157
161
  end
@@ -158,18 +158,24 @@ module Norikra
158
158
  end
159
159
  end
160
160
 
161
+ def apply_type_convert_to_events(events)
162
+ if events.respond_to?(:map)
163
+ events.map{|e| type_convert(e) }
164
+ else
165
+ type_convert(events)
166
+ end
167
+ end
168
+
161
169
  def update(new_events, old_events)
162
170
  t = Time.now.to_i
163
171
  if @mode == :sync
164
- news = new_events.map{|e| type_convert(e) }
165
- olds = if old_events.respond_to?(:map)
166
- old_events.map{|e| type_convert(e) }
167
- else
168
- type_convert(old_events)
169
- end
172
+ news = apply_type_convert_to_events(new_events)
173
+ olds = apply_type_convert_to_events(old_events)
170
174
  trace("produced events"){ { listener: self.class, query: @query_name, group: @query_group, news: news, olds: olds } }
171
175
  process_sync(news, olds)
172
- @events_statistics[:output] += news.size
176
+ if news.respond_to?(:size)
177
+ @events_statistics[:output] += news.size
178
+ end
173
179
  else # async
174
180
  events = new_events.map{|e| [t, type_convert(e)]}
175
181
  trace("pushed events"){ { listener: self.class, query: @query_name, group: @query_group, event: events } }
@@ -188,8 +194,10 @@ module Norikra
188
194
 
189
195
  def process_sync(news, olds)
190
196
  t = Time.now.to_i
191
- events = news.map{|e| [t, e]}
192
- @output_pool.push(@query_name, @query_group, events)
197
+ if news.respond_to?(:map)
198
+ events = news.map{|e| [t, e]}
199
+ @output_pool.push(@query_name, @query_group, events)
200
+ end
193
201
  end
194
202
  end
195
203
 
@@ -224,7 +232,9 @@ module Norikra
224
232
  # We does NOT convert 'container.$0' into container['field'].
225
233
  # Use escaped names like 'container__0'. That is NOT so confused.
226
234
  trace("loopback event"){ { query: @query_name, group: @query_group, event: news } }
227
- @engine.send(@argument, news)
235
+ if news.respond_to?(:each)
236
+ @engine.send(@argument, news)
237
+ end
228
238
  end
229
239
  end
230
240
 
@@ -241,8 +251,10 @@ module Norikra
241
251
  end
242
252
 
243
253
  def process_sync(news, olds)
244
- news.each do |e|
245
- @stdout.puts @query_name + "\t" + JSON.dump(e)
254
+ if news.respond_to?(:each)
255
+ news.each do |e|
256
+ @stdout.puts @query_name + "\t" + JSON.dump(e)
257
+ end
246
258
  end
247
259
  end
248
260
  end
@@ -1,3 +1,3 @@
1
1
  module Norikra
2
- VERSION = "1.3.1"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.add_runtime_dependency "mizuno", ">= 0.6.10"
23
23
  spec.add_runtime_dependency "rack"
24
24
  spec.add_runtime_dependency "thor"
25
- spec.add_runtime_dependency "msgpack-rpc-over-http", ">= 0.0.7"
26
- spec.add_runtime_dependency "norikra-client", "~> 1.3.0"
25
+ spec.add_runtime_dependency "msgpack-rpc-over-http", "~> 0.1.0"
26
+ spec.add_runtime_dependency "norikra-client", "~> 1.4.0"
27
27
  spec.add_runtime_dependency "sinatra"
28
28
  spec.add_runtime_dependency "sinatra-contrib"
29
29
  spec.add_runtime_dependency "erubis"
@@ -60,6 +60,7 @@ $(function(){
60
60
  button.popover({
61
61
  placement: 'top',
62
62
  html: true,
63
+ template: '<div class="popover" role="tooltip" style="height: 50%; overflow-y: scroll;"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>',
63
64
  content: table_html
64
65
  }).popover('toggle');
65
66
  $('table.target-fields').closest('div').css('padding', '0');
@@ -96,6 +96,61 @@ describe Norikra::Listener::Base do
96
96
  end
97
97
  end
98
98
 
99
+ describe '#apply_type_convert_to_events' do
100
+ statistics = {output: 0}
101
+ listener = DummySyncListener.new('', 'name', 'group')
102
+ listener.events_statistics = statistics
103
+
104
+ it 'returns value itself for nil' do
105
+ val = nil
106
+ expect(listener.apply_type_convert_to_events(val)).to eq(val)
107
+ end
108
+
109
+ it 'returns type_convert-ed events for non-nil events' do
110
+ s1 = "乗鞍".force_encoding("ASCII-8BIT")
111
+ events = [
112
+ [100, 100.01, false, true, nil, s1],
113
+ {
114
+ "100" => 100,
115
+ "100_01" => 100.01,
116
+ "bool$false" => false,
117
+ "bool$true" => true,
118
+ "object$$0" => nil,
119
+ "string" => s1,
120
+ "list" => [0, 1, 2],
121
+ "percentiles" => {
122
+ "10" => 0.1,
123
+ "50" => 0.5,
124
+ "99" => 0.99
125
+ }
126
+ }
127
+ ]
128
+ revents = listener.apply_type_convert_to_events(events)
129
+ expect(revents).to be_a(Array)
130
+ expect(revents.size).to eql(2)
131
+
132
+ expect(revents[0]).to be_a(Array)
133
+ expect(revents[0][0]).to eql(100)
134
+ expect(revents[0][1]).to eql(100.01)
135
+ expect(revents[0][2]).to eq(false)
136
+ expect(revents[0][3]).to eq(true)
137
+ expect(revents[0][4]).to be_nil
138
+ expect(revents[0][5].encoding.to_s).to eql("UTF-8")
139
+ expect(revents[0][5]).to eql("乗鞍")
140
+
141
+ expect(revents[1]).to be_a(Hash)
142
+ expect(revents[1]["100"]).to eql(100)
143
+ expect(revents[1]["100_01"]).to eql(100.01)
144
+ expect(revents[1]["bool.false"]).to eq(false)
145
+ expect(revents[1]["bool.true"]).to eq(true)
146
+ expect(revents[1]["object.$0"]).to be_nil
147
+ expect(revents[1]["string"].encoding.to_s).to eql("UTF-8")
148
+ expect(revents[1]["string"]).to eql("乗鞍")
149
+ expect(revents[1]["list"]).to eql([0,1,2])
150
+ expect(revents[1]["percentiles"]).to eql({"10" => 0.1, "50" => 0.5, "99" => 0.99})
151
+ end
152
+ end
153
+
99
154
  ### TODO: add specs of .parse, #start, #shutdown, #push and #update
100
155
  end
101
156
 
@@ -108,9 +163,9 @@ describe Norikra::Listener::MemoryPool do
108
163
 
109
164
  describe '#process_sync' do
110
165
  listener = Norikra::Listener::MemoryPool.new(nil, 'name', 'group')
111
- listener.output_pool = dummy_pool = Norikra::ListenerSpecHelper::DummyOutputPool.new
112
166
 
113
167
  it 'pushs events into pool, with current time' do
168
+ listener.output_pool = dummy_pool = Norikra::ListenerSpecHelper::DummyOutputPool.new
114
169
  listener.process_sync([{"n1" => 100, "s" => "string one"}, {"n1" => 101, "s" => "string two"}], [])
115
170
  expect(dummy_pool.pool['group']['name'].size).to eql(2)
116
171
  expect(dummy_pool.pool['group']['name'][0][0]).to be_a(Fixnum)
@@ -120,6 +175,12 @@ describe Norikra::Listener::MemoryPool do
120
175
  listener.process_sync([{"n1" => 102, "s" => "string three"}], [])
121
176
  expect(dummy_pool.pool['group']['name'].size).to eql(3)
122
177
  end
178
+
179
+ it 'sends nil events into pool with current time' do
180
+ listener.output_pool = dummy_pool = Norikra::ListenerSpecHelper::DummyOutputPool.new
181
+ listener.process_sync(nil, nil)
182
+ expect(dummy_pool.pool['group']).to be_nil
183
+ end
123
184
  end
124
185
  end
125
186
 
@@ -138,9 +199,9 @@ describe Norikra::Listener::Loopback do
138
199
 
139
200
  describe '#process_sync' do
140
201
  listener = Norikra::Listener::Loopback.new('target1', 'name', 'LOOPBACK(target1)')
141
- listener.engine = dummy_engine = Norikra::ListenerSpecHelper::DummyEngine.new
142
202
 
143
203
  it 'sends events into engine with target name' do
204
+ listener.engine = dummy_engine = Norikra::ListenerSpecHelper::DummyEngine.new
144
205
  listener.process_sync([{"n1" => 100, "s" => "string one"}, {"n1" => 101, "s" => "string two"}], [])
145
206
  expect(dummy_engine.events['target1'].size).to eql(2)
146
207
  expect(dummy_engine.events['target1'][0]).to eql({"n1" => 100, "s" => "string one"})
@@ -149,6 +210,12 @@ describe Norikra::Listener::Loopback do
149
210
  listener.process_sync([{"n1" => 102, "s" => "string three"}], [])
150
211
  expect(dummy_engine.events['target1'].size).to eql(3)
151
212
  end
213
+
214
+ it 'sends nil events into engine with target name' do
215
+ listener.engine = dummy_engine = Norikra::ListenerSpecHelper::DummyEngine.new
216
+ listener.process_sync(nil, nil)
217
+ expect(dummy_engine.events).to be_empty
218
+ end
152
219
  end
153
220
  end
154
221
 
@@ -187,5 +254,11 @@ describe Norikra::Listener::Stdout do
187
254
  end
188
255
  expect(results).to eql(events1 + events2)
189
256
  end
257
+
258
+ it 'sends nil events into engine with target name' do
259
+ dummyio.truncate(0)
260
+ listener.process_sync(nil, nil)
261
+ expect(dummyio.string).to eql('')
262
+ end
190
263
  end
191
264
  end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: norikra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: java
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - '>='
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: 0.6.10
19
19
  name: mizuno
@@ -21,13 +21,13 @@ dependencies:
21
21
  type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.6.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0'
33
33
  name: rack
@@ -35,13 +35,13 @@ dependencies:
35
35
  type: :runtime
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
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  name: thor
@@ -49,41 +49,41 @@ dependencies:
49
49
  type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 0.0.7
60
+ version: 0.1.0
61
61
  name: msgpack-rpc-over-http
62
62
  prerelease: false
63
63
  type: :runtime
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.0.7
68
+ version: 0.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 1.3.0
74
+ version: 1.4.0
75
75
  name: norikra-client
76
76
  prerelease: false
77
77
  type: :runtime
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.3.0
82
+ version: 1.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  name: sinatra
@@ -91,13 +91,13 @@ dependencies:
91
91
  type: :runtime
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  name: sinatra-contrib
@@ -105,13 +105,13 @@ dependencies:
105
105
  type: :runtime
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - '>='
114
+ - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  name: erubis
@@ -119,13 +119,13 @@ dependencies:
119
119
  type: :runtime
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - ~>
128
+ - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '1.3'
131
131
  name: bundler
@@ -133,13 +133,13 @@ dependencies:
133
133
  type: :development
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.3'
139
139
  - !ruby/object:Gem::Dependency
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '>='
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  name: rake
@@ -147,13 +147,13 @@ dependencies:
147
147
  type: :development
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  requirement: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - '>='
156
+ - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  name: rspec
@@ -161,13 +161,13 @@ dependencies:
161
161
  type: :development
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - '>='
170
+ - - ">="
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  name: pry
@@ -175,7 +175,7 @@ dependencies:
175
175
  type: :development
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  description: Norikra is a open source server software provides "Schema-les Stream Processing" with SQL, written in JRuby, runs on JVM, licensed under GPLv2.
@@ -186,9 +186,9 @@ executables:
186
186
  extensions: []
187
187
  extra_rdoc_files: []
188
188
  files:
189
- - .gitignore
190
- - .ruby-version
191
- - .travis.yml
189
+ - ".gitignore"
190
+ - ".ruby-version"
191
+ - ".travis.yml"
192
192
  - Changes.md
193
193
  - Gemfile
194
194
  - LICENSE
@@ -285,17 +285,17 @@ require_paths:
285
285
  - esper
286
286
  required_ruby_version: !ruby/object:Gem::Requirement
287
287
  requirements:
288
- - - '>='
288
+ - - ">="
289
289
  - !ruby/object:Gem::Version
290
290
  version: '0'
291
291
  required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  requirements:
293
- - - '>='
293
+ - - ">="
294
294
  - !ruby/object:Gem::Version
295
295
  version: '0'
296
296
  requirements: []
297
297
  rubyforge_project:
298
- rubygems_version: 2.4.5
298
+ rubygems_version: 2.4.8
299
299
  signing_key:
300
300
  specification_version: 4
301
301
  summary: Schema-less stream processing server with SQL