org.apache.storm.task.WorkerTopologyContext Java Examples

The following examples show how to use org.apache.storm.task.WorkerTopologyContext. 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: DbusGrouping.java    From DBus with Apache License 2.0 5 votes vote down vote up
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks) {
    choices = new ArrayList<>(targetTasks.size());
    allTasks = new ArrayList<>(targetTasks.size());
    for (Integer i : targetTasks) {
        choices.add(Arrays.asList(i));
        allTasks.add(i);
    }
}
 
Example #2
Source File: CustomGroupingTopology.java    From incubator-heron with Apache License 2.0 5 votes vote down vote up
@Override
public void prepare(
    WorkerTopologyContext context,
    GlobalStreamId stream,
    List<Integer> targetTasks) {
  this.taskIds = targetTasks;
}
 
Example #3
Source File: URLStreamGrouping.java    From storm-crawler with Apache License 2.0 5 votes vote down vote up
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream,
        List<Integer> targetTasks) {
    this.targetTask = targetTasks;
    partitioner = new URLPartitioner();
    if (StringUtils.isNotBlank(partitionMode)) {
        Map<String, String> conf = new HashMap<>();
        conf.put(Constants.PARTITION_MODEParamName, partitionMode);
        partitioner.configure(conf);
    }
}
 
Example #4
Source File: StormStreamBuilderTest.java    From incubator-heron with Apache License 2.0 4 votes vote down vote up
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream,
                    List<Integer> targetTasks) {

}
 
Example #5
Source File: FieldsGroupingAsCustomGrouping.java    From streamline with Apache License 2.0 4 votes vote down vote up
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks) {
    this.targetTasks = targetTasks;
}
 
Example #6
Source File: CustomStreamGrouping.java    From twister2 with Apache License 2.0 2 votes vote down vote up
/**
 * Tells the stream grouping at runtime the tasks in the target bolt.
 * This information should be used in chooseTasks to determine the target tasks.
 * <p>
 * It also tells the grouping the metadata on the stream this grouping will be used on.
 */
void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks);
 
Example #7
Source File: CustomStreamGrouping.java    From incubator-heron with Apache License 2.0 2 votes vote down vote up
/**
 * Tells the stream grouping at runtime the tasks in the target bolt.
 * This information should be used in chooseTasks to determine the target tasks.
 * <p>
 * It also tells the grouping the metadata on the stream this grouping will be used on.
 */
void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks);