V - Type of the valuespublic class SharedBuffer<V> extends Object
The idea of the implementation is to have a buffer for incoming events with unique ids assigned to them. This way we do not need to deserialize events during processing and we store only one copy of the event.
The entries in SharedBuffer are SharedBufferNode. The shared buffer node
allows to store relations between different entries. A dewey versioning scheme allows to
discriminate between different relations (e.g. preceding element).
The implementation is strongly based on the paper "Efficient Pattern Matching over Event Streams".
| 构造器和说明 |
|---|
SharedBuffer(org.apache.flink.api.common.state.KeyedStateStore stateStore,
org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer) |
SharedBuffer(org.apache.flink.api.common.state.KeyedStateStore stateStore,
org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer,
SharedBufferCacheConfig cacheConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
SharedBufferAccessor<V> |
getAccessor()
Construct an accessor to deal with this sharedBuffer.
|
int |
getEventsBufferCacheSize() |
int |
getEventsBufferSize() |
int |
getSharedBufferNodeCacheSize() |
int |
getSharedBufferNodeSize() |
boolean |
isEmpty()
Checks if there is no elements in the buffer.
|
void |
migrateOldState(org.apache.flink.runtime.state.KeyedStateBackend<?> stateBackend,
org.apache.flink.api.common.state.ValueState<NFAState> computationStates) |
void |
releaseCacheStatisticsTimer() |
@VisibleForTesting
public SharedBuffer(org.apache.flink.api.common.state.KeyedStateStore stateStore,
org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
public SharedBuffer(org.apache.flink.api.common.state.KeyedStateStore stateStore,
org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer,
SharedBufferCacheConfig cacheConfig)
public void migrateOldState(org.apache.flink.runtime.state.KeyedStateBackend<?> stateBackend,
org.apache.flink.api.common.state.ValueState<NFAState> computationStates)
throws Exception
Exceptionpublic SharedBufferAccessor<V> getAccessor()
public boolean isEmpty()
throws Exception
Exception - Thrown if the system cannot access the state.public void releaseCacheStatisticsTimer()
@VisibleForTesting public int getEventsBufferCacheSize()
@VisibleForTesting
public int getEventsBufferSize()
throws Exception
Exception@VisibleForTesting
public int getSharedBufferNodeSize()
throws Exception
ExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.