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 StreamsOperation
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void cleanUp()
cleanUp
in interface StreamsOperation
protected StreamsDatum prepareDatum(com.mongodb.DBObject dbObject)
public StreamsResultSet readAll()
readAll
in interface StreamsPersistReader
public void startStream()
startStream
in interface StreamsProvider
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
protected void write(StreamsDatum entry)
public StreamsResultSet readNew(BigInteger sequence)
readNew
in interface StreamsPersistReader
readNew
in interface StreamsProvider
public StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange
in interface StreamsPersistReader
readRange
in interface StreamsProvider
public boolean isRunning()
isRunning
in interface StreamsProvider
Copyright © 2018 The Apache Software Foundation. All rights reserved.