asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject incubator-asterixdb git commit: Flush Socket Feed Before Waiting for More Data
Date Sun, 13 Mar 2016 05:35:29 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master c90d3401c -> 472d2f50b


Flush Socket Feed Before Waiting for More Data

Change-Id: Ic37085114592e97b6c5b2d29c5451d816a154aa8
Reviewed-on: https://asterix-gerrit.ics.uci.edu/709
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <hubailmor@gmail.com>


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

Branch: refs/heads/master
Commit: 472d2f50bceb6d041645c62d726fc4a419dc85a0
Parents: c90d340
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Fri Mar 11 19:26:22 2016 +0300
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Sat Mar 12 21:29:57 2016 -0800

----------------------------------------------------------------------
 .../apache/asterix/external/input/stream/SocketInputStream.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/472d2f50/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketInputStream.java
----------------------------------------------------------------------
diff --git a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketInputStream.java
b/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketInputStream.java
index cf8d339..67c4493 100644
--- a/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketInputStream.java
+++ b/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketInputStream.java
@@ -33,6 +33,7 @@ public class SocketInputStream extends AInputStream {
     private ServerSocket server;
     private Socket socket;
     private InputStream connectionStream;
+    private AbstractFeedDataFlowController controller;
 
     public SocketInputStream(ServerSocket server) throws IOException {
         this.server = server;
@@ -73,6 +74,9 @@ public class SocketInputStream extends AInputStream {
         }
         int read = -1;
         try {
+            if (connectionStream.available() < 1) {
+                controller.flush();
+            }
             read = connectionStream.read(b, off, len);
         } catch (IOException e) {
             e.printStackTrace();
@@ -166,5 +170,6 @@ public class SocketInputStream extends AInputStream {
 
     @Override
     public void setController(AbstractFeedDataFlowController controller) {
+        this.controller = controller;
     }
 }


Mime
View raw message