Source:
private Operator getInstantOperator(final String queryId, final InstantOperatorInfo iOpInfo) throws IllegalArgumentException, InjectionException { final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(); cb.bindNamedParameter(QueryId.class, queryId); cb.bindNamedParameter(OperatorId.class, operatorIdGenerator.generate()); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); final List<ByteBuffer> functionList = iOpInfo.getFunctions(); switch(iOpInfo.getInstantOperatorType()) { case APPLY_STATEFUL: throw new IllegalArgumentException("MISTTask: ApplyStatefulOperator is currently not supported!"); case FILTER: final Predicate predicate = (Predicate) deserializeLambda(functionList.get(0)); injector.bindVolatileInstance(Predicate.class, predicate); return injector.getInstance(FilterOperator.class); case FLAT_MAP: final Function flatMapFunc = (Function) deserializeLambda(functionList.get(0)); injector.bindVolatileInstance(Function.class, flatMapFunc); return injector.getInstance(FlatMapOperator.class); case MAP: final Function mapFunc = (Function) deserializeLambda(functionList.get(0)); injector.bindVolatileInstance(Function.class, mapFunc); return injector.getInstance(MapOperator.class); case REDUCE_BY_KEY: final BiFunction reduceFunc = (BiFunction) deserializeLambda(functionList.get(0)); injector.bindVolatileInstance(BiFunction.class, reduceFunc); return injector.getInstance(ReduceByKeyOperator.class); case REDUCE_BY_KEY_WINDOW: throw new IllegalArgumentException("MISTTask: ReduceByKeyWindowOperator is currently not supported!"); default: throw new IllegalArgumentException("MISTTask: Invalid InstantOperatorType detected!"); } }

Target:
private Operator getInstantOperator(final String queryId, final InstantOperatorInfo iOpInfo) throws IllegalArgumentException, InjectionException { final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder(); cb.bindNamedParameter(QueryId.class, queryId); cb.bindNamedParameter(OperatorId.class, operatorIdGenerator.generate()); final List<ByteBuffer> functionList = iOpInfo.getFunctions(); switch (iOpInfo.getInstantOperatorType()) { case APPLY_STATEFUL: { throw new IllegalArgumentException("MISTTask: ApplyStatefulOperator is currently not supported!"); } case FILTER: { final Predicate predicate = (Predicate) deserializeLambda(functionList.get(0)); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); injector.bindVolatileInstance(Predicate.class, predicate); return injector.getInstance(FilterOperator.class); } case FLAT_MAP: { final Function flatMapFunc = (Function) deserializeLambda(functionList.get(0)); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); injector.bindVolatileInstance(Function.class, flatMapFunc); return injector.getInstance(FlatMapOperator.class); } case MAP: { final Function mapFunc = (Function) deserializeLambda(functionList.get(0)); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); injector.bindVolatileInstance(Function.class, mapFunc); return injector.getInstance(MapOperator.class); } case REDUCE_BY_KEY: { cb.bindNamedParameter(KeyIndex.class, iOpInfo.getKeyIndex().toString()); final BiFunction reduceFunc = (BiFunction) deserializeLambda(functionList.get(0)); final Injector injector = Tang.Factory.getTang().newInjector(cb.build()); injector.bindVolatileInstance(BiFunction.class, reduceFunc); return injector.getInstance(ReduceByKeyOperator.class); } case REDUCE_BY_KEY_WINDOW: { throw new IllegalArgumentException("MISTTask: ReduceByKeyWindowOperator is currently not supported!"); } default: { throw new IllegalArgumentException("MISTTask: Invalid InstantOperatorType detected!"); } } }