HBASE-13270 Setter for Result#getStats is #addResults; confusing!

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Mikhail Antonov 2015-04-09 01:02:15 -07:00 committed by stack
parent 6eeb5b38e1
commit 1deadb60d1
1 changed files with 10 additions and 0 deletions

View File

@ -907,14 +907,24 @@ public class Result implements CellScannable, CellScanner {
/** /**
* Add load information about the region to the information about the result * Add load information about the region to the information about the result
* @param loadStats statistics about the current region from which this was returned * @param loadStats statistics about the current region from which this was returned
* @deprecated use {@link #setStatistics(ClientProtos.RegionLoadStats)} instead
* @throws UnsupportedOperationException if invoked on instance of EMPTY_RESULT * @throws UnsupportedOperationException if invoked on instance of EMPTY_RESULT
* (which is supposed to be immutable). * (which is supposed to be immutable).
*/ */
@Deprecated
public void addResults(ClientProtos.RegionLoadStats loadStats) { public void addResults(ClientProtos.RegionLoadStats loadStats) {
checkReadonly(); checkReadonly();
this.stats = loadStats; this.stats = loadStats;
} }
/**
* Set load information about the region to the information about the result
* @param loadStats statistics about the current region from which this was returned
*/
public void setStatistics(ClientProtos.RegionLoadStats loadStats) {
this.stats = loadStats;
}
/** /**
* @return the associated statistics about the region from which this was returned. Can be * @return the associated statistics about the region from which this was returned. Can be
* <tt>null</tt> if stats are disabled. * <tt>null</tt> if stats are disabled.