本文整理匯總了Java中backtype.storm.tuple.Tuple.getValues方法的典型用法代碼示例。如果您正苦於以下問題:Java Tuple.getValues方法的具體用法?Java Tuple.getValues怎麽用?Java Tuple.getValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backtype.storm.tuple.Tuple
的用法示例。
在下文中一共展示了Tuple.getValues方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import backtype.storm.tuple.Tuple; //導入方法依賴的package包/類
@Override
public void execute(Tuple input, BasicOutputCollector collector) {
fields = new ArrayList<String>();
fields = (ArrayList<String>) input.getFields().toList();
fieldValues = new ArrayList<Object>();
fieldValues = (ArrayList<Object>) input.getValues();
try {
communicator.insertRow(this.tableName, fields, fieldValues);
} catch (SQLException e) {
System.out.println("Exception occurred in adding a row");
e.printStackTrace();
}
}
示例2: execute
import backtype.storm.tuple.Tuple; //導入方法依賴的package包/類
@Override
public void execute(Tuple tuple, BasicOutputCollector collector) {
List<Object> data = tuple.getValues();
String id = (String) data.get(0);
String memberid = (String) data.get(1);
String totalprice = (String) data.get(2);
String preprice = (String) data.get(3);
String sendpay = (String) data.get(4);
String createdate = (String) data.get(5);
collector.emit(new Values(id,memberid,totalprice,preprice,sendpay,createdate));
logger.info("+++++++++++++++++++++++++++++++++Valid+++++++++++++++++++++++++++++++++");
logger.info("msg = "+data+" [email protected]@[email protected]@[email protected] = "+(counter++));
logger.info("+++++++++++++++++++++++++++++++++Valid+++++++++++++++++++++++++++++++++");
}
示例3: execute
import backtype.storm.tuple.Tuple; //導入方法依賴的package包/類
public void execute(Tuple tuple, BasicOutputCollector collector) {
List<String> row = new ArrayList<>();
for (Object value : tuple.getValues()) {
row.add(value.toString());
}
String[] stringArray = row.toArray(new String[0]);
csvWriter.writeNext(stringArray);
}