streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [1/6] incubator-streams-examples git commit: fix parent pom reference simplify thread start
Date Thu, 12 Mar 2015 10:36:38 GMT
Repository: incubator-streams-examples
Updated Branches:
  refs/heads/master 073f0f39c -> 5a5553475


fix parent pom reference
simplify thread start


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

Branch: refs/heads/master
Commit: 7288c390358c43032f0809e86ab02b1d6e981572
Parents: 5ac85ed
Author: sblackmon <sblackmon@apache.org>
Authored: Tue Feb 24 15:28:21 2015 -0600
Committer: sblackmon <sblackmon@apache.org>
Committed: Tue Feb 24 15:30:32 2015 -0600

----------------------------------------------------------------------
 local/mongo-elasticsearch-sync/pom.xml                |  3 ++-
 .../example/elasticsearch/MongoElasticsearchSync.java | 14 ++++----------
 2 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams-examples/blob/7288c390/local/mongo-elasticsearch-sync/pom.xml
----------------------------------------------------------------------
diff --git a/local/mongo-elasticsearch-sync/pom.xml b/local/mongo-elasticsearch-sync/pom.xml
index 79470ee..4d271e0 100644
--- a/local/mongo-elasticsearch-sync/pom.xml
+++ b/local/mongo-elasticsearch-sync/pom.xml
@@ -22,8 +22,9 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.streams</groupId>
-        <artifactId>streams-examples</artifactId>
+        <artifactId>streams-examples-local</artifactId>
         <version>0.2-incubating-SNAPSHOT</version>
+        <relativePath>..</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 

http://git-wip-us.apache.org/repos/asf/incubator-streams-examples/blob/7288c390/local/mongo-elasticsearch-sync/src/main/java/org/apache/streams/example/elasticsearch/MongoElasticsearchSync.java
----------------------------------------------------------------------
diff --git a/local/mongo-elasticsearch-sync/src/main/java/org/apache/streams/example/elasticsearch/MongoElasticsearchSync.java
b/local/mongo-elasticsearch-sync/src/main/java/org/apache/streams/example/elasticsearch/MongoElasticsearchSync.java
index 568a1a9..fccbf47 100644
--- a/local/mongo-elasticsearch-sync/src/main/java/org/apache/streams/example/elasticsearch/MongoElasticsearchSync.java
+++ b/local/mongo-elasticsearch-sync/src/main/java/org/apache/streams/example/elasticsearch/MongoElasticsearchSync.java
@@ -45,19 +45,10 @@ public class MongoElasticsearchSync implements Runnable {
 
     private final static Logger LOGGER = LoggerFactory.getLogger(MongoElasticsearchSync.class);
 
-    protected static ListeningExecutorService executor = MoreExecutors.listeningDecorator(newFixedThreadPoolWithQueueSize(5,
20));
-
-    private static ExecutorService newFixedThreadPoolWithQueueSize(int nThreads, int queueSize)
{
-        return new ThreadPoolExecutor(nThreads, nThreads,
-                5000L, TimeUnit.MILLISECONDS,
-                new ArrayBlockingQueue<Runnable>(queueSize, true), new ThreadPoolExecutor.CallerRunsPolicy());
-    }
-
     MongoElasticsearchSyncConfiguration config;
 
     public MongoElasticsearchSync() {
         this(new ComponentConfigurator<MongoElasticsearchSyncConfiguration>(MongoElasticsearchSyncConfiguration.class).detectConfiguration(StreamsConfigurator.getConfig()));
-
     }
 
     public MongoElasticsearchSync(MongoElasticsearchSyncConfiguration config) {
@@ -68,7 +59,9 @@ public class MongoElasticsearchSync implements Runnable {
     {
         LOGGER.info(StreamsConfigurator.config.toString());
 
-        executor.submit(new MongoElasticsearchSync());
+        MongoElasticsearchSync sync = new MongoElasticsearchSync();
+
+        new Thread(sync).start();
 
     }
 
@@ -80,6 +73,7 @@ public class MongoElasticsearchSync implements Runnable {
         ElasticsearchPersistWriter elasticsearchPersistWriter = new ElasticsearchPersistWriter(config.getDestination());
 
         Map<String, Object> streamConfig = Maps.newHashMap();
+        streamConfig.put(LocalStreamBuilder.STREAM_IDENTIFIER_KEY, STREAMS_ID);
         streamConfig.put(LocalStreamBuilder.TIMEOUT_KEY, 7 * 24 * 60 * 1000);
         StreamBuilder builder = new LocalStreamBuilder(1000, streamConfig);
 


Mime
View raw message