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

The following examples show how to use backtype.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: StormSpout.java    From PoseidonX with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer)
{
    if (!StringUtils.isEmpty(input.getOutputStream()))
    {
        declarer.declareStream(input.getOutputStream(), new Fields(input.getOutputSchema().getAllAttributeNames()));
    }
    else
    {
        if (input.getOutputSchema() != null)
        {
            declarer.declare(new Fields(input.getOutputSchema().getAllAttributeNames()));
        }
    }
    
}
 
Example 2
Source File: FlowmixBuilder.java    From flowmix with Apache License 2.0 6 votes vote down vote up
public static void declareOutputStreams(OutputFieldsDeclarer declarer, Fields fields) {
    declarer.declareStream(PARTITION, fields);
    declarer.declareStream(FILTER, fields);
    declarer.declareStream(SELECT, fields);
    declarer.declareStream(AGGREGATE, fields);
    declarer.declareStream(SWITCH, fields);
    declarer.declareStream(SORT, fields);
    declarer.declareStream(JOIN, fields);
    declarer.declareStream(SPLIT, fields);
    declarer.declareStream(EACH, fields);
    declarer.declareStream(OUTPUT, fields);

    declarer.declareStream(BROADCAST_STREAM + PARTITION, fields);
    declarer.declareStream(BROADCAST_STREAM + FILTER, fields);
    declarer.declareStream(BROADCAST_STREAM + SELECT, fields);
    declarer.declareStream(BROADCAST_STREAM + AGGREGATE, fields);
    declarer.declareStream(BROADCAST_STREAM + SWITCH, fields);
    declarer.declareStream(BROADCAST_STREAM + SORT, fields);
    declarer.declareStream(BROADCAST_STREAM + JOIN, fields);
    declarer.declareStream(BROADCAST_STREAM + EACH, fields);
    declarer.declareStream(BROADCAST_STREAM + SPLIT, fields);
}
 
Example 3
Source File: StormBolt.java    From PoseidonX with Apache License 2.0 5 votes vote down vote up
private void declare(OutputFieldsDeclarer declarer, String streamName, IEventType schema)
{
    if (!StringUtils.isEmpty(streamName))
    {
        declarer.declareStream(streamName, new Fields(schema.getAllAttributeNames()));
    }
    else
    {
        declarer.declare(new Fields(schema.getAllAttributeNames()));
    }
}
 
Example 4
Source File: PcapParserBolt.java    From opensoc-streaming with Apache License 2.0 5 votes vote down vote up
public void declareOutputFields(OutputFieldsDeclarer declarer) {
 declarer.declareStream("message", new Fields("key", "message")); 
  //declarer.declareStream("pcap_index_stream", new Fields("index_json", "pcap_id"));
  declarer.declareStream("pcap_header_stream", new Fields("header_json", "pcap_id"));
  declarer.declareStream("pcap_data_stream", new Fields("pcap_id", "timestamp", "pcap"));
  declarer.declareStream("error", new Fields("error"));

}
 
Example 5
Source File: StormEntranceProcessingItem.java    From incubator-samoa with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  // for (StormStream stream : streams) {
  // declarer.declareStream(stream.getOutputId(), new
  // Fields(StormSamoaUtils.CONTENT_EVENT_FIELD,
  // StormSamoaUtils.KEY_FIELD));
  // }
  declarer.declareStream(outputStream.getOutputId(), new Fields(StormSamoaUtils.CONTENT_EVENT_FIELD,
      StormSamoaUtils.KEY_FIELD));
}
 
Example 6
Source File: StormProcessingItem.java    From incubator-samoa with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
  for (StormStream stream : streams) {
    declarer.declareStream(stream.getOutputId(),
        new Fields(StormSamoaUtils.CONTENT_EVENT_FIELD,
            StormSamoaUtils.KEY_FIELD));
  }
}
 
Example 7
Source File: AbstractStreamBolt.java    From eagle with Apache License 2.0 5 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    if (this.outputStreamIds != null) {
        LOG.info("declare streams: {} ", outputStreamIds);
        for (String streamId : this.outputStreamIds) {
            declarer.declareStream(streamId, new Fields(AlertConstants.FIELD_0));
        }
    } else {
        declarer.declare(new Fields(AlertConstants.FIELD_0));
    }
}
 
