org.apache.storm.topology.OutputFieldsDeclarer Java Examples

The following examples show how to use org.apache.storm.topology.OutputFieldsDeclarer. 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: WindowRulesBolt.java    From streamline with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    if (this.rulesProcessor == null) {
        throw new RuntimeException("rulesProcessor cannot be null");
    }
    for (Stream stream : rulesProcessor.getOutputStreams()) {
        declarer.declareStream(stream.getId(), new Fields(StreamlineEvent.STREAMLINE_EVENT));
    }
}
 
Example #2
Source File: NiFiSpout.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
    final List<String> fieldNames = new ArrayList<>();
    fieldNames.add(NIFI_DATA_PACKET);
    fieldNames.addAll(attributeNames);
    outputFieldsDeclarer.declare(new Fields(fieldNames));
}
 
Example #3
Source File: WordCountBolt.java    From java-study with Apache License 2.0 5 votes vote down vote up
/**
 * 
 */
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    // TODO Auto-generated method stub
    //声明一个输出流,其中tuple包括了单词和对应的计数,向后发射
    //其他bolt可以订阅这个数据流进一步处理
    declarer.declare(new Fields("word","count"));
}
 
Example #4
Source File: RollingCountBoltTest.java    From storm-net-adapter with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldDeclareOutputFields() {
    // given
    OutputFieldsDeclarer declarer = mock(OutputFieldsDeclarer.class);
    RollingCountBolt bolt = new RollingCountBolt();

    // when
    bolt.declareOutputFields(declarer);

    // then
    verify(declarer, times(1)).declare(any(Fields.class));

}
 
Example #5
Source File: EncRowCalcBolt.java    From incubator-retired-pirk with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer)
{
  outputFieldsDeclarer.declareStream(StormConstants.ENCROWCALCBOLT_DATASTREAM_ID,
      new Fields(StormConstants.COLUMN_INDEX_ERC_FIELD, StormConstants.ENCRYPTED_VALUE_FIELD, StormConstants.SALT));
  outputFieldsDeclarer.declareStream(StormConstants.ENCROWCALCBOLT_FLUSH_SIG, new Fields(StormConstants.FLUSH));
}
 
Example #6
Source File: SLRealtimeJoinBolt.java    From streamline with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream(this.outputStream, new Fields(StreamlineEvent.STREAMLINE_EVENT));
}
 
Example #7
Source File: DBusRouterKafkaReadSpout.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("umsOrHbStream", new Fields("data", "ns"));
    declarer.declareStream("ctrlStream", new Fields("data"));
}
 
Example #8
Source File: RTJoinExampleTopology.java    From streamline with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer ofd) {
}
 
Example #9
Source File: SentenceWordCountTopology.java    From incubator-heron with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
  outputFieldsDeclarer.declare(new Fields("sentence"));
}
 
Example #10
Source File: TestRunWindowProcessorBolt.java    From streamline with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    processorBolt.declareOutputFields(declarer);
}
 
Example #11
Source File: DbusKafkaWriterBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields(EmitFields.GROUP_FIELD, EmitFields.DATA, EmitFields.COMMAND, EmitFields.EMIT_TYPE));
}
 
Example #12
Source File: CustomIRichSpout.java    From bullet-storm with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("record", "timestamp"));
}
 
Example #13
Source File: DbusKafkaSpout.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields(EmitFields.DATA, EmitFields.COMMAND));
}
 
Example #14
Source File: DataShardsSplittingBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
}
 
Example #15
Source File: SlidingWindowTopology.java    From incubator-heron with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declare(new Fields("avg"));
}
 
Example #16
Source File: ResourceAwareExampleTopology.java    From storm-net-adapter with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("word"));
}
 
Example #17
Source File: DispatcherBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields(EmitFields.GROUP_FIELD, EmitFields.DATA, EmitFields.COMMAND, EmitFields.EMIT_TYPE));
}
 
Example #18
Source File: KafkaProducerBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("message"));
}
 
Example #19
Source File: SentenceWordCountTopology.java    From incubator-heron with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declare(new Fields("word", "count"));
}
 
Example #20
Source File: TestSpout.java    From java-study with Apache License 2.0 4 votes vote down vote up
/**
    * declareOutputFields是在IComponent接口中定义,用于声明数据格式。
    * 即输出的一个Tuple中,包含几个字段。
    */
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
	System.out.println("定义格式...");
	declarer.declare(new Fields(field));
}
 
Example #21
Source File: RandomSentenceSpout.java    From hadoop-mini-clusters with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("word"));
}
 
Example #22
Source File: CustomProcessorBolt.java    From streamline with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields (OutputFieldsDeclarer declarer) {
    declarer.declareStream(outputSchema.keySet().iterator().next(), new Fields(StreamlineEvent.STREAMLINE_EVENT));
}
 
Example #23
Source File: IntervalWindowTopology.java    From twister2 with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declare(new Fields("index"));
}
 
Example #24
Source File: EvenAndOddBolt.java    From incubator-heron with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declareStream("evens", new Fields("evens"));
  declarer.declareStream("odds", new Fields("odds"));
  declarer.declare(new Fields("number"));
}
 
Example #25
Source File: TestBolt.java    From java-study with Apache License 2.0 4 votes vote down vote up
/**
 * 声明数据格式
 */
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
	declarer.declare(new Fields("count"));
}
 
Example #26
Source File: IPFraudHiveBolt.java    From Building-Data-Streaming-Applications-with-Apache-Kafka with MIT License 4 votes vote down vote up
public void declareOutputFields(OutputFieldsDeclarer ofDeclarer) {
    ofDeclarer.declare(new Fields("ip", "date", "request_url", "protocol_type", "status_code"));
}
 
Example #27
Source File: BlobStoreAPIWordCountTopology.java    From storm-net-adapter with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("word"));
}
 
Example #28
Source File: SplitSentenceBolt.java    From storm_spring_boot_demo with MIT License 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("word")); //分词定义的field为word
}
 
Example #29
Source File: WordNormalizer.java    From java-study with Apache License 2.0 4 votes vote down vote up
/**
 * 这个*bolt*只会发布“word”域
 */
public void declareOutputFields(OutputFieldsDeclarer declarer) {
	System.out.println("WordNormalizer.declareOutputFields()");
	declarer.declare(new Fields("word"));
}
 
Example #30
Source File: WordCountTopology.java    From storm-net-adapter with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("word", "count"));
}