streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [07/11] incubator-streams git commit: supply these variables via type safe config
Date Thu, 12 Feb 2015 16:18:16 GMT
supply these variables via type safe config


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/ec995078
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/ec995078
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/ec995078

Branch: refs/heads/master
Commit: ec995078e45408376a47737acde9f6df5d75e1b1
Parents: ab4c2e9
Author: sblackmon <sblackmon@w2odigital.com>
Authored: Fri Feb 6 17:56:56 2015 -0600
Committer: sblackmon <sblackmon@w2odigital.com>
Committed: Fri Feb 6 18:08:15 2015 -0600

----------------------------------------------------------------------
 streams-config/src/main/jsonschema/StreamsConfiguration.json | 8 ++++++++
 .../org/apache/streams/dropwizard/StreamsApplication.java    | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/ec995078/streams-config/src/main/jsonschema/StreamsConfiguration.json
----------------------------------------------------------------------
diff --git a/streams-config/src/main/jsonschema/StreamsConfiguration.json b/streams-config/src/main/jsonschema/StreamsConfiguration.json
index 3cafbc7..2f68164 100644
--- a/streams-config/src/main/jsonschema/StreamsConfiguration.json
+++ b/streams-config/src/main/jsonschema/StreamsConfiguration.json
@@ -14,6 +14,14 @@
         },
 		"broadcastURI": {
             "type": "string"
+        },
+        "broadcastIntervalMs": {
+          "type": "integer"
+        },
+        "timeoutMs": {
+          "type": "integer",
+          "default": "1440000",
+          "description": "Kill the stream if all providers supply nothing for this long."
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/ec995078/streams-runtimes/streams-runtime-dropwizard/src/main/java/org/apache/streams/dropwizard/StreamsApplication.java
----------------------------------------------------------------------
diff --git a/streams-runtimes/streams-runtime-dropwizard/src/main/java/org/apache/streams/dropwizard/StreamsApplication.java
b/streams-runtimes/streams-runtime-dropwizard/src/main/java/org/apache/streams/dropwizard/StreamsApplication.java
index fce9852..2a6ce1c 100644
--- a/streams-runtimes/streams-runtime-dropwizard/src/main/java/org/apache/streams/dropwizard/StreamsApplication.java
+++ b/streams-runtimes/streams-runtime-dropwizard/src/main/java/org/apache/streams/dropwizard/StreamsApplication.java
@@ -128,9 +128,9 @@ public class StreamsApplication extends Application<StreamsDropwizardConfigurati
     public StreamBuilder setup(StreamsConfiguration streamsConfiguration, Set<StreamsProvider>
resourceProviders) {
 
         Map<String, Object> streamConfig = Maps.newHashMap();
-        streamConfig.put(LocalStreamBuilder.TIMEOUT_KEY, 20 * 60 * 1000 * 1000);
-        //if(! Strings.isNullOrEmpty(streamsConfiguration.getBroadcastURI()) ) streamConfig.put("broadcastURI",
streamsConfiguration.getBroadcastURI());
-        streamConfig.put("monitoring_broadcast_interval_ms", -1);
+        streamConfig.put(LocalStreamBuilder.TIMEOUT_KEY, streamsConfiguration.getTimeoutMs().intValue());
+        if(! Strings.isNullOrEmpty(streamsConfiguration.getBroadcastURI()) ) streamConfig.put("broadcastURI",
streamsConfiguration.getBroadcastURI());
+        if(streamsConfiguration.getBroadcastIntervalMs() != null ) streamConfig.put("monitoring_broadcast_interval_ms",
streamsConfiguration.getBroadcastIntervalMs().intValue());
         StreamBuilder builder = new StreamDropwizardBuilder(1000, streamConfig);
 
         List<String> providers = new ArrayList<>();


Mime
View raw message