Class BlockResolver
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.BlockResolver
- Direct Known Subclasses:
FixedBlockResolver
Given an external reference, create a sequence of blocks and associated
metadata.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblockLengths(FileStatus status) protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProtobuildBlock(long blockId, long bytes) protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProtobuildBlock(long blockId, long bytes, long genstamp) abstract intgetReplication(FileStatus status) protected abstract longlastId()abstract longnextId()longpreferredBlockSize(FileStatus status) Iterable<org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto>
-
Constructor Details
-
BlockResolver
public BlockResolver()
-
-
Method Details
-
buildBlock
protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto buildBlock(long blockId, long bytes) -
buildBlock
protected org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.BlockProto buildBlock(long blockId, long bytes, long genstamp) -
resolve
- Parameters:
s- the external reference.- Returns:
- sequence of blocks that make up the reference.
-
nextId
public abstract long nextId()- Returns:
- the next block id.
-
lastId
protected abstract long lastId()- Returns:
- the maximum sequentially allocated block ID for this filesystem.
-
blockLengths
- Parameters:
status- the external reference.- Returns:
- the lengths of the resultant blocks.
-
preferredBlockSize
- Parameters:
status- the external reference.- Returns:
- the block size to assign to this external reference.
-
getReplication
- Parameters:
status- the external reference.- Returns:
- the replication to assign to this external reference.
-