Class StorageTransportHandler
- java.lang.Object
-
- org.apache.cassandra.spark.transports.storage.extensions.StorageTransportHandler
-
- All Implemented Interfaces:
CredentialChangeListener,ObjectFailureListener
public class StorageTransportHandler extends java.lang.Object implements CredentialChangeListener, ObjectFailureListener
-
-
Constructor Summary
Constructors Constructor Description StorageTransportHandler(TransportContext.CloudStorageTransportContext transportContext, JobInfo jobInfo, java.util.function.Consumer<CancelJobEvent> cancelConsumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonCredentialsChanged(java.lang.String jobId, java.lang.String clusterId, StorageCredentialPair newCredentials)The method is called when new access tokens are available for the job with IDjobIdin the cluster ofclusterId.voidonObjectFailed(java.lang.String jobId, java.lang.String bucket, java.lang.String key, java.lang.String errorMessage)Method to call when an unrecoverable error has been encountered for the givenjobId,objectURI, witherrorMessage.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.spark.transports.storage.extensions.CredentialChangeListener
onCredentialsChanged
-
-
-
-
Constructor Detail
-
StorageTransportHandler
public StorageTransportHandler(TransportContext.CloudStorageTransportContext transportContext, JobInfo jobInfo, java.util.function.Consumer<CancelJobEvent> cancelConsumer)
-
-
Method Detail
-
onCredentialsChanged
public void onCredentialsChanged(java.lang.String jobId, @Nullable java.lang.String clusterId, StorageCredentialPair newCredentials)Description copied from interface:CredentialChangeListenerThe method is called when new access tokens are available for the job with IDjobIdin the cluster ofclusterId. The previous set of credentials and the newly-provided set must both be valid simultaneously for the Spark job to have time to rotate credentials without interruption. These tokens should be provided with plenty of time for the job to distribute them to the consumers of the storage transport endpoint to update their tokens before expiration.- Specified by:
onCredentialsChangedin interfaceCredentialChangeListener- Parameters:
jobId- the unique identifier for the jobclusterId- the unique identifier for the cluster. When its value is null, it behaves the same asCredentialChangeListener.onCredentialsChanged(String, StorageCredentialPair)newCredentials- a map of access tokens used to authenticate to the storage transport
-
onObjectFailed
public void onObjectFailed(java.lang.String jobId, java.lang.String bucket, java.lang.String key, java.lang.String errorMessage)Description copied from interface:ObjectFailureListenerMethod to call when an unrecoverable error has been encountered for the givenjobId,objectURI, witherrorMessage.- Specified by:
onObjectFailedin interfaceObjectFailureListener- Parameters:
jobId- the unique identifier for the job. It could be customer-supplied or self-generated (when not supplied)bucket- the object storage bucketkey- the key in the object storageerrorMessage- a description of the error
-
-