public abstract class BaseCassandraBolt<T> extends BaseTickTupleAwareRichBolt
A base cassandra bolt.
Default BaseTickTupleAwareRichBolt
| 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() |
void |
prepare(Map stormConfig,
TopologyContext topologyContext,
OutputCollector outputCollector) |
BaseCassandraBolt |
withOutputFields(Fields fields) |
BaseCassandraBolt |
withResultHandler(ExecutionResultHandler resultHandler) |
BaseCassandraBolt |
withStreamOutputFields(String stream,
Fields fields) |
onTickTuple, processprotected 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)
execute in interface IBoltexecute in class BaseTickTupleAwareRichBoltinput - the tuple to process.public void declareOutputFields(OutputFieldsDeclarer declarer)
public Map<String,Object> getComponentConfiguration()
getComponentConfiguration in interface IComponentgetComponentConfiguration in class BaseComponentpublic void cleanup()
cleanup in interface IBoltcleanup in class BaseRichBoltCopyright © 2018 The Apache Software Foundation. All Rights Reserved.