@ThreadSafe public final class DefaultReplicationHandler extends Object implements ReplicationHandler
ReplicationHandler
that utilizes job service.Constructor and Description |
---|
DefaultReplicationHandler(JobMasterClientPool jobMasterClientPool)
Creates a new instance of
DefaultReplicationHandler . |
Modifier and Type | Method and Description |
---|---|
long |
evict(AlluxioURI uri,
long blockId,
int numReplicas)
Decreases the block replication level by a target number of replicas.
|
List<Long> |
findJobs(String jobName,
Set<Status> status) |
Status |
getJobStatus(long jobId) |
long |
migrate(AlluxioURI uri,
long blockId,
String workerHost,
String mediumType)
Migrate blocks to the correctly pinned locations.
|
long |
replicate(AlluxioURI uri,
long blockId,
int numReplicas)
Increases the block replication level by a target number of replicas.
|
public DefaultReplicationHandler(JobMasterClientPool jobMasterClientPool)
DefaultReplicationHandler
.jobMasterClientPool
- job master client poolpublic Status getJobStatus(long jobId) throws IOException
getJobStatus
in interface ReplicationHandler
jobId
- the job id returned by evict, replicate, or migrateIOException
- if a non-Alluxio error is encounteredpublic List<Long> findJobs(String jobName, Set<Status> status) throws IOException
findJobs
in interface ReplicationHandler
jobName
- name of the jobstatus
- job statusIOException
- if a non-Alluxio error is encounteredpublic long evict(AlluxioURI uri, long blockId, int numReplicas) throws AlluxioException, IOException
ReplicationHandler
evict
in interface ReplicationHandler
uri
- URI of the file the block belongs toblockId
- ID of the blocknumReplicas
- how many replicas to removeAlluxioException
- if an Alluxio error is encounteredIOException
- if a non-Alluxio error is encounteredpublic long replicate(AlluxioURI uri, long blockId, int numReplicas) throws AlluxioException, IOException
ReplicationHandler
replicate
in interface ReplicationHandler
uri
- URI of the file the block belongs toblockId
- ID of the blocknumReplicas
- how many replicas to addAlluxioException
- if an Alluxio error is encounteredIOException
- if a non-Alluxio error is encounteredpublic long migrate(AlluxioURI uri, long blockId, String workerHost, String mediumType) throws AlluxioException, IOException
ReplicationHandler
migrate
in interface ReplicationHandler
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 toAlluxioException
- if an Alluxio error is encounteredIOException
- if a non-Alluxio error is encounteredCopyright © 2023. All Rights Reserved.