Interface ReplicationHandler

  • All Known Implementing Classes:
    DefaultReplicationHandler

    public interface ReplicationHandler
    Interface for adjusting the replication level of blocks.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Long> findJobs​(java.lang.String jobName, java.util.Set<alluxio.job.wire.Status> statusList)  
      alluxio.job.wire.Status getJobStatus​(long jobId)  
      long migrate​(alluxio.AlluxioURI uri, long blockId, java.lang.String workerHost, java.lang.String mediumType)
      Migrate blocks to the correctly pinned locations.
      long setReplica​(alluxio.AlluxioURI uri, long blockId, int numReplicas)
      Set the block replication level by a target number of replicas.
    • Method Detail

      • getJobStatus

        alluxio.job.wire.Status getJobStatus​(long jobId)
                                      throws java.io.IOException
        Parameters:
        jobId - the job id returned by evict, replicate, or migrate
        Returns:
        the job status (running, completed, failed, etc.)
        Throws:
        java.io.IOException - if a non-Alluxio error is encountered
      • findJobs

        java.util.List<java.lang.Long> findJobs​(java.lang.String jobName,
                                                java.util.Set<alluxio.job.wire.Status> statusList)
                                         throws java.io.IOException
        Parameters:
        jobName - name of the job
        statusList - job status
        Returns:
        a list of job ids that match the criteria
        Throws:
        java.io.IOException - if a non-Alluxio error is encountered
      • setReplica

        long setReplica​(alluxio.AlluxioURI uri,
                        long blockId,
                        int numReplicas)
                 throws alluxio.exception.AlluxioException,
                        java.io.IOException
        Set the block replication level by a target number of replicas.
        Parameters:
        uri - URI of the file the block belongs to
        blockId - ID of the block
        numReplicas - how many replicas to add
        Returns:
        the ID of the replicate job
        Throws:
        alluxio.exception.AlluxioException - if an Alluxio error is encountered
        java.io.IOException - if a non-Alluxio error is encountered
      • migrate

        long migrate​(alluxio.AlluxioURI uri,
                     long blockId,
                     java.lang.String workerHost,
                     java.lang.String mediumType)
              throws alluxio.exception.AlluxioException,
                     java.io.IOException
        Migrate blocks to the correctly pinned locations.
        Parameters:
        uri - URI of the file the block belongs to
        blockId - ID of the block
        workerHost - worker host this block is located at
        mediumType - medium type to migrate this block to
        Returns:
        the ID of the replicate job
        Throws:
        alluxio.exception.AlluxioException - if an Alluxio error is encountered
        java.io.IOException - if a non-Alluxio error is encountered