本文整理汇总了Java中cascading.operation.FunctionCall类的典型用法代码示例。如果您正苦于以下问题:Java FunctionCall类的具体用法?Java FunctionCall怎么用?Java FunctionCall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FunctionCall类属于cascading.operation包,在下文中一共展示了FunctionCall类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@Override
public void operate(@SuppressWarnings("rawtypes") FlowProcess flowProcess, FunctionCall<Tuple> functionCall) {
TupleEntry tupleEntry = functionCall.getArguments();
Tuple outputTuple = functionCall.getContext();
boolean allGroupFieldsValuesAreNull = true;
for(Fields fields : groupFieldsPerPipe) {
if(! groupFieldsValuesAreNull(tupleEntry, fields)) {
for(int i=0; i<fields.size(); i++) {
outputTuple.set(i, tupleEntry.getObject(fields.get(i)));
}
allGroupFieldsValuesAreNull = false;
break;
}
}
if(allGroupFieldsValuesAreNull) {
outputTuple = Tuple.size(numOfGroupFields);
}
functionCall.getOutputCollector().add(outputTuple);
}
示例2: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void operate(FlowProcess process, FunctionCall call) {
Data data = ((Data) call.getArguments().getObject(0)).deepCopy();
DataUnit du = data.get_dataunit();
if (du.getSetField() == DataUnit._Fields.PAGEVIEW) {
String url = du.get_pageview().get_page().get_url();
int time = data.get_pedigree().get_true_as_of_secs();
call.getOutputCollector().add(new Tuple(url, time));
}
}
示例3: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void operate(FlowProcess flowProcess, FunctionCall fnCall) {
String sentence = fnCall.getArguments().getString(0);
for (String word : sentence.split(" ")) {
fnCall.getOutputCollector().add(new Tuple(word));
}
}
示例4: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@Override
public void operate(FlowProcess flowProcess, FunctionCall functionCall) {
TupleEntry arguments = functionCall.getArguments();
Tuple result = new Tuple();
Name name = new Name();
name.setFirst_name(arguments.getString(0));
name.setLast_name(arguments.getString(1));
result.add(name);
functionCall.getOutputCollector().add(result);
}
示例5: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@Override
public void operate(FlowProcess flowProcess, FunctionCall functionCall) {
Object record = functionCall.getArguments().getObject(0);
Tuple result = new Tuple();
result.add(record.toString());
functionCall.getOutputCollector().add(result);
}
示例6: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@Override
public void operate(FlowProcess flowProcess, FunctionCall functionCall) {
TupleEntry arguments = functionCall.getArguments();
Tuple result = new Tuple();
Tuple name = new Tuple();
name.addString(arguments.getString(0));
name.addString(arguments.getString(1));
result.add(name);
functionCall.getOutputCollector().add(result);
}
示例7: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
public void operate( FlowProcess flowProcess, FunctionCall functionCall )
{
TupleEntry argument = functionCall.getArguments();
String token = scrubText( argument.getString( "token" ) );
if( token.length() > 0 )
{
Tuple result = new Tuple();
result.add( token );
functionCall.getOutputCollector().add( result );
}
}
示例8: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
public void operate( FlowProcess flowProcess, FunctionCall functionCall )
{
TupleEntry argument = functionCall.getArguments();
String doc_id = argument.getString( 0 );
String token = scrubText( argument.getString( 1 ) );
if( token.length() > 0 )
{
Tuple result = new Tuple();
result.add( doc_id );
result.add( token );
functionCall.getOutputCollector().add( result );
}
}
示例9: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void operate(FlowProcess process, FunctionCall call) {
System.out.println("DEBUG: " + call.getArguments().toString());
call.getOutputCollector().add(new Tuple(1));
}
示例10: operate
import cascading.operation.FunctionCall; //导入依赖的package包/类
@Override
public void operate(FlowProcess flowProcess, FunctionCall<Object> functionCall){
Evaluator evaluator = getEvaluator();
TupleEntry input = functionCall.getArguments();
Map<FieldName, FieldValue> arguments = decodeArguments(evaluator, input);
Map<FieldName, ?> result = evaluator.evaluate(arguments);
TupleEntry output = encodeResult(evaluator, getFieldDeclaration(), result);
TupleEntryCollector outputCollector = functionCall.getOutputCollector();
outputCollector.add(output);
}