private void checkTimerServiceInitialization() { if (getKeyedStateBackend() == null) { throw new UnsupportedOperationException("Timers can only be used on keyed operators."); } else if (timeServiceManager == null) { throw new RuntimeException("The timer service has not been initialized."); } }
public <N> int numKeyedStateEntries(N namespace) { AbstractStreamOperator<?> abstractStreamOperator = (AbstractStreamOperator<?>) operator; KeyedStateBackend<Object> keyedStateBackend = abstractStreamOperator.getKeyedStateBackend(); if (keyedStateBackend instanceof HeapKeyedStateBackend) { return ((HeapKeyedStateBackend) keyedStateBackend).numKeyValueStateEntries(namespace); } else { throw new UnsupportedOperationException(); } } }
public int numKeyedStateEntries() { AbstractStreamOperator<?> abstractStreamOperator = (AbstractStreamOperator<?>) operator; KeyedStateBackend<Object> keyedStateBackend = abstractStreamOperator.getKeyedStateBackend(); if (keyedStateBackend instanceof HeapKeyedStateBackend) { return ((HeapKeyedStateBackend) keyedStateBackend).numKeyValueStateEntries(); } else { throw new UnsupportedOperationException(); } } }
public int numKeyedStateEntries() { AbstractStreamOperator<?> abstractStreamOperator = (AbstractStreamOperator<?>) operator; KeyedStateBackend<Object> keyedStateBackend = abstractStreamOperator.getKeyedStateBackend(); if (keyedStateBackend instanceof HeapKeyedStateBackend) { return ((HeapKeyedStateBackend) keyedStateBackend).numKeyValueStateEntries(); } else { throw new UnsupportedOperationException(); } }
KeyedStateBackend<K> keyedStateBackend = getKeyedStateBackend(); TypeSerializer<K> keySerializer = keyedStateBackend.getKeySerializer(); InternalTimeServiceManager<K> keyedTimeServiceHandler = (InternalTimeServiceManager<K>) timeServiceManager;
final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();
private void checkTimerServiceInitialization() { if (getKeyedStateBackend() == null) { throw new UnsupportedOperationException("Timers can only be used on keyed operators."); } else if (timeServiceManager == null) { throw new RuntimeException("The timer service has not been initialized."); } }
private void checkTimerServiceInitialization() { if (getKeyedStateBackend() == null) { throw new UnsupportedOperationException("Timers can only be used on keyed operators."); } else if (timeServiceManager == null) { throw new RuntimeException("The timer service has not been initialized."); } }
private void checkTimerServiceInitialization() { if (getKeyedStateBackend() == null) { throw new UnsupportedOperationException("Timers can only be used on keyed operators."); } else if (timeServiceManager == null) { throw new RuntimeException("The timer service has not been initialized."); } }
TypeSerializer<K> keySerializer = (TypeSerializer<K>) getKeyedStateBackend().getKeySerializer(); InternalTimeServiceManager<K, N> keyedTimeServiceHandler = (InternalTimeServiceManager<K, N>) timeServiceManager; return keyedTimeServiceHandler.getInternalTimerService(name, keySerializer, namespaceSerializer, triggerable);
/** * Stream operators with state which can be restored need to override this hook method. * * @param context context that allows to register different states. */ public void initializeState(StateInitializationContext context) throws Exception { if (getKeyedStateBackend() != null) { KeyGroupsList localKeyGroupRange = getKeyedStateBackend().getKeyGroupRange(); // and then initialize the timer services for (KeyGroupStatePartitionStreamProvider streamProvider : context.getRawKeyedStateInputs()) { int keyGroupIdx = streamProvider.getKeyGroupId(); checkArgument(localKeyGroupRange.contains(keyGroupIdx), "Key Group " + keyGroupIdx + " does not belong to the local range."); timeServiceManager.restoreStateForKeyGroup( new DataInputViewStreamWrapper(streamProvider.getStream()), keyGroupIdx, getUserCodeClassloader()); } } }
if (getKeyedStateBackend() != null) { KeyedStateCheckpointOutputStream out;
KeyedStateBackend<K> keyedStateBackend = getKeyedStateBackend(); TypeSerializer<K> keySerializer = keyedStateBackend.getKeySerializer(); InternalTimeServiceManager<K> keyedTimeServiceHandler = (InternalTimeServiceManager<K>) timeServiceManager;
KeyedStateBackend<K> keyedStateBackend = getKeyedStateBackend(); TypeSerializer<K> keySerializer = keyedStateBackend.getKeySerializer(); InternalTimeServiceManager<K> keyedTimeServiceHandler = (InternalTimeServiceManager<K>) timeServiceManager;
if (getKeyedStateBackend() != null && timeServiceManager == null) { timeServiceManager = new InternalTimeServiceManager<>( getKeyedStateBackend().getNumberOfKeyGroups(), getKeyedStateBackend().getKeyGroupRange(), this, getRuntimeContext().getProcessingTimeService()); operatorStateHandlesRaw = stateHandles.getRawOperatorState(); if (null != getKeyedStateBackend()) {
final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();
final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();