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()
Calls by an input tick tuple.
|
void |
prepare(Map stormConfig,
TopologyContext topologyContext,
OutputCollector outputCollector) |
void |
prepareAndExecuteStatement() |
protected void |
process(Tuple input)
Process a single tuple of 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, withStreamOutputFields
public 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 a single tuple of input.
process
in class BaseCassandraBolt<List<Tuple>>
input
- The input tuple to be processed.protected void onTickTuple()
Calls by an input tick tuple.
onTickTuple
in class BaseCassandraBolt<List<Tuple>>
public 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.this
public Map<String,Object> getComponentConfiguration()
getComponentConfiguration
in interface IComponent
getComponentConfiguration
in class BaseCassandraBolt<List<Tuple>>
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.