lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject [2/3] lucene-solr:branch_8x: SOLR-12983: tests don't need to use the optimization
Date Wed, 09 Jan 2019 02:50:05 GMT
SOLR-12983: tests don't need to use the optimization


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

Branch: refs/heads/branch_8x
Commit: 6f6a35d8f7353856476d24dbfe404c4b171dafc2
Parents: 507a96e
Author: Noble Paul <noble@apache.org>
Authored: Tue Jan 8 17:25:26 2019 +1100
Committer: Noble Paul <noble@apache.org>
Committed: Wed Jan 9 13:49:25 2019 +1100

----------------------------------------------------------------------
 .../solr/handler/loader/JavabinLoader.java       |  4 +++-
 .../solrj/request/JavaBinUpdateRequestCodec.java | 19 ++++++++-----------
 2 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6f6a35d8/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java b/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java
index a4ac256..8bbbde2 100644
--- a/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java
+++ b/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java
@@ -118,7 +118,9 @@ public class JavabinLoader extends ContentStreamLoader {
     for (; ; ) {
       if (in.peek() == -1) return;
       try {
-        update = new JavaBinUpdateRequestCodec().unmarshal(in, handler);
+        update = new JavaBinUpdateRequestCodec()
+            .setReadStringAsCharSeq(true)
+            .unmarshal(in, handler);
       } catch (EOFException e) {
         break; // this is expected
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6f6a35d8/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java
index 59072c5..05d955e 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/JavaBinUpdateRequestCodec.java
@@ -51,6 +51,13 @@ import static org.apache.solr.common.util.ByteArrayUtf8CharSequence.convertCharS
  * @since solr 1.4
  */
 public class JavaBinUpdateRequestCodec {
+  private boolean readStringAsCharSeq = false;
+
+  public JavaBinUpdateRequestCodec setReadStringAsCharSeq(boolean flag) {
+    this.readStringAsCharSeq = flag;
+    return this;
+
+  }
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
   private static final AtomicBoolean WARNED_ABOUT_INDEX_TIME_BOOSTS = new AtomicBoolean();
@@ -274,16 +281,6 @@ public class JavaBinUpdateRequestCodec {
     }
 
 
-   /* @Override
-    protected Object readDocumentFieldVal(String fieldName, DataInputInputStream dis) throws
IOException {
-      super.readStringAsCharSeq = utf8FieldPredicate != null && utf8FieldPredicate.test(fieldName);
-      try {
-        return super.readDocumentFieldVal(fieldName, dis);
-      } finally {
-        super.readStringAsCharSeq = false;
-      }
-    }*/
-
     private List readOuterMostDocIterator(DataInputInputStream fis) throws IOException {
       NamedList params = (NamedList) namedList[0].get("params");
       updateRequest.setParams(new ModifiableSolrParams(params.toSolrParams()));
@@ -291,7 +288,7 @@ public class JavaBinUpdateRequestCodec {
       Integer commitWithin = null;
       Boolean overwrite = null;
       Object o = null;
-      super.readStringAsCharSeq = true;
+      super.readStringAsCharSeq = JavaBinUpdateRequestCodec.this.readStringAsCharSeq;
       try {
         while (true) {
           if (o == null) {


Mime
View raw message