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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorDescriptionWindowState
(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 TypeMethodDescriptionboolean
void
void
commit
(long txid) Commits theWindowState
.iterator()
void
prepareCommit
(long txid) Prepares theWindowState
for commit.void
rollback
(boolean reInit) Rolls back theWindowState
.int
size()
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
add
in interfaceCollection<T>
- Overrides:
add
in classAbstractCollection<Event<T>>
-
iterator
- Specified by:
iterator
in interfaceCollection<T>
- Specified by:
iterator
in interfaceIterable<T>
- Specified by:
iterator
in classAbstractCollection<Event<T>>
-
clearIteratorPins
public void clearIteratorPins() -
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in classAbstractCollection<Event<T>>
-
prepareCommit
public void prepareCommit(long txid) Prepares theWindowState
for 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.
-