public class BatchCassandraWriterBolt extends BaseCassandraBolt<List<Tuple>>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_EMIT_FREQUENCY |
cassandraConfConfig, client, clientProvider, outputCollector, session, stormConfig| Constructor and Description |
|---|
BatchCassandraWriterBolt(CQLStatementTupleMapper tupleMapper)
Creates a new
CassandraWriterBolt instance. |
BatchCassandraWriterBolt(CQLStatementTupleMapper tupleMapper,
int tickFrequencyInSeconds)
Creates a new
CassandraWriterBolt instance. |
| Modifier and Type | Method and Description |
|---|---|
protected AsyncResultHandler<List<Tuple>> |
getAsyncHandler() |
Map<String,Object> |
getComponentConfiguration() |
protected void |
onTickTuple(Tuple tuple) |
void |
prepare(Map stormConfig,
TopologyContext topologyContext,
OutputCollector outputCollector) |
void |
prepareAndExecuteStatement() |
protected void |
process(Tuple input) |
BatchCassandraWriterBolt |
withQueueSize(int size)
Maximum number of tuple kept in memory before inserting batches to cassandra.
|
BatchCassandraWriterBolt |
withTickFrequency(long time,
TimeUnit unit) |
cleanup, declareOutputFields, execute, getAsyncExecutor, getMapper, getResultHandler, withOutputFields, withResultHandler, withStreamOutputFieldspublic static final int DEFAULT_EMIT_FREQUENCY
public BatchCassandraWriterBolt(CQLStatementTupleMapper tupleMapper)
Creates a new CassandraWriterBolt instance.
tupleMapper - public BatchCassandraWriterBolt(CQLStatementTupleMapper tupleMapper, int tickFrequencyInSeconds)
Creates a new CassandraWriterBolt instance.
tupleMapper - public void prepare(Map stormConfig, TopologyContext topologyContext, OutputCollector outputCollector)
protected AsyncResultHandler<List<Tuple>> getAsyncHandler()
getAsyncHandler in class BaseCassandraBolt<List<Tuple>>protected void process(Tuple input)
process in class BaseTickTupleAwareRichBoltprotected void onTickTuple(Tuple tuple)
onTickTuple in class BaseTickTupleAwareRichBoltpublic void prepareAndExecuteStatement()
public BatchCassandraWriterBolt withTickFrequency(long time, TimeUnit unit)
public BatchCassandraWriterBolt withQueueSize(int size)
Maximum number of tuple kept in memory before inserting batches to cassandra.
size - the max queue size.thispublic Map<String,Object> getComponentConfiguration()
getComponentConfiguration in interface IComponentgetComponentConfiguration in class BaseCassandraBolt<List<Tuple>>Copyright © 2018 The Apache Software Foundation. All Rights Reserved.