Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.12.0
-
None
-
None
Description
I think that the HDFS client protocol should change like:
/** The meta-data about a file that was opened. */
class OpenFileInfo {
/** the info for the first block */
public LocatedBlockInfo getBlockInfo();
public long getBlockSize();
public long getLength();
}
interface ClientProtocol extends VersionedProtocol {
public OpenFileInfo open(String name) throws IOException;
/** get block info for any range of blocks */
public LocatedBlockInfo[] getBlockInfo(String name, int blockOffset, int blockLength) throws IOException;
}
so that the client can decide how much block info to request and when. Currently, when the file is opened or an error occurs, the entire block list is requested and sent.