Update comments about PackStatistics

Change-Id: I4862932dc38b58cc98400ed584cc506013846065
Signed-off-by: Terry Parker <tparker@google.com>
This commit is contained in:
Terry Parker 2015-06-16 10:05:29 -07:00
parent 6a415915c2
commit 8b20f2c890
2 changed files with 14 additions and 4 deletions

View File

@ -1032,8 +1032,8 @@ public void writePack(ProgressMonitor compressMonitor,
/** /**
* @return description of what this PackWriter did in order to create the * @return description of what this PackWriter did in order to create the
* final pack stream. The object is only available to callers after * final pack stream. This should only be invoked after the calls to
* {@link #writePack(ProgressMonitor, ProgressMonitor, OutputStream)} * create the pack/index/bitmap have completed.
*/ */
public PackStatistics getStatistics() { public PackStatistics getStatistics() {
return new PackStatistics(stats); return new PackStatistics(stats);

View File

@ -101,6 +101,12 @@ public static class Accumulator {
* the accumulator of the statistics * the accumulator of the statistics
*/ */
public ObjectType(ObjectType.Accumulator accumulator) { public ObjectType(ObjectType.Accumulator accumulator) {
/*
* For efficiency this wraps and serves up the Accumulator object
* rather than making a deep clone. Normal usage of PackWriter is to
* create a single pack/index/bitmap and only call getStatistics()
* after all work is complete.
*/
objectType = accumulator; objectType = accumulator;
} }
@ -251,8 +257,12 @@ public static class Accumulator {
* the accumulator of the statistics * the accumulator of the statistics
*/ */
public PackStatistics(Accumulator accumulator) { public PackStatistics(Accumulator accumulator) {
// Note: PackStatistics directly serves up the collections in the /*
// accumulator. * For efficiency this wraps and serves up the Accumulator object rather
* than making a deep clone. Normal usage of PackWriter is to create a
* single pack/index/bitmap and only call getStatistics() after all work
* is complete.
*/
statistics = accumulator; statistics = accumulator;
} }