java.lang.Comparable<org.apache.hadoop.hdfs.protocol.Block>, Replica, org.apache.hadoop.io.Writable, org.apache.hadoop.util.LightWeightGSet.LinkedElementLocalReplica, ProvidedReplica@Private public abstract class ReplicaInfo extends org.apache.hadoop.hdfs.protocol.Block implements Replica, org.apache.hadoop.util.LightWeightGSet.LinkedElement
| Modifier and Type | Method | Description |
|---|---|---|
abstract boolean |
blockDataExists() |
|
abstract boolean |
breakHardLinksIfNeeded() |
|
abstract void |
bumpReplicaGS(long newGS) |
Bump a replica's generation stamp to a new one.
|
abstract int |
compareWith(FsVolumeSpi.ScanInfo info) |
|
abstract void |
copyBlockdata(java.net.URI destination) |
|
abstract void |
copyMetadata(java.net.URI destination) |
|
abstract ReplicaRecoveryInfo |
createInfo() |
|
abstract boolean |
deleteBlockData() |
Used to deletes the replica's block data.
|
abstract boolean |
deleteMetadata() |
Used to deletes the replica's metadata.
|
abstract long |
getBlockDataLength() |
|
abstract java.net.URI |
getBlockURI() |
Get the
URI for where the data of this replica is stored. |
long |
getBytesReserved() |
Number of bytes reserved for this replica on disk.
|
abstract java.io.InputStream |
getDataInputStream(long seekOffset) |
Returns an
InputStream to the replica's data. |
abstract java.io.OutputStream |
getDataOutputStream(boolean append) |
Returns an
OutputStream to the replica's data. |
FileIoProvider |
getFileIoProvider() |
Get the
FileIoProvider for disk IO operations. |
abstract LengthInputStream |
getMetadataInputStream(long offset) |
Returns an
InputStream to the replica's metadata. |
abstract long |
getMetadataLength() |
|
abstract java.io.OutputStream |
getMetadataOutputStream(boolean append) |
Returns an
OutputStream to the replica's metadata. |
abstract java.net.URI |
getMetadataURI() |
Get the
URI for where the metadata of this replica is stored. |
org.apache.hadoop.util.LightWeightGSet.LinkedElement |
getNext() |
|
long |
getOriginalBytesReserved() |
Number of bytes originally reserved for this replica.
|
abstract ReplicaInfo |
getOriginalReplica() |
|
abstract boolean |
getPinning(org.apache.hadoop.fs.LocalFileSystem localFS) |
Check whether the block was pinned.
|
abstract long |
getRecoveryID() |
Get the recovery id.
|
java.lang.String |
getStorageUuid() |
Get the storageUuid of the volume that stores this replica.
|
FsVolumeSpi |
getVolume() |
Get the volume of replica.
|
boolean |
isOnTransientStorage() |
Return true if the target volume is backed by RAM.
|
abstract boolean |
metadataExists() |
|
abstract boolean |
renameData(java.net.URI destURI) |
Rename the data
URI to that referenced by destURI. |
abstract boolean |
renameMeta(java.net.URI destURI) |
Rename the metadata
URI to that referenced by destURI. |
void |
setNext(org.apache.hadoop.util.LightWeightGSet.LinkedElement next) |
|
abstract void |
setPinning(org.apache.hadoop.fs.LocalFileSystem localFS) |
Set a block to be pinned on this datanode so that it cannot be moved
by Balancer/Mover.
|
abstract void |
setRecoveryID(long recoveryId) |
Set the recovery id.
|
java.lang.String |
toString() |
|
abstract void |
truncateBlock(long newLength) |
|
abstract void |
updateWithReplica(StorageLocation replicaLocation) |
Update this replica with the
StorageLocation found. |
appendStringTo, compareTo, equals, filename2id, getBlockId, getBlockId, getBlockName, getGenerationStamp, getGenerationStamp, getNumBytes, hashCode, isBlockFilename, isMetaFilename, matchingIdAndGenStamp, metaToBlockFile, readFields, readId, set, setBlockId, setGenerationStamp, setNumBytes, toString, write, writeIdclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBlockId, getBytesOnDisk, getGenerationStamp, getNumBytes, getState, getVisibleLengthpublic FsVolumeSpi getVolume()
Replicapublic FileIoProvider getFileIoProvider()
FileIoProvider for disk IO operations.public java.lang.String getStorageUuid()
getStorageUuid in interface Replicapublic long getBytesReserved()
public abstract java.net.URI getBlockURI()
URI for where the data of this replica is stored.URI for the location of replica data.public abstract java.io.InputStream getDataInputStream(long seekOffset)
throws java.io.IOException
InputStream to the replica's data.seekOffset - the offset at which the read is started from.InputStream to read the replica data.java.io.IOException - if an error occurs in opening a stream to the data.public abstract java.io.OutputStream getDataOutputStream(boolean append)
throws java.io.IOException
OutputStream to the replica's data.append - indicates if the block should be opened for append.OutputStream to write to the replica.java.io.IOException - if an error occurs in creating an OutputStream.public abstract boolean blockDataExists()
public abstract boolean deleteBlockData()
public abstract long getBlockDataLength()
public abstract java.net.URI getMetadataURI()
URI for where the metadata of this replica is stored.URI for the location of replica metadata.public abstract LengthInputStream getMetadataInputStream(long offset) throws java.io.IOException
InputStream to the replica's metadata.offset - the offset at which the read is started from.LengthInputStream to read the replica metadata.java.io.IOExceptionpublic abstract java.io.OutputStream getMetadataOutputStream(boolean append)
throws java.io.IOException
OutputStream to the replica's metadata.append - indicates if the block metadata should be opened for append.OutputStream to write to the replica's metadata.java.io.IOException - if an error occurs in creating an OutputStream.public abstract boolean metadataExists()
public abstract boolean deleteMetadata()
public abstract long getMetadataLength()
public abstract boolean renameMeta(java.net.URI destURI)
throws java.io.IOException
URI to that referenced by destURI.destURI - the target URI.java.io.IOException - if an exception occurs in the rename.public abstract boolean renameData(java.net.URI destURI)
throws java.io.IOException
URI to that referenced by destURI.destURI - the target URI.java.io.IOException - if an exception occurs in the rename.public abstract void updateWithReplica(StorageLocation replicaLocation)
StorageLocation found.replicaLocation - the StorageLocation found for this replica.public abstract boolean getPinning(org.apache.hadoop.fs.LocalFileSystem localFS)
throws java.io.IOException
localFS - the local filesystem to use.java.io.IOExceptionpublic abstract void setPinning(org.apache.hadoop.fs.LocalFileSystem localFS)
throws java.io.IOException
localFS - the local filesystem to use.java.io.IOException - if there is an exception in the pinning.public abstract void bumpReplicaGS(long newGS)
throws java.io.IOException
newGS - new generation stampjava.io.IOException - if the change failspublic abstract ReplicaInfo getOriginalReplica()
public abstract long getRecoveryID()
public abstract void setRecoveryID(long recoveryId)
recoveryId - the new recoveryIdpublic abstract boolean breakHardLinksIfNeeded()
throws java.io.IOException
java.io.IOExceptionpublic abstract ReplicaRecoveryInfo createInfo()
public abstract int compareWith(FsVolumeSpi.ScanInfo info)
public abstract void truncateBlock(long newLength)
throws java.io.IOException
java.io.IOExceptionpublic abstract void copyMetadata(java.net.URI destination)
throws java.io.IOException
java.io.IOExceptionpublic abstract void copyBlockdata(java.net.URI destination)
throws java.io.IOException
java.io.IOExceptionpublic long getOriginalBytesReserved()
public java.lang.String toString()
toString in class org.apache.hadoop.hdfs.protocol.Blockpublic boolean isOnTransientStorage()
ReplicaisOnTransientStorage in interface Replicapublic org.apache.hadoop.util.LightWeightGSet.LinkedElement getNext()
getNext in interface org.apache.hadoop.util.LightWeightGSet.LinkedElementpublic void setNext(org.apache.hadoop.util.LightWeightGSet.LinkedElement next)
setNext in interface org.apache.hadoop.util.LightWeightGSet.LinkedElementCopyright © 2008–2025 Apache Software Foundation. All rights reserved.