Apache Lucene open-source search software
SOLR-12036: Factor out DefaultStreamFactory solrj class.
Christine Poerschkee8f862ea444d
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 74e5ad2fa76..909708bf164 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -84,6 +84,8 @@ New Features* SOLR-10783: Add support for Hadoop Credential Provider as SSL/TLS store password source.(Mano Kovacs via Mark Miller)+* SOLR-12036: Factor out DefaultStreamFactory solrj class. (Christine Poerschke)+Bug Fixes----------------------diff --git a/solr/core/src/java/org/apache/solr/handler/GraphHandler.java b/solr/core/src/java/org/apache/solr/handler/GraphHandler.javaindex cb4f8d5ad2d..13874c93727 100644--- a/solr/core/src/java/org/apache/solr/handler/GraphHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/GraphHandler.java@@ -25,10 +25,10 @@ import java.util.Map;import java.util.Map.Entry;import org.apache.solr.client.solrj.io.Tuple;-import org.apache.solr.client.solrj.io.Lang;import org.apache.solr.client.solrj.io.comp.StreamComparator;import org.apache.solr.client.solrj.io.graph.Traversal;import org.apache.solr.client.solrj.io.stream.*;+import org.apache.solr.client.solrj.io.stream.expr.DefaultStreamFactory;import org.apache.solr.client.solrj.io.stream.expr.Explanation;import org.apache.solr.client.solrj.io.stream.expr.Expressible;import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;@@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory;*/public class GraphHandler extends RequestHandlerBase implements SolrCoreAware, PermissionNameProvider {- private StreamFactory streamFactory = new StreamFactory();+ private StreamFactory streamFactory = new DefaultStreamFactory();private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());private String coreName;@@ -86,8 +86,6 @@ public class GraphHandler extends RequestHandlerBase implements SolrCoreAware, PstreamFactory.withDefaultZkHost(defaultZkhost);}- Lang.register(streamFactory);-// This pulls all the overrides and additions from the configObject functionMappingsObj = initArgs.get("streamFunctions");if(null != functionMappingsObj){diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.javaindex ffe66dea31f..269d12dc814 100644--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java@@ -29,9 +29,9 @@ import java.util.Map;import org.apache.solr.client.solrj.io.ModelCache;import org.apache.solr.client.solrj.io.SolrClientCache;import org.apache.solr.client.solrj.io.Tuple;-import org.apache.solr.client.solrj.io.Lang;import org.apache.solr.client.solrj.io.comp.StreamComparator;import org.apache.solr.client.solrj.io.stream.*;+import org.apache.solr.client.solrj.io.stream.expr.DefaultStreamFactory;import org.apache.solr.client.solrj.io.stream.expr.Explanation;import org.apache.solr.client.solrj.io.stream.expr.Explanation.ExpressionType;import org.apache.solr.client.solrj.io.stream.expr.Expressible;@@ -65,7 +65,7 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,static SolrClientCache clientCache = new SolrClientCache();static ModelCache modelCache = null;- private StreamFactory streamFactory = new StreamFactory();+ private StreamFactory streamFactory = new DefaultStreamFactory();private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());private String coreName;private Map<String,DaemonStream> daemons = Collections.synchronizedMap(new HashMap());@@ -106,8 +106,6 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,clientCache);}- Lang.register(streamFactory);-/** Add the core functions. These are functions that rely directly on either Lucene or Solr* capabilities that are not part of Lang.diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/DefaultStreamFactory.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/DefaultStreamFactory.javanew file mode 100644index 00000000000..672d0cd056b--- /dev/null+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/DefaultStreamFactory.java@@ -0,0 +1,31 @@+/*+ * Licensed to the Apache Software Foundation (ASF) under one or more+ * contributor license agreements. See the NOTICE file distributed with+ * this work for additional information regarding copyright ownership.+ * The ASF licenses this file to You under the Apache License, Version 2.0+ * (the "License"); you may not use this file except in compliance with+ * the License. You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.apache.solr.client.solrj.io.stream.expr;++import org.apache.solr.client.solrj.io.Lang;++/**+ * A default collection of mappings, used to convert strings into stream expressions.+ */+public class DefaultStreamFactory extends StreamFactory {++ public DefaultStreamFactory() {+ super();+ Lang.register(this);+ }++}