Search in sources :

Example 1 with IBasicTransactionSpoutExecutor

use of com.alibaba.jstorm.transactional.spout.IBasicTransactionSpoutExecutor in project jstorm by alibaba.

the class TransactionTopologyBuilder method setSpout.

private SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelismHint, boolean isSchedule) {
    upToDownstreamComponentsMap.put(id, new HashSet<String>());
    IRichSpout spoutExecutor;
    if (spout instanceof IBasicTransactionSpoutExecutor) {
        spoutExecutor = new BasicTransactionSpout((IBasicTransactionSpoutExecutor) spout);
    } else if (!isSchedule) {
        spoutExecutor = new BasicTransactionSpout((ITransactionSpoutExecutor) spout);
    } else {
        spoutExecutor = new ScheduleTransactionSpout((ITransactionSpoutExecutor) spout);
    }
    SpoutDeclarer ret = super.setSpout(id, spoutExecutor, parallelismHint);
    return ret;
}
Also used : IRichSpout(backtype.storm.topology.IRichSpout) BasicTransactionSpout(com.alibaba.jstorm.transactional.spout.BasicTransactionSpout) IBasicTransactionSpoutExecutor(com.alibaba.jstorm.transactional.spout.IBasicTransactionSpoutExecutor) ScheduleTransactionSpout(com.alibaba.jstorm.transactional.spout.ScheduleTransactionSpout) SpoutDeclarer(backtype.storm.topology.SpoutDeclarer)

Aggregations

IRichSpout (backtype.storm.topology.IRichSpout)1 SpoutDeclarer (backtype.storm.topology.SpoutDeclarer)1 BasicTransactionSpout (com.alibaba.jstorm.transactional.spout.BasicTransactionSpout)1 IBasicTransactionSpoutExecutor (com.alibaba.jstorm.transactional.spout.IBasicTransactionSpoutExecutor)1 ScheduleTransactionSpout (com.alibaba.jstorm.transactional.spout.ScheduleTransactionSpout)1