public class ReplicaBuilder extends Object
ReplicaInfo
objects.
The state of the replica is used to determine which object is instantiated.Constructor and Description |
---|
ReplicaBuilder(HdfsServerConstants.ReplicaState state) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hdfs.server.datanode.ReplicaInfo |
build() |
LocalReplicaInPipeline |
buildLocalReplicaInPipeline() |
ReplicaBuilder |
from(org.apache.hadoop.hdfs.server.datanode.ReplicaInfo fromReplica) |
ReplicaBuilder |
setBlock(org.apache.hadoop.hdfs.protocol.Block block) |
ReplicaBuilder |
setBlockId(long blockId) |
ReplicaBuilder |
setBytesToReserve(long bytesToReserve) |
ReplicaBuilder |
setConf(org.apache.hadoop.conf.Configuration conf) |
ReplicaBuilder |
setDirectoryToUse(File dir) |
ReplicaBuilder |
setFileRegion(FileRegion fileRegion) |
ReplicaBuilder |
setFsVolume(FsVolumeSpi volume) |
ReplicaBuilder |
setGenerationStamp(long genStamp) |
ReplicaBuilder |
setLastPartialChunkChecksum(byte[] checksum) |
ReplicaBuilder |
setLength(long length) |
ReplicaBuilder |
setOffset(long offset) |
ReplicaBuilder |
setPathHandle(org.apache.hadoop.fs.PathHandle pathHandle) |
ReplicaBuilder |
setPathPrefix(org.apache.hadoop.fs.Path prefix)
Set the prefix of the
Path associated with the replica. |
ReplicaBuilder |
setPathSuffix(String suffix)
Set the suffix of the
Path associated with the replica. |
ReplicaBuilder |
setRecoveryId(long recoveryId) |
ReplicaBuilder |
setRemoteFS(org.apache.hadoop.fs.FileSystem remoteFS) |
ReplicaBuilder |
setState(HdfsServerConstants.ReplicaState state) |
ReplicaBuilder |
setURI(URI uri) |
ReplicaBuilder |
setWriterThread(Thread writer) |
public ReplicaBuilder(HdfsServerConstants.ReplicaState state)
public ReplicaBuilder setState(HdfsServerConstants.ReplicaState state)
public ReplicaBuilder setBlockId(long blockId)
public ReplicaBuilder setGenerationStamp(long genStamp)
public ReplicaBuilder setLength(long length)
public ReplicaBuilder setFsVolume(FsVolumeSpi volume)
public ReplicaBuilder setDirectoryToUse(File dir)
public ReplicaBuilder setBytesToReserve(long bytesToReserve)
public ReplicaBuilder setWriterThread(Thread writer)
public ReplicaBuilder from(org.apache.hadoop.hdfs.server.datanode.ReplicaInfo fromReplica)
public ReplicaBuilder setRecoveryId(long recoveryId)
public ReplicaBuilder setBlock(org.apache.hadoop.hdfs.protocol.Block block)
public ReplicaBuilder setURI(URI uri)
public ReplicaBuilder setConf(org.apache.hadoop.conf.Configuration conf)
public ReplicaBuilder setOffset(long offset)
public ReplicaBuilder setFileRegion(FileRegion fileRegion)
public ReplicaBuilder setRemoteFS(org.apache.hadoop.fs.FileSystem remoteFS)
public ReplicaBuilder setPathSuffix(String suffix)
Path
associated with the replica.
Intended to be use only for ProvidedReplica
s.suffix
- the path suffix.public ReplicaBuilder setPathPrefix(org.apache.hadoop.fs.Path prefix)
Path
associated with the replica.
Intended to be use only for ProvidedReplica
s.prefix
- the path prefix.public ReplicaBuilder setPathHandle(org.apache.hadoop.fs.PathHandle pathHandle)
public ReplicaBuilder setLastPartialChunkChecksum(byte[] checksum)
public LocalReplicaInPipeline buildLocalReplicaInPipeline() throws IllegalArgumentException
IllegalArgumentException
public org.apache.hadoop.hdfs.server.datanode.ReplicaInfo build() throws IllegalArgumentException
IllegalArgumentException
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.