Class IdempotencyPolicy (2.26.0-rc)

Define the interface for the AsyncClient's idempotency policy.

The idempotency policy controls which requests are treated as idempotent and therefore safe to retry on a transient failure. Retrying non-idempotent operations can result in data loss.

Consider, for example, DeleteObject(). If this operation is called without pre-conditions retrying it may delete more than one version of an object.

Even operations that "add" data can result in data loss. Consider, as another example, inserting a new object. If called without pre-conditions retrying this operation will insert multiple new versions. If the bucket is configured to only keep the last N versions of each object, then the retry would have deleted more data than desired.

Some applications are designed to handle duplicate requests without data loss, or the library may be used in an environment where the risk of data loss due to duplicate requests is negligible or zero.

This policy allows application developers to control the behavior of the library with respect to retrying non-idempotent operations. Application developers can configure the library to only retry operations that are known to be idempotent (that is, they will succeed only once). Application may also configure the library to retry all operations, regardless of whether the operations are idempotent or not.

Functions

virtual ReadObject(google::storage::v2::ReadObjectRequest const &)

Determine if a google.storage.v2.ReadObjectRequest is idempotent.

Parameter
Name Description
google::storage::v2::ReadObjectRequest const &
Returns
Type Description
google::cloud::Idempotency

virtual InsertObject(google::storage::v2::WriteObjectRequest const &)

Determine if a google.storage.v2.WriteObjectRequest for a one-shot upload is idempotent.

Parameter
Name Description
google::storage::v2::WriteObjectRequest const &
Returns
Type Description
google::cloud::Idempotency

virtual WriteObject(google::storage::v2::WriteObjectRequest const &)

Determine if a google.storage.v2.WriteObjectRequest for a resumable upload is idempotent.

Parameter
Name Description
google::storage::v2::WriteObjectRequest const &
Returns
Type Description
google::cloud::Idempotency

virtual ComposeObject(google::storage::v2::ComposeObjectRequest const &)

Determine if a google.storage.v2.ComposeObjectRequest is idempotent.

Parameter
Name Description
google::storage::v2::ComposeObjectRequest const &
Returns
Type Description
google::cloud::Idempotency

virtual DeleteObject(google::storage::v2::DeleteObjectRequest const &)

Determine if a google.storage.v2.DeleteObjectRequest is idempotent.

Parameter
Name Description
google::storage::v2::DeleteObjectRequest const &
Returns
Type Description
google::cloud::Idempotency

virtual RewriteObject(google::storage::v2::RewriteObjectRequest const &)

Determine if a google.storage.v2.RewriteObjectRequest is idempotent.

Parameter
Name Description
google::storage::v2::RewriteObjectRequest const &
Returns
Type Description
google::cloud::Idempotency