Interface FailedElement

All Known Subinterfaces:
BigQueryFailure
All Known Implementing Classes:
FailedMessage, FailedMutation, FailedMutation, FailedRequest, 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 Type
    Method
    Description
    Returns the destination the element was routed to as a stable resource string, for example my-project.my_dataset.my_table or projects/p/topics/t.
    Returns the underlying failure, or null when 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.ByteString
    Returns portable payload bytes for inspection or replay, or null when 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 example my-project.my_dataset.my_table or projects/p/topics/t. A connector may return a stable sentinel such as unresolved when destination resolution itself failed.
    • getPayloadBytes

      @Nullable com.google.protobuf.ByteString getPayloadBytes()
      Returns portable payload bytes for inspection or replay, or null when 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 when getCause() is null, and it is the detail that FailureHandler.failJob() raises and FailureHandler.logAndDrop() logs.
    • getCause

      @Nullable Throwable getCause()
      Returns the underlying failure, or null when none is available.