Class DefaultFailureHandlerContext
java.lang.Object
io.github.flink.gcp.connector.base.failure.DefaultFailureHandlerContext
- All Implemented Interfaces:
FailureHandlerContext
@Internal
public final class DefaultFailureHandlerContext
extends Object
implements FailureHandlerContext
The
FailureHandlerContext the sinks build from their WriterInitContext.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFailureHandlerContext(int subtaskIndex, org.apache.flink.metrics.MetricGroup metricGroup) Creates a context. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.metrics.MetricGroupReturns the sink writer's metric group, for handler-registered counters and gauges.intReturns the index of the sink writer subtask driving the handler.static DefaultFailureHandlerContextof(org.apache.flink.api.connector.sink2.WriterInitContext context) Creates the context a sink passes toFailureHandler.open(io.github.flink.gcp.connector.base.failure.FailureHandlerContext)when creating its writer.
-
Constructor Details
-
DefaultFailureHandlerContext
public DefaultFailureHandlerContext(int subtaskIndex, org.apache.flink.metrics.MetricGroup metricGroup) Creates a context.- Parameters:
subtaskIndex- the sink writer's subtask indexmetricGroup- the sink writer's metric group
-
-
Method Details
-
of
public static DefaultFailureHandlerContext of(org.apache.flink.api.connector.sink2.WriterInitContext context) Creates the context a sink passes toFailureHandler.open(io.github.flink.gcp.connector.base.failure.FailureHandlerContext)when creating its writer.- Parameters:
context- the writer init context- Returns:
- the failure-handler context
-
getSubtaskIndex
public int getSubtaskIndex()Description copied from interface:FailureHandlerContextReturns the index of the sink writer subtask driving the handler.- Specified by:
getSubtaskIndexin interfaceFailureHandlerContext
-
getMetricGroup
public org.apache.flink.metrics.MetricGroup getMetricGroup()Description copied from interface:FailureHandlerContextReturns the sink writer's metric group, for handler-registered counters and gauges.- Specified by:
getMetricGroupin interfaceFailureHandlerContext
-