本文整理汇总了Java中org.apache.storm.task.WorkerTopologyContext类的典型用法代码示例。如果您正苦于以下问题:Java WorkerTopologyContext类的具体用法?Java WorkerTopologyContext怎么用?Java WorkerTopologyContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorkerTopologyContext类属于org.apache.storm.task包,在下文中一共展示了WorkerTopologyContext类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
@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);
}
}
示例2: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
@Override
public void prepare(
WorkerTopologyContext context,
GlobalStreamId stream,
List<Integer> targetTasks) {
this.taskIds = targetTasks;
}
示例3: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream,
List<Integer> targetTasks) {
numTasks = targetTasks.size();
partitioner = new URLPartitioner();
if (StringUtils.isNotBlank(partitionMode)) {
Map<String, String> conf = new HashMap<>();
conf.put(Constants.PARTITION_MODEParamName, partitionMode);
partitioner.configure(conf);
}
}
示例4: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
public void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks)
{
tasks = targetTasks.size();
}
示例5: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks) {
this.targetTasks = targetTasks;
}
示例6: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
@Override
public void prepare(WorkerTopologyContext context, GlobalStreamId stream,
List<Integer> targetTasks) {
}
示例7: prepare
import org.apache.storm.task.WorkerTopologyContext; //导入依赖的package包/类
/**
* 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);