public class MongoPersistReader extends Object implements StreamsPersistReader
| Modifier and Type | Class and Description |
|---|---|
class |
MongoPersistReader.MongoPersistReaderTask |
| Modifier and Type | Field and Description |
|---|---|
protected com.mongodb.MongoClient |
client |
protected com.mongodb.DBCollection |
collection |
protected com.mongodb.DBCursor |
cursor |
protected com.mongodb.DB |
db |
protected ReadWriteLock |
lock |
protected Queue<StreamsDatum> |
persistQueue |
static String |
STREAMS_ID |
| Constructor and Description |
|---|
MongoPersistReader()
KafkaPersistReader constructor - resolves KafkaConfiguration from JVM 'mongo'.
|
MongoPersistReader(MongoConfiguration config)
KafkaPersistReader constructor - uses supplied MongoConfiguration.
|
MongoPersistReader(Queue<StreamsDatum> persistQueue)
KafkaPersistReader constructor - uses supplied persistQueue.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp() |
String |
getId() |
Queue<StreamsDatum> |
getPersistQueue() |
boolean |
isRunning() |
void |
prepare(Object configurationObject) |
protected StreamsDatum |
prepareDatum(com.mongodb.DBObject dbObject) |
StreamsResultSet |
readAll() |
StreamsResultSet |
readCurrent() |
StreamsResultSet |
readNew(BigInteger sequence) |
StreamsResultSet |
readRange(org.joda.time.DateTime start,
org.joda.time.DateTime end) |
void |
setPersistQueue(Queue<StreamsDatum> persistQueue) |
void |
startStream() |
void |
stop() |
protected void |
write(StreamsDatum entry) |
public static final String STREAMS_ID
protected volatile Queue<StreamsDatum> persistQueue
protected com.mongodb.MongoClient client
protected com.mongodb.DB db
protected com.mongodb.DBCollection collection
protected com.mongodb.DBCursor cursor
protected final ReadWriteLock lock
public MongoPersistReader()
public MongoPersistReader(MongoConfiguration config)
config - configpublic MongoPersistReader(Queue<StreamsDatum> persistQueue)
persistQueue - persistQueuepublic void setPersistQueue(Queue<StreamsDatum> persistQueue)
public Queue<StreamsDatum> getPersistQueue()
public void stop()
public String getId()
getId in interface StreamsOperationpublic void prepare(Object configurationObject)
prepare in interface StreamsOperationpublic void cleanUp()
cleanUp in interface StreamsOperationprotected StreamsDatum prepareDatum(com.mongodb.DBObject dbObject)
public StreamsResultSet readAll()
readAll in interface StreamsPersistReaderpublic void startStream()
startStream in interface StreamsProviderpublic StreamsResultSet readCurrent()
readCurrent in interface StreamsProviderprotected void write(StreamsDatum entry)
public StreamsResultSet readNew(BigInteger sequence)
readNew in interface StreamsPersistReaderreadNew in interface StreamsProviderpublic StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange in interface StreamsPersistReaderreadRange in interface StreamsProviderpublic boolean isRunning()
isRunning in interface StreamsProviderCopyright © 2018 The Apache Software Foundation. All rights reserved.