Class CoordinatedImportCoordinator

  • All Implemented Interfaces:
    ImportCoordinator, CoordinationSignalListener

    public class CoordinatedImportCoordinator
    extends java.lang.Object
    implements ImportCoordinator, CoordinationSignalListener
    Import coordinator that implements the two phase import for coordinated write. 1. It waits for the stageReady signal from StorageTransportExtension and update the restore job status on all clusters to STAGE_READY 2. It, then, polls the stage progress of each cluster and notifies StorageTransportExtension on completion 3. It waits for the applyReady signal from StorageTransportExtension and update the restore job status on all clusters to APPLY_READY 4. It polls the apply/import progress of each cluster 5. Finally, the two phase import completes. The procedure is programed in awaitInternal()
    • Method Detail

      • succeeded

        public boolean succeeded()
        Description copied from interface: ImportCoordinator
        Check whether the import operation has succeeded. The method does not block.
        Specified by:
        succeeded in interface ImportCoordinator
        Returns:
        true if import has succeeded. When import is pending or failed, it returns false
      • failure

        public org.apache.cassandra.spark.exception.ImportFailedException failure()
        Description copied from interface: ImportCoordinator
        Check whether the import operation has failed. The method does not block.
        Specified by:
        failure in interface ImportCoordinator
        Returns:
        ImportFailedException if import has failed; null otherwise
      • await

        public void await()
                   throws org.apache.cassandra.spark.exception.ImportFailedException
        Description copied from interface: ImportCoordinator
        Wait indefinitely for the import operation to complete
        Specified by:
        await in interface ImportCoordinator
        Throws:
        org.apache.cassandra.spark.exception.ImportFailedException - import failure if failed
      • onStageReady

        public void onStageReady​(java.lang.String jobId)
        Description copied from interface: CoordinationSignalListener
        The method is called when the write coordinator, i.e. implementation of CoordinatedTransportExtension, decides that it is ready to stage SSTable bundles on all participating clusters.
        Specified by:
        onStageReady in interface CoordinationSignalListener
        Parameters:
        jobId - the unique identifier for the job
      • onImportReady

        public void onImportReady​(java.lang.String jobId)
        Description copied from interface: CoordinationSignalListener
        The method is called when the write coordinator, i.e. implementation of CoordinatedTransportExtension, decides that it is ready to apply/import SSTables on all participating clusters.
        Specified by:
        onImportReady in interface CoordinationSignalListener
        Parameters:
        jobId - the unique identifier for the job