LocatedStripedBlock@Private
@Evolving
public class LocatedBlock
extends java.lang.Object
| Constructor | Description |
|---|---|
LocatedBlock(ExtendedBlock b,
DatanodeInfo[] locs) |
|
LocatedBlock(ExtendedBlock b,
DatanodeInfo[] locs,
java.lang.String[] storageIDs,
org.apache.hadoop.fs.StorageType[] storageTypes) |
|
LocatedBlock(ExtendedBlock b,
DatanodeInfo[] locs,
java.lang.String[] storageIDs,
org.apache.hadoop.fs.StorageType[] storageTypes,
long startOffset,
boolean corrupt,
DatanodeInfo[] cachedLocs) |
|
LocatedBlock(ExtendedBlock b,
DatanodeInfoWithStorage[] locs,
java.lang.String[] storageIDs,
org.apache.hadoop.fs.StorageType[] storageTypes,
long startOffset,
boolean corrupt,
DatanodeInfo[] cachedLocs) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addCachedLoc(DatanodeInfo loc) |
Add a the location of a cached replica of the block.
|
ExtendedBlock |
getBlock() |
|
long |
getBlockSize() |
|
org.apache.hadoop.security.token.Token<BlockTokenIdentifier> |
getBlockToken() |
|
BlockType |
getBlockType() |
|
DatanodeInfo[] |
getCachedLocations() |
|
DatanodeInfoWithStorage[] |
getLocations() |
Returns the locations associated with this block.
|
long |
getStartOffset() |
|
java.lang.String[] |
getStorageIDs() |
|
org.apache.hadoop.fs.StorageType[] |
getStorageTypes() |
|
boolean |
isCorrupt() |
|
boolean |
isStriped() |
|
void |
moveProvidedToEnd(int activeLen) |
Moves all locations that have
StorageType
PROVIDED to the end of the locations array without
changing the relative ordering of the remaining locations
Only the first activeLen locations are considered. |
void |
setBlockToken(org.apache.hadoop.security.token.Token<BlockTokenIdentifier> token) |
|
void |
setCorrupt(boolean corrupt) |
|
void |
setStartOffset(long value) |
|
java.lang.String |
toString() |
|
void |
updateCachedStorageInfo() |
Updates the cached StorageID and StorageType information.
|
public LocatedBlock(ExtendedBlock b, DatanodeInfo[] locs)
public LocatedBlock(ExtendedBlock b, DatanodeInfo[] locs, java.lang.String[] storageIDs, org.apache.hadoop.fs.StorageType[] storageTypes)
public LocatedBlock(ExtendedBlock b, DatanodeInfo[] locs, java.lang.String[] storageIDs, org.apache.hadoop.fs.StorageType[] storageTypes, long startOffset, boolean corrupt, DatanodeInfo[] cachedLocs)
public LocatedBlock(ExtendedBlock b, DatanodeInfoWithStorage[] locs, java.lang.String[] storageIDs, org.apache.hadoop.fs.StorageType[] storageTypes, long startOffset, boolean corrupt, DatanodeInfo[] cachedLocs)
public org.apache.hadoop.security.token.Token<BlockTokenIdentifier> getBlockToken()
public void setBlockToken(org.apache.hadoop.security.token.Token<BlockTokenIdentifier> token)
public ExtendedBlock getBlock()
public DatanodeInfoWithStorage[] getLocations()
updateCachedStorageInfo()
to update the cached Storage ID/Type arrays.public org.apache.hadoop.fs.StorageType[] getStorageTypes()
public java.lang.String[] getStorageIDs()
public void updateCachedStorageInfo()
public void moveProvidedToEnd(int activeLen)
StorageType
PROVIDED to the end of the locations array without
changing the relative ordering of the remaining locations
Only the first activeLen locations are considered.
The caller must immediately invoke updateCachedStorageInfo()
to update the cached Storage ID/Type arrays.activeLen - public long getStartOffset()
public long getBlockSize()
public void setStartOffset(long value)
public void setCorrupt(boolean corrupt)
public boolean isCorrupt()
public void addCachedLoc(DatanodeInfo loc)
loc - of datanode with the cached replicapublic DatanodeInfo[] getCachedLocations()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isStriped()
public BlockType getBlockType()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.