Class WindowState<T>
- All Implemented Interfaces:
Iterable<Event<T>>,Collection<Event<T>>
A wrapper around the window related states that are checkpointed.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionWindowState(KeyValueState<Long, WindowState.WindowPartition<T>> windowPartitionsState, KeyValueState<String, Deque<Long>> partitionIdsState, KeyValueState<String, Optional<?>> windowSystemState, Supplier<Map<String, Optional<?>>> windowSystemStateSupplier, long maxEventsInMemory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidvoidcommit(long txid) Commits theWindowState.iterator()voidprepareCommit(long txid) Prepares theWindowStatefor commit.voidrollback(boolean reInit) Rolls back theWindowState.intsize()Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
MAX_PARTITION_EVENTS
public static final int MAX_PARTITION_EVENTS- See Also:
-
MIN_PARTITIONS
public static final int MIN_PARTITIONS- See Also:
-
-
Constructor Details
-
WindowState
public WindowState(KeyValueState<Long, WindowState.WindowPartition<T>> windowPartitionsState, KeyValueState<String, Deque<Long>> partitionIdsState, KeyValueState<String, Optional<?>> windowSystemState, Supplier<Map<String, Optional<?>>> windowSystemStateSupplier, long maxEventsInMemory)
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<T>- Overrides:
addin classAbstractCollection<Event<T>>
-
iterator
- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Specified by:
iteratorin classAbstractCollection<Event<T>>
-
clearIteratorPins
public void clearIteratorPins() -
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein classAbstractCollection<Event<T>>
-
prepareCommit
public void prepareCommit(long txid) Prepares theWindowStatefor commit.- Parameters:
txid- the transaction id
-
commit
public void commit(long txid) Commits theWindowState.- Parameters:
txid- the transaction id
-
rollback
public void rollback(boolean reInit) Rolls back theWindowState.- Parameters:
reInit- if the members should be synced with the values from the state.
-