当前位置: 首页>>代码示例>>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;未经允许,请勿转载。