Class ImportCompletionCoordinator

  • All Implemented Interfaces:
    ImportCoordinator

    public final class ImportCompletionCoordinator
    extends java.lang.Object
    implements ImportCoordinator
    Import coordinator that wait for import of all slices to complete. 1. It queries all relevant sidecar instance to learned whether slices are imported or not 2. It aggregates the results locally to determine whether consistency level has been satisfied or not. The procedure is programed in await()
    • 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
        Block for the imports to complete by invoking the CreateRestoreJobSlice call to the server. The method passes when the successful import can satisfy the configured consistency level; otherwise, the method fails. The wait is indefinite until one of the following conditions is met, 1) _all_ slices have been checked, or 2) the spark job reaches to its completion timeout 3) At least one slice fails CL validation, as the job will eventually fail in this case. this means that some slices may never be processed by this loop

        When there is a slice failed on CL validation and there are remaining slices to check, the wait continues.

        Specified by:
        await in interface ImportCoordinator
        Throws:
        org.apache.cassandra.spark.exception.ImportFailedException - import failure if failed