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 StreamsOperation
public void write(StreamsDatum streamsDatum)
write
in interface StreamsPersistWriter
public void flush() throws IOException
flush
in interface Flushable
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void start()
public void stop()
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void cleanUp()
cleanUp
in interface StreamsOperation
protected void flushIfNecessary()
Copyright © 2018 The Apache Software Foundation. All rights reserved.