@InterfaceAudience.Private public class BlockReaderFactory extends Object
| Constructor and Description |
|---|
BlockReaderFactory() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getFileName(InetSocketAddress s,
String poolId,
long blockId)
File name to print when accessing a block directly (from servlets)
|
static BlockReader |
newBlockReader(DFSClient.Conf conf,
String file,
ExtendedBlock block,
Token<BlockTokenIdentifier> blockToken,
long startOffset,
long len,
boolean verifyChecksum,
String clientName,
Peer peer,
DatanodeID datanodeID,
org.apache.hadoop.hdfs.DomainSocketFactory domSockFactory,
org.apache.hadoop.hdfs.PeerCache peerCache,
org.apache.hadoop.hdfs.FileInputStreamCache fisCache,
boolean allowShortCircuitLocalReads,
CachingStrategy cachingStrategy)
Create a new BlockReader specifically to satisfy a read.
|
public static BlockReader newBlockReader(DFSClient.Conf conf, String file, ExtendedBlock block, Token<BlockTokenIdentifier> blockToken, long startOffset, long len, boolean verifyChecksum, String clientName, Peer peer, DatanodeID datanodeID, org.apache.hadoop.hdfs.DomainSocketFactory domSockFactory, org.apache.hadoop.hdfs.PeerCache peerCache, org.apache.hadoop.hdfs.FileInputStreamCache fisCache, boolean allowShortCircuitLocalReads, CachingStrategy cachingStrategy) throws IOException
conf - the DFSClient configurationfile - File locationblock - The block objectblockToken - The block token for securitystartOffset - The read offset, relative to block headlen - The number of bytes to read, or -1 to read as many as
possible.bufferSize - The IO buffer size (not the client buffer size)
Ignored except on the legacy BlockReader.verifyChecksum - Whether to verify checksumclientName - Client name. Used for log messages.peer - The peerdatanodeID - The datanode that the Peer is connected todomainSocketFactory - The DomainSocketFactory to notify if the Peer
is a DomainPeer which turns out to be faulty.
If null, no factory will be notified in this
case.allowShortCircuitLocalReads - True if short-circuit local reads
should be allowed.IOExceptionpublic static String getFileName(InetSocketAddress s, String poolId, long blockId)
s - Address of the block locationpoolId - Block pool ID of the blockblockId - Block ID of the blockCopyright © 2013 Apache Software Foundation. All rights reserved.