Revision 55760
Added by Claudio Atzori almost 5 years ago
CloudIndexClient.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.index; |
2 | 2 |
|
3 |
import java.io.Closeable; |
|
4 |
import java.io.IOException; |
|
5 |
import java.text.SimpleDateFormat; |
|
6 |
import java.util.Date; |
|
7 |
import java.util.List; |
|
8 |
|
|
9 | 3 |
import eu.dnetlib.functionality.index.solr.feed.StreamingInputDocumentFactory; |
10 | 4 |
import eu.dnetlib.miscutils.datetime.HumanTime; |
11 | 5 |
import eu.dnetlib.miscutils.functional.UnaryFunction; |
... | ... | |
13 | 7 |
import org.apache.commons.logging.LogFactory; |
14 | 8 |
import org.apache.solr.client.solrj.SolrQuery; |
15 | 9 |
import org.apache.solr.client.solrj.SolrServerException; |
16 |
import org.apache.solr.client.solrj.impl.CloudSolrServer;
|
|
10 |
import org.apache.solr.client.solrj.impl.CloudSolrClient;
|
|
17 | 11 |
import org.apache.solr.client.solrj.response.QueryResponse; |
18 | 12 |
import org.apache.solr.client.solrj.response.UpdateResponse; |
19 | 13 |
import org.apache.solr.common.SolrInputDocument; |
20 | 14 |
|
15 |
import java.io.Closeable; |
|
16 |
import java.io.IOException; |
|
17 |
import java.text.SimpleDateFormat; |
|
18 |
import java.util.Date; |
|
19 |
import java.util.List; |
|
20 |
|
|
21 | 21 |
/** |
22 | 22 |
* Created by michele on 11/11/15. |
23 | 23 |
*/ |
... | ... | |
26 | 26 |
private static final Log log = LogFactory.getLog(CloudIndexClient.class); |
27 | 27 |
private static final String INDEX_RECORD_RESULT_FIELD = "dnetResult"; |
28 | 28 |
|
29 |
private final CloudSolrServer solrClient;
|
|
29 |
private final CloudSolrClient solrClient;
|
|
30 | 30 |
|
31 |
protected CloudIndexClient(final CloudSolrServer solrServer) {
|
|
31 |
protected CloudIndexClient(final CloudSolrClient solrServer) {
|
|
32 | 32 |
this.solrClient = solrServer; |
33 | 33 |
} |
34 | 34 |
|
... | ... | |
153 | 153 |
|
154 | 154 |
public void close() throws IOException { |
155 | 155 |
if (solrClient != null) { |
156 |
solrClient.shutdown();
|
|
156 |
solrClient.close();
|
|
157 | 157 |
} |
158 | 158 |
} |
159 | 159 |
|
Also available in: Unified diff
reintegrated branch solr75 -r53766:HEAD