public final class PersistedStateRegistry
extends java.lang.Object
PersistedStateRegistry can be used to register persisted state, such as a PersistedValue or PersistedTable, etc. All state that is registered via this registry is
persisted and maintained by the system for fault-tolerance.
Created state registries must be bound to the system by using the Persisted
annotation. Please see the class-level Javadoc of StatefulFunction for an example on how
to do that.
StatefulFunction| Constructor and Description |
|---|
PersistedStateRegistry() |
| Modifier and Type | Method and Description |
|---|---|
<E> void |
registerAppendingBuffer(PersistedAppendingBuffer<E> bufferState)
Registers a
PersistedAppendingBuffer. |
void |
registerRemoteValue(RemotePersistedValue remoteValueState)
Registers a
RemotePersistedValue. |
<K,V> void |
registerTable(PersistedTable<K,V> tableState)
Registers a
PersistedTable. |
<T> void |
registerValue(PersistedValue<T> valueState)
Registers a
PersistedValue. |
public <T> void registerValue(PersistedValue<T> valueState)
PersistedValue. If a registered state already exists for the specified name
of the value, the registration fails.T - the type of the value.valueState - the value state to register.java.lang.IllegalStateException - if a previous registration exists for the given state name.public <K,V> void registerTable(PersistedTable<K,V> tableState)
PersistedTable. If a registered state already exists for the specified name
of the table, the registration fails.K - the type of the keys.V - the type of the values.tableState - the table state to register.java.lang.IllegalStateException - if a previous registration exists for the given state name.public <E> void registerAppendingBuffer(PersistedAppendingBuffer<E> bufferState)
PersistedAppendingBuffer. If a registered state already exists for the
specified name of the table, the registration fails.E - the type of the buffer elements.bufferState - the appending buffer to register.java.lang.IllegalStateException - if a previous registration exists for the given state name.@ForRuntime public void registerRemoteValue(RemotePersistedValue remoteValueState)
RemotePersistedValue. If a registered state already exists for the
specified name of the table, the registration fails.
This method is intended only for internal use by the runtime.
remoteValueState - the remote value to register.java.lang.IllegalStateException - if a previous registration exists for the given state name.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.