com.datasalt.pangool.solr
Class BatchWriter

java.lang.Object
  extended by com.datasalt.pangool.solr.BatchWriter

public class BatchWriter
extends Object

Enables adding batches of documents to an EmbeddedSolrServer.

This class has been copied from SOLR-1301 patch although it might be slightly different from it.


Constructor Summary
BatchWriter(org.apache.solr.client.solrj.embedded.EmbeddedSolrServer solr, int batchSize, org.apache.hadoop.mapreduce.TaskID tid, int writerThreads, int queueSize)
           
 
Method Summary
 void close(org.apache.hadoop.mapreduce.TaskAttemptContext context, org.apache.solr.core.SolrCore core)
           
 Exception getBatchWriteException()
           
 void queueBatch(Collection<org.apache.solr.common.SolrInputDocument> batch)
           
protected  org.apache.solr.client.solrj.response.UpdateResponse runUpdate(List<org.apache.solr.common.SolrInputDocument> batchToWrite)
           
 void setBatchWriteException(Exception batchWriteException)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchWriter

public BatchWriter(org.apache.solr.client.solrj.embedded.EmbeddedSolrServer solr,
                   int batchSize,
                   org.apache.hadoop.mapreduce.TaskID tid,
                   int writerThreads,
                   int queueSize)
Method Detail

getBatchWriteException

public Exception getBatchWriteException()

setBatchWriteException

public void setBatchWriteException(Exception batchWriteException)

runUpdate

protected org.apache.solr.client.solrj.response.UpdateResponse runUpdate(List<org.apache.solr.common.SolrInputDocument> batchToWrite)

queueBatch

public void queueBatch(Collection<org.apache.solr.common.SolrInputDocument> batch)
                throws IOException,
                       org.apache.solr.client.solrj.SolrServerException
Throws:
IOException
org.apache.solr.client.solrj.SolrServerException

close

public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context,
                  org.apache.solr.core.SolrCore core)
           throws InterruptedException,
                  org.apache.solr.client.solrj.SolrServerException,
                  IOException
Throws:
InterruptedException
org.apache.solr.client.solrj.SolrServerException
IOException


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.