本文整理汇总了Java中cascading.flow.FlowProcess.increment方法的典型用法代码示例。如果您正苦于以下问题:Java FlowProcess.increment方法的具体用法?Java FlowProcess.increment怎么用?Java FlowProcess.increment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cascading.flow.FlowProcess
的用法示例。
在下文中一共展示了FlowProcess.increment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: source
import cascading.flow.FlowProcess; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean source(final FlowProcess<JobConf> flowProcess, final SourceCall<Object[], RecordReader> sourceCall) throws IOException {
final Object[] context = sourceCall.getContext();
while (sourceCall.getInput().next(context[0], context[1])) {
if (hasHeader && ((LongWritable) context[0]).get() == 0)
continue;
final String[] split;
try {
split = ((CSVParser) sourceCall.getContext()[3]).parseLine(makeEncodedString(context));
} catch (IOException exc) {
if (strict)
throw exc;
LOGGER.warn("exception", exc);
flowProcess.increment("com.tresata.cascading.scheme.OpenCsvScheme", "Invalid Records", 1);
continue;
}
for (int i = 0; i < split.length; i++)
if (split[i].equals(""))
split[i] = null;
final Tuple tuple = sourceCall.getIncomingEntry().getTuple();
tuple.clear();
tuple.addAll(split);
if (tuple.size() != getSourceFields().size()) {
if (strict)
throw new TapException(String.format("expected %s items but got %s", getSourceFields().size(), tuple.size()), tuple);
LOGGER.warn("expected {} items but got {}, tuple: {}", new Object[]{getSourceFields().size(), tuple.size() , tuple});
flowProcess.increment("com.tresata.cascading.scheme.OpenCsvScheme", "Invalid Records", 1);
tuple.clear(); // probably not necessary
continue;
}
return true;
}
return false;
}
示例2: report
import cascading.flow.FlowProcess; //导入方法依赖的package包/类
private void report(Stats stats, FlowProcess<Properties> flowProcess) {
// report current stats
for (Counter count : Counter.ALL) {
flowProcess.increment(count, count.get(stats));
}
}