@Override public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { functionCall.getOutputCollector().add( Tuple.NULL ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { boolean isRemove = !filter.isRemove( flowProcess, (FilterCall) functionCall ); int pos = isRemove ? 0 : 1; functionCall.getOutputCollector().add( values[ pos ] ); }
public void operate(FlowProcess process, FunctionCall call) { long val = call.getArguments().getLong(0); ByteBuffer buffer = ByteBuffer.allocate(8); buffer.putLong(val); call.getOutputCollector().add( new Tuple(buffer.array())); } }
public void operate(FlowProcess process, FunctionCall call) { String urlStr = call.getArguments().getString(0); try { URL url = new URL(urlStr); call.getOutputCollector().add( new Tuple(url.getAuthority())); } catch(MalformedURLException e) { } } }
public void operate(FlowProcess process, FunctionCall call) { String str = call.getArguments().getString(0); try { call.getOutputCollector().add( new Tuple(str.getBytes("UTF-8"))); } catch(UnsupportedEncodingException e) { throw new RuntimeException(e); } } }
public void operate(FlowProcess process, FunctionCall call) { Object node1 = call.getArguments().getObject(0); Object node2 = call.getArguments().getObject(1); if(!node1.equals(node2)) { call.getOutputCollector().add( new Tuple(node1, node2)); call.getOutputCollector().add( new Tuple(node2, node1)); } } }
@Override public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { URL resource = Thread.currentThread().getContextClassLoader().getResource( testClasspathJarContents ); if( resource == null ) throw new RuntimeException( "cannot find resource" ); functionCall.getOutputCollector().add( functionCall.getArguments() ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Context> functionCall ) { functionCall.getOutputCollector().add( (Tuple) evaluate( functionCall.getContext(), functionCall.getArguments() ) ); } }
public void operate(FlowProcess process, FunctionCall call) { int timestamp = call.getArguments().getInteger(0); int hourBucket = timestamp / HOUR_SECS; call.getOutputCollector().add(new Tuple(hourBucket)); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Pair<SimpleDateFormat, TupleEntry>> functionCall ) { long ts = functionCall.getArguments().getLong( 0 ); Calendar calendar = getCalendar(); calendar.setTimeInMillis( ts ); String formatted = functionCall.getContext().getLhs().format( calendar.getTime() ); functionCall.getContext().getRhs().setString( 0, formatted ); functionCall.getOutputCollector().add( functionCall.getContext().getRhs() ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Tuple> functionCall ) { functionCall.getContext().set( 0, functionCall.getArguments().getTuple().toString( delimiter, false ) ); functionCall.getOutputCollector().add( functionCall.getContext() ); }
@Override public void operate( FlowProcess flowProcess, FunctionCall<ExpressionOperation.Context> functionCall ) { functionCall.getContext().result.set( 0, evaluate( functionCall.getContext(), functionCall.getArguments() ) ); functionCall.getOutputCollector().add( functionCall.getContext().result ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Context> functionCall ) { functionCall.getContext().result.set( 0, evaluate( functionCall.getContext(), functionCall.getArguments() ) ); functionCall.getOutputCollector().add( functionCall.getContext().result ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Tuple> functionCall ) { functionCall.getContext().set( 0, functionCall.getArguments().getTuple().format( format ) ); functionCall.getOutputCollector().add( functionCall.getContext() ); }
public void operate(FlowProcess process, FunctionCall call) { Data data = (Data) call.getArguments().getObject(0); EquivEdge equiv = data.get_dataunit().get_equiv(); call.getOutputCollector().add( new Tuple(equiv.get_id1(), equiv.get_id2())); } }
public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { functionCall.getOutputCollector().add( new Tuple( new BooleanWritable( asBoolean ) ) ); } }
public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { Set<Tuple> set = new TreeSet<Tuple>(); TupleEntry input = functionCall.getArguments(); for( Fields field : fields ) set.add( input.selectTuple( field ) ); int i = 0; Tuple inputCopy = new Tuple( input.getTuple() ); for( Tuple tuple : set ) inputCopy.put( input.getFields(), fields[ i++ ], tuple ); functionCall.getOutputCollector().add( inputCopy ); }
public void operate(FlowProcess process, FunctionCall call) { PersonID newId = (PersonID) call.getArguments() .getObject(0); Data data = ((Data) call.getArguments().getObject(1)) .deepCopy(); if(newId!=null) { data.get_dataunit().get_page_view().set_person(newId); } call.getOutputCollector().add(new Tuple(data)); } }
public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { TupleEntry input = functionCall.getArguments(); functionCall.getOutputCollector().add( new Tuple( Math.pow( input.getTuple().getDouble( 0 ) - input.getTuple().getDouble( 1 ), 2 ) ) ); } };
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.PAGE_VIEW) { normalize(du.get_page_view().get_page()); } else if(du.getSetField() == DataUnit._Fields.PAGE_PROPERTY) { normalize(du.get_page_property().get_id()); } call.getOutputCollector().add(new Tuple(data)); }