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


Java TridentTuple.getStringByField方法代碼示例

本文整理匯總了Java中storm.trident.tuple.TridentTuple.getStringByField方法的典型用法代碼示例。如果您正苦於以下問題:Java TridentTuple.getStringByField方法的具體用法?Java TridentTuple.getStringByField怎麽用?Java TridentTuple.getStringByField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在storm.trident.tuple.TridentTuple的用法示例。


在下文中一共展示了TridentTuple.getStringByField方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isKeep

import storm.trident.tuple.TridentTuple; //導入方法依賴的package包/類
@Override
public boolean isKeep(TridentTuple tuple) {
    String mac = tuple.getStringByField("src_mac");
    boolean status = true;

    if(mac!=null) {
        String macSplit[] = mac.split(":");
        String macHex = macSplit[0];

        // if (_debug)
        //    System.out.println("HEX: " + macHex);

        String binary = hexToBin(macHex);

        if (binary.endsWith("10") || binary.endsWith("11"))
            status = false;

        // if (_debug) {
        //     System.out.println("BIN: " + binary);
        //     System.out.println("TRUE/FALSE: " + status);
        // }
    }
    return status;
}
 
開發者ID:redBorder,項目名稱:rb-bi,代碼行數:25,代碼來源:MacLocallyAdministeredFilter.java

示例2: execute

import storm.trident.tuple.TridentTuple; //導入方法依賴的package包/類
@Override
public void execute(TridentTuple tuple,
		TridentCollector collector) {
	// TODO Auto-generated method stub
	String currentThreadName = Thread.currentThread().getName();
	String randomPhrase = tuple.getStringByField("randomPhrase");
	
	CommonUtil.logMessage(logger, currentThreadName, "execute: entered with tuple = %s", randomPhrase);
	
	StringTokenizer st = new StringTokenizer(randomPhrase);
	
	while(st.hasMoreTokens())
	{
		String token = st.nextToken();
		
		List<Object> tupleList = new ArrayList<>();
		tupleList.add(token);
		CommonUtil.logMessage(logger, currentThreadName, "execute: emitting tuple with word = %s", token);

		collector.emit(tupleList);
		
	}
	
}
 
開發者ID:BinitaBharati,項目名稱:storm-trident-example,代碼行數:25,代碼來源:RandomPhraseSplitter.java

示例3: sendToSiddhi

import storm.trident.tuple.TridentTuple; //導入方法依賴的package包/類
public void sendToSiddhi(TridentTuple tuple) {
        String section = tuple.getStringByField("sections");
        Map<String, Object> map = (Map<String, Object>) tuple.getValueByField("maps");
        for (int i = 0; i < _inputsHandler.get(section).size(); i++) {
            try {
                _inputsHandler.get(section).get(i).send(mapToArray(map, section, i).toArray());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
}
 
開發者ID:redBorder,項目名稱:rb-bi,代碼行數:12,代碼來源:SiddhiState.java

示例4: execute

import storm.trident.tuple.TridentTuple; //導入方法依賴的package包/類
@Override
public void execute(TridentTuple tuple,
		TridentCollector collector) {
	// TODO Auto-generated method stub
	String currentThreadName = Thread.currentThread().getName();
	String randomPhrase = tuple.getStringByField("randomPhrase");
	
	CommonUtil.logMessage(logger, currentThreadName, "execute: entered with tuple = %s", randomPhrase);
	
	//Eliminate stop words and punctuation like comma , double quotes - use Lucene
	List<String> filteredFailedPhrase = Util.filterPhrase2(randomPhrase);
	 
	CommonUtil.logMessage(logger, currentThreadName, "execute: filteredFailedPhraseList = %s", filteredFailedPhrase);		

	
	for(String eachWord : filteredFailedPhrase)
	{
		
		List<Object> tupleList = new ArrayList<>();
		tupleList.add(eachWord);
		CommonUtil.logMessage(logger, currentThreadName, "execute: emitting tuple with word = %s", eachWord);

		collector.emit(tupleList);
		
	}
	
}
 
開發者ID:BinitaBharati,項目名稱:storm-trident-example,代碼行數:28,代碼來源:RandomPhraseSplitter.java


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