Class TaskQueueCircuitBreaker
java.lang.Object
io.openlineage.client.circuitBreaker.TaskQueueCircuitBreaker
- All Implemented Interfaces:
CircuitBreaker
Queues every openlineage task for execution by a bounded threadpool to prevent creation of too
many threads (unlike cachedthreadpool) and resulting impact on the spark job. Once queued, the
circuit breaker waits for some configured time for the task to finish execution in an effort to
preserve the ordering of completion of tasks. If queue is full, it gives up on the task. An
explicit close() that need to be called after the application end event is processed shuts it
down after waiting for a while (configurable) to finish pending tasks. Also the circuit breaker
maintains the count of rejected, canceled tasks, or submission timeouts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from interface io.openlineage.client.circuitBreaker.CircuitBreaker
CIRCUIT_CHECK_INTERVAL_IN_MILLIS
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TASK_QUEUE_METRIC_PREFIX
- See Also:
-
DROPPED_METRIC
- See Also:
-
TIMED_OUT_METRIC
- See Also:
-
FAILED_METRIC
- See Also:
-
-
Constructor Details
-
TaskQueueCircuitBreaker
-
-
Method Details
-
currentState
- Specified by:
currentState
in interfaceCircuitBreaker
-
run
- Specified by:
run
in interfaceCircuitBreaker
- Type Parameters:
T
- callable generic type- Parameters:
callable
- The callable to be run- Returns:
- result of callable
-
getPendingTasks
public int getPendingTasks() -
getCheckIntervalMillis
public int getCheckIntervalMillis()- Specified by:
getCheckIntervalMillis
in interfaceCircuitBreaker
-
close
public void close()- Specified by:
close
in interfaceCircuitBreaker
-