public class SolrServerDocumentLoader extends Object implements DocumentLoader
SolrServer.
This class should be considered private and it's API is subject to change without notice.| Constructor and Description |
|---|
SolrServerDocumentLoader(org.apache.solr.client.solrj.SolrServer server,
int batchSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTransaction()
Begins a transaction
|
void |
commitTransaction()
Sends any outstanding documents to the destination and waits for a positive
or negative ack (i.e.
|
void |
deleteById(String id)
Deletes the document with the given id from the destination
|
void |
deleteByQuery(String query)
Deletes the documents matching the given query from the destination
|
org.apache.solr.client.solrj.SolrServer |
getSolrServer() |
void |
load(org.apache.solr.common.SolrInputDocument doc)
Loads the given document into the destination
|
org.apache.solr.client.solrj.response.SolrPingResponse |
ping()
Issues a ping request to check if the server is alive
|
org.apache.solr.client.solrj.response.UpdateResponse |
rollbackTransaction()
Performs a rollback of all non-committed documents pending.
|
void |
shutdown()
Releases allocated resources
|
public SolrServerDocumentLoader(org.apache.solr.client.solrj.SolrServer server,
int batchSize)
public void beginTransaction()
DocumentLoaderbeginTransaction in interface DocumentLoaderpublic void load(org.apache.solr.common.SolrInputDocument doc)
throws IOException,
org.apache.solr.client.solrj.SolrServerException
DocumentLoaderload in interface DocumentLoaderIOExceptionorg.apache.solr.client.solrj.SolrServerExceptionpublic void deleteById(String id) throws IOException, org.apache.solr.client.solrj.SolrServerException
DocumentLoaderdeleteById in interface DocumentLoaderIOExceptionorg.apache.solr.client.solrj.SolrServerExceptionpublic void deleteByQuery(String query) throws IOException, org.apache.solr.client.solrj.SolrServerException
DocumentLoaderdeleteByQuery in interface DocumentLoaderIOExceptionorg.apache.solr.client.solrj.SolrServerExceptionpublic void commitTransaction()
throws org.apache.solr.client.solrj.SolrServerException,
IOException
DocumentLoadercommitTransaction in interface DocumentLoaderIOException - If there is a low-level I/O error.org.apache.solr.client.solrj.SolrServerExceptionpublic org.apache.solr.client.solrj.response.UpdateResponse rollbackTransaction()
throws org.apache.solr.client.solrj.SolrServerException,
IOException
DocumentLoaderNote that this is not a true rollback as in databases. Content you have previously added may have already been committed due to autoCommit, buffer full, other client performing a commit etc. So this is only a best-effort rollback.
rollbackTransaction in interface DocumentLoaderIOException - If there is a low-level I/O error.org.apache.solr.client.solrj.SolrServerExceptionpublic void shutdown()
DocumentLoadershutdown in interface DocumentLoaderpublic org.apache.solr.client.solrj.response.SolrPingResponse ping()
throws org.apache.solr.client.solrj.SolrServerException,
IOException
DocumentLoaderping in interface DocumentLoaderIOException - If there is a low-level I/O error.org.apache.solr.client.solrj.SolrServerExceptionpublic org.apache.solr.client.solrj.SolrServer getSolrServer()
Copyright © 2013–2015. All rights reserved.