Package alluxio.job.plan.replicate
Class DefaultReplicationHandler
- java.lang.Object
-
- alluxio.job.plan.replicate.DefaultReplicationHandler
-
- All Implemented Interfaces:
ReplicationHandler
@ThreadSafe public final class DefaultReplicationHandler extends java.lang.Object implements ReplicationHandler
The implementation ofReplicationHandlerthat utilizes job service.
-
-
Constructor Summary
Constructors Constructor Description DefaultReplicationHandler(JobMasterClientPool jobMasterClientPool)Creates a new instance ofDefaultReplicationHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Long>findJobs(java.lang.String jobName, java.util.Set<alluxio.job.wire.Status> status)alluxio.job.wire.StatusgetJobStatus(long jobId)longmigrate(alluxio.AlluxioURI uri, long blockId, java.lang.String workerHost, java.lang.String mediumType)Migrate blocks to the correctly pinned locations.longsetReplica(alluxio.AlluxioURI uri, long blockId, int numReplicas)Set the block replication level by a target number of replicas.
-
-
-
Constructor Detail
-
DefaultReplicationHandler
public DefaultReplicationHandler(JobMasterClientPool jobMasterClientPool)
Creates a new instance ofDefaultReplicationHandler.- Parameters:
jobMasterClientPool- job master client pool
-
-
Method Detail
-
getJobStatus
public alluxio.job.wire.Status getJobStatus(long jobId) throws java.io.IOException- Specified by:
getJobStatusin interfaceReplicationHandler- 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
public java.util.List<java.lang.Long> findJobs(java.lang.String jobName, java.util.Set<alluxio.job.wire.Status> status) throws java.io.IOException- Specified by:
findJobsin interfaceReplicationHandler- Parameters:
jobName- name of the jobstatus- job status- Returns:
- a list of job ids that match the criteria
- Throws:
java.io.IOException- if a non-Alluxio error is encountered
-
setReplica
public long setReplica(alluxio.AlluxioURI uri, long blockId, int numReplicas) throws alluxio.exception.AlluxioException, java.io.IOExceptionDescription copied from interface:ReplicationHandlerSet the block replication level by a target number of replicas.- Specified by:
setReplicain interfaceReplicationHandler- Parameters:
uri- URI of the file the block belongs toblockId- ID of the blocknumReplicas- how many replicas to add- Returns:
- the ID of the replicate job
- Throws:
alluxio.exception.AlluxioException- if an Alluxio error is encounteredjava.io.IOException- if a non-Alluxio error is encountered
-
migrate
public long migrate(alluxio.AlluxioURI uri, long blockId, java.lang.String workerHost, java.lang.String mediumType) throws alluxio.exception.AlluxioException, java.io.IOExceptionDescription copied from interface:ReplicationHandlerMigrate blocks to the correctly pinned locations.- Specified by:
migratein interfaceReplicationHandler- Parameters:
uri- URI of the file the block belongs toblockId- ID of the blockworkerHost- worker host this block is located atmediumType- medium type to migrate this block to- Returns:
- the ID of the replicate job
- Throws:
alluxio.exception.AlluxioException- if an Alluxio error is encounteredjava.io.IOException- if a non-Alluxio error is encountered
-
-