streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject [4/5] git commit: STREAMS-135 | Updated per code review notes
Date Fri, 01 Aug 2014 12:22:56 GMT
STREAMS-135 | Updated per code review notes


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

Branch: refs/heads/master
Commit: c3ae9c8aed44043b30f6216d0646a1f81f86d0f7
Parents: 04054d4
Author: mfranklin <mfranklin@apache.org>
Authored: Wed Jul 30 10:17:00 2014 -0400
Committer: mfranklin <mfranklin@apache.org>
Committed: Wed Jul 30 10:17:00 2014 -0400

----------------------------------------------------------------------
 .../apache/streams/twitter/provider/TwitterStreamProcessor.java  | 4 +++-
 .../apache/streams/twitter/provider/TwitterStreamProvider.java   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/c3ae9c8a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProcessor.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProcessor.java
b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProcessor.java
index 8fe67b5..83ea5ae 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProcessor.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProcessor.java
@@ -62,7 +62,9 @@ public class TwitterStreamProcessor extends StringDelimitedProcessor {
         String msg = null;
         do {
             msg = this.processNextMessage();
-            Thread.sleep(10);
+            if(msg == null) {
+                Thread.sleep(10);
+            }
         } while(msg == null);
 
         //Deserializing to an ObjectNode can take time.  Parallelize the task to improve
throughput

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/c3ae9c8a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
index fb1e55f..98d0acb 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
@@ -229,7 +229,7 @@ public class TwitterStreamProvider implements StreamsProvider, Serializable,
Dat
     public void cleanUp() {
         this.client.stop();
         this.processor.cleanUp();
-        this.running.set(true);
+        this.running.set(false);
     }
 
     @Override


Mime
View raw message