/** @deprecated use {@link StateSpec#bind} method via {@link #getSpec} for now. */ @Override @Deprecated public StateT bind(StateTag.StateBinder binder) { return spec.bind(this.id.getRawId(), adaptTagBinder(binder)); }
private static void finishSpecifyingStateSpecs( DoFn<?, ?> fn, CoderRegistry coderRegistry, Coder<?> inputCoder) { DoFnSignature signature = DoFnSignatures.getSignature(fn.getClass()); Map<String, DoFnSignature.StateDeclaration> stateDeclarations = signature.stateDeclarations(); for (DoFnSignature.StateDeclaration stateDeclaration : stateDeclarations.values()) { try { StateSpec<?> stateSpec = (StateSpec<?>) stateDeclaration.field().get(fn); stateSpec.offerCoders(codersForStateSpecTypes(stateDeclaration, coderRegistry, inputCoder)); stateSpec.finishSpecifying(); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } }
final RunnerApi.StateSpec.Builder builder = RunnerApi.StateSpec.newBuilder(); return stateSpec.match( new StateSpec.Cases<RunnerApi.StateSpec>() { @Override
@Override public <T extends State> T state( StateNamespace namespace, StateTag<T> address, StateContext<?> context) { return address .getSpec() .bind( address.getId(), new FlinkStateBinder(namespace, context, flinkStateBackend, watermarkHolds)); }
@Override public <T extends State> T state( StateNamespace namespace, StateTag<T> address, StateContext<?> context) { return address .getSpec() .bind( address.getId(), new FlinkStateBinder(namespace, context, flinkStateBackend, watermarkHolds)); }