lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbern...@apache.org
Subject [1/2] lucene-solr:branch_6x: SOLR-10444: SQL interface does not use client cache
Date Fri, 07 Apr 2017 01:45:23 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x cf3fc6dc8 -> aefac193e


SOLR-10444: SQL interface does not use client cache


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

Branch: refs/heads/branch_6x
Commit: b198910f8535f4b4679cf69ff441c8f0d6367353
Parents: cf3fc6d
Author: Joel Bernstein <jbernste@apache.org>
Authored: Thu Apr 6 21:17:02 2017 -0400
Committer: Joel Bernstein <jbernste@apache.org>
Committed: Thu Apr 6 21:36:00 2017 -0400

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/handler/StreamHandler.java | 4 ++++
 solr/core/src/java/org/apache/solr/handler/sql/SolrTable.java | 6 ++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b198910f/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index 5b9e1a7..8a18b89 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -115,6 +115,10 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
     return PermissionNameProvider.Name.READ_PERM;
   }
 
+  public static SolrClientCache getClientCache() {
+    return clientCache;
+  }
+
   public void inform(SolrCore core) {
     
     /* The stream factory will always contain the zkUrl for the given collection

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b198910f/solr/core/src/java/org/apache/solr/handler/sql/SolrTable.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrTable.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrTable.java
index b7f552b..aa873cc 100644
--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrTable.java
+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrTable.java
@@ -28,6 +28,7 @@ import org.apache.calcite.schema.SchemaPlus;
 import org.apache.calcite.schema.TranslatableTable;
 import org.apache.calcite.schema.impl.AbstractTableQueryable;
 import org.apache.calcite.util.Pair;
+import org.apache.solr.client.solrj.io.SolrClientCache;
 import org.apache.solr.client.solrj.io.comp.ComparatorOrder;
 import org.apache.solr.client.solrj.io.comp.FieldComparator;
 import org.apache.solr.client.solrj.io.comp.MultipleFieldComparator;
@@ -51,6 +52,7 @@ import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;
 import org.apache.solr.client.solrj.io.stream.metrics.*;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.handler.StreamHandler;
 
 import java.io.IOException;
 import java.util.*;
@@ -158,6 +160,10 @@ class SolrTable extends AbstractQueryableTable implements TranslatableTable
{
       throw new RuntimeException(e);
     }
 
+    StreamContext streamContext = new StreamContext();
+    streamContext.setSolrClientCache(StreamHandler.getClientCache());
+    tupleStream.setStreamContext(streamContext);
+
     final TupleStream finalStream = tupleStream;
 
     return new AbstractEnumerable<Object>() {


Mime
View raw message