public class SolrClientDocumentLoader extends Object implements DocumentLoader
SolrClient
.Constructor and Description |
---|
SolrClientDocumentLoader(SolrClient client,
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.
|
SolrClient |
getSolrClient() |
void |
load(SolrInputDocument doc)
Loads the given document into the destination
|
SolrPingResponse |
ping()
Issues a ping request to check if the server is alive
|
UpdateResponse |
rollbackTransaction()
Performs a rollback of all non-committed documents pending.
|
void |
shutdown()
Releases allocated resources
|
public SolrClientDocumentLoader(SolrClient client, int batchSize)
public void beginTransaction()
DocumentLoader
beginTransaction
in interface DocumentLoader
public void load(SolrInputDocument doc) throws IOException, SolrServerException
DocumentLoader
load
in interface DocumentLoader
IOException
SolrServerException
public void commitTransaction() throws SolrServerException, IOException
DocumentLoader
commitTransaction
in interface DocumentLoader
IOException
- If there is a low-level I/O error.SolrServerException
public UpdateResponse rollbackTransaction() throws SolrServerException, IOException
DocumentLoader
Note 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 DocumentLoader
IOException
- If there is a low-level I/O error.SolrServerException
public void shutdown() throws IOException
DocumentLoader
shutdown
in interface DocumentLoader
IOException
public SolrPingResponse ping() throws SolrServerException, IOException
DocumentLoader
ping
in interface DocumentLoader
IOException
- If there is a low-level I/O error.SolrServerException
public SolrClient getSolrClient()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.