public abstract class BaseCassandraBolt<T> extends BaseRichBolt
A base cassandra bolt.
Default BaseRichBolt
Modifier and Type | Field and Description |
---|---|
protected CassandraConf |
cassandraConfConfig |
protected SimpleClient |
client |
protected SimpleClientProvider |
clientProvider |
protected OutputCollector |
outputCollector |
protected com.datastax.driver.core.Session |
session |
protected Map |
stormConfig |
Constructor and Description |
---|
BaseCassandraBolt(CQLStatementTupleMapper tupleMapper)
Creates a new
CassandraWriterBolt instance. |
BaseCassandraBolt(CQLStatementTupleMapper mapper,
SimpleClientProvider clientProvider)
Creates a new
CassandraWriterBolt instance. |
Modifier and Type | Method and Description |
---|---|
void |
cleanup() |
void |
declareOutputFields(OutputFieldsDeclarer declarer) |
void |
execute(Tuple input) |
protected AsyncExecutor<T> |
getAsyncExecutor() |
protected abstract AsyncResultHandler<T> |
getAsyncHandler() |
Map<String,Object> |
getComponentConfiguration() |
protected CQLStatementTupleMapper |
getMapper() |
protected ExecutionResultHandler |
getResultHandler() |
protected abstract void |
onTickTuple()
Calls by an input tick tuple.
|
void |
prepare(Map stormConfig,
TopologyContext topologyContext,
OutputCollector outputCollector) |
protected abstract void |
process(Tuple input)
Process a single tuple of input.
|
BaseCassandraBolt |
withOutputFields(Fields fields) |
BaseCassandraBolt |
withResultHandler(ExecutionResultHandler resultHandler) |
BaseCassandraBolt |
withStreamOutputFields(String stream,
Fields fields) |
protected OutputCollector outputCollector
protected SimpleClientProvider clientProvider
protected SimpleClient client
protected com.datastax.driver.core.Session session
protected Map stormConfig
protected CassandraConf cassandraConfConfig
public BaseCassandraBolt(CQLStatementTupleMapper mapper, SimpleClientProvider clientProvider)
Creates a new CassandraWriterBolt
instance.
mapper
- public BaseCassandraBolt(CQLStatementTupleMapper tupleMapper)
Creates a new CassandraWriterBolt
instance.
tupleMapper
- public void prepare(Map stormConfig, TopologyContext topologyContext, OutputCollector outputCollector)
public BaseCassandraBolt withResultHandler(ExecutionResultHandler resultHandler)
public BaseCassandraBolt withOutputFields(Fields fields)
public BaseCassandraBolt withStreamOutputFields(String stream, Fields fields)
protected ExecutionResultHandler getResultHandler()
protected CQLStatementTupleMapper getMapper()
protected abstract AsyncResultHandler<T> getAsyncHandler()
protected AsyncExecutor<T> getAsyncExecutor()
public final void execute(Tuple input)
input
- the tuple to process.protected abstract void process(Tuple input)
Process a single tuple of input.
input
- The input tuple to be processed.protected abstract void onTickTuple()
Calls by an input tick tuple.
public void declareOutputFields(OutputFieldsDeclarer declarer)
public Map<String,Object> getComponentConfiguration()
getComponentConfiguration
in interface IComponent
getComponentConfiguration
in class BaseComponent
public void cleanup()
cleanup
in interface IBolt
cleanup
in class BaseRichBolt
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.