@InterfaceAudience.Private public class BlockCacheKey extends Object implements HeapSize, Serializable
BlockCache
Modifier and Type | Field and Description |
---|---|
private BlockType |
blockType |
private org.apache.hadoop.fs.Path |
filePath |
static long |
FIXED_OVERHEAD |
private String |
hfileName |
private boolean |
isPrimaryReplicaBlock |
private long |
offset |
private static long |
serialVersionUID |
Constructor and Description |
---|
BlockCacheKey(org.apache.hadoop.fs.Path hfilePath,
long offset,
boolean isPrimaryReplica,
BlockType blockType) |
BlockCacheKey(String hfileName,
long offset)
Construct a new BlockCacheKey
|
BlockCacheKey(String hfileName,
long offset,
boolean isPrimaryReplica,
BlockType blockType) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
BlockType |
getBlockType() |
org.apache.hadoop.fs.Path |
getFilePath() |
String |
getHfileName()
Returns The hfileName portion of this cache key
|
long |
getOffset() |
int |
hashCode() |
long |
heapSize()
Strings have two bytes per character due to default Java Unicode encoding (hence length times
2).
|
boolean |
isPrimary() |
void |
setBlockType(BlockType blockType) |
String |
toString() |
private static final long serialVersionUID
private final long offset
private final boolean isPrimaryReplicaBlock
private org.apache.hadoop.fs.Path filePath
public static final long FIXED_OVERHEAD
public BlockCacheKey(String hfileName, long offset)
hfileName
- The name of the HFile this block belongs to.offset
- Offset of the block into the filepublic BlockCacheKey(String hfileName, long offset, boolean isPrimaryReplica, BlockType blockType)
public BlockCacheKey(org.apache.hadoop.fs.Path hfilePath, long offset, boolean isPrimaryReplica, BlockType blockType)
public long heapSize()
public String getHfileName()
public boolean isPrimary()
public long getOffset()
public BlockType getBlockType()
public void setBlockType(BlockType blockType)
public org.apache.hadoop.fs.Path getFilePath()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.