使用Storm实现实时大数据分析!

Listing Five:临界值检测代码段

  1. public void execute(Tuple tuple, BasicOutputCollector collector)   
  2. {  
  3.     if(tuple!=null)   
  4.     {  
  5.         List<Object> inputTupleList = (List<Object>) tuple.getValues();  
  6.         int thresholdColNum = thresholdInfo.getThresholdColNumber();   
  7.         Object thresholdValue = thresholdInfo.getThresholdValue();   
  8.         String thresholdDataType = tupleInfo.getFieldList().get(thresholdColNum-1).getColumnType();