Example 8
Source File: CorrelationSpout.java    From eagle with Apache License 2.0 5 votes vote down vote up
/**
 * the only output field is for StreamEvent.
 *
 * @param declarer
 */
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    for (int i = 0; i < numOfRouterBolts; i++) {
        String streamId = StreamIdConversion.generateStreamIdBetween(spoutName, routeBoltName + i);
        declarer.declareStream(streamId, new Fields(AlertConstants.FIELD_0));
        LOG.info("declare stream between spout and streamRouterBolt " + streamId);
    }
}
 
Example 9
Source File: MockStreamReceiver.java    From eagle with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    for (String streamId : outputStreamIds) {
        declarer.declareStream(streamId, new Fields(AlertConstants.FIELD_0));
    }
}
 
Example 10
Source File: TestStormStreamIdRouting.java    From eagle with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("green-bolt-stream-1", new Fields("a"));
    declarer.declareStream("green-bolt-stream-2", new Fields("a"));
}
 
Example 11
Source File: ElasticSearchJsonBolt.java    From cognition with Apache License 2.0 4 votes vote down vote up
@Override
public final void declareOutputFields(OutputFieldsDeclarer declarer) {
  declarer.declare(new Fields(AbstractLogRecordBolt.RECORD));
  declarer.declareStream(ES_JSON, new Fields(ES_JSON));
}
 
Example 12
Source File: FlowLoaderBaseBolt.java    From flowmix with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
  outputFieldsDeclarer.declareStream(FLOW_LOADER_STREAM, new Fields("flows"));
}
 
Example 13
Source File: FlowLoaderBaseSpout.java    From flowmix with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
  outputFieldsDeclarer.declareStream(FLOW_LOADER_STREAM, new Fields("flows"));
}
 
Example 14
Source File: GenericEnrichmentBolt.java    From opensoc-streaming with Apache License 2.0 4 votes vote down vote up
public void declareOutputFields(OutputFieldsDeclarer declearer) {
	declearer.declareStream("message", new Fields("key", "message"));
	declearer.declareStream("error", new Fields("message"));
}
 
Example 15
Source File: TickSpout.java    From flowmix with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
    outputFieldsDeclarer.declareStream("tick", new Fields());
}
 
Example 16
Source File: AbstractAlertBolt.java    From opensoc-streaming with Apache License 2.0 4 votes vote down vote up
public void declareOutputFields(OutputFieldsDeclarer declearer) {
	declearer.declareStream("message", new Fields("key", "message"));
	declearer.declareStream("alert", new Fields( "message"));
	declearer.declareStream("error", new Fields("message"));
}
 
Example 17
Source File: HBaseBolt.java    From opensoc-streaming with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */

public void declareOutputFields(OutputFieldsDeclarer declarer) {
 declarer.declareStream("error", new Fields("HBase"));
}
 
Example 18
Source File: MRRunningJobFetchSpout.java    From eagle with Apache License 2.0 4 votes vote down vote up
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
    outputFieldsDeclarer.declareStream(MRRunningJobConfig.APP_TO_JOB_STREAM,
            new Fields("appId", "appInfo", "mrJobEntity"));
    outputFieldsDeclarer.declareStream(MRRunningJobConfig.APP_TO_METRIC_STREAM, new Fields("apps"));
}
 
Example 19
Source File: TelemetryParserBolt.java    From opensoc-streaming with Apache License 2.0 4 votes vote down vote up
public void declareOutputFields(OutputFieldsDeclarer declearer) {
	declearer.declareStream("message", new Fields("key", "message"));
	declearer.declareStream("error", new Fields("message"));

}
 
Example 20
Source File: PcapSimulatorSpout.java    From opensoc-streaming with Apache License 2.0 3 votes vote down vote up
public void declareOutputFields(OutputFieldsDeclarer declarer) {

    System.out.println("Declaring output fields of PcapSimulatorSpout");

    declarer.declareStream("pcap_index_stream", new Fields("index_json"));
    declarer.declareStream("pcap_header_stream", new Fields("header_json"));
    declarer.declareStream("pcap_data_stream", new Fields("pcap_id", "timestamp", "pcap"));

  }