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".
Constructor and Description |
---|
SharedBuffer(KeyedStateStore stateStore,
TypeSerializer<V> valueSerializer) |
SharedBuffer(KeyedStateStore stateStore,
TypeSerializer<V> valueSerializer,
SharedBufferCacheConfig cacheConfig) |
Modifier and Type | Method and Description |
---|---|
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(KeyedStateBackend<?> stateBackend,
ValueState<NFAState> computationStates) |
void |
releaseCacheStatisticsTimer() |
@VisibleForTesting public SharedBuffer(KeyedStateStore stateStore, TypeSerializer<V> valueSerializer)
public SharedBuffer(KeyedStateStore stateStore, TypeSerializer<V> valueSerializer, SharedBufferCacheConfig cacheConfig)
public void migrateOldState(KeyedStateBackend<?> stateBackend, ValueState<NFAState> computationStates) throws Exception
Exception
public 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
Exception
@VisibleForTesting public int getSharedBufferNodeCacheSize() throws Exception
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.