norikra 0.0.18-java → 0.0.19-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -241,10 +241,11 @@ module Norikra
241
241
  class Listener
242
242
  include com.espertech.esper.client.UpdateListener
243
243
 
244
- def initialize(query_name, query_group, output_pool)
244
+ def initialize(query_name, query_group, output_pool, events_statistics)
245
245
  @query_name = query_name
246
246
  @query_group = query_group
247
247
  @output_pool = output_pool
248
+ @events_statistics = events_statistics
248
249
  end
249
250
 
250
251
  def type_convert(event)
@@ -269,7 +270,7 @@ module Norikra
269
270
  events = new_events.map{|e| [t, type_convert(e)]}
270
271
  trace "updated event", :query => @query_name, :group => @query_group, :event => events
271
272
  @output_pool.push(@query_name, @query_group, events)
272
- @statistics[:events][:output] += events.size
273
+ @events_statistics[:output] += events.size
273
274
  end
274
275
  end
275
276
  ##### Unmatched events are simply ignored
@@ -445,7 +446,7 @@ module Norikra
445
446
  Norikra::Query.rewrite_query(statement_model, event_type_name_map)
446
447
 
447
448
  epl = administrator.create(statement_model)
448
- epl.java_send :addListener, [com.espertech.esper.client.UpdateListener.java_class], Listener.new(query.name, query.group, @output_pool)
449
+ epl.java_send :addListener, [com.espertech.esper.client.UpdateListener.java_class], Listener.new(query.name, query.group, @output_pool, @statistics[:events])
449
450
  query.statement_name = epl.getName
450
451
  # epl is automatically started.
451
452
  # epl.isStarted #=> true
@@ -1,3 +1,3 @@
1
1
  module Norikra
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: norikra
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.18
5
+ version: 0.0.19
6
6
  platform: java
7
7
  authors:
8
8
  - TAGOMORI Satoshi