本文整理汇总了Java中org.apache.storm.generated.GlobalStreamId.get_componentId方法的典型用法代码示例。如果您正苦于以下问题:Java GlobalStreamId.get_componentId方法的具体用法?Java GlobalStreamId.get_componentId怎么用?Java GlobalStreamId.get_componentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.storm.generated.GlobalStreamId
的用法示例。
在下文中一共展示了GlobalStreamId.get_componentId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TwoFlinkStreamsMerger
import org.apache.storm.generated.GlobalStreamId; //导入方法依赖的package包/类
public TwoFlinkStreamsMerger(GlobalStreamId streamId1, Fields schema1, GlobalStreamId streamId2,
Fields schema2) {
this.inputStreamId1 = streamId1.get_streamId();
this.inputComponentId1 = streamId1.get_componentId();
this.inputSchema1 = schema1;
this.inputStreamId2 = streamId2.get_streamId();
this.inputComponentId2 = streamId2.get_componentId();
this.inputSchema2 = schema2;
}
示例2: StormFlinkStreamMerger
import org.apache.storm.generated.GlobalStreamId; //导入方法依赖的package包/类
public StormFlinkStreamMerger(GlobalStreamId streamId, Fields schema) {
this.inputStreamId = streamId.get_streamId();
this.inputComponentId = streamId.get_componentId();
this.inputSchema = schema;
}
示例3: processInput
import org.apache.storm.generated.GlobalStreamId; //导入方法依赖的package包/类
private DataStream<Tuple> processInput(String boltId, IRichBolt userBolt,
GlobalStreamId streamId, Grouping grouping,
Map<String, DataStream<Tuple>> producer) {
assert (userBolt != null);
assert (boltId != null);
assert (streamId != null);
assert (grouping != null);
assert (producer != null);
final String producerId = streamId.get_componentId();
final String inputStreamId = streamId.get_streamId();
DataStream<Tuple> inputStream = producer.get(inputStreamId);
final FlinkOutputFieldsDeclarer declarer = new FlinkOutputFieldsDeclarer();
declarers.put(boltId, declarer);
userBolt.declareOutputFields(declarer);
this.outputStreams.put(boltId, declarer.outputStreams);
// if producer was processed already
if (grouping.is_set_shuffle()) {
// Storm uses a round-robin shuffle strategy
inputStream = inputStream.rebalance();
} else if (grouping.is_set_fields()) {
// global grouping is emulated in Storm via an empty fields grouping list
final List<String> fields = grouping.get_fields();
if (fields.size() > 0) {
FlinkOutputFieldsDeclarer prodDeclarer = this.declarers.get(producerId);
inputStream = inputStream.keyBy(prodDeclarer
.getGroupingFieldIndexes(inputStreamId,
grouping.get_fields()));
} else {
inputStream = inputStream.global();
}
} else if (grouping.is_set_all()) {
inputStream = inputStream.broadcast();
} else if (!grouping.is_set_local_or_shuffle()) {
throw new UnsupportedOperationException(
"Flink only supports (local-or-)shuffle, fields, all, and global grouping");
}
return inputStream;
}