Search in sources :

Example 1 with InternalPriorityQueue

use of org.apache.flink.runtime.state.InternalPriorityQueue in project beam by apache.

the class Workarounds method retrieveInternalProcessingTimerQueue.

@SuppressWarnings("all")
public static InternalPriorityQueue<InternalTimer<Object, TimerInternals.TimerData>> retrieveInternalProcessingTimerQueue(InternalTimerService<TimerInternals.TimerData> timerService) {
    Field internalProcessingTimerQueue = null;
    try {
        internalProcessingTimerQueue = InternalTimerServiceImpl.class.getDeclaredField("processingTimeTimersQueue");
        internalProcessingTimerQueue.setAccessible(true);
        return (InternalPriorityQueue) internalProcessingTimerQueue.get(timerService);
    } catch (Exception e) {
        throw new IllegalStateException("Failed to retrieve processing timer queue.", e);
    } finally {
        if (internalProcessingTimerQueue != null) {
            internalProcessingTimerQueue.setAccessible(false);
        }
    }
}
Also used : Field(java.lang.reflect.Field) InternalPriorityQueue(org.apache.flink.runtime.state.InternalPriorityQueue) InternalTimerServiceImpl(org.apache.flink.streaming.api.operators.InternalTimerServiceImpl)

Aggregations

Field (java.lang.reflect.Field)1 InternalPriorityQueue (org.apache.flink.runtime.state.InternalPriorityQueue)1 InternalTimerServiceImpl (org.apache.flink.streaming.api.operators.InternalTimerServiceImpl)1