本文整理汇总了Java中backtype.storm.topology.IComponent类的典型用法代码示例。如果您正苦于以下问题:Java IComponent类的具体用法?Java IComponent怎么用?Java IComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IComponent类属于backtype.storm.topology包,在下文中一共展示了IComponent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCreateTimestampAttributeToSchemas
import backtype.storm.topology.IComponent; //导入依赖的package包/类
static void addCreateTimestampAttributeToSchemas(IComponent spoutOrBolt, OutputFieldsDeclarer declarer) {
TransparentFieldsDeclarer transparentDeclarer = new TransparentFieldsDeclarer();
spoutOrBolt.declareOutputFields(transparentDeclarer);
for(Entry<String, List<String>> declaredStream : transparentDeclarer.declaredStreams.entrySet()) {
String streamId = declaredStream.getKey();
boolean direct = transparentDeclarer.directStreams.contains(streamId);
ArrayList<String> fieldsWithID = new ArrayList<String>(declaredStream.getValue());
if(!streamId.startsWith("aeolus::")) {
fieldsWithID.add(CREATE_TS_FIELD_NAME);
}
declarer.declareStream(streamId, direct, new Fields(fieldsWithID));
}
}
示例2: getSingleOutputStreamFields
import backtype.storm.topology.IComponent; //导入依赖的package包/类
public static Fields getSingleOutputStreamFields(IComponent component) {
OutputFieldsGetter getter = new OutputFieldsGetter();
component.declareOutputFields(getter);
Map<String, StreamInfo> declaration = getter.getFieldsDeclaration();
if(declaration.size()!=1) {
throw new RuntimeException("Trident only supports components that emit a single stream");
}
StreamInfo si = declaration.values().iterator().next();
if(si.is_direct()) {
throw new RuntimeException("Trident does not support direct streams");
}
return new Fields(si.get_output_fields());
}
示例3: getSingleOutputStreamFields
import backtype.storm.topology.IComponent; //导入依赖的package包/类
public static Fields getSingleOutputStreamFields(IComponent component) {
OutputFieldsGetter getter = new OutputFieldsGetter();
component.declareOutputFields(getter);
Map<String, StreamInfo> declaration = getter.getFieldsDeclaration();
if(declaration.size()!=1) {
throw new RuntimeException("Trident only supports components that emit a single stream");
}
StreamInfo si = declaration.values().iterator().next();
if(si.is_direct()) {
throw new RuntimeException("Trident does not support direct streams");
}
return new Fields(si.get_output_fields());
}
示例4: getSpout
import backtype.storm.topology.IComponent; //导入依赖的package包/类
@Override
public IComponent getSpout() {
return s;
}
示例5: getSpout
import backtype.storm.topology.IComponent; //导入依赖的package包/类
IComponent getSpout();
示例6: setBolt
import backtype.storm.topology.IComponent; //导入依赖的package包/类
protected abstract IComponent setBolt(TopologyBuilder builder, String upStreamId);