Apache Solr open-source search software
Fix license location and CloudSolrClient leak
Kevin Risdene554ae404c7f
diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrEnumerator.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrEnumerator.javaindex 8697b07ca7b..cd354389b6f 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrEnumerator.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrEnumerator.java@@ -1,12 +1,3 @@-package org.apache.solr.handler.sql;--import java.io.IOException;-import java.util.List;--import org.apache.calcite.linq4j.Enumerator;-import org.apache.solr.client.solrj.io.Tuple;-import org.apache.solr.client.solrj.io.stream.TupleStream;-/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with@@ -23,6 +14,14 @@ import org.apache.solr.client.solrj.io.stream.TupleStream;* See the License for the specific language governing permissions and* limitations under the License.*/+package org.apache.solr.handler.sql;++import java.io.IOException;+import java.util.List;++import org.apache.calcite.linq4j.Enumerator;+import org.apache.solr.client.solrj.io.Tuple;+import org.apache.solr.client.solrj.io.stream.TupleStream;/** Enumerator that reads from a Solr collection. */class SolrEnumerator implements Enumerator<Object> {diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrFilter.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrFilter.javaindex 12113b441a5..1828ae532db 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrFilter.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrFilter.java@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.util.ArrayList;@@ -16,23 +32,6 @@ import org.apache.calcite.rex.RexInputRef;import org.apache.calcite.rex.RexLiteral;import org.apache.calcite.rex.RexNode;-/*- * 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.- */-/*** Implementation of a {@link org.apache.calcite.rel.core.Filter} relational expression in Solr.*/diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrMethod.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrMethod.javaindex 7e3fae2b163..323f1353443 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrMethod.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrMethod.java@@ -1,11 +1,3 @@-package org.apache.solr.handler.sql;--import java.lang.reflect.Method;-import java.util.List;--import com.google.common.collect.ImmutableMap;-import org.apache.calcite.linq4j.tree.Types;-/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with@@ -22,6 +14,13 @@ import org.apache.calcite.linq4j.tree.Types;* See the License for the specific language governing permissions and* limitations under the License.*/+package org.apache.solr.handler.sql;++import java.lang.reflect.Method;+import java.util.List;++import com.google.common.collect.ImmutableMap;+import org.apache.calcite.linq4j.tree.Types;/*** Builtin methods in the Solr adapter.diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrProject.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrProject.javaindex ee44dd1d878..26d9ee0dde1 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrProject.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrProject.java@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.util.HashMap;@@ -16,23 +32,6 @@ import org.apache.calcite.rel.type.RelDataType;import org.apache.calcite.rex.RexNode;import org.apache.calcite.util.Pair;-/*- * 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.- */-/*** Implementation of {@link org.apache.calcite.rel.core.Project} relational expression in Solr.*/diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrRel.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrRel.javaindex 44afee3869b..a61cc3f5619 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrRel.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrRel.java@@ -1,14 +1,3 @@-package org.apache.solr.handler.sql;--import java.util.ArrayList;-import java.util.HashMap;-import java.util.List;-import java.util.Map;--import org.apache.calcite.plan.Convention;-import org.apache.calcite.plan.RelOptTable;-import org.apache.calcite.rel.RelNode;-/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with@@ -25,6 +14,16 @@ import org.apache.calcite.rel.RelNode;* See the License for the specific language governing permissions and* limitations under the License.*/+package org.apache.solr.handler.sql;++import java.util.ArrayList;+import java.util.HashMap;+import java.util.List;+import java.util.Map;++import org.apache.calcite.plan.Convention;+import org.apache.calcite.plan.RelOptTable;+import org.apache.calcite.rel.RelNode;/*** Relational expression that uses Solr calling convention.@@ -32,8 +31,8 @@ import org.apache.calcite.rel.RelNode;public interface SolrRel extends RelNode {void implement(Implementor implementor);- /** Calling convention for relational operations that occur in Cassandra. */- Convention CONVENTION = new Convention.Impl("SOLR", SolrRel.class);+ /** Calling convention for relational operations that occur in Solr. */+ Convention CONVENTION = new Convention.Impl("Solr", SolrRel.class);/** Callback for the implementation process that converts a tree of {@link SolrRel} nodes into a Solr query. */class Implementor {diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrRules.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrRules.javaindex d1fdbce5a5a..9cefc55d605 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrRules.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrRules.java@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.util.AbstractList;@@ -19,23 +35,6 @@ import org.apache.calcite.rex.RexNode;import org.apache.calcite.rex.RexVisitorImpl;import org.apache.calcite.sql.validate.SqlValidatorUtil;-/*- * 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.- */-/*** Rules and relational operators for* {@link SolrRel#CONVENTION}diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrSchema.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrSchema.javaindex cfba33adfab..84b5b150c74 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrSchema.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrSchema.java@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.io.IOException;@@ -20,53 +36,40 @@ import org.apache.solr.client.solrj.request.LukeRequest;import org.apache.solr.client.solrj.response.LukeResponse;import org.apache.solr.common.luke.FieldFlag;-/*- * 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.- */-class SolrSchema extends AbstractSchema {- final CloudSolrClient cloudSolrClient;+ final String zk;SolrSchema(String zk) {super();- this.cloudSolrClient = new CloudSolrClient(zk);- this.cloudSolrClient.connect();+ this.zk = zk;}@Overrideprotected Map<String, Table> getTableMap() {- this.cloudSolrClient.connect();- Set<String> collections = this.cloudSolrClient.getZkStateReader().getClusterState().getCollections();- final ImmutableMap.Builder<String, Table> builder = ImmutableMap.builder();- for (String collection : collections) {- builder.put(collection, new SolrTable(this, collection));+ try(CloudSolrClient cloudSolrClient = new CloudSolrClient.Builder().withZkHost(zk).build()) {+ cloudSolrClient.connect();+ Set<String> collections = cloudSolrClient.getZkStateReader().getClusterState().getCollections();++ final ImmutableMap.Builder<String, Table> builder = ImmutableMap.builder();+ for (String collection : collections) {+ builder.put(collection, new SolrTable(this, collection));+ }+ return builder.build();+ } catch (IOException e) {+ throw new RuntimeException(e);}- return builder.build();}private Map<String, LukeResponse.FieldInfo> getFieldInfo(String collection) {- LukeRequest lukeRequest = new LukeRequest();- lukeRequest.setNumTerms(0);- LukeResponse lukeResponse;- try {- lukeResponse = lukeRequest.process(cloudSolrClient, collection);+ try(CloudSolrClient cloudSolrClient = new CloudSolrClient.Builder().withZkHost(zk).build()) {+ cloudSolrClient.connect();+ LukeRequest lukeRequest = new LukeRequest();+ lukeRequest.setNumTerms(0);+ LukeResponse lukeResponse = lukeRequest.process(cloudSolrClient, collection);+ return lukeResponse.getFieldInfo();} catch (SolrServerException | IOException e) {throw new RuntimeException(e);}- return lukeResponse.getFieldInfo();}RelProtoDataType getRelDataType(String collection) {diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrSchemaFactory.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrSchemaFactory.javaindex f0a6ba0e356..84ace8a2a0b 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrSchemaFactory.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrSchemaFactory.java@@ -1,11 +1,3 @@-package org.apache.solr.handler.sql;--import java.util.Map;--import org.apache.calcite.schema.Schema;-import org.apache.calcite.schema.SchemaFactory;-import org.apache.calcite.schema.SchemaPlus;-/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with@@ -22,6 +14,13 @@ import org.apache.calcite.schema.SchemaPlus;* See the License for the specific language governing permissions and* limitations under the License.*/+package org.apache.solr.handler.sql;++import java.util.Map;++import org.apache.calcite.schema.Schema;+import org.apache.calcite.schema.SchemaFactory;+import org.apache.calcite.schema.SchemaPlus;@SuppressWarnings("UnusedDeclaration")public class SolrSchemaFactory implements SchemaFactory {diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrSort.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrSort.javaindex 0945984ec5a..465986b96f1 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrSort.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrSort.java@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.util.ArrayList;@@ -16,23 +32,6 @@ import org.apache.calcite.rel.type.RelDataTypeField;import org.apache.calcite.rex.RexLiteral;import org.apache.calcite.rex.RexNode;-/*- * 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.- */-/*** Implementation of {@link org.apache.calcite.rel.core.Sort} relational expression in Solr.*/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.javaindex 0390040654d..8ed7e38da71 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@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.io.IOException;@@ -26,23 +42,6 @@ import org.apache.solr.client.solrj.io.stream.CloudSolrStream;import org.apache.solr.client.solrj.io.stream.TupleStream;import org.apache.solr.common.params.CommonParams;-/*- * 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.- */-/*** Table based on a Solr collection*/@@ -70,18 +69,18 @@ public class SolrTable extends AbstractQueryableTable implements TranslatableTabreturn protoRowType.apply(typeFactory);}- public Enumerable<Object> query(final CloudSolrClient cloudSolrClient) {- return query(cloudSolrClient, Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), null);+ public Enumerable<Object> query(final String zk) {+ return query(zk, Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), null);}/** Executes a Solr query on the underlying table.*- * @param cloudSolrClient Solr CloudSolrClient+ * @param zk Solr ZooKeeper connection string* @param fields List of fields to project* @param filterQueries A list of filterQueries which should be used in the query* @return Enumerator of results*/- public Enumerable<Object> query(final CloudSolrClient cloudSolrClient, List<String> fields,+ public Enumerable<Object> query(final String zk, List<String> fields,List<String> filterQueries, List<String> order, String limit) {Map<String, String> solrParams = new HashMap<>();solrParams.put(CommonParams.Q, "*:*");@@ -117,7 +116,7 @@ public class SolrTable extends AbstractQueryableTable implements TranslatableTabpublic Enumerator<Object> enumerator() {TupleStream cloudSolrStream;try {- cloudSolrStream = new CloudSolrStream(cloudSolrClient.getZkHost(), collection, solrParams);+ cloudSolrStream = new CloudSolrStream(zk, collection, solrParams);cloudSolrStream.open();} catch (IOException e) {throw new RuntimeException(e);@@ -144,7 +143,7 @@ public class SolrTable extends AbstractQueryableTable implements TranslatableTabpublic Enumerator<T> enumerator() {//noinspection unchecked- final Enumerable<T> enumerable = (Enumerable<T>) getTable().query(getCloudSolrClient());+ final Enumerable<T> enumerable = (Enumerable<T>) getTable().query(getZK());return enumerable.enumerator();}@@ -152,8 +151,8 @@ public class SolrTable extends AbstractQueryableTable implements TranslatableTabreturn (SolrTable) table;}- private CloudSolrClient getCloudSolrClient() {- return schema.unwrap(SolrSchema.class).cloudSolrClient;+ private String getZK() {+ return schema.unwrap(SolrSchema.class).zk;}/** Called via code-generation.@@ -162,7 +161,7 @@ public class SolrTable extends AbstractQueryableTable implements TranslatableTab*/@SuppressWarnings("UnusedDeclaration")public Enumerable<Object> query(List<String> fields, List<String> filterQueries, List<String> order, String limit) {- return getTable().query(getCloudSolrClient(), fields, filterQueries, order, limit);+ return getTable().query(getZK(), fields, filterQueries, order, limit);}}}diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrTableScan.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrTableScan.javaindex 4655a01d041..45eb09c4e00 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrTableScan.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrTableScan.java@@ -1,16 +1,3 @@-package org.apache.solr.handler.sql;--import java.util.List;--import org.apache.calcite.plan.RelOptCluster;-import org.apache.calcite.plan.RelOptPlanner;-import org.apache.calcite.plan.RelOptRule;-import org.apache.calcite.plan.RelOptTable;-import org.apache.calcite.plan.RelTraitSet;-import org.apache.calcite.rel.RelNode;-import org.apache.calcite.rel.core.TableScan;-import org.apache.calcite.rel.type.RelDataType;-/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with@@ -27,6 +14,18 @@ import org.apache.calcite.rel.type.RelDataType;* See the License for the specific language governing permissions and* limitations under the License.*/+package org.apache.solr.handler.sql;++import java.util.List;++import org.apache.calcite.plan.RelOptCluster;+import org.apache.calcite.plan.RelOptPlanner;+import org.apache.calcite.plan.RelOptRule;+import org.apache.calcite.plan.RelOptTable;+import org.apache.calcite.plan.RelTraitSet;+import org.apache.calcite.rel.RelNode;+import org.apache.calcite.rel.core.TableScan;+import org.apache.calcite.rel.type.RelDataType;/*** Relational expression representing a scan of a Solr collection.diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.javaindex 6ee7908c398..76558558e81 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverter.java@@ -1,3 +1,19 @@+/*+ * 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.handler.sql;import java.util.ArrayList;@@ -27,23 +43,6 @@ import org.apache.calcite.rel.type.RelDataType;import org.apache.calcite.runtime.Hook;import org.apache.calcite.util.BuiltInMethod;-/*- * 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.- */-/*** Relational expression representing a scan of a table in Solr*/diff --git a/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverterRule.java b/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverterRule.javaindex a97e047f70b..80365caec1c 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverterRule.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/SolrToEnumerableConverterRule.java@@ -1,10 +1,3 @@-package org.apache.solr.handler.sql;--import org.apache.calcite.adapter.enumerable.EnumerableConvention;-import org.apache.calcite.plan.RelTraitSet;-import org.apache.calcite.rel.RelNode;-import org.apache.calcite.rel.convert.ConverterRule;-/** Licensed to the Apache Software Foundation (ASF) under one or more* contributor license agreements. See the NOTICE file distributed with@@ -21,6 +14,12 @@ import org.apache.calcite.rel.convert.ConverterRule;* See the License for the specific language governing permissions and* limitations under the License.*/+package org.apache.solr.handler.sql;++import org.apache.calcite.adapter.enumerable.EnumerableConvention;+import org.apache.calcite.plan.RelTraitSet;+import org.apache.calcite.rel.RelNode;+import org.apache.calcite.rel.convert.ConverterRule;/*** Rule to convert a relational expression from {@link SolrRel#CONVENTION} to {@link EnumerableConvention}.diff --git a/solr/core/src/java/org/apache/solr/handler/sql/package-info.java b/solr/core/src/java/org/apache/solr/handler/sql/package-info.javaindex 7346ec54050..5aef90dace2 100644--- a/solr/core/src/java/org/apache/solr/handler/sql/package-info.java+++ b/solr/core/src/java/org/apache/solr/handler/sql/package-info.java@@ -1,3 +1,20 @@+/*+ * 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.+ */+/*** Classes related to Apache Calcite implementation in {@link org.apache.solr.handler.SQLHandler}*/