Example usage for org.apache.solr.client.solrj SolrClient rollback

List of usage examples for org.apache.solr.client.solrj SolrClient rollback

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj SolrClient rollback.

Prototype

public UpdateResponse rollback() throws SolrServerException, IOException 

Source Link

Document

Performs a rollback of all non-committed documents pending.

Usage

From source file:com.frank.search.solr.core.SolrTemplate.java

License:Apache License

@Override
public void rollback() {
    execute(new SolrCallback<UpdateResponse>() {
        @Override/*from   w  w  w.ja v a2s .co  m*/
        public UpdateResponse doInSolr(SolrClient solrClient) throws SolrServerException, IOException {
            return solrClient.rollback();
        }
    });
}

From source file:net.yacy.cora.federate.solr.instance.ServerShard.java

License:Open Source License

/**
 * Performs a rollback of all non-committed documents pending.
 * <p>/*from  w w w .ja  v a 2  s.  c  om*/
 * 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.
 */
@Override
public UpdateResponse rollback() throws SolrServerException, IOException {
    if (!this.writeEnabled)
        return _dummyOKResponse;
    UpdateResponse ur = null;
    for (SolrClient s : this.shards)
        ur = s.rollback();
    return ur;
}

From source file:org.codice.ddf.persistence.internal.PersistentStoreImpl.java

License:Open Source License

private void doRollback(SolrClient solrClient, String type) {
    LOGGER.debug("ENTERING: doRollback()");
    try {/* www . java2 s .c o m*/
        solrClient.rollback();
    } catch (SolrServerException e) {
        LOGGER.info("SolrServerException while doing rollback for persistent type {}", type, e);
    } catch (IOException e) {
        LOGGER.info("IOException while doing rollback for persistent type {}", type, e);
    }
    LOGGER.debug("EXITING: doRollback()");
}