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 class
WindowState.WindowPartition<T>
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_PARTITION_EVENTS
static int
MIN_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 boolean
add(Event<T> event)
void
clearIteratorPins()
void
commit(long txid)
Commits theWindowState
.Iterator<Event<T>>
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 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:
add
in interfaceCollection<T>
- Overrides:
add
in classAbstractCollection<Event<T>>
-
iterator
public Iterator<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.
-
-