norikra 1.2.2-java → 1.3.0.beta.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -5
- data/esper/changelog.txt +61 -0
- data/esper/{esper-5.0.0.jar → esper-5.2.0.jar} +0 -0
- data/lib/norikra/cli.rb +15 -4
- data/lib/norikra/engine.rb +1 -1
- data/lib/norikra/listener.rb +1 -1
- data/lib/norikra/query/ast.rb +18 -8
- data/lib/norikra/query.rb +3 -2
- data/lib/norikra/rpc/handler.rb +7 -0
- data/lib/norikra/rpc/http.rb +5 -1
- data/lib/norikra/rpc.rb +1 -0
- data/lib/norikra/server.rb +52 -4
- data/lib/norikra/stats.rb +1 -1
- data/lib/norikra/version.rb +1 -1
- data/lib/norikra/webui/api.rb +12 -0
- data/lib/norikra/webui/handler.rb +9 -0
- data/lib/norikra/webui/http.rb +5 -0
- data/views/index.erb +1 -1
- metadata +42 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dab9c348735650b1a4de5cb5cf1c75f2efd92cdc
|
4
|
+
data.tar.gz: 566b75a8325c7e9d61d3382b20def317f6d46ef8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1800a71b713db3cfd166e85913039b46032afb74def7c3a597db4860a9013011843aa5803c9db61b338786fbdb7b05afa850fc3509c9ceb20cffc28fa8bf4c37
|
7
|
+
data.tar.gz: 29e0060543f2d18c7b7eb95778d1de4ddac8d0bdd4a3b246781d1a04ad7a3ef9590373a8d65c9de9714f087d71b6439e823c0641fac9c4b3540b429b22d945bd
|
data/.travis.yml
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
3
|
- jruby-19mode
|
4
|
-
|
4
|
+
- jruby-head
|
5
5
|
jdk:
|
6
6
|
- oraclejdk8
|
7
7
|
- oraclejdk7
|
8
8
|
- openjdk7
|
9
9
|
- openjdk6
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
# jdk: openjdk6
|
10
|
+
matrix:
|
11
|
+
allow_failures:
|
12
|
+
- rvm: jruby-head
|
data/esper/changelog.txt
CHANGED
@@ -1,6 +1,67 @@
|
|
1
1
|
Esper Changelog
|
2
2
|
===================
|
3
3
|
|
4
|
+
Changes in version 5.2.0
|
5
|
+
------------------------
|
6
|
+
- Support for aggregation functions to specify the level of grouping in the parameter list, removing the need for separate subqueries for many use cases
|
7
|
+
- Support for aggregation rollup in conjunction with tables
|
8
|
+
- Support for a new pattern observer "timer:schedule" that supports the ISO8601 standard for scheduling
|
9
|
+
- Support for match-recognize to have patterns that specify repetition (exact, N-or-more, between-N-and-M, between-0-and-M)
|
10
|
+
- Support for match-recognize to have patterns that specify permutation, i.e. for A and B to become "A B" or "B A"
|
11
|
+
- Support for the "new" expression to instantiate a given class
|
12
|
+
- Support for substitution parameter to be given names so that they are available by name and not just by numeric position
|
13
|
+
- Support for filter expressions that use "or" and "typeof" to optimize filter tree use for reverse index sharing
|
14
|
+
- Support for "create schema" to specify "null" as a property type
|
15
|
+
- Many smaller enhancements, optimizations, documentation updates
|
16
|
+
|
17
|
+
Bug fixes and other improvements
|
18
|
+
- Fixed issue ESPER-802 EsperIO CSV and CurrentTimeEvent issue
|
19
|
+
- Fixed issue ESPER-803 outer join with historical stream and on-clause in addition to where-clause causes incorrect result
|
20
|
+
- Fixed issue ESPER-804 Allow Subscriber methods other than "update"
|
21
|
+
- Fixed issue ESPER-805 toEPL() generates badly formatted EPL for contained event selections
|
22
|
+
- Fixed issue ESPER-806 The type checking rejects the child types for non-bean types and insert
|
23
|
+
- Fixed issue ESPER-807 Outer join with context partitions thread safety issue
|
24
|
+
- Fixed issue ESPER-808 Accessing Data via Method Invocation on injected Objects
|
25
|
+
- Fixed issue ESPER-809 ExprBetweenCompBigDecimal.isLowIncluded/isHighIncluded shouldn't use equals
|
26
|
+
- Fixed issue ESPER-810 Context partitioned by key throws NPE with partition key property in pattern filter expression
|
27
|
+
- Fixed issue QQY-321-19355 non-overlapping context started by filter for same event as statements can miss an event under threading
|
28
|
+
- Fixed issue AHK-632-44071 ArrayIndexOutOfBoundsEx on non-fully-aggregated query with stream select
|
29
|
+
|
30
|
+
Changes in version 5.1.0
|
31
|
+
------------------------
|
32
|
+
- Support for tables. Tables introduce a number of new capabilities, allowing for more expressive EPL.
|
33
|
+
- Tables allow multiple statements to aggregate into the same state (we call this co-aggregation)
|
34
|
+
- Tables allow statements to co-locate aggregation state, update-in-place data and event data conveniently
|
35
|
+
- Tables can be accessed using a convenient key-based expression, as well as in joins, subqueries etc. comparably to named windows
|
36
|
+
- Support for the Count�min sketch (or CM sketch) probabilistic sub-linear space streaming algorithm and approximate streaming Top-K
|
37
|
+
- Support for the new "countever" aggregation function that returns a count of events ever regardless of data windows
|
38
|
+
- Additional API to query context partition instance count
|
39
|
+
- Audit logging for context partitions
|
40
|
+
- The match-recognize "define" clause is now optional
|
41
|
+
- Support for loosely-scoped expressions using expression alias
|
42
|
+
- CSV adapter now uses time-spans to advance time
|
43
|
+
- Socket adapter CSV format now supports a property-ordered string without field names
|
44
|
+
- Many smaller enhancements and bug fixes, with the most important ones listed here
|
45
|
+
|
46
|
+
Bug fixes and other improvements
|
47
|
+
- Fixed issue ESPER-782 "interval" keyword in match-recognize does not allow uppercase
|
48
|
+
- Fixed issue ESPER-783 ArithmeticException big decimal divide
|
49
|
+
- Fixed issue ESPER-784 EsperIO Socket Adapter causes configuration loss when calling "initialize"
|
50
|
+
- Fixed issue ESPER-788 Exception on uppercase MIN/MAX
|
51
|
+
- Fixed issue ESPER-791 "Route" API call with outbound threading enabled does not work
|
52
|
+
- Fixed issue ESPER-792 Dataflow is not initializing in correct order with ~16+ operators
|
53
|
+
- Fixed issue ESPER-793 QualityOfService example main uses wrong provider URI
|
54
|
+
- Fixed issue ESPER-794 OSGi Manifest does not contain com.espertech.esper.epl.agg.aggregator package
|
55
|
+
- Fixed issue ESPER-795 Multidrectional join between two unique-window named windows join throws errors and returns spurious results.
|
56
|
+
- Fixed issue ESPER-796 EventType Configuration Exception compiling Pojo with Collections
|
57
|
+
- Fixed issue ESPER-799 Escaping comma character error while using socket adapter
|
58
|
+
- Fixed issue ESPER-800 Custom aggregation function with multiple parameters receives WildcardParameter instead of event
|
59
|
+
- Fixed issue ESPER-801 Json renderer escape in a wrong way
|
60
|
+
- Fixed issue ADQ-943-19260 context-partitioned named window with create index causes NPE
|
61
|
+
- Fixed issue HXB-611-44301 get method called needlessly when using output snapshot
|
62
|
+
- Fixed issue UJI-364-58495 CPE repeatedly stopping and starting statement with aggregation and grouped window
|
63
|
+
- Fixed issue TJJ-530-49640 Transpose function causes type incompatibility message when transposing into an existing type
|
64
|
+
|
4
65
|
Changes in version 5.0.0
|
5
66
|
------------------------
|
6
67
|
- The following dependent jar files are upgraded:
|
Binary file
|
data/lib/norikra/cli.rb
CHANGED
@@ -24,6 +24,10 @@ module Norikra
|
|
24
24
|
option :'dump-stat-interval', type: :numeric, default: nil, \
|
25
25
|
desc: 'interval(seconds) of status file dumps on runtime [none (on shutdown only)]'
|
26
26
|
|
27
|
+
option :shutoff, type: :boolean, default: false, desc: '[EXPERIMENTAL] enable "shutoff" mode, to reject input data under high memory usage'
|
28
|
+
option :'shutoff-threshold', type: :numeric, default: 90, desc: 'threshold percent of heap memory usage to turn "shutoff mode" on'
|
29
|
+
option :'shutoff-check-interval', type: :numeric, default: 10, desc: 'interval seconds to turn "shutoff mode" on/off'
|
30
|
+
|
27
31
|
### Daemonize options
|
28
32
|
option :daemonize, type: :boolean, default: false, aliases: "-d", \
|
29
33
|
desc: 'daemonize Norikra server [false (foreground)]'
|
@@ -39,13 +43,13 @@ module Norikra
|
|
39
43
|
### Performance options
|
40
44
|
# performance predefined configuration sets
|
41
45
|
option :micro, type: :boolean, default: false, \
|
42
|
-
desc: 'development or testing (inbound:0, outbound:0, route:0, timer:0, rpc:2)'
|
46
|
+
desc: 'development or testing (inbound:0, outbound:0, route:0, timer:0, rpc:2, web:2)'
|
43
47
|
option :small, type: :boolean, default: false, \
|
44
|
-
desc: 'virtual or small scale servers (inbound:
|
48
|
+
desc: 'virtual or small scale servers (inbound:2, outbount:2, route:2, timer:2, rpc:9, web:9)'
|
45
49
|
option :middle, type: :boolean, default: false, \
|
46
|
-
desc: 'rackmount servers (inbound:4, outbound:
|
50
|
+
desc: 'rackmount servers (inbound:4, outbound:4, route:4, timer:4, rpc:17, web:17)'
|
47
51
|
option :large, type: :boolean, default: false, \
|
48
|
-
desc: 'high performance servers (inbound:
|
52
|
+
desc: 'high performance servers (inbound: 8, outbound: 8, route:8, timer:8, rpc:49, web:49)'
|
49
53
|
# Esper
|
50
54
|
option :'inbound-threads', type: :numeric, default: nil, desc: 'number of threads for inbound data'
|
51
55
|
option :'outbound-threads', type: :numeric, default: nil, desc: 'number of threads for outbound data'
|
@@ -197,6 +201,13 @@ module Norikra
|
|
197
201
|
suppress: options[:'suppress-dump-stat'], interval: options[:'dump-stat-interval'],
|
198
202
|
}
|
199
203
|
|
204
|
+
### shut off mode
|
205
|
+
conf[:shutoff] = {
|
206
|
+
enabled: options[:shutoff],
|
207
|
+
threshold: options[:'shutoff-threshold'],
|
208
|
+
interval: options[:'shutoff-check-interval'],
|
209
|
+
}
|
210
|
+
|
200
211
|
### threads
|
201
212
|
predefined_selecteds = [:micro, :small, :middle, :large].select{|sym| options[sym]}
|
202
213
|
if predefined_selecteds.size > 1
|
data/lib/norikra/engine.rb
CHANGED
@@ -10,7 +10,7 @@ require 'norikra/suspended_query'
|
|
10
10
|
require 'norikra/logger'
|
11
11
|
include Norikra::Log
|
12
12
|
|
13
|
-
require 'esper-5.
|
13
|
+
require 'esper-5.2.0.jar'
|
14
14
|
require 'esper/lib/commons-logging-1.1.3.jar'
|
15
15
|
require 'esper/lib/antlr-runtime-4.1.jar'
|
16
16
|
require 'esper/lib/cglib-nodep-3.1.jar'
|
data/lib/norikra/listener.rb
CHANGED
data/lib/norikra/query/ast.rb
CHANGED
@@ -1254,11 +1254,20 @@ module Norikra
|
|
1254
1254
|
# ")"]]
|
1255
1255
|
|
1256
1256
|
def function_name
|
1257
|
-
f = self.find("funcIdentTop")
|
1258
|
-
|
1259
|
-
|
1257
|
+
if f = self.find("funcIdentTop")
|
1258
|
+
if e = f.find("escapableIdent")
|
1259
|
+
e.child.name
|
1260
|
+
else
|
1261
|
+
f.child.name
|
1262
|
+
end
|
1263
|
+
elsif f = self.find("funcIdentInner")
|
1264
|
+
if e = f.find("escapableIdent")
|
1265
|
+
e.child.name
|
1266
|
+
else
|
1267
|
+
f.child.name
|
1268
|
+
end
|
1260
1269
|
else
|
1261
|
-
|
1270
|
+
raise "BUG: unknown function AST"
|
1262
1271
|
end
|
1263
1272
|
end
|
1264
1273
|
|
@@ -1302,15 +1311,16 @@ module Norikra
|
|
1302
1311
|
class ASTLibFunctionArgItemNode < ASTNode
|
1303
1312
|
# ["libFunctionArgs",
|
1304
1313
|
# ["libFunctionArgItem",
|
1305
|
-
# ["
|
1306
|
-
# ["
|
1307
|
-
# ["
|
1314
|
+
# ["expressionWithNamed",
|
1315
|
+
# ["expressionWithTime",
|
1316
|
+
# ["expressionQualifyable",
|
1317
|
+
# ["expression", ... ]]]]]
|
1308
1318
|
def nodetype?(*sym)
|
1309
1319
|
sym.include?(:libarg)
|
1310
1320
|
end
|
1311
1321
|
|
1312
1322
|
def expression
|
1313
|
-
self.chain("expressionWithTime", "expressionQualifyable", "expression")
|
1323
|
+
self.chain("expressionWithNamed", "expressionWithTime", "expressionQualifyable", "expression")
|
1314
1324
|
end
|
1315
1325
|
end
|
1316
1326
|
|
data/lib/norikra/query.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'java'
|
2
|
-
require 'esper-5.
|
2
|
+
require 'esper-5.2.0.jar'
|
3
3
|
require 'esper/lib/commons-logging-1.1.3.jar'
|
4
4
|
require 'esper/lib/antlr-runtime-4.1.jar'
|
5
5
|
require 'esper/lib/cglib-nodep-3.1.jar'
|
@@ -239,7 +239,8 @@ module Norikra
|
|
239
239
|
services.getPatternNodeFactory,
|
240
240
|
services.getContextManagementService,
|
241
241
|
result.getScripts,
|
242
|
-
services.getExprDeclaredService
|
242
|
+
services.getExprDeclaredService,
|
243
|
+
services.getTableService
|
243
244
|
)
|
244
245
|
|
245
246
|
Java::ComEspertechEsperEplParse::ParseHelper.walk(ast, walker, target, forerrmsg)
|
data/lib/norikra/rpc/handler.rb
CHANGED
@@ -9,6 +9,11 @@ require 'norikra/query'
|
|
9
9
|
class Norikra::RPC::Handler
|
10
10
|
def initialize(engine)
|
11
11
|
@engine = engine
|
12
|
+
@shut_off_mode = false
|
13
|
+
end
|
14
|
+
|
15
|
+
def shut_off(mode)
|
16
|
+
@shut_off_mode = true
|
12
17
|
end
|
13
18
|
|
14
19
|
def logging(type, handler, args=[])
|
@@ -107,6 +112,8 @@ class Norikra::RPC::Handler
|
|
107
112
|
end
|
108
113
|
|
109
114
|
def send(target, events)
|
115
|
+
raise Norikra::RPC::ServiceUnavailableError if @shut_off_mode
|
116
|
+
|
110
117
|
logging(:data, :send, [target, events]){
|
111
118
|
r = @engine.send(target, events)
|
112
119
|
!!r
|
data/lib/norikra/rpc/http.rb
CHANGED
@@ -24,7 +24,7 @@ module Norikra::RPC
|
|
24
24
|
@host = opts[:host] || DEFAULT_LISTEN_HOST
|
25
25
|
@port = opts[:port] || DEFAULT_LISTEN_PORT
|
26
26
|
@threads = opts[:threads] || DEFAULT_THREADS
|
27
|
-
handler = Norikra::RPC::Handler.new(@engine)
|
27
|
+
@handler = handler = Norikra::RPC::Handler.new(@engine)
|
28
28
|
@app = Rack::Builder.new {
|
29
29
|
use Norikra::RPC::Gatekeeper
|
30
30
|
run MessagePack::RPCOverHTTP::Server.app(handler)
|
@@ -44,5 +44,9 @@ module Norikra::RPC
|
|
44
44
|
@thread.kill
|
45
45
|
@thread.join
|
46
46
|
end
|
47
|
+
|
48
|
+
def shut_off(mode)
|
49
|
+
@handler.shut_off(mode)
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
data/lib/norikra/rpc.rb
CHANGED
@@ -3,6 +3,7 @@ require 'msgpack-rpc-over-http-jruby'
|
|
3
3
|
module Norikra::RPC
|
4
4
|
class ClientError < MessagePack::RPCOverHTTP::RemoteError; end
|
5
5
|
class ServerError < MessagePack::RPCOverHTTP::RemoteError; end
|
6
|
+
class ServiceUnavailableError < MessagePack::RPCOverHTTP::RemoteError; end
|
6
7
|
end
|
7
8
|
|
8
9
|
require 'norikra/rpc/handler'
|
data/lib/norikra/server.rb
CHANGED
@@ -18,6 +18,9 @@ module Norikra
|
|
18
18
|
class Server
|
19
19
|
attr_accessor :running
|
20
20
|
|
21
|
+
DEFAULT_SHUT_OFF_THRESHOLD = 90
|
22
|
+
DEFAULT_SHUT_OFF_CHECK_INTERVAL = 10
|
23
|
+
|
21
24
|
MICRO_PREDEFINED = {
|
22
25
|
engine: { inbound: { threads: 0, capacity: 0 }, outbound: { threads: 0, capacity: 0 },
|
23
26
|
route_exec: { threads: 0, capacity: 0 }, timer_exec: { threads: 0, capacity: 0 }, },
|
@@ -80,6 +83,10 @@ module Norikra
|
|
80
83
|
puts "working on #{$PID}"
|
81
84
|
end
|
82
85
|
|
86
|
+
@shutoff = conf[:shutoff][:enabled] || false
|
87
|
+
@shutoff_threshold = conf[:shutoff][:threshold] || DEFAULT_SHUT_OFF_THRESHOLD
|
88
|
+
@shutoff_check_interval = conf[:shutoff][:interval] || DEFAULT_SHUT_OFF_CHECK_INTERVAL
|
89
|
+
|
83
90
|
@stats_path = conf[:stats][:path]
|
84
91
|
@stats_secondary_path = conf[:stats][:secondary_path]
|
85
92
|
@stats_suppress_dump = conf[:stats][:suppress]
|
@@ -116,6 +123,8 @@ module Norikra
|
|
116
123
|
@output_pool = Norikra::OutputPool.new
|
117
124
|
|
118
125
|
@engine = Norikra::Engine.new(@output_pool, @typedef_manager, {thread: @thread_conf[:engine]})
|
126
|
+
@udf_plugins = []
|
127
|
+
@listener_plugins = []
|
119
128
|
|
120
129
|
@rpcserver = Norikra::RPC::HTTP.new(
|
121
130
|
engine: @engine,
|
@@ -168,11 +177,13 @@ module Norikra
|
|
168
177
|
end
|
169
178
|
Signal.trap(:USR2, ->{ @dump_stats = true })
|
170
179
|
|
171
|
-
|
180
|
+
@reload_plugins = false
|
181
|
+
Signal.trap(:HUP, ->{ @reload_plugins = true })
|
172
182
|
|
173
|
-
|
174
|
-
|
183
|
+
memory_stat_next = Time.now
|
184
|
+
shut_off_mode = false
|
175
185
|
|
186
|
+
while @running
|
176
187
|
if @stats_path && !@stats_suppress_dump
|
177
188
|
if @dump_stats || (@dump_next_time && Time.now > @dump_next_time)
|
178
189
|
dump_stats
|
@@ -180,6 +191,31 @@ module Norikra
|
|
180
191
|
@dump_next_time = Time.now + @stats_dump_interval if @dump_next_time
|
181
192
|
end
|
182
193
|
end
|
194
|
+
|
195
|
+
if @reload_plugins
|
196
|
+
begin
|
197
|
+
load_plugins(true) # reload
|
198
|
+
rescue => e
|
199
|
+
warn "Error in plugin reloading", type: e.class, error: e
|
200
|
+
end
|
201
|
+
@reload_plugins = false
|
202
|
+
end
|
203
|
+
|
204
|
+
if @shutoff && memory_stat_next < Time.now
|
205
|
+
used = @engine.memory_statistics[:heap][:used_percent]
|
206
|
+
if !shut_off_mode && used >= @shutoff_threshold
|
207
|
+
warn "Entering SHUT OFF mode, heap used #{used}%."
|
208
|
+
@rpcserver.shut_off(true)
|
209
|
+
@webserver.shut_off(true)
|
210
|
+
elsif shut_off_mode && used < @shutoff_threshold
|
211
|
+
warn "Recovering from SHUT OFF mode, heap used #{used}%."
|
212
|
+
@rpcserver.shut_off(false)
|
213
|
+
@webserver.shut_off(false)
|
214
|
+
end
|
215
|
+
memory_stat_next = Time.now + @shutoff_check_interval
|
216
|
+
end
|
217
|
+
|
218
|
+
sleep 0.3
|
183
219
|
end
|
184
220
|
end
|
185
221
|
|
@@ -197,16 +233,26 @@ module Norikra
|
|
197
233
|
info "Norikra server shutdown complete."
|
198
234
|
end
|
199
235
|
|
200
|
-
def load_plugins
|
236
|
+
def load_plugins(reload=false)
|
237
|
+
if reload
|
238
|
+
info "Reloading plugins by user action."
|
239
|
+
require 'rubygems/specification'
|
240
|
+
Gem::Specification.reset # Reset the list of known specs to find newly installed gems
|
241
|
+
end
|
242
|
+
|
201
243
|
info "Loading UDF plugins"
|
202
244
|
Norikra::UDF.listup.each do |mojule|
|
203
245
|
if mojule.is_a?(Class)
|
246
|
+
next if @udf_plugins.include?(mojule)
|
204
247
|
name = @engine.load(:udf, mojule)
|
248
|
+
@udf_plugins.push(mojule)
|
205
249
|
info "UDF loaded", name: name
|
206
250
|
elsif mojule.is_a?(Module) && mojule.respond_to?(:plugins)
|
207
251
|
mojule.init if mojule.respond_to?(:init)
|
208
252
|
mojule.plugins.each do |klass|
|
253
|
+
next if @udf_plugins.include?(klass)
|
209
254
|
name = @engine.load(:udf, klass)
|
255
|
+
@udf_plugins.push(klass)
|
210
256
|
info "UDF loaded", name: name
|
211
257
|
end
|
212
258
|
end
|
@@ -214,7 +260,9 @@ module Norikra
|
|
214
260
|
|
215
261
|
info "Loading Listener plugins"
|
216
262
|
Norikra::Listener.listup.each do |klass|
|
263
|
+
next if @listener_plugins.include?(klass)
|
217
264
|
@engine.load(:listener, klass)
|
265
|
+
@listener_plugins.push(klass)
|
218
266
|
info "Listener loaded", name: klass
|
219
267
|
end
|
220
268
|
end
|
data/lib/norikra/stats.rb
CHANGED
data/lib/norikra/version.rb
CHANGED
data/lib/norikra/webui/api.rb
CHANGED
@@ -18,6 +18,12 @@ class Norikra::WebUI::API < Sinatra::Base
|
|
18
18
|
@@engine = engine
|
19
19
|
end
|
20
20
|
|
21
|
+
@@shut_off_mode = false
|
22
|
+
|
23
|
+
def self.shut_off=(mode)
|
24
|
+
@@shut_off_mode = mode
|
25
|
+
end
|
26
|
+
|
21
27
|
before do
|
22
28
|
content_type :json
|
23
29
|
headers 'Access-Control-Allow-Origin' => '*',
|
@@ -59,6 +65,8 @@ class Norikra::WebUI::API < Sinatra::Base
|
|
59
65
|
|
60
66
|
def engine; @@engine; end
|
61
67
|
|
68
|
+
def shut_off_mode; @@shut_off_mode; end
|
69
|
+
|
62
70
|
def parse_args(param_names, request)
|
63
71
|
body = request.body.read
|
64
72
|
parsed = begin
|
@@ -140,6 +148,10 @@ class Norikra::WebUI::API < Sinatra::Base
|
|
140
148
|
end
|
141
149
|
|
142
150
|
post '/send' do
|
151
|
+
if shut_off_mode
|
152
|
+
halt 503, "SHUT OFF mode"
|
153
|
+
end
|
154
|
+
|
143
155
|
target, events = args = parse_args(['target', 'events'], request)
|
144
156
|
logging(:data, :send, args){
|
145
157
|
r = engine.send(target, events)
|
@@ -25,6 +25,12 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
25
25
|
@@engine = engine
|
26
26
|
end
|
27
27
|
|
28
|
+
@@shut_off_mode = false
|
29
|
+
|
30
|
+
def self.shut_off=(mode)
|
31
|
+
@@shut_off_mode = mode
|
32
|
+
end
|
33
|
+
|
28
34
|
def logging(type, handler, args=[], opts={})
|
29
35
|
if type == :manage
|
30
36
|
debug("WebUI"){ { handler: handler.to_s, args: args } }
|
@@ -56,6 +62,8 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
56
62
|
|
57
63
|
def engine; @@engine; end
|
58
64
|
|
65
|
+
def shut_off_mode; @@shut_off_mode; end
|
66
|
+
|
59
67
|
def targets
|
60
68
|
engine.targets.map(&:name)
|
61
69
|
end
|
@@ -80,6 +88,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
80
88
|
|
81
89
|
erb :index, layout: :base, locals: {
|
82
90
|
input_data: input_data,
|
91
|
+
shut_off_mode: shut_off_mode,
|
83
92
|
stat: engine.statistics,
|
84
93
|
queries: queries,
|
85
94
|
pool: pooled_events,
|
data/lib/norikra/webui/http.rb
CHANGED
data/views/index.erb
CHANGED
metadata
CHANGED
@@ -1,183 +1,183 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: norikra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0.beta.1
|
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-
|
11
|
+
date: 2015-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: mizuno
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.6'
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
16
|
- - ~>
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: '0.6'
|
19
|
+
name: mizuno
|
25
20
|
prerelease: false
|
26
21
|
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rack
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - ~>
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
26
|
+
version: '0.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - '>='
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '0'
|
33
|
+
name: rack
|
39
34
|
prerelease: false
|
40
35
|
type: :runtime
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: thor
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
38
|
- - '>='
|
46
39
|
- !ruby/object:Gem::Version
|
47
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
48
42
|
requirement: !ruby/object:Gem::Requirement
|
49
43
|
requirements:
|
50
44
|
- - '>='
|
51
45
|
- !ruby/object:Gem::Version
|
52
46
|
version: '0'
|
47
|
+
name: thor
|
53
48
|
prerelease: false
|
54
49
|
type: :runtime
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: msgpack-rpc-over-http-jruby
|
57
50
|
version_requirements: !ruby/object:Gem::Requirement
|
58
51
|
requirements:
|
59
52
|
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
62
56
|
requirement: !ruby/object:Gem::Requirement
|
63
57
|
requirements:
|
64
58
|
- - '>='
|
65
59
|
- !ruby/object:Gem::Version
|
66
60
|
version: 0.0.6
|
61
|
+
name: msgpack-rpc-over-http-jruby
|
67
62
|
prerelease: false
|
68
63
|
type: :runtime
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: norikra-client-jruby
|
71
64
|
version_requirements: !ruby/object:Gem::Requirement
|
72
65
|
requirements:
|
73
66
|
- - '>='
|
74
67
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
68
|
+
version: 0.0.6
|
69
|
+
- !ruby/object:Gem::Dependency
|
76
70
|
requirement: !ruby/object:Gem::Requirement
|
77
71
|
requirements:
|
78
72
|
- - '>='
|
79
73
|
- !ruby/object:Gem::Version
|
80
74
|
version: 1.1.0
|
75
|
+
name: norikra-client-jruby
|
81
76
|
prerelease: false
|
82
77
|
type: :runtime
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: sinatra
|
85
78
|
version_requirements: !ruby/object:Gem::Requirement
|
86
79
|
requirements:
|
87
80
|
- - '>='
|
88
81
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
82
|
+
version: 1.1.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
90
84
|
requirement: !ruby/object:Gem::Requirement
|
91
85
|
requirements:
|
92
86
|
- - '>='
|
93
87
|
- !ruby/object:Gem::Version
|
94
88
|
version: '0'
|
89
|
+
name: sinatra
|
95
90
|
prerelease: false
|
96
91
|
type: :runtime
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: sinatra-contrib
|
99
92
|
version_requirements: !ruby/object:Gem::Requirement
|
100
93
|
requirements:
|
101
94
|
- - '>='
|
102
95
|
- !ruby/object:Gem::Version
|
103
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
104
98
|
requirement: !ruby/object:Gem::Requirement
|
105
99
|
requirements:
|
106
100
|
- - '>='
|
107
101
|
- !ruby/object:Gem::Version
|
108
102
|
version: '0'
|
103
|
+
name: sinatra-contrib
|
109
104
|
prerelease: false
|
110
105
|
type: :runtime
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: erubis
|
113
106
|
version_requirements: !ruby/object:Gem::Requirement
|
114
107
|
requirements:
|
115
108
|
- - '>='
|
116
109
|
- !ruby/object:Gem::Version
|
117
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
118
112
|
requirement: !ruby/object:Gem::Requirement
|
119
113
|
requirements:
|
120
114
|
- - '>='
|
121
115
|
- !ruby/object:Gem::Version
|
122
116
|
version: '0'
|
117
|
+
name: erubis
|
123
118
|
prerelease: false
|
124
119
|
type: :runtime
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: bundler
|
127
120
|
version_requirements: !ruby/object:Gem::Requirement
|
128
121
|
requirements:
|
129
|
-
- -
|
122
|
+
- - '>='
|
130
123
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
132
126
|
requirement: !ruby/object:Gem::Requirement
|
133
127
|
requirements:
|
134
128
|
- - ~>
|
135
129
|
- !ruby/object:Gem::Version
|
136
130
|
version: '1.3'
|
131
|
+
name: bundler
|
137
132
|
prerelease: false
|
138
133
|
type: :development
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rake
|
141
134
|
version_requirements: !ruby/object:Gem::Requirement
|
142
135
|
requirements:
|
143
|
-
- -
|
136
|
+
- - ~>
|
144
137
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
138
|
+
version: '1.3'
|
139
|
+
- !ruby/object:Gem::Dependency
|
146
140
|
requirement: !ruby/object:Gem::Requirement
|
147
141
|
requirements:
|
148
142
|
- - '>='
|
149
143
|
- !ruby/object:Gem::Version
|
150
144
|
version: '0'
|
145
|
+
name: rake
|
151
146
|
prerelease: false
|
152
147
|
type: :development
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rspec
|
155
148
|
version_requirements: !ruby/object:Gem::Requirement
|
156
149
|
requirements:
|
157
150
|
- - '>='
|
158
151
|
- !ruby/object:Gem::Version
|
159
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
160
154
|
requirement: !ruby/object:Gem::Requirement
|
161
155
|
requirements:
|
162
156
|
- - '>='
|
163
157
|
- !ruby/object:Gem::Version
|
164
158
|
version: '0'
|
159
|
+
name: rspec
|
165
160
|
prerelease: false
|
166
161
|
type: :development
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: pry
|
169
162
|
version_requirements: !ruby/object:Gem::Requirement
|
170
163
|
requirements:
|
171
164
|
- - '>='
|
172
165
|
- !ruby/object:Gem::Version
|
173
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
174
168
|
requirement: !ruby/object:Gem::Requirement
|
175
169
|
requirements:
|
176
170
|
- - '>='
|
177
171
|
- !ruby/object:Gem::Version
|
178
172
|
version: '0'
|
173
|
+
name: pry
|
179
174
|
prerelease: false
|
180
175
|
type: :development
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '>='
|
179
|
+
- !ruby/object:Gem::Version
|
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.
|
182
182
|
email:
|
183
183
|
- tagomoris@gmail.com
|
@@ -196,7 +196,7 @@ files:
|
|
196
196
|
- Rakefile
|
197
197
|
- bin/norikra
|
198
198
|
- esper/changelog.txt
|
199
|
-
- esper/esper-5.
|
199
|
+
- esper/esper-5.2.0.jar
|
200
200
|
- esper/esper-license.txt
|
201
201
|
- esper/esper/lib/antlr-runtime-4.1.jar
|
202
202
|
- esper/esper/lib/cglib-nodep-3.1.jar
|
@@ -288,9 +288,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
288
288
|
version: '0'
|
289
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
290
|
requirements:
|
291
|
-
- - '
|
291
|
+
- - '>'
|
292
292
|
- !ruby/object:Gem::Version
|
293
|
-
version:
|
293
|
+
version: 1.3.1
|
294
294
|
requirements: []
|
295
295
|
rubyforge_project:
|
296
296
|
rubygems_version: 2.1.9
|