RANGER-1122 - Remove ranger_solrj module Reviewed by [email protected]
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/d9a661cf Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/d9a661cf Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/d9a661cf Branch: refs/heads/master Commit: d9a661cfefd6b5c13486bc7d16e66e98dcf05bcd Parents: 246d536 Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Jul 27 10:11:12 2016 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Jul 27 10:11:12 2016 +0100 ---------------------------------------------------------------------- pom.xml | 1 - ranger_solrj/.gitignore | 1 - ranger_solrj/pom.xml | 68 - .../solr/client/solrj/ResponseParser.java | 53 - .../apache/solr/client/solrj/SolrClient.java | 416 ------ .../org/apache/solr/client/solrj/SolrQuery.java | 1109 ---------------- .../apache/solr/client/solrj/SolrRequest.java | 137 -- .../apache/solr/client/solrj/SolrResponse.java | 65 - .../apache/solr/client/solrj/SolrServer.java | 25 - .../solr/client/solrj/SolrServerException.java | 54 - .../client/solrj/StreamingResponseCallback.java | 37 - .../client/solrj/beans/BindingException.java | 29 - .../solrj/beans/DocumentObjectBinder.java | 470 ------- .../apache/solr/client/solrj/beans/Field.java | 38 - .../solr/client/solrj/beans/package-info.java | 23 - .../client/solrj/impl/BinaryRequestWriter.java | 120 -- .../client/solrj/impl/BinaryResponseParser.java | 64 - .../solr/client/solrj/impl/CloudSolrClient.java | 1232 ------------------ .../solr/client/solrj/impl/CloudSolrServer.java | 61 - .../solrj/impl/ConcurrentUpdateSolrClient.java | 492 ------- .../solrj/impl/ConcurrentUpdateSolrServer.java | 46 - .../client/solrj/impl/HttpClientConfigurer.java | 96 -- .../solr/client/solrj/impl/HttpClientUtil.java | 365 ------ .../solr/client/solrj/impl/HttpSolrClient.java | 821 ------------ .../solr/client/solrj/impl/HttpSolrServer.java | 41 - .../client/solrj/impl/LBHttpSolrClient.java | 730 ----------- .../client/solrj/impl/LBHttpSolrServer.java | 43 - .../client/solrj/impl/NoOpResponseParser.java | 83 -- .../impl/StreamingBinaryResponseParser.java | 91 -- .../client/solrj/impl/XMLResponseParser.java | 465 ------- .../solr/client/solrj/impl/package-info.java | 24 - .../apache/solr/client/solrj/package-info.java | 23 - .../solrj/request/AbstractUpdateRequest.java | 145 --- .../solrj/request/CollectionAdminRequest.java | 860 ------------ .../request/ContentStreamUpdateRequest.java | 78 -- .../client/solrj/request/CoreAdminRequest.java | 593 --------- .../client/solrj/request/DirectXmlRequest.java | 66 - .../solrj/request/DocumentAnalysisRequest.java | 199 --- .../solrj/request/FieldAnalysisRequest.java | 270 ---- .../client/solrj/request/IsUpdateRequest.java | 25 - .../request/JavaBinUpdateRequestCodec.java | 238 ---- .../solr/client/solrj/request/LukeRequest.java | 120 -- .../solr/client/solrj/request/QueryRequest.java | 89 -- .../client/solrj/request/RequestWriter.java | 146 --- .../solr/client/solrj/request/SolrPing.java | 111 -- .../client/solrj/request/UpdateRequest.java | 463 ------- .../solr/client/solrj/request/package-info.java | 23 - .../solrj/response/AnalysisResponseBase.java | 252 ---- .../solrj/response/CollectionAdminResponse.java | 79 -- .../solrj/response/CoreAdminResponse.java | 58 - .../response/DocumentAnalysisResponse.java | 258 ---- .../solr/client/solrj/response/FacetField.java | 176 --- .../solrj/response/FieldAnalysisResponse.java | 204 --- .../client/solrj/response/FieldStatsInfo.java | 191 --- .../solr/client/solrj/response/Group.java | 69 - .../client/solrj/response/GroupCommand.java | 125 -- .../client/solrj/response/GroupResponse.java | 55 - .../client/solrj/response/IntervalFacet.java | 86 -- .../client/solrj/response/LukeResponse.java | 270 ---- .../solr/client/solrj/response/PivotField.java | 97 -- .../client/solrj/response/QueryResponse.java | 586 --------- .../solr/client/solrj/response/RangeFacet.java | 126 -- .../client/solrj/response/SolrPingResponse.java | 28 - .../client/solrj/response/SolrResponseBase.java | 91 -- .../solrj/response/SpellCheckResponse.java | 274 ---- .../client/solrj/response/TermsResponse.java | 90 -- .../client/solrj/response/UpdateResponse.java | 30 - .../client/solrj/response/package-info.java | 24 - .../solr/client/solrj/util/ClientUtils.java | 251 ---- .../solr/client/solrj/util/package-info.java | 23 - .../org/apache/solr/common/EnumFieldValue.java | 116 -- .../org/apache/solr/common/SolrDocument.java | 396 ------ .../apache/solr/common/SolrDocumentList.java | 68 - .../org/apache/solr/common/SolrException.java | 206 --- .../apache/solr/common/SolrInputDocument.java | 301 ----- .../org/apache/solr/common/SolrInputField.java | 232 ---- .../org/apache/solr/common/StringUtils.java | 26 - .../org/apache/solr/common/cloud/Aliases.java | 63 - .../solr/common/cloud/BeforeReconnect.java | 22 - .../solr/common/cloud/ClosableThread.java | 27 - .../apache/solr/common/cloud/ClusterState.java | 397 ------ .../solr/common/cloud/ClusterStateUtil.java | 230 ---- .../solr/common/cloud/CompositeIdRouter.java | 327 ----- .../solr/common/cloud/ConnectionManager.java | 237 ---- .../common/cloud/DefaultConnectionStrategy.java | 75 -- .../solr/common/cloud/DefaultZkACLProvider.java | 45 - .../cloud/DefaultZkCredentialsProvider.java | 41 - .../apache/solr/common/cloud/DocCollection.java | 201 --- .../org/apache/solr/common/cloud/DocRouter.java | 227 ---- .../solr/common/cloud/HashBasedRouter.java | 81 -- .../solr/common/cloud/ImplicitDocRouter.java | 104 -- .../apache/solr/common/cloud/OnReconnect.java | 22 - .../apache/solr/common/cloud/PlainIdRouter.java | 22 - .../org/apache/solr/common/cloud/Replica.java | 48 - .../apache/solr/common/cloud/RoutingRule.java | 71 - .../solr/common/cloud/SaslZkACLProvider.java | 49 - .../org/apache/solr/common/cloud/Slice.java | 196 --- .../apache/solr/common/cloud/SolrZkClient.java | 736 ----------- .../apache/solr/common/cloud/SolrZooKeeper.java | 103 -- ...ParamsAllAndReadonlyDigestZkACLProvider.java | 90 -- ...tCredentialsDigestZkCredentialsProvider.java | 60 - .../apache/solr/common/cloud/ZkACLProvider.java | 28 - .../cloud/ZkClientConnectionStrategy.java | 113 -- .../apache/solr/common/cloud/ZkCmdExecutor.java | 111 -- .../solr/common/cloud/ZkConfigManager.java | 145 --- .../solr/common/cloud/ZkCoreNodeProps.java | 74 -- .../common/cloud/ZkCredentialsProvider.java | 45 - .../apache/solr/common/cloud/ZkNodeProps.java | 154 --- .../apache/solr/common/cloud/ZkOperation.java | 35 - .../apache/solr/common/cloud/ZkStateReader.java | 925 ------------- .../solr/common/cloud/ZooKeeperException.java | 32 - .../apache/solr/common/cloud/package-info.java | 23 - .../org/apache/solr/common/luke/FieldFlag.java | 70 - .../apache/solr/common/luke/package-info.java | 23 - .../org/apache/solr/common/package-info.java | 23 - .../solr/common/params/AnalysisParams.java | 60 - .../solr/common/params/AppendedSolrParams.java | 55 - .../solr/common/params/CollectionParams.java | 73 -- .../apache/solr/common/params/CommonParams.java | 228 ---- .../solr/common/params/CoreAdminParams.java | 151 --- .../solr/common/params/CursorMarkParams.java | 48 - .../solr/common/params/DefaultSolrParams.java | 68 - .../apache/solr/common/params/DisMaxParams.java | 78 -- .../apache/solr/common/params/EventParams.java | 30 - .../apache/solr/common/params/ExpandParams.java | 32 - .../apache/solr/common/params/FacetParams.java | 405 ------ .../apache/solr/common/params/GroupParams.java | 71 - .../solr/common/params/HighlightParams.java | 82 -- .../solr/common/params/MapSolrParams.java | 88 -- .../common/params/ModifiableSolrParams.java | 210 --- .../solr/common/params/MoreLikeThisParams.java | 74 -- .../solr/common/params/MultiMapSolrParams.java | 92 -- .../common/params/QueryElevationParams.java | 52 - .../solr/common/params/RequiredSolrParams.java | 155 --- .../apache/solr/common/params/ShardParams.java | 56 - .../apache/solr/common/params/SimpleParams.java | 50 - .../apache/solr/common/params/SolrParams.java | 363 ------ .../solr/common/params/SpatialParams.java | 42 - .../solr/common/params/SpellingParams.java | 174 --- .../apache/solr/common/params/StatsParams.java | 28 - .../solr/common/params/TermVectorParams.java | 66 - .../apache/solr/common/params/TermsParams.java | 120 -- .../apache/solr/common/params/UpdateParams.java | 72 - .../apache/solr/common/params/package-info.java | 22 - .../org/apache/solr/common/util/Base64.java | 153 --- .../org/apache/solr/common/util/ByteUtils.java | 126 -- .../apache/solr/common/util/ContentStream.java | 81 -- .../solr/common/util/ContentStreamBase.java | 260 ---- .../solr/common/util/DataInputInputStream.java | 27 - .../org/apache/solr/common/util/DateUtil.java | 261 ---- .../apache/solr/common/util/ExecutorUtil.java | 64 - .../solr/common/util/FastInputStream.java | 253 ---- .../solr/common/util/FastOutputStream.java | 233 ---- .../java/org/apache/solr/common/util/Hash.java | 422 ------ .../org/apache/solr/common/util/IOUtils.java | 37 - .../apache/solr/common/util/IteratorChain.java | 87 -- .../apache/solr/common/util/JavaBinCodec.java | 820 ------------ .../solr/common/util/JsonRecordReader.java | 586 --------- .../org/apache/solr/common/util/NamedList.java | 708 ---------- .../solr/common/util/ObjectReleaseTracker.java | 62 - .../org/apache/solr/common/util/RetryUtil.java | 43 - .../solr/common/util/SimpleOrderedMap.java | 67 - .../common/util/SolrjNamedThreadFactory.java | 51 - .../org/apache/solr/common/util/StrUtils.java | 309 ----- .../org/apache/solr/common/util/URLUtil.java | 50 - .../java/org/apache/solr/common/util/XML.java | 207 --- .../apache/solr/common/util/XMLErrorLogger.java | 84 -- .../apache/solr/common/util/package-info.java | 23 - ranger_solrj/src/main/java/overview.html | 21 - 169 files changed, 28892 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 0abb7f3..f2cd9d8 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,6 @@ <module>knox-agent</module> <module>storm-agent</module> <module>plugin-yarn</module> - <module>ranger_solrj</module> <module>security-admin</module> <module>plugin-kafka</module> <module>plugin-solr</module> http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/.gitignore ---------------------------------------------------------------------- diff --git a/ranger_solrj/.gitignore b/ranger_solrj/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/ranger_solrj/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/pom.xml ---------------------------------------------------------------------- diff --git a/ranger_solrj/pom.xml b/ranger_solrj/pom.xml deleted file mode 100644 index 163d407..0000000 --- a/ranger_solrj/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0"?> -<!-- - 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. ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.ranger</groupId> - <artifactId>ranger</artifactId> - <version>0.7.0-SNAPSHOT</version> - </parent> - <artifactId>ranger_solrj</artifactId> - <name>ranger_solrj</name> - <url>http://maven.apache.org</url> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - <dependencies> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>${commons.io.version}</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>${httpcomponents.httpclient.version}</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpcore</artifactId> - <version>${httpcomponents.httpcore.version}</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpmime</artifactId> - <version>${httpcomponents.httpmime.version}</version> - </dependency> - <dependency> - <groupId>org.noggit</groupId> - <artifactId>noggit</artifactId> - <version>${noggit.version}</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>${slf4j-api.version}</version> - </dependency> - <dependency> - <groupId>org.apache.zookeeper</groupId> - <artifactId>zookeeper</artifactId> - <version>${zookeeper.version}</version> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/ResponseParser.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/ResponseParser.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/ResponseParser.java deleted file mode 100644 index d5c3b38..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/ResponseParser.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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; - -import java.io.Reader; -import java.io.InputStream; -import org.apache.solr.common.util.NamedList; - -/** - * - * - * @since solr 1.3 - */ -public abstract class ResponseParser -{ - public abstract String getWriterType(); // for example: wt=XML, JSON, etc - - public abstract NamedList<Object> processResponse(InputStream body, String encoding); - - public abstract NamedList<Object> processResponse(Reader reader); - - /** - * A well behaved ResponseParser will return its content-type. - * - * @return the content-type this parser expects to parse - */ - public String getContentType() { - return null; - } - - /** - * @return the version param passed to solr - */ - public String getVersion() - { - return "2.2"; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrClient.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrClient.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrClient.java deleted file mode 100644 index 5c06a03..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrClient.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * 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; - -import org.apache.solr.client.solrj.SolrRequest.METHOD; -import org.apache.solr.client.solrj.beans.DocumentObjectBinder; -import org.apache.solr.client.solrj.impl.StreamingBinaryResponseParser; -import org.apache.solr.client.solrj.request.QueryRequest; -import org.apache.solr.client.solrj.request.SolrPing; -import org.apache.solr.client.solrj.request.UpdateRequest; -import org.apache.solr.client.solrj.response.QueryResponse; -import org.apache.solr.client.solrj.response.SolrPingResponse; -import org.apache.solr.client.solrj.response.UpdateResponse; -import org.apache.solr.common.SolrDocument; -import org.apache.solr.common.SolrDocumentList; -import org.apache.solr.common.SolrInputDocument; -import org.apache.solr.common.StringUtils; -import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.params.SolrParams; -import org.apache.solr.common.util.NamedList; - -import java.io.Closeable; -import java.io.IOException; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -/** - * Abstraction through which all communication with a Solr server may be routed - * - * @since 5.0, replaced {@code SolrServer} - */ -public abstract class SolrClient implements Serializable, Closeable { - - private static final long serialVersionUID = 1L; - private DocumentObjectBinder binder; - - /** - * Adds a collection of documents - * @param docs the collection of documents - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse add(Collection<SolrInputDocument> docs) throws SolrServerException, IOException { - return add(docs, -1); - } - - /** - * Adds a collection of documents, specifying max time before they become committed - * @param docs the collection of documents - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since solr 3.5 - */ - public UpdateResponse add(Collection<SolrInputDocument> docs, int commitWithinMs) throws SolrServerException, IOException { - UpdateRequest req = new UpdateRequest(); - req.add(docs); - req.setCommitWithin(commitWithinMs); - return req.process(this); - } - - /** - * Adds a collection of beans - * @param beans the collection of beans - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse addBeans(Collection<?> beans) throws SolrServerException, IOException { - return addBeans(beans, -1); - } - - /** - * Adds a collection of beans specifying max time before they become committed - * @param beans the collection of beans - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since solr 3.5 - */ - public UpdateResponse addBeans(Collection<?> beans, int commitWithinMs) throws SolrServerException, IOException { - DocumentObjectBinder binder = this.getBinder(); - ArrayList<SolrInputDocument> docs = new ArrayList<>(beans.size()); - for (Object bean : beans) { - docs.add(binder.toSolrInputDocument(bean)); - } - return add(docs, commitWithinMs); - } - - /** - * Adds a single document - * @param doc the input document - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse add(SolrInputDocument doc) throws SolrServerException, IOException { - return add(doc, -1); - } - - /** - * Adds a single document specifying max time before it becomes committed - * @param doc the input document - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since solr 3.5 - */ - public UpdateResponse add(SolrInputDocument doc, int commitWithinMs) throws SolrServerException, IOException { - UpdateRequest req = new UpdateRequest(); - req.add(doc); - req.setCommitWithin(commitWithinMs); - return req.process(this); - } - - /** - * Adds a single bean - * @param obj the input bean - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse addBean(Object obj) throws IOException, SolrServerException { - return addBean(obj, -1); - } - - /** - * Adds a single bean specifying max time before it becomes committed - * @param obj the input bean - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since solr 3.5 - */ - public UpdateResponse addBean(Object obj, int commitWithinMs) throws IOException, SolrServerException { - return add(getBinder().toSolrInputDocument(obj),commitWithinMs); - } - - /** - * Performs an explicit commit, causing pending documents to be committed for indexing - * <p> - * waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse commit() throws SolrServerException, IOException { - return commit(true, true); - } - - /** - * Performs an explicit optimize, causing a merge of all segments to one. - * <p> - * waitFlush=true and waitSearcher=true to be inline with the defaults for plain HTTP access - * <p> - * Note: In most cases it is not required to do explicit optimize - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse optimize() throws SolrServerException, IOException { - return optimize(true, true, 1); - } - - /** - * Performs an explicit commit, causing pending documents to be committed for indexing - * @param waitFlush block until index changes are flushed to disk - * @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse commit(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException { - return new UpdateRequest().setAction(UpdateRequest.ACTION.COMMIT, waitFlush, waitSearcher).process( this ); - } - - /** - * Performs an explicit commit, causing pending documents to be committed for indexing - * @param waitFlush block until index changes are flushed to disk - * @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible - * @param softCommit makes index changes visible while neither fsync-ing index files nor writing a new index descriptor - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse commit(boolean waitFlush, boolean waitSearcher, boolean softCommit) throws SolrServerException, IOException { - return new UpdateRequest().setAction(UpdateRequest.ACTION.COMMIT, waitFlush, waitSearcher, softCommit).process( this ); - } - - /** - * Performs an explicit optimize, causing a merge of all segments to one. - * <p> - * Note: In most cases it is not required to do explicit optimize - * @param waitFlush block until index changes are flushed to disk - * @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher) throws SolrServerException, IOException { - return optimize(waitFlush, waitSearcher, 1); - } - - /** - * Performs an explicit optimize, causing a merge of all segments to one. - * <p> - * Note: In most cases it is not required to do explicit optimize - * @param waitFlush block until index changes are flushed to disk - * @param waitSearcher block until a new searcher is opened and registered as the main query searcher, making the changes visible - * @param maxSegments optimizes down to at most this number of segments - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse optimize(boolean waitFlush, boolean waitSearcher, int maxSegments) throws SolrServerException, IOException { - return new UpdateRequest().setAction(UpdateRequest.ACTION.OPTIMIZE, waitFlush, waitSearcher, maxSegments).process( this ); - } - - /** - * Performs a rollback of all non-committed documents pending. - * <p> - * Note that this is not a true rollback as in databases. Content you have previously - * added may have been committed due to autoCommit, buffer full, other client performing - * a commit etc. - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse rollback() throws SolrServerException, IOException { - return new UpdateRequest().rollback().process( this ); - } - - /** - * Deletes a single document by unique ID - * @param id the ID of the document to delete - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse deleteById(String id) throws SolrServerException, IOException { - return deleteById(id, -1); - } - - /** - * Deletes a single document by unique ID, specifying max time before commit - * @param id the ID of the document to delete - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since 3.6 - */ - public UpdateResponse deleteById(String id, int commitWithinMs) throws SolrServerException, IOException { - UpdateRequest req = new UpdateRequest(); - req.deleteById(id); - req.setCommitWithin(commitWithinMs); - return req.process(this); - } - - /** - * Deletes a list of documents by unique ID - * @param ids the list of document IDs to delete - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException { - return deleteById(ids, -1); - } - - /** - * Deletes a list of documents by unique ID, specifying max time before commit - * @param ids the list of document IDs to delete - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since 3.6 - */ - public UpdateResponse deleteById(List<String> ids, int commitWithinMs) throws SolrServerException, IOException { - UpdateRequest req = new UpdateRequest(); - req.deleteById(ids); - req.setCommitWithin(commitWithinMs); - return req.process(this); - } - - /** - * Deletes documents from the index based on a query - * @param query the query expressing what documents to delete - * @throws IOException If there is a low-level I/O error. - */ - public UpdateResponse deleteByQuery(String query) throws SolrServerException, IOException { - return deleteByQuery(query, -1); - } - - /** - * Deletes documents from the index based on a query, specifying max time before commit - * @param query the query expressing what documents to delete - * @param commitWithinMs max time (in ms) before a commit will happen - * @throws IOException If there is a low-level I/O error. - * @since 3.6 - */ - public UpdateResponse deleteByQuery(String query, int commitWithinMs) throws SolrServerException, IOException { - UpdateRequest req = new UpdateRequest(); - req.deleteByQuery(query); - req.setCommitWithin(commitWithinMs); - return req.process(this); - } - - /** - * Issues a ping request to check if the server is alive - * @throws IOException If there is a low-level I/O error. - */ - public SolrPingResponse ping() throws SolrServerException, IOException { - return new SolrPing().process(this); - } - - /** - * Performs a query to the Solr server - * @param params an object holding all key/value parameters to send along the request - */ - public QueryResponse query(SolrParams params) throws SolrServerException, IOException { - return new QueryRequest(params).process(this); - } - - /** - * Performs a query to the Solr server - * @param params an object holding all key/value parameters to send along the request - * @param method specifies the HTTP method to use for the request, such as GET or POST - */ - public QueryResponse query(SolrParams params, METHOD method) throws SolrServerException, IOException { - return new QueryRequest(params, method).process(this); - } - - /** - * Query solr, and stream the results. Unlike the standard query, this will - * send events for each Document rather then add them to the QueryResponse. - * - * Although this function returns a 'QueryResponse' it should be used with care - * since it excludes anything that was passed to callback. Also note that - * future version may pass even more info to the callback and may not return - * the results in the QueryResponse. - * - * @since solr 4.0 - */ - public QueryResponse queryAndStreamResponse(SolrParams params, StreamingResponseCallback callback) throws SolrServerException, IOException - { - ResponseParser parser = new StreamingBinaryResponseParser(callback); - QueryRequest req = new QueryRequest(params); - req.setStreamingResponseCallback(callback); - req.setResponseParser(parser); - return req.process(this); - } - - /** - * Retrieves the SolrDocument associated with the given identifier. - * - * @return retrieved SolrDocument, null if no document is found. - */ - public SolrDocument getById(String id) throws SolrServerException, IOException { - return getById(id, null); - } - - /** - * Retrieves the SolrDocument associated with the given identifier and uses - * the SolrParams to execute the request. - * - * @return retrieved SolrDocument, null if no document is found. - */ - public SolrDocument getById(String id, SolrParams params) throws SolrServerException, IOException { - SolrDocumentList docs = getById(Arrays.asList(id), params); - if (!docs.isEmpty()) { - return docs.get(0); - } - return null; - } - - /** - * Retrieves the SolrDocuments associated with the given identifiers. - * If a document was not found, it will not be added to the SolrDocumentList. - */ - public SolrDocumentList getById(Collection<String> ids) throws SolrServerException, IOException { - return getById(ids, null); - } - - /** - * Retrieves the SolrDocuments associated with the given identifiers and uses - * the SolrParams to execute the request. - * If a document was not found, it will not be added to the SolrDocumentList. - */ - public SolrDocumentList getById(Collection<String> ids, SolrParams params) throws SolrServerException, IOException { - if (ids == null || ids.isEmpty()) { - throw new IllegalArgumentException("Must provide an identifier of a document to retrieve."); - } - - ModifiableSolrParams reqParams = new ModifiableSolrParams(params); - if (StringUtils.isEmpty(reqParams.get(CommonParams.QT))) { - reqParams.set(CommonParams.QT, "/get"); - } - reqParams.set("ids", (String[]) ids.toArray(new String[ids.size()])); - - return query(reqParams).getResults(); - } - - /** - * SolrServer implementations need to implement how a request is actually processed - */ - public abstract NamedList<Object> request(final SolrRequest request) throws SolrServerException, IOException; - - public DocumentObjectBinder getBinder() { - if(binder == null){ - binder = new DocumentObjectBinder(); - } - return binder; - } - - /** - * Release allocated resources. - * - * @since solr 4.0 - * @deprecated Use close() instead. - */ - @Deprecated - public abstract void shutdown(); - - //@SuppressWarnings("deprecation") - public void close() throws IOException { - shutdown(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrQuery.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrQuery.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrQuery.java deleted file mode 100644 index bda6f34..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrQuery.java +++ /dev/null @@ -1,1109 +0,0 @@ -/* - * 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; - -import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.FacetParams; -import org.apache.solr.common.params.HighlightParams; -import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.params.StatsParams; -import org.apache.solr.common.params.TermsParams; -import org.apache.solr.common.util.DateUtil; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Locale; -import java.util.regex.Pattern; - - -/** - * This is an augmented SolrParams with get/set/add fields for common fields used - * in the Standard and Dismax request handlers - * - * - * @since solr 1.3 - */ -public class SolrQuery extends ModifiableSolrParams -{ - public static final String DOCID = "_docid_"; // duplicate of org.apache.solr.search.QueryParsing.DOCID which is not accessible from here - - public enum ORDER { desc, asc; - public ORDER reverse() { - return (this == asc) ? desc : asc; - } - } - - /** Maintains a map of current sorts */ - private List<SortClause> sortClauses; - - public SolrQuery() { - super(); - } - - /** Create a new SolrQuery - * - * @param q query string - */ - public SolrQuery(String q) { - this(); - this.set(CommonParams.Q, q); - } - - /** enable/disable terms. - * - * @param b flag to indicate terms should be enabled. <br> if b==false, removes all other terms parameters - * @return Current reference (<i>this</i>) - */ - public SolrQuery setTerms(boolean b) { - if (b) { - this.set(TermsParams.TERMS, true); - } else { - this.remove(TermsParams.TERMS); - this.remove(TermsParams.TERMS_FIELD); - this.remove(TermsParams.TERMS_LOWER); - this.remove(TermsParams.TERMS_UPPER); - this.remove(TermsParams.TERMS_UPPER_INCLUSIVE); - this.remove(TermsParams.TERMS_LOWER_INCLUSIVE); - this.remove(TermsParams.TERMS_LIMIT); - this.remove(TermsParams.TERMS_PREFIX_STR); - this.remove(TermsParams.TERMS_MINCOUNT); - this.remove(TermsParams.TERMS_MAXCOUNT); - this.remove(TermsParams.TERMS_RAW); - this.remove(TermsParams.TERMS_SORT); - this.remove(TermsParams.TERMS_REGEXP_STR); - this.remove(TermsParams.TERMS_REGEXP_FLAG); - } - return this; - } - - public boolean getTerms() { - return this.getBool(TermsParams.TERMS, false); - } - - public SolrQuery addTermsField(String field) { - this.add(TermsParams.TERMS_FIELD, field); - return this; - } - - public String[] getTermsFields() { - return this.getParams(TermsParams.TERMS_FIELD); - } - - public SolrQuery setTermsLower(String lower) { - this.set(TermsParams.TERMS_LOWER, lower); - return this; - } - - public String getTermsLower() { - return this.get(TermsParams.TERMS_LOWER, ""); - } - - public SolrQuery setTermsUpper(String upper) { - this.set(TermsParams.TERMS_UPPER, upper); - return this; - } - - public String getTermsUpper() { - return this.get(TermsParams.TERMS_UPPER, ""); - } - - public SolrQuery setTermsUpperInclusive(boolean b) { - this.set(TermsParams.TERMS_UPPER_INCLUSIVE, b); - return this; - } - - public boolean getTermsUpperInclusive() { - return this.getBool(TermsParams.TERMS_UPPER_INCLUSIVE, false); - } - - public SolrQuery setTermsLowerInclusive(boolean b) { - this.set(TermsParams.TERMS_LOWER_INCLUSIVE, b); - return this; - } - - public boolean getTermsLowerInclusive() { - return this.getBool(TermsParams.TERMS_LOWER_INCLUSIVE, true); - } - - public SolrQuery setTermsLimit(int limit) { - this.set(TermsParams.TERMS_LIMIT, limit); - return this; - } - - public int getTermsLimit() { - return this.getInt(TermsParams.TERMS_LIMIT, 10); - } - - public SolrQuery setTermsMinCount(int cnt) { - this.set(TermsParams.TERMS_MINCOUNT, cnt); - return this; - } - - public int getTermsMinCount() { - return this.getInt(TermsParams.TERMS_MINCOUNT, 1); - } - - public SolrQuery setTermsMaxCount(int cnt) { - this.set(TermsParams.TERMS_MAXCOUNT, cnt); - return this; - } - - public int getTermsMaxCount() { - return this.getInt(TermsParams.TERMS_MAXCOUNT, -1); - } - - public SolrQuery setTermsPrefix(String prefix) { - this.set(TermsParams.TERMS_PREFIX_STR, prefix); - return this; - } - - public String getTermsPrefix() { - return this.get(TermsParams.TERMS_PREFIX_STR, ""); - } - - public SolrQuery setTermsRaw(boolean b) { - this.set(TermsParams.TERMS_RAW, b); - return this; - } - - public boolean getTermsRaw() { - return this.getBool(TermsParams.TERMS_RAW, false); - } - - public SolrQuery setTermsSortString(String type) { - this.set(TermsParams.TERMS_SORT, type); - return this; - } - - public String getTermsSortString() { - return this.get(TermsParams.TERMS_SORT, TermsParams.TERMS_SORT_COUNT); - } - - public SolrQuery setTermsRegex(String regex) { - this.set(TermsParams.TERMS_REGEXP_STR, regex); - return this; - } - - public String getTermsRegex() { - return this.get(TermsParams.TERMS_REGEXP_STR); - } - - public SolrQuery setTermsRegexFlag(String flag) { - this.add(TermsParams.TERMS_REGEXP_FLAG, flag); - return this; - } - - public String[] getTermsRegexFlags() { - return this.getParams(TermsParams.TERMS_REGEXP_FLAG); - } - - /** Add field(s) for facet computation. - * - * @param fields Array of field names from the IndexSchema - * @return this - */ - public SolrQuery addFacetField(String ... fields) { - add(FacetParams.FACET_FIELD, fields); - this.set(FacetParams.FACET, true); - return this; - } - - /** Add field(s) for pivot computation. - * - * pivot fields are comma separated - * - * @param fields Array of field names from the IndexSchema - * @return this - */ - public SolrQuery addFacetPivotField(String ... fields) { - add(FacetParams.FACET_PIVOT, fields); - this.set(FacetParams.FACET, true); - return this; - } - - /** - * Add a numeric range facet. - * - * @param field The field - * @param start The start of range - * @param end The end of the range - * @param gap The gap between each count - * @return this - */ - public SolrQuery addNumericRangeFacet(String field, Number start, Number end, Number gap) { - add(FacetParams.FACET_RANGE, field); - add(String.format(Locale.ROOT, "f.%s.%s", field, FacetParams.FACET_RANGE_START), start.toString()); - add(String.format(Locale.ROOT, "f.%s.%s", field, FacetParams.FACET_RANGE_END), end.toString()); - add(String.format(Locale.ROOT, "f.%s.%s", field, FacetParams.FACET_RANGE_GAP), gap.toString()); - this.set(FacetParams.FACET, true); - return this; - } - - /** - * Add a numeric range facet. - * - * @param field The field - * @param start The start of range - * @param end The end of the range - * @param gap The gap between each count - * @return this - */ - public SolrQuery addDateRangeFacet(String field, Date start, Date end, String gap) { - add(FacetParams.FACET_RANGE, field); - add(String.format(Locale.ROOT, "f.%s.%s", field, FacetParams.FACET_RANGE_START), DateUtil.getThreadLocalDateFormat().format(start)); - add(String.format(Locale.ROOT, "f.%s.%s", field, FacetParams.FACET_RANGE_END), DateUtil.getThreadLocalDateFormat().format(end)); - add(String.format(Locale.ROOT, "f.%s.%s", field, FacetParams.FACET_RANGE_GAP), gap); - this.set(FacetParams.FACET, true); - return this; - } - - /** - * Add Interval Faceting on a field. All intervals for the same field should be included - * in the same call to this method. - * For syntax documentation see <a href="https://wiki.apache.org/solr/SimpleFacetParameters#Interval_Faceting">Solr wiki</a>. - * <br> - * Key substitution, filter exclusions or other local params on the field are not supported when using this method, - * if this is needed, use the lower level {@link #add} method.<br> - * Key substitution IS supported on intervals when using this method. - * - * - * @param field the field to add facet intervals. Must be an existing field and can't be null - * @param intervals Intervals to be used for faceting. It can be an empty array, but it can't - * be <code>null</code> - * @return this - */ - public SolrQuery addIntervalFacets(String field, String[] intervals) { - if (intervals == null) { - throw new IllegalArgumentException("Can't add null intervals"); - } - if (field == null) { - throw new IllegalArgumentException("Field can't be null"); - } - set(FacetParams.FACET, true); - add(FacetParams.FACET_INTERVAL, field); - for (String interval:intervals) { - add(String.format(Locale.ROOT, "f.%s.facet.interval.set", field), interval); - } - return this; - } - - /** - * Remove all Interval Facets on a field - * - * @param field the field to remove from facet intervals - * @return Array of current intervals for <code>field</code> - */ - public String[] removeIntervalFacets(String field) { - while(remove(FacetParams.FACET_INTERVAL, field)){}; - return remove(String.format(Locale.ROOT, "f.%s.facet.interval.set", field)); - } - - /** get the facet fields - * - * @return string array of facet fields or null if not set/empty - */ - public String[] getFacetFields() { - return this.getParams(FacetParams.FACET_FIELD); - } - - /** remove a facet field - * - * @param name Name of the facet field to be removed. - * - * @return true, if the item was removed. <br> - * false, if the facet field was null or did not exist. - */ - public boolean removeFacetField(String name) { - boolean b = this.remove(FacetParams.FACET_FIELD, name); - if (this.get(FacetParams.FACET_FIELD) == null && this.get(FacetParams.FACET_QUERY) == null) { - this.setFacet(false); - } - return b; - } - - /** enable/disable faceting. - * - * @param b flag to indicate faceting should be enabled. <br> if b==false, removes all other faceting parameters - * @return Current reference (<i>this</i>) - */ - public SolrQuery setFacet(boolean b) { - if (b) { - this.set(FacetParams.FACET, true); - } else { - this.remove(FacetParams.FACET); - this.remove(FacetParams.FACET_MINCOUNT); - this.remove(FacetParams.FACET_FIELD); - this.remove(FacetParams.FACET_LIMIT); - this.remove(FacetParams.FACET_MISSING); - this.remove(FacetParams.FACET_OFFSET); - this.remove(FacetParams.FACET_PREFIX); - this.remove(FacetParams.FACET_QUERY); - this.remove(FacetParams.FACET_SORT); - this.remove(FacetParams.FACET_ZEROS); - this.remove(FacetParams.FACET_PREFIX); // does not include the individual fields... - this.remove(FacetParams.FACET_INTERVAL); // does not remove interval parameters - } - return this; - } - - public SolrQuery setFacetPrefix( String prefix ) - { - this.set( FacetParams.FACET_PREFIX, prefix ); - return this; - } - - public SolrQuery setFacetPrefix( String field, String prefix ) - { - this.set( "f."+field+"."+FacetParams.FACET_PREFIX, prefix ); - return this; - } - - /** add a faceting query - * - * @param f facet query - */ - public SolrQuery addFacetQuery(String f) { - this.add(FacetParams.FACET_QUERY, f); - this.set(FacetParams.FACET, true); - return this; - } - - /** get facet queries - * - * @return all facet queries or null if not set/empty - */ - public String[] getFacetQuery() { - return this.getParams(FacetParams.FACET_QUERY); - } - - /** remove a facet query - * - * @param q the facet query to remove - * @return true if the facet query was removed false otherwise - */ - public boolean removeFacetQuery(String q) { - boolean b = this.remove(FacetParams.FACET_QUERY, q); - if (this.get(FacetParams.FACET_FIELD) == null && this.get(FacetParams.FACET_QUERY) == null) { - this.setFacet(false); - } - return b; - } - - /** set the facet limit - * - * @param lim number facet items to return - */ - public SolrQuery setFacetLimit(int lim) { - this.set(FacetParams.FACET_LIMIT, lim); - return this; - } - - /** get current facet limit - * - * @return facet limit or default of 25 - */ - public int getFacetLimit() { - return this.getInt(FacetParams.FACET_LIMIT, 25); - } - - /** set facet minimum count - * - * @param cnt facets having less that cnt hits will be excluded from teh facet list - */ - public SolrQuery setFacetMinCount(int cnt) { - this.set(FacetParams.FACET_MINCOUNT, cnt); - return this; - } - - /** get facet minimum count - * - * @return facet minimum count or default of 1 - */ - public int getFacetMinCount() { - return this.getInt(FacetParams.FACET_MINCOUNT, 1); - } - - /** - * Sets facet missing boolean flag - * - * @param v flag to indicate the field of {@link FacetParams#FACET_MISSING} . - * @return this - */ - public SolrQuery setFacetMissing(Boolean v) { - this.set(FacetParams.FACET_MISSING, v); - return this; - } - - /** get facet sort - * - * @return facet sort or default of {@link FacetParams#FACET_SORT_COUNT} - */ - public String getFacetSortString() { - return this.get(FacetParams.FACET_SORT, FacetParams.FACET_SORT_COUNT); - } - - - /** set facet sort - * - * @param sort sort facets - * @return this - */ - public SolrQuery setFacetSort(String sort) { - this.set(FacetParams.FACET_SORT, sort); - return this; - } - - /** add highlight field - * - * @param f field to enable for highlighting - */ - public SolrQuery addHighlightField(String f) { - this.add(HighlightParams.FIELDS, f); - this.set(HighlightParams.HIGHLIGHT, true); - return this; - } - - /** remove a field for highlighting - * - * @param f field name to not highlight - * @return <i>true</i>, if removed, <br> <i>false</i>, otherwise - */ - public boolean removeHighlightField(String f) { - boolean b = this.remove(HighlightParams.FIELDS, f); - if (this.get(HighlightParams.FIELDS) == null) { - this.setHighlight(false); - } - return b; - } - - /** get list of highlighted fields - * - * @return Array of highlight fields or null if not set/empty - */ - public String[] getHighlightFields() { - return this.getParams(HighlightParams.FIELDS); - } - - public SolrQuery setHighlightSnippets(int num) { - this.set(HighlightParams.SNIPPETS, num); - return this; - } - - public int getHighlightSnippets() { - return this.getInt(HighlightParams.SNIPPETS, 1); - } - - public SolrQuery setHighlightFragsize(int num) { - this.set(HighlightParams.FRAGSIZE, num); - return this; - } - - public int getHighlightFragsize() { - return this.getInt(HighlightParams.FRAGSIZE, 100); - } - - public SolrQuery setHighlightRequireFieldMatch(boolean flag) { - this.set(HighlightParams.FIELD_MATCH, flag); - return this; - } - - public boolean getHighlightRequireFieldMatch() { - return this.getBool(HighlightParams.FIELD_MATCH, false); - } - - public SolrQuery setHighlightSimplePre(String f) { - this.set(HighlightParams.SIMPLE_PRE, f); - return this; - } - - public String getHighlightSimplePre() { - return this.get(HighlightParams.SIMPLE_PRE, ""); - } - - public SolrQuery setHighlightSimplePost(String f) { - this.set(HighlightParams.SIMPLE_POST, f); - return this; - } - - public String getHighlightSimplePost() { - return this.get(HighlightParams.SIMPLE_POST, ""); - } - - /** - * Gets the raw sort field, as it will be sent to Solr. - * <p> - * The returned sort field will always contain a serialized version - * of the sort string built using {@link #setSort(SortClause)}, - * {@link #addSort(SortClause)}, {@link #addOrUpdateSort(SortClause)}, - * {@link #removeSort(SortClause)}, {@link #clearSorts()} and - * {@link #setSorts(List)}. - */ - public String getSortField() { - return this.get(CommonParams.SORT); - } - - /** - * Clears current sort information. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery clearSorts() { - sortClauses = null; - serializeSorts(); - return this; - } - - /** - * Replaces the current sort information. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery setSorts(List<SortClause> value) { - sortClauses = new ArrayList<>(value); - serializeSorts(); - return this; - } - - /** - * Gets an a list of current sort clauses. - * - * @return an immutable list of current sort clauses - * @since 4.2 - */ - public List<SortClause> getSorts() { - if (sortClauses == null) return Collections.emptyList(); - else return Collections.unmodifiableList(sortClauses); - } - - /** - * Replaces the current sort information with a single sort clause - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery setSort(String field, ORDER order) { - return setSort(new SortClause(field, order)); - } - - /** - * Replaces the current sort information with a single sort clause - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery setSort(SortClause sortClause) { - clearSorts(); - return addSort(sortClause); - } - - /** - * Adds a single sort clause to the end of the current sort information. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery addSort(String field, ORDER order) { - return addSort(new SortClause(field, order)); - } - - /** - * Adds a single sort clause to the end of the query. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery addSort(SortClause sortClause) { - if (sortClauses == null) sortClauses = new ArrayList<>(); - sortClauses.add(sortClause); - serializeSorts(); - return this; - } - - /** - * Updates or adds a single sort clause to the query. - * If the field is already used for sorting, the order - * of the existing field is modified; otherwise, it is - * added to the end. - * <p> - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery addOrUpdateSort(String field, ORDER order) { - return addOrUpdateSort(new SortClause(field, order)); - } - - /** - * Updates or adds a single sort field specification to the current sort - * information. If the sort field already exist in the sort information map, - * its position is unchanged and the sort order is set; if it does not exist, - * it is appended at the end with the specified order.. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery addOrUpdateSort(SortClause sortClause) { - if (sortClauses != null) { - for (int index=0 ; index<sortClauses.size() ; index++) { - SortClause existing = sortClauses.get(index); - if (existing.getItem().equals(sortClause.getItem())) { - sortClauses.set(index, sortClause); - serializeSorts(); - return this; - } - } - } - return addSort(sortClause); - } - - /** - * Removes a single sort field from the current sort information. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery removeSort(SortClause sortClause) { - return removeSort(sortClause.getItem()); - } - - /** - * Removes a single sort field from the current sort information. - * - * @return the modified SolrQuery object, for easy chaining - * @since 4.2 - */ - public SolrQuery removeSort(String itemName) { - if (sortClauses != null) { - for (SortClause existing : sortClauses) { - if (existing.getItem().equals(itemName)) { - sortClauses.remove(existing); - if (sortClauses.isEmpty()) sortClauses = null; - serializeSorts(); - break; - } - } - } - return this; - } - - private void serializeSorts() { - if (sortClauses == null || sortClauses.isEmpty()) { - remove(CommonParams.SORT); - } else { - StringBuilder sb = new StringBuilder(); - for (SortClause sortClause : sortClauses) { - if (sb.length() > 0) sb.append(","); - sb.append(sortClause.getItem()); - sb.append(" "); - sb.append(sortClause.getOrder()); - } - set(CommonParams.SORT, sb.toString()); - } - } - - public void setGetFieldStatistics( boolean v ) - { - this.set( StatsParams.STATS, v ); - } - - public void setGetFieldStatistics( String field ) - { - this.set( StatsParams.STATS, true ); - this.add( StatsParams.STATS_FIELD, field ); - } - - - public void addGetFieldStatistics( String ... field ) - { - this.set( StatsParams.STATS, true ); - this.add( StatsParams.STATS_FIELD, field ); - } - - public void addStatsFieldFacets( String field, String ... facets ) - { - if( field == null ) { - this.add( StatsParams.STATS_FACET, facets ); - } - else { - for( String f : facets ) { - this.add( "f."+field+"."+StatsParams.STATS_FACET, f ); - } - } - } - - public void addStatsFieldCalcDistinct(String field, boolean calcDistinct) { - if (field == null) { - this.add(StatsParams.STATS_CALC_DISTINCT, Boolean.toString(calcDistinct)); - } else { - this.add("f." + field + "." + StatsParams.STATS_CALC_DISTINCT, Boolean.toString(calcDistinct)); - } - } - - public SolrQuery setFilterQueries(String ... fq) { - this.set(CommonParams.FQ, fq); - return this; - } - - public SolrQuery addFilterQuery(String ... fq) { - this.add(CommonParams.FQ, fq); - return this; - } - - public boolean removeFilterQuery(String fq) { - return this.remove(CommonParams.FQ, fq); - } - - public String[] getFilterQueries() { - return this.getParams(CommonParams.FQ); - } - - public boolean getHighlight() { - return this.getBool(HighlightParams.HIGHLIGHT, false); - } - - public SolrQuery setHighlight(boolean b) { - if (b) { - this.set(HighlightParams.HIGHLIGHT, true); - } else { - this.remove(HighlightParams.HIGHLIGHT); - this.remove(HighlightParams.FIELD_MATCH); - this.remove(HighlightParams.FIELDS); - this.remove(HighlightParams.FORMATTER); - this.remove(HighlightParams.FRAGSIZE); - this.remove(HighlightParams.SIMPLE_POST); - this.remove(HighlightParams.SIMPLE_PRE); - this.remove(HighlightParams.SNIPPETS); - } - return this; - } - - public SolrQuery setFields(String ... fields) { - if( fields == null || fields.length == 0 ) { - this.remove( CommonParams.FL ); - return this; - } - StringBuilder sb = new StringBuilder(); - sb.append( fields[0] ); - for( int i=1; i<fields.length; i++ ) { - sb.append( ',' ); - sb.append( fields[i] ); - } - this.set(CommonParams.FL, sb.toString() ); - return this; - } - - public SolrQuery addField(String field) { - return addValueToParam(CommonParams.FL, field); - } - - public String getFields() { - String fields = this.get(CommonParams.FL); - if (fields!=null && fields.equals("score")) { - fields = "*, score"; - } - return fields; - } - - private static Pattern scorePattern = Pattern.compile("(^|[, ])score"); - - public SolrQuery setIncludeScore(boolean includeScore) { - String fields = get(CommonParams.FL,"*"); - if (includeScore) { - if (!scorePattern.matcher(fields).find()) { - this.set(CommonParams.FL, fields+",score"); - } - } else { - this.set(CommonParams.FL, scorePattern.matcher(fields).replaceAll("")); - } - return this; - } - - public SolrQuery setQuery(String query) { - this.set(CommonParams.Q, query); - return this; - } - - public String getQuery() { - return this.get(CommonParams.Q); - } - - public SolrQuery setRows(Integer rows) { - if( rows == null ) { - this.remove( CommonParams.ROWS ); - } - else { - this.set(CommonParams.ROWS, rows); - } - return this; - } - - public Integer getRows() - { - return this.getInt(CommonParams.ROWS); - } - - public void setShowDebugInfo(boolean showDebugInfo) { - this.set(CommonParams.DEBUG_QUERY, String.valueOf(showDebugInfo)); - } - - public void setDistrib(boolean val) { - this.set(CommonParams.DISTRIB, String.valueOf(val)); - } - - - public SolrQuery setStart(Integer start) { - if( start == null ) { - this.remove( CommonParams.START ); - } - else { - this.set(CommonParams.START, start); - } - return this; - } - - public Integer getStart() - { - return this.getInt(CommonParams.START); - } - - /** - * The Request Handler to use (see the solrconfig.xml), which is stored in the "qt" parameter. - * Normally it starts with a '/' and if so it will be used by - * {@link org.apache.solr.client.solrj.request.QueryRequest#getPath()} in the URL instead of the "qt" parameter. - * If this is left blank, then the default of "/select" is assumed. - * - * @param qt The Request Handler name corresponding to one in solrconfig.xml on the server. - * @return this - */ - public SolrQuery setRequestHandler(String qt) { - this.set(CommonParams.QT, qt); - return this; - } - - public String getRequestHandler() { - return this.get(CommonParams.QT); - } - - /** - * @return this - * @see ModifiableSolrParams#set(String,String[]) - */ - public SolrQuery setParam(String name, String ... values) { - this.set(name, values); - return this; - } - - /** - * @return this - * @see org.apache.solr.common.params.ModifiableSolrParams#set(String, boolean) - */ - public SolrQuery setParam(String name, boolean value) { - this.set(name, value); - return this; - } - - /** get a deep copy of this object **/ - public SolrQuery getCopy() { - SolrQuery q = new SolrQuery(); - for (String name : this.getParameterNames()) { - q.setParam(name, this.getParams(name)); - } - return q; - } - - /** - * Set the maximum time allowed for this query. If the query takes more time - * than the specified milliseconds, a timeout occurs and partial (or no) - * results may be returned. - * - * If given Integer is null, then this parameter is removed from the request - * - *@param milliseconds the time in milliseconds allowed for this query - */ - public SolrQuery setTimeAllowed(Integer milliseconds) { - if (milliseconds == null) { - this.remove(CommonParams.TIME_ALLOWED); - } else { - this.set(CommonParams.TIME_ALLOWED, milliseconds); - } - return this; - } - - /** - * Get the maximum time allowed for this query. - */ - public Integer getTimeAllowed() { - return this.getInt(CommonParams.TIME_ALLOWED); - } - - /////////////////////// - // Utility functions - /////////////////////// - - private String toSortString(String field, ORDER order) { - return field.trim() + ' ' + String.valueOf(order).trim(); - } - - private String join(String a, String b, String sep) { - StringBuilder sb = new StringBuilder(); - if (a!=null && a.length()>0) { - sb.append(a); - sb.append(sep); - } - if (b!=null && b.length()>0) { - sb.append(b); - } - return sb.toString().trim(); - } - - private SolrQuery addValueToParam(String name, String value) { - String tmp = this.get(name); - tmp = join(tmp, value, ","); - this.set(name, tmp); - return this; - } - - private String join(String[] vals, String sep, String removeVal) { - StringBuilder sb = new StringBuilder(); - for (int i=0; i<vals.length; i++) { - if (!vals[i].equals(removeVal)) { - if (sb.length() > 0) { - sb.append(sep); - } - sb.append(vals[i]); - } - } - return sb.toString().trim(); - } - - /** - * A single sort clause, encapsulating what to sort and the sort order. - * <p> - * The item specified can be "anything sortable" by solr; some examples - * include a simple field name, the constant string {@code score}, and functions - * such as {@code sum(x_f, y_f)}. - * <p> - * A SortClause can be created through different mechanisms: - * <PRE><code> - * new SortClause("product", SolrQuery.ORDER.asc); - * new SortClause("product", "asc"); - * SortClause.asc("product"); - * SortClause.desc("product"); - * </code></PRE> - */ - public static class SortClause implements java.io.Serializable { - - private static final long serialVersionUID = 1L; - - private final String item; - private final ORDER order; - - /** - * Creates a SortClause based on item and order - * @param item item to sort on - * @param order direction to sort - */ - public SortClause(String item, ORDER order) { - this.item = item; - this.order = order; - } - - /** - * Creates a SortClause based on item and order - * @param item item to sort on - * @param order string value for direction to sort - */ - public SortClause(String item, String order) { - this(item, ORDER.valueOf(order)); - } - - /** - * Creates an ascending SortClause for an item - * @param item item to sort on - */ - public static SortClause create (String item, ORDER order) { - return new SortClause(item, order); - } - - /** - * Creates a SortClause based on item and order - * @param item item to sort on - * @param order string value for direction to sort - */ - public static SortClause create(String item, String order) { - return new SortClause(item, ORDER.valueOf(order)); - } - - /** - * Creates an ascending SortClause for an item - * @param item item to sort on - */ - public static SortClause asc (String item) { - return new SortClause(item, ORDER.asc); - } - - /** - * Creates a decending SortClause for an item - * @param item item to sort on - */ - public static SortClause desc (String item) { - return new SortClause(item, ORDER.desc); - } - - /** - * Gets the item to sort, typically a function or a fieldname - * @return item to sort - */ - public String getItem() { - return item; - } - - /** - * Gets the order to sort - * @return order to sort - */ - public ORDER getOrder() { - return order; - } - - public boolean equals(Object other){ - if (this == other) return true; - if (!(other instanceof SortClause)) return false; - final SortClause that = (SortClause) other; - return this.getItem().equals(that.getItem()) && this.getOrder().equals(that.getOrder()); - } - - public int hashCode(){ - return this.getItem().hashCode(); - } - - /** - * Gets a human readable description of the sort clause. - * <p> - * The returned string is not suitable for passing to Solr, - * but may be useful in debug output and the like. - * @return a description of the current sort clause - */ - public String toString() { - return "[" + getClass().getSimpleName() + ": item=" + getItem() + "; order=" + getOrder() + "]"; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrRequest.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrRequest.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrRequest.java deleted file mode 100644 index 6d4efb6..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrRequest.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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; - -import org.apache.solr.common.params.SolrParams; -import org.apache.solr.common.util.ContentStream; - -import java.io.IOException; -import java.io.Serializable; -import java.util.Collection; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -/** - * - * - * @since solr 1.3 - */ -public abstract class SolrRequest<T extends SolrResponse> implements Serializable { - - public enum METHOD { - GET, - POST, - PUT - }; - - private METHOD method = METHOD.GET; - private String path = null; - - private ResponseParser responseParser; - private StreamingResponseCallback callback; - private Set<String> queryParams; - - //--------------------------------------------------------- - //--------------------------------------------------------- - - public SolrRequest( METHOD m, String path ) - { - this.method = m; - this.path = path; - } - - //--------------------------------------------------------- - //--------------------------------------------------------- - - public METHOD getMethod() { - return method; - } - public void setMethod(METHOD method) { - this.method = method; - } - - public String getPath() { - return path; - } - public void setPath(String path) { - this.path = path; - } - - /** - * - * @return The {@link org.apache.solr.client.solrj.ResponseParser} - */ - public ResponseParser getResponseParser() { - return responseParser; - } - - /** - * Optionally specify how the Response should be parsed. Not all server implementations require a ResponseParser - * to be specified. - * @param responseParser The {@link org.apache.solr.client.solrj.ResponseParser} - */ - public void setResponseParser(ResponseParser responseParser) { - this.responseParser = responseParser; - } - - public StreamingResponseCallback getStreamingResponseCallback() { - return callback; - } - - public void setStreamingResponseCallback(StreamingResponseCallback callback) { - this.callback = callback; - } - - /** - * Parameter keys that are sent via the query string - */ - public Set<String> getQueryParams() { - return this.queryParams; - } - - public void setQueryParams(Set<String> queryParams) { - this.queryParams = queryParams; - } - - public abstract SolrParams getParams(); - - public abstract Collection<ContentStream> getContentStreams() throws IOException; - - /** - * Create a new SolrResponse to hold the response from the server - * @param client the {@link SolrClient} the request will be sent to - */ - protected abstract T createResponse(SolrClient client); - - /** - * Send this request to a {@link SolrClient} and return the response - * @param client the SolrClient to communicate with - * @return the response - * @throws SolrServerException if there is an error on the Solr server - * @throws IOException if there is a communication error - */ - public final T process(SolrClient client) throws SolrServerException, IOException { - long startTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS); - T res = createResponse(client); - res.setResponse(client.request(this)); - long endTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS); - res.setElapsedTime(endTime - startTime); - return res; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrResponse.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrResponse.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrResponse.java deleted file mode 100644 index 244a757..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrResponse.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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; - -import org.apache.solr.common.SolrException; -import org.apache.solr.common.SolrException.ErrorCode; -import org.apache.solr.common.util.NamedList; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - - -/** - * - * - * @since solr 1.3 - */ -public abstract class SolrResponse implements Serializable { - public abstract long getElapsedTime(); - - public abstract void setResponse(NamedList<Object> rsp); - - public abstract void setElapsedTime(long elapsedTime); - - public abstract NamedList<Object> getResponse(); - - public static byte[] serializable(SolrResponse response) { - try { - ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); - ObjectOutputStream outputStream = new ObjectOutputStream(byteStream); - outputStream.writeObject(response); - return byteStream.toByteArray(); - } catch (Exception e) { - throw new SolrException(ErrorCode.SERVER_ERROR, e); - } - } - - public static SolrResponse deserialize(byte[] bytes) { - try { - ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes); - ObjectInputStream inputStream = new ObjectInputStream(byteStream); - return (SolrResponse) inputStream.readObject(); - } catch (Exception e) { - throw new SolrException(ErrorCode.SERVER_ERROR, e); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServer.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServer.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServer.java deleted file mode 100644 index 0238214..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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; - -/** - * @deprecated Use {@link org.apache.solr.client.solrj.SolrClient} - */ -@Deprecated -public abstract class SolrServer extends SolrClient { -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServerException.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServerException.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServerException.java deleted file mode 100644 index ed16a43..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/SolrServerException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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; - -/** Exception to catch all types of communication / parsing issues associated with talking to SOLR - * - * - * @since solr 1.3 - */ -public class SolrServerException extends Exception { - - private static final long serialVersionUID = -3371703521752000294L; - - public SolrServerException(String message, Throwable cause) { - super(message, cause); - } - - public SolrServerException(String message) { - super(message); - } - - public SolrServerException(Throwable cause) { - super(cause); - } - - public Throwable getRootCause() { - Throwable t = this; - while (true) { - Throwable cause = t.getCause(); - if (cause!=null) { - t = cause; - } else { - break; - } - } - return t; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/StreamingResponseCallback.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/StreamingResponseCallback.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/StreamingResponseCallback.java deleted file mode 100644 index 2ba79c8..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/StreamingResponseCallback.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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; - -import org.apache.solr.common.SolrDocument; - -/** - * A callback interface for streaming response - * - * @since solr 4.0 - */ -public abstract class StreamingResponseCallback { - /* - * Called for each SolrDocument in the response - */ - public abstract void streamSolrDocument( SolrDocument doc ); - - /* - * Called at the beginning of each DocList (and SolrDocumentList) - */ - public abstract void streamDocListInfo( long numFound, long start, Float maxScore ); -} http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/d9a661cf/ranger_solrj/src/main/java/org/apache/solr/client/solrj/beans/BindingException.java ---------------------------------------------------------------------- diff --git a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/beans/BindingException.java b/ranger_solrj/src/main/java/org/apache/solr/client/solrj/beans/BindingException.java deleted file mode 100644 index fc9ebfa..0000000 --- a/ranger_solrj/src/main/java/org/apache/solr/client/solrj/beans/BindingException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.beans; - -public class BindingException extends RuntimeException { - - public BindingException(String message) { - super(message); - } - - public BindingException(String message, Throwable cause) { - super(message, cause); - } -}
