當前位置: 首頁>>代碼示例>>Java>>正文


Java OutputFieldsDeclarer類代碼示例

本文整理匯總了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);
}
 
開發者ID:anderelate,項目名稱:storm-rabbitmq,代碼行數:21,代碼來源:RabbitMqSpoutTest.java

示例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);
}
 
開發者ID:bigdataFlySQL,項目名稱:SQLonStorm,代碼行數:18,代碼來源:JoinSpouttest_2.java

示例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);
}
 
開發者ID:bigdataFlySQL,項目名稱:SQLonStorm,代碼行數:18,代碼來源:JoinSpouttest_1.java

示例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"));
}
 
開發者ID:eorliac,項目名稱:patent-crawler,代碼行數:8,代碼來源:PatentParserBolt.java

示例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);
    }
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:8,代碼來源:RouteBolt.java

示例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);
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:16,代碼來源:SplitterBolt.java

示例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);
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:10,代碼來源:SpeakerBolt.java

示例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);
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:10,代碼來源:SpeakerBolt.java

示例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);
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:12,代碼來源:CacheBolt.java

示例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());
    }
}
 
開發者ID:anderelate,項目名稱:storm-rabbitmq,代碼行數:8,代碼來源:RabbitMqSpout.java

示例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));
    }
}
 
開發者ID:Paleozoic,項目名稱:storm_spring_boot_demo,代碼行數:8,代碼來源:KafkaSpout.java

示例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);
}
 
開發者ID:bigdataFlySQL,項目名稱:SQLonStorm,代碼行數:13,代碼來源:SelectBolt.java

示例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


注:本文中的org.apache.storm.topology.OutputFieldsDeclarer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。