You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2016/04/14 19:52:08 UTC

lucene-solr:master: SOLR-8937: bin/post (SimplePostTool) should tell JDK to stream stdin instead of fully buffer

Repository: lucene-solr
Updated Branches:
  refs/heads/master b36a6ecbe -> 037a40316


SOLR-8937: bin/post (SimplePostTool) should tell JDK to stream stdin instead of fully buffer


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/037a4031
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/037a4031
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/037a4031

Branch: refs/heads/master
Commit: 037a40316c897034c060041730ecefff4eca816a
Parents: b36a6ec
Author: David Smiley <ds...@apache.org>
Authored: Thu Apr 14 13:51:57 2016 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Thu Apr 14 13:51:57 2016 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                            | 2 ++
 solr/core/src/java/org/apache/solr/util/SimplePostTool.java | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/037a4031/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f40bc95..e236c19 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -130,6 +130,8 @@ Optimizations
   produced. This resulted in up to 3x throughput when small filter creation was the bottleneck,
   as well as orders of magnitude less garbage. (Jeff Wartes, yonik)
 
+* SOLR-8937: bin/post (SimplePostTool) now streams the standard input instead of buffering fully.
+  (David Smiley)
 
 Other Changes
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/037a4031/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
index 448897a..44a35ca 100644
--- a/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
+++ b/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
@@ -890,7 +890,11 @@ public class SimplePostTool {
           String encoding = DatatypeConverter.printBase64Binary(url.getUserInfo().getBytes(StandardCharsets.US_ASCII));
           urlc.setRequestProperty("Authorization", "Basic " + encoding);
         }
-        if (null != length) urlc.setFixedLengthStreamingMode(length);
+        if (null != length) {
+          urlc.setFixedLengthStreamingMode(length);
+        } else {
+          urlc.setChunkedStreamingMode(-1);//use JDK default chunkLen, 4k in Java 8.
+        }
         urlc.connect();
       } catch (IOException e) {
         fatal("Connection error (is Solr running at " + solrUrl + " ?): " + e);