本文整理匯總了Java中org.apache.storm.topology.OutputFieldsDeclarer類的典型用法代碼示例。如果您正苦於以下問題:Java OutputFieldsDeclarer類的具體用法?Java OutputFieldsDeclarer怎麽用?Java OutputFieldsDeclarer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OutputFieldsDeclarer類屬於org.apache.storm.topology包,在下文中一共展示了OutputFieldsDeclarer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Test
public void declareOutputFields() {
Map<String, Fields> outputFields = new HashMap<>(2);
String streamId1 = "testStream1",
streamId2 = "testStream2";
Fields fields1 = new Fields("field1", "field2"),
fields2 = new Fields("field3", "field4");
outputFields.put(streamId1, fields1);
outputFields.put(streamId2, fields2);
RabbitMqSpout rabbitMqSpout = new RabbitMqSpout(rabbitMqChannelProvider, new EmptyRabbitMqMessageScheme() {
@Override
public Map<String, Fields> getStreamsOutputFields() {
return outputFields;
}
});
OutputFieldsDeclarer mockOutputFieldsDeclarer = mock(OutputFieldsDeclarer.class);
rabbitMqSpout.declareOutputFields(mockOutputFieldsDeclarer);
verify(mockOutputFieldsDeclarer, times(1)).declareStream(streamId1, fields1);
verify(mockOutputFieldsDeclarer, times(1)).declareStream(streamId2, fields2);
}
示例2: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
try{
Global.loadingDataStructure("/Users/yuxiao/項目/stormSQL/code/SQLonStorm/src/main/resources/createtabledata.txt");
HashMap<String, MTable> dataBase = Global.DataBase;
MTable jData_Action_201603 = dataBase.get("JData_Product");
this.descOfOutputFields = new ArrayList<String>();
this.descOfOutputFields.add("Table");
for(MField mField: jData_Action_201603.getField()){
this.descOfOutputFields.add(mField.getName());
}
}catch (Exception e){
e.printStackTrace();
}
Fields fields = new Fields(this.descOfOutputFields);
outputFieldsDeclarer.declare(fields);
}
示例3: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
try{
Global.loadingDataStructure("/Users/yuxiao/項目/stormSQL/code/SQLonStorm/src/main/resources/createtabledata.txt");
HashMap<String, MTable> dataBase = Global.DataBase;
MTable jData_Action_201602 = dataBase.get("JData_Action_201602");
this.descOfOutputFields = new ArrayList<String>();
this.descOfOutputFields.add("Table");
for(MField mField: jData_Action_201602.getField()){
this.descOfOutputFields.add(mField.getName());
}
}catch (Exception e){
e.printStackTrace();
}
Fields fields = new Fields(this.descOfOutputFields);
outputFieldsDeclarer.declare(fields);
}
示例4: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
super.declareOutputFields(declarer);
// output of this module is the list of fields to index
// with at least the URL, text content
declarer.declare(new Fields("url", "content", "metadata", "text"));
}
示例5: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declareStream(STREAM_ID_ERROR, KafkaMessage.FORMAT);
for (String streamId : endpointMapping.values()) {
declarer.declareStream(streamId, RouteMessage.FORMAT);
}
}
示例6: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
outputFieldsDeclarer.declareStream(StreamType.CREATE.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.READ.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.UPDATE.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.DELETE.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.PATH.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.STATUS.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.RESTORE.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.REROUTE.toString(), FlowTopology.fieldsMessageFlowId);
outputFieldsDeclarer.declareStream(StreamType.ERROR.toString(), FlowTopology.fieldsMessageErrorType);
}
示例7: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
outputFieldsDeclarer.declareStream(StreamType.CREATE.toString(), FlowTopology.fieldsMessageSwitchIdFlowIdTransactionId);
outputFieldsDeclarer.declareStream(StreamType.DELETE.toString(), FlowTopology.fieldsMessageSwitchIdFlowIdTransactionId);
outputFieldsDeclarer.declareStream(StreamType.STATUS.toString(), FlowTopology.fieldsFlowIdStatus);
}
示例8: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
outputFieldsDeclarer.declareStream(PORT_STATS_STREAM, fieldMessage);
outputFieldsDeclarer.declareStream(METER_CFG_STATS_STREAM, fieldMessage);
outputFieldsDeclarer.declareStream(FLOW_STATS_STREAM, fieldMessage);
}
示例9: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void declareOutputFields(OutputFieldsDeclarer output) {
output.declareStream(StreamType.TPE.toString(), AbstractTopology.fieldMessage);
output.declareStream(StreamType.WFM_DUMP.toString(), AbstractTopology.fieldMessage);
output.declareStream(StreamType.OFE.toString(), AbstractTopology.fieldMessage);
// FIXME(dbogun): use proper tuple format
output.declareStream(STREAM_ID_CTRL, AbstractTopology.fieldMessage);
}
示例10: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
Map<String, Fields> streamsOutputFields = rabbitMqMessageScheme.getStreamsOutputFields();
for (Entry<String, Fields> entry : streamsOutputFields.entrySet()) {
declarer.declareStream(entry.getKey(), entry.getValue());
}
}
示例11: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
RecordTranslator<K, V> translator = kafkaSpoutConfig.getTranslator();
for (String stream : translator.streams()) {
declarer.declareStream(stream, translator.getFieldsFor(stream));
}
}
示例12: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
/**
* 輸出元組數據屬性名到下一個bolt
*/
public void declareOutputFields(OutputFieldsDeclarer declarer) {
if (this.descOfOutputFileds == null){
System.out.print("we");
}
Fields fields = new Fields(this.descOfOutputFileds);
declarer.declare(fields);
}
示例13: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declare(new Fields("word", "count"));
}
開發者ID:PacktPublishing,項目名稱:Practical-Real-time-Processing-and-Analytics,代碼行數:4,代碼來源:WordCountBolt.java
示例14: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
public void declareOutputFields(OutputFieldsDeclarer declarer) {
// this bolt does not emit anything
}
開發者ID:PacktPublishing,項目名稱:Practical-Real-time-Processing-and-Analytics,代碼行數:4,代碼來源:DisplayBolt.java
示例15: declareOutputFields
import org.apache.storm.topology.OutputFieldsDeclarer; //導入依賴的package包/類
public void declareOutputFields(OutputFieldsDeclarer declarer) {
declarer.declare(new Fields("sentence"));
}
開發者ID:PacktPublishing,項目名稱:Practical-Real-time-Processing-and-Analytics,代碼行數:4,代碼來源:FixedSentenceSpout.java