streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Blackmon (JIRA)" <j...@apache.org>
Subject [jira] [Created] (STREAMS-223) streams-monitoring exception when streamConfig not set
Date Fri, 14 Nov 2014 06:35:34 GMT
Steve Blackmon created STREAMS-223:
--------------------------------------

             Summary: streams-monitoring exception when streamConfig not set
                 Key: STREAMS-223
                 URL: https://issues.apache.org/jira/browse/STREAMS-223
             Project: Streams
          Issue Type: Bug
            Reporter: Steve Blackmon


LocalStreamBuilder supports a default execution even when streamConfig is empty/null

StreamBuilder builder = new LocalStreamBuilder(100);

streams-monitoring throws an exception and does not run when no config is supplied.

00:31:21.762 [main] ERROR o.a.s.m.tasks.BroadcastMonitorThread - Exception while trying to
set default broadcast thread wait time: {}
java.lang.NullPointerException: null
	at org.apache.streams.monitoring.tasks.BroadcastMonitorThread.setWaitTime(BroadcastMonitorThread.java:144)
[classes/:na]
	at org.apache.streams.monitoring.tasks.BroadcastMonitorThread.<init>(BroadcastMonitorThread.java:58)
[classes/:na]
	at org.apache.streams.local.builders.LocalStreamBuilder.<init>(LocalStreamBuilder.java:114)
[classes/:na]
	at org.apache.streams.local.builders.LocalStreamBuilder.<init>(LocalStreamBuilder.java:89)
[classes/:na]
	at org.apache.streams.twitter.example.TwitterUserstreamConsole.main(TwitterUserstreamConsole.java:49)
[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_20]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_20]
	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_20]
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) [idea_rt.jar:na]
00:31:21.773 [main] DEBUG o.a.s.l.builders.LocalStreamBuilder - Attaching shutdown handler



The workaround is to supply a config like this:
        Map<String, Object> streamConfig = Maps.newHashMap();
        streamConfig.put(LocalStreamBuilder.TIMEOUT_KEY, 20 * 60 * 1000);
        streamConfig.put("monitoring_broadcast_interval_ms", -1);
        StreamBuilder builder = new LocalStreamBuilder(100, streamConfig);

But that should not be necessary.  

Establish documented defaults for this capability, ensure no exceptions occur in the default
state, and do not require explicit action by the implementation to use the default.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message