Class FinalizedProvidedReplica
java.lang.Object
org.apache.hadoop.hdfs.protocol.Block
org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
org.apache.hadoop.hdfs.server.datanode.ProvidedReplica
org.apache.hadoop.hdfs.server.datanode.FinalizedProvidedReplica
- All Implemented Interfaces:
Comparable<org.apache.hadoop.hdfs.protocol.Block>,Replica,org.apache.hadoop.io.Writable,org.apache.hadoop.util.LightWeightGSet.LinkedElement
This class is used for provided replicas that are finalized.
-
Field Summary
Fields inherited from class org.apache.hadoop.hdfs.server.datanode.ProvidedReplica
LOGFields inherited from class org.apache.hadoop.hdfs.protocol.Block
BLOCK_FILE_PREFIX, blockFilePattern, METADATA_EXTENSION, metaFilePattern, metaOrBlockFilePattern -
Constructor Summary
ConstructorsConstructorDescriptionFinalizedProvidedReplica(long blockId, URI fileURI, long fileOffset, long blockLen, long genStamp, org.apache.hadoop.fs.PathHandle pathHandle, FsVolumeSpi volume, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem remoteFS) FinalizedProvidedReplica(long blockId, org.apache.hadoop.fs.Path pathPrefix, String pathSuffix, long fileOffset, long blockLen, long genStamp, org.apache.hadoop.fs.PathHandle pathHandle, FsVolumeSpi volume, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem remoteFS) FinalizedProvidedReplica(FileRegion fileRegion, FsVolumeSpi volume, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem remoteFS) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongGet the number of bytes that have written to disklongGet the recovery id.getState()Get the replica statelongGet the number of bytes that are visible to readersinthashCode()voidsetRecoveryID(long recoveryId) Set the recovery id.toString()Methods inherited from class org.apache.hadoop.hdfs.server.datanode.ProvidedReplica
blockDataExists, breakHardLinksIfNeeded, bumpReplicaGS, compareWith, copyBlockdata, copyMetadata, deleteBlockData, deleteMetadata, getBlockDataLength, getBlockURI, getDataInputStream, getDataOutputStream, getMetadataInputStream, getMetadataLength, getMetadataOutputStream, getMetadataURI, getPathPrefix, getPathSuffix, getPinning, metadataExists, renameData, renameMeta, setPathHandle, setPinning, truncateBlock, updateWithReplicaMethods inherited from class org.apache.hadoop.hdfs.server.datanode.ReplicaInfo
getBytesReserved, getFileIoProvider, getNext, getOriginalBytesReserved, getStorageUuid, getVolume, isOnTransientStorage, setNextMethods inherited from class org.apache.hadoop.hdfs.protocol.Block
appendStringTo, compareTo, filename2id, getBlockId, getBlockId, getBlockName, getGenerationStamp, getGenerationStamp, getNumBytes, isBlockFilename, isMetaFilename, matchingIdAndGenStamp, metaToBlockFile, readFields, readId, set, setBlockId, setGenerationStamp, setNumBytes, toString, write, writeIdMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.hdfs.server.datanode.Replica
getBlockId, getGenerationStamp, getNumBytes
-
Constructor Details
-
FinalizedProvidedReplica
public FinalizedProvidedReplica(long blockId, URI fileURI, long fileOffset, long blockLen, long genStamp, org.apache.hadoop.fs.PathHandle pathHandle, FsVolumeSpi volume, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem remoteFS) -
FinalizedProvidedReplica
public FinalizedProvidedReplica(FileRegion fileRegion, FsVolumeSpi volume, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem remoteFS) -
FinalizedProvidedReplica
public FinalizedProvidedReplica(long blockId, org.apache.hadoop.fs.Path pathPrefix, String pathSuffix, long fileOffset, long blockLen, long genStamp, org.apache.hadoop.fs.PathHandle pathHandle, FsVolumeSpi volume, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem remoteFS)
-
-
Method Details
-
getState
Description copied from interface:ReplicaGet the replica state- Returns:
- the replica state
-
getBytesOnDisk
public long getBytesOnDisk()Description copied from interface:ReplicaGet the number of bytes that have written to disk- Returns:
- the number of bytes that have written to disk
-
getVisibleLength
public long getVisibleLength()Description copied from interface:ReplicaGet the number of bytes that are visible to readers- Returns:
- the number of bytes that are visible to readers
-
equals
- Overrides:
equalsin classorg.apache.hadoop.hdfs.protocol.Block
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.apache.hadoop.hdfs.protocol.Block
-
toString
- Overrides:
toStringin classReplicaInfo
-
getOriginalReplica
- Specified by:
getOriginalReplicain classReplicaInfo
-
getRecoveryID
public long getRecoveryID()Description copied from class:ReplicaInfoGet the recovery id.- Specified by:
getRecoveryIDin classReplicaInfo- Returns:
- the generation stamp that the replica will be bumped to
-
setRecoveryID
public void setRecoveryID(long recoveryId) Description copied from class:ReplicaInfoSet the recovery id.- Specified by:
setRecoveryIDin classReplicaInfo- Parameters:
recoveryId- the new recoveryId
-
createInfo
- Overrides:
createInfoin classProvidedReplica
-