Class SharedBuffer<V>
java.lang.Object
org.apache.flink.cep.nfa.sharedbuffer.SharedBuffer<V>
- Type Parameters:
V- Type of the values
A shared buffer implementation which stores values under according state. Additionally, the
values can be versioned such that it is possible to retrieve their predecessor element in the
buffer.
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".
-
Constructor Summary
ConstructorsConstructorDescriptionSharedBuffer(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) -
Method Summary
Modifier and TypeMethodDescriptionConstruct an accessor to deal with this sharedBuffer.intintintintbooleanisEmpty()Checks if there is no elements in the buffer.void
-
Constructor Details
-
SharedBuffer
@VisibleForTesting public SharedBuffer(org.apache.flink.api.common.state.KeyedStateStore stateStore, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
-
-
Method Details
-
getAccessor
Construct an accessor to deal with this sharedBuffer.- Returns:
- an accessor to deal with this sharedBuffer.
-
isEmpty
Checks if there is no elements in the buffer.- Returns:
- true if there is no elements in the buffer
- Throws:
Exception- Thrown if the system cannot access the state.
-
releaseCacheStatisticsTimer
public void releaseCacheStatisticsTimer() -
getEventsBufferCacheSize
@VisibleForTesting public int getEventsBufferCacheSize() -
getEventsBufferSize
- Throws:
Exception
-