public class SolrPump extends Object
| Modifier and Type | Method and Description |
|---|---|
static SolrPump |
createPump(ReadJsonStream<?> rs,
WriteJsonStream<?> ws)
Pumps data from a
ReadJsonStream to a WriteJsonStream
and performs flow control where necessary to prevent the write stream buffer from getting overfull. |
static SolrPump |
createPump(ReadJsonStream<?> rs,
WriteJsonStream<?> ws,
int writeQueueMaxSize)
Create a new
SolrDataPump with the given ReadJsonStream and WriteJsonStream and
writeQueueMaxSize |
int |
objectsPumped()
Return the total number of Json objects pumped by this pump.
|
SolrPump |
setWriteQueueMaxSize(int maxSize)
Set the write queue max size to
writeQueueMaxSize |
SolrPump |
start()
Start the Pump.
|
SolrPump |
stop()
Stop the SolrDataPump.
|
public static SolrPump createPump(ReadJsonStream<?> rs, WriteJsonStream<?> ws)
ReadJsonStream to a WriteJsonStream
and performs flow control where necessary to prevent the write stream buffer from getting overfull.
Instances of this class read bytes from a ReadJsonStream and write them to
a WriteJsonStream.
This class can be used to pump from any ReadJsonStream to any WriteJsonStream,
e.g. from an OffsetReadJsonStream to an WriteJsonStreamBase,
Instances of this class are not thread-safe.
private final WriteJsonStream> writeStream; private final ReadJsonStream> readJsonStream; private int pumped;
/**
Create a new SolrDataPump with the given ReadJsonStream and WriteJsonStream
rs - ReadStreamws - WriteStreampublic static SolrPump createPump(ReadJsonStream<?> rs, WriteJsonStream<?> ws, int writeQueueMaxSize)
SolrDataPump with the given ReadJsonStream and WriteJsonStream and
writeQueueMaxSizers - ReadStreamws - WriteStreamwriteQueueMaxSize - Maximum allowed size of the write queuepublic SolrPump setWriteQueueMaxSize(int maxSize)
writeQueueMaxSizemaxSize - Maximum size to set for the write queuepublic SolrPump start()
public SolrPump stop()
public int objectsPumped()
Copyright © 2015 Englishtown. All rights reserved.