HADOOP-7058. Expose number of bytes in FSOutputSummer buffer to implementatins. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1044148 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hairong Kuang 2010-12-09 22:22:53 +00:00
parent 6afbdb6e41
commit aa089fc5d0
2 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,9 @@ Trunk (unreleased changes)
HADOOP-7060. A more elegant FileSystem#listCorruptFileBlocks API.
(Patrick Kling via hairong)
HADOOP-7058. Expose number of bytes in FSOutputSummer buffer to
implementatins. (Todd Lipcon via hairong)
OPTIMIZATIONS
BUG FIXES

View File

@ -139,6 +139,13 @@ protected synchronized void flushBuffer(boolean keep) throws IOException {
}
}
}
/**
* Return the number of valid bytes currently in the buffer.
*/
protected synchronized int getBufferedDataSize() {
return count;
}
/** Generate checksum for the data chunk and output data chunk & checksum
* to the underlying output stream. If keep is true then keep the