@Setup public void setup() { invoker = DoFnInvokers.invokerFor(splittableFn); invoker.invokeSetup(); }
private static boolean isSplittable(DoFn<?, ?> fn) { return DoFnSignatures.signatureForDoFn(fn).processElement().isSplittable(); } }
public void checkArgument(boolean condition, String message, Object... args) { if (!condition) { throwIllegalArgument(message, args); } }
private static Implementation getRestrictionCoderDelegation( TypeDescription doFnType, DoFnSignature signature) { if (signature.processElement().isSplittable()) { if (signature.getRestrictionCoder() == null) { return MethodDelegation.to( new DefaultRestrictionCoder(signature.getInitialRestriction().restrictionT())); } else { return new DowncastingParametersMethodDelegation( doFnType, signature.getRestrictionCoder().targetMethod()); } } else { return ExceptionMethod.throwing(UnsupportedOperationException.class); } }
private DoFn.ProcessContinuation invokeProcessElement(DoFn<String, String> fn) { return DoFnInvokers.invokerFor(fn).invokeProcessElement(mockArgumentProvider); }
static DoFnSignature.ProcessElementMethod analyzeProcessElementMethod(AnonymousMethod method) throws Exception { return DoFnSignatures.analyzeProcessElementMethod( errors(), TypeDescriptor.of(FakeDoFn.class), method.getMethod(), TypeDescriptor.of(Integer.class), TypeDescriptor.of(String.class), FnAnalysisContext.create()); } }
private static Implementation splitRestrictionDelegation( TypeDescription doFnType, DoFnSignature signature) { if (signature.splitRestriction() == null) { return MethodDelegation.to(DefaultSplitRestriction.class); } else { return new DowncastingParametersMethodDelegation( doFnType, signature.splitRestriction().targetMethod()); } }
private void invokeOnTimer(DoFn<String, String> fn, String timerId) { OnTimerInvokers.forTimer(fn, timerId).invokeOnTimer(mockArgumentProvider); }
public void addTimerDeclarations(Iterable<TimerDeclaration> decls) { for (TimerDeclaration decl : decls) { addTimerDeclaration(decl); } }
@Override public void open(Configuration parameters) throws Exception { doFnInvoker = DoFnInvokers.invokerFor(doFn); doFnInvoker.invokeSetup(); }
public void checkNotNull(Object value, String message, Object... args) { if (value == null) { throwIllegalArgument(message, args); } } }
@Setup public void setup() { DoFnInvokers.invokerFor(underlyingDoFn).invokeSetup(); }
@Setup public void setup() throws Exception { invoker = DoFnInvokers.invokerFor(fn); invoker.invokeSetup(); }
@Override public void open(Configuration parameters) throws Exception { doFnInvoker = DoFnInvokers.invokerFor(dofn); doFnInvoker.invokeSetup(); }
@Override public void open(Configuration parameters) throws Exception { doFnInvoker = DoFnInvokers.invokerFor(dofn); doFnInvoker.invokeSetup(); }
@Setup public void setup() { invoker = DoFnInvokers.invokerFor(fn); invoker.invokeSetup(); }
@Override public void open(Configuration parameters) throws Exception { doFnInvoker = DoFnInvokers.invokerFor(doFn); doFnInvoker.invokeSetup(); }
@Setup public void setup() { this.invoker = DoFnInvokers.invokerFor(fn); invoker.invokeSetup(); }
@Override public void open(Configuration parameters) throws Exception { doFnInvoker = DoFnInvokers.invokerFor(dofn); doFnInvoker.invokeSetup(); }
@Override public void open(Configuration parameters) throws Exception { doFnInvoker = DoFnInvokers.invokerFor(doFn); doFnInvoker.invokeSetup(); }