storm.trident.spout.ITridentSpout Java Examples

The following examples show how to use storm.trident.spout.ITridentSpout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MasterBatchCoordinator.java    From jstorm with Apache License 2.0 5 votes vote down vote up
public MasterBatchCoordinator(List<String> spoutIds, List<ITridentSpout> spouts) {
    if (spoutIds.isEmpty()) {
        throw new IllegalArgumentException("Must manage at least one spout");
    }
    _managedSpoutIds = spoutIds;
    _spouts = spouts;
}
 
Example #2
Source File: MasterBatchCoordinator.java    From jstorm with Apache License 2.0 5 votes vote down vote up
private boolean isReady(long txid) {
    if (_throttler.isThrottled()) return false;
    //TODO: make this strategy configurable?... right now it goes if anyone is ready
    for (ITridentSpout.BatchCoordinator coord : _coordinators) {
        if (coord.isReady(txid)) return true;
    }
    return false;
}
 
Example #3
Source File: TridentTopology.java    From jstorm with Apache License 2.0 5 votes vote down vote up
public Stream newStream(String txId, ITridentDataSource dataSource) {
    if (dataSource instanceof IBatchSpout) {
        return newStream(txId, (IBatchSpout) dataSource);
    } else if (dataSource instanceof ITridentSpout) {
        return newStream(txId, (ITridentSpout) dataSource);
    } else if (dataSource instanceof IPartitionedTridentSpout) {
        return newStream(txId, (IPartitionedTridentSpout) dataSource);
    } else if (dataSource instanceof IOpaquePartitionedTridentSpout) {
        return newStream(txId, (IOpaquePartitionedTridentSpout) dataSource);
    } else {
        throw new UnsupportedOperationException("Unsupported stream");
    }
}
 
Example #4
Source File: TridentTopology.java    From jstorm with Apache License 2.0 5 votes vote down vote up
private static Map getSpoutComponentConfig(Object spout) {
    if(spout instanceof IRichSpout) {
        return ((IRichSpout) spout).getComponentConfiguration();
    } else if (spout instanceof IBatchSpout) {
        return ((IBatchSpout) spout).getComponentConfiguration();
    } else {
        return ((ITridentSpout) spout).getComponentConfiguration();
    }
}
 
Example #5
Source File: FeederCommitterBatchSpout.java    From jstorm with Apache License 2.0 4 votes vote down vote up
public CommitterEmitter(ITridentSpout.Emitter e) {
    _emitter = e;
}
 
Example #6
Source File: TridentTopology.java    From jstorm with Apache License 2.0 4 votes vote down vote up
public Stream newStream(String txId, ITridentSpout spout) {
    Node n = new SpoutNode(getUniqueStreamId(), spout.getOutputFields(), txId, spout, SpoutNode.SpoutType.BATCH);
    return addNode(n);
}