Class WindowState<T>
- java.lang.Object
-
- java.util.AbstractCollection<Event<T>>
-
- org.apache.storm.windowing.persistence.WindowState<T>
-
- All Implemented Interfaces:
Iterable<Event<T>>,Collection<Event<T>>
public class WindowState<T> extends AbstractCollection<Event<T>>
A wrapper around the window related states that are checkpointed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWindowState.WindowPartition<T>
-
Field Summary
Fields Modifier and Type Field Description static intMAX_PARTITION_EVENTSstatic intMIN_PARTITIONS
-
Constructor Summary
Constructors Constructor Description WindowState(KeyValueState<Long,WindowState.WindowPartition<T>> windowPartitionsState, KeyValueState<String,Deque<Long>> partitionIdsState, KeyValueState<String,Optional<?>> windowSystemState, Supplier<Map<String,Optional<?>>> windowSystemStateSupplier, long maxEventsInMemory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Event<T> event)voidclearIteratorPins()voidcommit(long txid)Commits theWindowState.Iterator<Event<T>>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, 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 Detail
-
MAX_PARTITION_EVENTS
public static final int MAX_PARTITION_EVENTS
- See Also:
- Constant Field Values
-
MIN_PARTITIONS
public static final int MIN_PARTITIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
add
public boolean add(Event<T> event)
- Specified by:
addin interfaceCollection<T>- Overrides:
addin classAbstractCollection<Event<T>>
-
iterator
public Iterator<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.
-
-