Example usage for org.apache.cassandra.utils ConcurrentBiMap get

List of usage examples for org.apache.cassandra.utils ConcurrentBiMap get

Introduction

In this page you can find the example usage for org.apache.cassandra.utils ConcurrentBiMap get.

Prototype

public V get(Object key) 

Source Link

Usage

From source file:org.jesterj.ingest.processors.SendToSolrCloudProcessor.java

License:Apache License

@Override
protected void individualFallbackOperation(ConcurrentBiMap<Document, SolrInputDocument> oldBatch, Exception e) {
    // TODO: send in bisected batches to avoid massive traffic down due to one doc when batches are large
    for (Document document : oldBatch.keySet()) {
        ThreadContext.put(JesterJAppender.JJ_INGEST_DOCID, document.getId());
        try {/*w  ww .  j a va 2  s. com*/
            SolrInputDocument doc = oldBatch.get(document);
            if (doc instanceof Delete) {
                solrClient.deleteById(oldBatch.inverse().get(doc).getId());
                log.info(Status.INDEXED.getMarker(), "{} deleted from solr successfully", document.getId());
            } else {
                solrClient.add(doc);
                log.info(Status.INDEXED.getMarker(), "{} sent to solr successfully", document.getId());
            }
        } catch (IOException | SolrServerException e1) {
            log.info(Status.ERROR.getMarker(), "{} could not be sent to solr because of {}", document.getId(),
                    e1.getMessage());
            log.error("Error sending to with solr!", e1);
        }
    }
}