Interface FailedElement
- All Known Subinterfaces:
BigQueryFailure
- All Known Implementing Classes:
FailedMessage,FailedMutation,FailedMutation,FailedRow,FailedTask,UnroutableRecord
@Public
public interface FailedElement
An element that terminally failed to be written by one of this project's sinks — the read-only
contract every connector's concrete failure type implements, and the view a cross-connector
DeadLetterQueue sees.
Carries portable payload bytes chosen by the concrete failure type. A sink-created failure normally carries the serialized service request because the original record may no longer exist when an asynchronous failure arrives; a failure created during destination resolution can carry resolver-supplied bytes instead. Connector-specific detail beyond this contract (a typed destination, the full request proto) lives on the concrete type.
Failures reach handlers on the task thread and are not serializable. Depending on the connector contract, the sink or a user-supplied resolver may create the concrete instance.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the destination the element was routed to as a stable resource string, for examplemy-project.my_dataset.my_tableorprojects/p/topics/t.getCause()Returns the underlying failure, ornullwhen none is available.Returns the connector that produced the failure, as a lower-case identifier ("bigquery","bigtable","cloudtasks","pubsub","spanner") — stable, so dead-letter consumers can key on it.Returns the failure description.com.google.protobuf.ByteStringReturns portable payload bytes for inspection or replay, ornullwhen no payload was available.
-
Method Details
-
getConnector
String getConnector()Returns the connector that produced the failure, as a lower-case identifier ("bigquery","bigtable","cloudtasks","pubsub","spanner") — stable, so dead-letter consumers can key on it. -
describeDestination
String describeDestination()Returns the destination the element was routed to as a stable resource string, for examplemy-project.my_dataset.my_tableorprojects/p/topics/t. A connector may return a stable sentinel such asunresolvedwhen destination resolution itself failed. -
getPayloadBytes
@Nullable com.google.protobuf.ByteString getPayloadBytes()Returns portable payload bytes for inspection or replay, ornullwhen no payload was available. The concrete failure type defines whether these are a serialized service request or record bytes supplied at an earlier boundary. -
getErrorMessage
String getErrorMessage()Returns the failure description. It is always present, even whengetCause()isnull, and it is the detail thatFailureHandler.failJob()raises andFailureHandler.logAndDrop()logs. -
getCause
Returns the underlying failure, ornullwhen none is available.
-