Java Code Examples for org.apache.storm.topology.OutputFieldsDeclarer#declareStream()

The following examples show how to use org.apache.storm.topology.OutputFieldsDeclarer#declareStream() . 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: 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 2
Source File: LogProcessorTransformBolt.java    From DBus with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("umsStream", new Fields("outputTopic", "table", "value", "emitDataType"));
    declarer.declareStream("statStream", new Fields("value", "emitDataType"));
    declarer.declareStream("heartbeatStream", new Fields("value", "emitDataType"));
    declarer.declareStream("ctrlStream", new Fields("value", "emitDataType"));
}
 
Example 3
Source File: NotificationsTestBolt.java    From streamline with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    if (!consoleNotificationStream.isEmpty()) {
        declarer.declareStream(consoleNotificationStream, new Fields(StreamlineEvent.STREAMLINE_EVENT));
    }
    if (!emailNotificationStream.isEmpty()) {
        declarer.declareStream(emailNotificationStream, new Fields(StreamlineEvent.STREAMLINE_EVENT));
    }
}
 
Example 4
Source File: EncColMultBolt.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.ENCCOLMULTBOLT_ID,
      new Fields(StormConstants.COLUMN_INDEX_ECM_FIELD, StormConstants.COLUMN_PRODUCT_FIELD));
  outputFieldsDeclarer.declareStream(StormConstants.ENCCOLMULTBOLT_SESSION_END, new Fields("finished"));
}
 
Example 5
Source File: JoinBolt.java    From bullet-storm with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    // This is where the data for each queries go
    declarer.declareStream(RESULT_STREAM, new Fields(ID_FIELD, RESULT_FIELD, METADATA_FIELD));
    // This is where the metadata that is used for feedback is sent
    declarer.declareStream(FEEDBACK_STREAM, new Fields(ID_FIELD, METADATA_FIELD));
}
 
Example 6
Source File: NormalizationBolt.java    From streamline with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    if (normalizationProcessor == null) {
        throw new RuntimeException("normalizationProcessor cannot be null");
    }
    for (Stream stream : normalizationProcessor.getOutputStreams()) {
        declarer.declareStream(stream.getId(), new Fields(StreamlineEvent.STREAMLINE_EVENT));
    }
}
 
Example 7
Source File: FilterBolt.java    From bullet-storm with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    // This is the per query data stream.
    declarer.declareStream(DATA_STREAM, new Fields(ID_FIELD, DATA_FIELD));
    // This is the where any errors per query are sent
    declarer.declareStream(ERROR_STREAM, new Fields(ID_FIELD, ERROR_FIELD));
}
 
Example 8
Source File: KafkaSpout.java    From storm_spring_boot_demo with MIT License 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    RecordTranslator<K, V> translator = kafkaSpoutConfig.getTranslator();
    for (String stream : translator.streams()) {
        declarer.declareStream(stream, translator.getFieldsFor(stream));
    }
}
 
Example 9
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 10
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 11
Source File: TickSpout.java    From bullet-storm with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream(TICK_STREAM, new Fields(ID_FIELD, TICK_FIELD));
}
 
Example 12
Source File: HBaseEmitter.java    From metron with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declareStream(getStreamId(), new Fields("measurement"));
}
 
Example 13
Source File: PagedBatchDataFetchingBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("progressInfo"));
    declarer.declareStream(FullPullConstants.CTRL_STREAM, new Fields("progressInfo"));
}
 
Example 14
Source File: FileReaderSpout.java    From streamline with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
    outputFieldsDeclarer.declareStream(outputStream, new Fields(StreamlineEvent.STREAMLINE_EVENT));
}
 
Example 15
Source File: DBusRouterStatBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("statStream", new Fields("data"));
}
 
Example 16
Source File: SinkerWriteBolt.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("dataStream", new Fields("data"));
    declarer.declareStream("ctrlStream", new Fields("data"));
}
 
Example 17
Source File: LogProcessorKafkaReadSpout.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("ctrlOrHbStream", new Fields("records", "emitDataType"));
    declarer.declareStream("umsStream", new Fields("records", "emitDataType"));
}
 
Example 18
Source File: DataPullingSpout.java    From DBus with Apache License 2.0 4 votes vote down vote up
/**
 * 定义字段id,该id在简单模式下没有用处,但在按照字段分组的模式下有很大的用处。
 * 该declarer变量有很大作用,我们还可以调用declarer.declareStream();来定义stramId,该id可以用来定义更加复杂的流拓扑结构
 */
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields("source"));
    declarer.declareStream(FullPullConstants.CTRL_STREAM, new Fields("source"));
}
 
Example 19
Source File: ParserBolt.java    From metron with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declareStream(Constants.ERROR_STREAM, new Fields("message"));
}
 
Example 20
Source File: UnifiedEnrichmentBolt.java    From metron with Apache License 2.0 2 votes vote down vote up
/**
 * Declare the output schema for all the streams of this topology.
 * We declare two streams: error and message.
 *
 * @param declarer this is used to declare output stream ids, output fields, and whether or not each output stream is a direct stream
 */
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declareStream("message", new Fields("key", "message"));
  declarer.declareStream("error", new Fields("message"));
}