Class TimerHeapInternalTimer<K,N>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.TimerHeapInternalTimer<K,N>
-
- Type Parameters:
K
- Type of the keys to which timers are scoped.N
- Type of the namespace to which timers are scoped.
- All Implemented Interfaces:
HeapPriorityQueueElement
,Keyed<K>
,PriorityComparable<InternalTimer<?,?>>
,InternalTimer<K,N>
@Internal public final class TimerHeapInternalTimer<K,N> extends Object implements InternalTimer<K,N>, HeapPriorityQueueElement
Implementation ofInternalTimer
to use with aHeapPriorityQueueSet
.
-
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.state.heap.HeapPriorityQueueElement
NOT_CONTAINED
-
Fields inherited from interface org.apache.flink.streaming.api.operators.InternalTimer
KEY_EXTRACTOR_FUNCTION, TIMER_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description TimerHeapInternalTimer(long timestamp, K key, N namespace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
comparePriorityTo(InternalTimer<?,?> other)
boolean
equals(Object o)
int
getInternalIndex()
Returns the current index of this object in the internal array ofHeapPriorityQueue
.K
getKey()
Returns the key that is bound to this timer.N
getNamespace()
Returns the namespace that is bound to this timer.long
getTimestamp()
Returns the timestamp of the timer.int
hashCode()
void
setInternalIndex(int newIndex)
Sets the current index of this object in theHeapPriorityQueue
and should only be called by the owningHeapPriorityQueue
.String
toString()
-
-
-
Method Detail
-
getTimestamp
public long getTimestamp()
Description copied from interface:InternalTimer
Returns the timestamp of the timer. This value determines the point in time when the timer will fire.- Specified by:
getTimestamp
in interfaceInternalTimer<K,N>
-
getKey
@Nonnull public K getKey()
Description copied from interface:InternalTimer
Returns the key that is bound to this timer.
-
getNamespace
@Nonnull public N getNamespace()
Description copied from interface:InternalTimer
Returns the namespace that is bound to this timer.- Specified by:
getNamespace
in interfaceInternalTimer<K,N>
-
getInternalIndex
public int getInternalIndex()
Description copied from interface:HeapPriorityQueueElement
Returns the current index of this object in the internal array ofHeapPriorityQueue
.- Specified by:
getInternalIndex
in interfaceHeapPriorityQueueElement
-
setInternalIndex
public void setInternalIndex(int newIndex)
Description copied from interface:HeapPriorityQueueElement
Sets the current index of this object in theHeapPriorityQueue
and should only be called by the owningHeapPriorityQueue
.- Specified by:
setInternalIndex
in interfaceHeapPriorityQueueElement
- Parameters:
newIndex
- the new index in the timer heap.
-
comparePriorityTo
public int comparePriorityTo(@Nonnull InternalTimer<?,?> other)
- Specified by:
comparePriorityTo
in interfacePriorityComparable<K>
-
-