public class CassandraPersistWriter extends Object implements StreamsPersistWriter, Runnable, Flushable, Closeable
| Modifier and Type | Field and Description |
|---|---|
protected List<com.datastax.driver.core.BoundStatement> |
insertBatch |
protected com.datastax.driver.core.PreparedStatement |
insertStatement |
protected ReadWriteLock |
lock |
protected Queue<StreamsDatum> |
persistQueue |
static String |
STREAMS_ID |
| Constructor and Description |
|---|
CassandraPersistWriter() |
CassandraPersistWriter(CassandraConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp() |
void |
close() |
void |
flush() |
protected void |
flushIfNecessary() |
String |
getId() |
Queue<StreamsDatum> |
getPersistQueue() |
void |
prepare(Object configurationObject) |
void |
run() |
void |
setPersistQueue(Queue<StreamsDatum> persistQueue) |
void |
start()
start write thread.
|
void |
stop()
stop.
|
void |
write(StreamsDatum streamsDatum) |
public static final String STREAMS_ID
protected volatile Queue<StreamsDatum> persistQueue
protected com.datastax.driver.core.PreparedStatement insertStatement
protected List<com.datastax.driver.core.BoundStatement> insertBatch
protected final ReadWriteLock lock
public CassandraPersistWriter()
public CassandraPersistWriter(CassandraConfiguration config)
public void setPersistQueue(Queue<StreamsDatum> persistQueue)
public Queue<StreamsDatum> getPersistQueue()
public String getId()
getId in interface StreamsOperationpublic void write(StreamsDatum streamsDatum)
write in interface StreamsPersistWriterpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void start()
public void stop()
public void prepare(Object configurationObject)
prepare in interface StreamsOperationpublic void cleanUp()
cleanUp in interface StreamsOperationprotected void flushIfNecessary()
Copyright © 2018 The Apache Software Foundation. All rights reserved.