怎样在程序中得到HDFS的块大小
现在要在MR里面得到块的大小,怎样在程序中得到HDFS的块大小public long getBlockSize() {
return blocksize;
}
返回块的大小
long blockSize = file.getBlockSize();
getBlockSize
public long getBlockSize(Path f)
throws IOException
Get the block size for a particular file.
Specified by:
getBlockSize in class FileSystem
Parameters:
f - the filename
Returns:
the number of bytes in a block
Throws:
IOException
地址:http://web.mit.edu/mriap/hadoop/hadoop-0.13.1/docs/api/org/apache/hadoop/fs/FilterFileSystem.html#getBlockSize
页:
[1]