public void operate(FlowProcess process, FunctionCall call) { long l1 = call.getArguments().getLong(0); long l2 = call.getArguments().getLong(1); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(l1); buffer.putLong(l2); call.getOutputCollector().add(new Tuple(buffer.array())); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { if( resultFieldSelectors != null ) useResultSelectors( functionCall.getArguments(), functionCall.getOutputCollector() ); else useSize( functionCall.getArguments(), functionCall.getOutputCollector() ); }
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) { System.out.println("DEBUG: " + call.getArguments().toString()); call.getOutputCollector().add(new Tuple(1)); } }
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() ) ); } }
@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() ); } }
public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { if( !functionCall.getArguments().isUnmodifiable() ) throw new IllegalStateException( "is modifiable" ); if( !functionCall.getArguments().getTuple().isUnmodifiable() ) throw new IllegalStateException( "is modifiable" ); Tuple result = new Tuple( functionCall.getArguments().getTuple() ); functionCall.getOutputCollector().add( result ); if( result.isUnmodifiable() ) throw new IllegalStateException( "is unmodifiable" ); } }
public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { functionCall.getOutputCollector().add( new Tuple( new BytesWritable( functionCall.getArguments().getString( 0 ).getBytes() ) ) ); } }
public void operate( FlowProcess flowProcess, FunctionCall functionCall ) { functionCall.getOutputCollector().add( new Tuple( new BytesWritable( functionCall.getArguments().getString( 0 ).getBytes() ) ) ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Context<BaseRegressionFunction.ExpressionContext>> functionCall ) { ExpressionEvaluator evaluator = functionCall.getContext().payload.expressions[ 0 ]; LinkFunction linkFunction = getSpec().linkFunction; double result = evaluator.calculate( functionCall.getArguments() ); double linkResult = linkFunction.calculate( result ); LOG.debug( "result: {}", linkResult ); functionCall.getOutputCollector().add( functionCall.getContext().result( linkResult ) ); } }
@Override public void operate( FlowProcess flowProcess, FunctionCall<Context> functionCall ) { Node rootNode = getResultNode( functionCall ); TupleEntry arguments = functionCall.getArguments(); builder.build( arguments::getObject, rootNode ); Context context = functionCall.getContext(); context.result.set( 0, rootNode ); functionCall.getOutputCollector().add( context.result ); } }
@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 ); } }
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 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 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) { int hourBucket = call.getArguments().getInteger(0); int dayBucket = hourBucket / 24; int weekBucket = dayBucket / 7; int monthBucket = dayBucket / 28; call.getOutputCollector().add(new Tuple("h", hourBucket)); call.getOutputCollector().add(new Tuple("d", dayBucket)); call.getOutputCollector().add(new Tuple("w", weekBucket)); call.getOutputCollector().add(new Tuple("m", monthBucket)); } }