You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2016/07/05 17:07:10 UTC
hbase git commit: Revert "HBASE-15650 Remove TimeRangeTracker as
point of contention when many threads reading a StoreFile"
Repository: hbase
Updated Branches:
refs/heads/0.98 f3002bf2f -> 47c19607c
Revert "HBASE-15650 Remove TimeRangeTracker as point of contention when many threads reading a StoreFile"
This reverts commit 017ab8d7f1e9f8acd9bfeb5cbd24e68f418ee4f1.
Investigation on HBASE-16074 (ITBLL fails, reports lost big or tiny
families) implicates the HBASE-15650 optimization as cause. Revert,
at least for now, out of due concern.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/47c19607
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/47c19607
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/47c19607
Branch: refs/heads/0.98
Commit: 47c19607c2c88c44f226940a2357087294fe70a5
Parents: f3002bf
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue Jul 5 09:53:16 2016 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Jul 5 09:53:16 2016 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/io/TimeRange.java | 37 +++-------
.../hbase/io/hfile/HFilePrettyPrinter.java | 3 +-
.../hadoop/hbase/regionserver/MemStore.java | 5 +-
.../hadoop/hbase/regionserver/StoreFile.java | 59 +++++++++-------
.../hbase/regionserver/StoreFileScanner.java | 2 +-
.../hbase/regionserver/TimeRangeTracker.java | 74 ++++----------------
.../hbase/mapreduce/TestHFileOutputFormat.java | 7 +-
.../hbase/mapreduce/TestHFileOutputFormat2.java | 7 +-
.../hbase/regionserver/MockStoreFile.java | 13 ++--
.../regionserver/TestTimeRangeTracker.java | 2 +-
10 files changed, 80 insertions(+), 129 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
index 95ec6b9..b2c3ebe 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java
@@ -36,13 +36,11 @@ import org.apache.hadoop.hbase.util.Bytes;
@InterfaceAudience.Public
@InterfaceStability.Stable
public class TimeRange {
- static final long INITIAL_MIN_TIMESTAMP = 0L;
- private static final long MIN_TIME = INITIAL_MIN_TIMESTAMP;
- static final long INITIAL_MAX_TIMESTAMP = Long.MAX_VALUE;
- static final long MAX_TIME = INITIAL_MAX_TIMESTAMP;
+ private static final long MIN_TIME = 0L;
+ private static final long MAX_TIME = Long.MAX_VALUE;
private long minStamp = MIN_TIME;
private long maxStamp = MAX_TIME;
- private final boolean allTime;
+ private boolean allTime = false;
/**
* Default constructor.
@@ -58,7 +56,9 @@ public class TimeRange {
*/
public TimeRange(long minStamp) {
this.minStamp = minStamp;
- this.allTime = this.minStamp == MIN_TIME;
+ if (this.minStamp == MIN_TIME){
+ this.allTime = true;
+ }
}
/**
@@ -67,7 +67,6 @@ public class TimeRange {
*/
public TimeRange(byte [] minStamp) {
this.minStamp = Bytes.toLong(minStamp);
- this.allTime = false;
}
/**
@@ -82,12 +81,14 @@ public class TimeRange {
throw new IllegalArgumentException("Timestamp cannot be negative. minStamp:" + minStamp
+ ", maxStamp" + maxStamp);
}
- if (maxStamp < minStamp) {
+ if(maxStamp < minStamp) {
throw new IOException("maxStamp is smaller than minStamp");
}
this.minStamp = minStamp;
this.maxStamp = maxStamp;
- this.allTime = this.minStamp == MIN_TIME && this.maxStamp == MAX_TIME;
+ if (this.minStamp == MIN_TIME && this.maxStamp == MAX_TIME){
+ this.allTime = true;
+ }
}
/**
@@ -133,27 +134,11 @@ public class TimeRange {
* @return true if within TimeRange, false if not
*/
public boolean withinTimeRange(byte [] bytes, int offset) {
- if (allTime) {
- return true;
- }
+ if(allTime) return true;
return withinTimeRange(Bytes.toLong(bytes, offset));
}
/**
- * Check if the range has any overlap with TimeRange
- * @param tr TimeRange
- * @return True if there is overlap, false otherwise
- */
- // This method came from TimeRangeTracker. We used to go there for this function but better
- // to come here to the immutable, unsynchronized datastructure at read time.
- public boolean includesTimeRange(final TimeRange tr) {
- if (this.allTime) {
- return true;
- }
- return getMin() < tr.getMax() && getMax() >= tr.getMin();
- }
-
- /**
* Check if the specified timestamp is within this TimeRange.
* <p>
* Returns true if within interval [minStamp, maxStamp), false
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
index 270b552..070d5d4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java
@@ -417,7 +417,8 @@ public class HFilePrettyPrinter extends Configured implements Tool {
TimeRangeTracker timeRangeTracker = new TimeRangeTracker();
Writables.copyWritable(e.getValue(), timeRangeTracker);
- out.println(timeRangeTracker.getMin() + "...." + timeRangeTracker.getMax());
+ out.println(timeRangeTracker.getMinimumTimestamp() + "...."
+ + timeRangeTracker.getMaximumTimestamp());
} else if (Bytes.compareTo(e.getKey(), FileInfo.AVG_KEY_LEN) == 0
|| Bytes.compareTo(e.getKey(), FileInfo.AVG_VALUE_LEN) == 0) {
out.println(Bytes.toInt(e.getValue()));
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
index 366a9dd..549f15e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
@@ -662,8 +662,9 @@ public class MemStore implements HeapSize {
public boolean shouldSeek(Scan scan, long oldestUnexpiredTS) {
return (timeRangeTracker.includesTimeRange(scan.getTimeRange()) ||
snapshotTimeRangeTracker.includesTimeRange(scan.getTimeRange()))
- && (Math.max(timeRangeTracker.getMax(), snapshotTimeRangeTracker.getMax())
- >= oldestUnexpiredTS);
+ && (Math.max(timeRangeTracker.getMaximumTimestamp(),
+ snapshotTimeRangeTracker.getMaximumTimestamp()) >=
+ oldestUnexpiredTS);
}
public TimeRangeTracker getSnapshotTimeRangeTracker() {
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
index 168ebca..b959152 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
@@ -48,7 +48,6 @@ import org.apache.hadoop.hbase.KeyValue.KVComparator;
import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.FSDataInputStreamWrapper;
-import org.apache.hadoop.hbase.io.TimeRange;
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
import org.apache.hadoop.hbase.io.hfile.BlockType;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
@@ -469,11 +468,15 @@ public class StoreFile {
reader.loadBloomfilter(BlockType.DELETE_FAMILY_BLOOM_META);
try {
- this.reader.timeRange = TimeRangeTracker.getTimeRange(metadataMap.get(TIMERANGE_KEY));
+ byte [] timerangeBytes = metadataMap.get(TIMERANGE_KEY);
+ if (timerangeBytes != null) {
+ this.reader.timeRangeTracker = new TimeRangeTracker();
+ Writables.copyWritable(timerangeBytes, this.reader.timeRangeTracker);
+ }
} catch (IllegalArgumentException e) {
LOG.error("Error reading timestamp range data from meta -- " +
"proceeding without", e);
- this.reader.timeRange = null;
+ this.reader.timeRangeTracker = null;
}
return this.reader;
}
@@ -691,13 +694,18 @@ public class StoreFile {
}
public Long getMinimumTimestamp() {
- return getReader().timeRange == null? null: getReader().timeRange.getMin();
+ return (getReader().timeRangeTracker == null) ?
+ null :
+ getReader().timeRangeTracker.getMinimumTimestamp();
}
public Long getMaximumTimestamp() {
- return getReader().timeRange == null? null: getReader().timeRange.getMax();
+ return (getReader().timeRangeTracker == null) ?
+ null :
+ getReader().timeRangeTracker.getMaximumTimestamp();
}
+
/**
* Gets the approximate mid-point of this file that is optimal for use in splitting it.
* @param comparator Comparator used to compare KVs.
@@ -755,14 +763,13 @@ public class StoreFile {
protected int bytesPerChecksum;
TimeRangeTracker timeRangeTracker = new TimeRangeTracker();
- /**
- * timeRangeTrackerSet is used to figure if we were passed a filled-out TimeRangeTracker or not.
- * When flushing a memstore, we set the TimeRangeTracker that it accumulated during updates to
- * memstore in here into this Writer and use this variable to indicate that we do not need to
- * recalculate the timeRangeTracker bounds; it was done already as part of add-to-memstore.
- * A completed TimeRangeTracker is not set in cases of compactions when it is recalculated.
- */
- boolean timeRangeTrackerSet = false;
+ /* isTimeRangeTrackerSet keeps track if the timeRange has already been set
+ * When flushing a memstore, we set TimeRange and use this variable to
+ * indicate that it doesn't need to be calculated again while
+ * appending KeyValues.
+ * It is not set in cases of compactions when it is recalculated using only
+ * the appended KeyValues*/
+ boolean isTimeRangeTrackerSet = false;
protected HFile.Writer writer;
@@ -846,16 +853,12 @@ public class StoreFile {
}
/**
- * Set TimeRangeTracker.
- * Called when flushing to pass us a pre-calculated TimeRangeTracker, one made during updates
- * to memstore so we don't have to make one ourselves as Cells get appended. Call before first
- * append. If this method is not called, we will calculate our own range of the Cells that
- * comprise this StoreFile (and write them on the end as metadata). It is good to have this stuff
- * passed because it is expensive to make.
+ * Set TimeRangeTracker
+ * @param trt
*/
public void setTimeRangeTracker(final TimeRangeTracker trt) {
this.timeRangeTracker = trt;
- timeRangeTrackerSet = true;
+ isTimeRangeTrackerSet = true;
}
/**
@@ -869,7 +872,7 @@ public class StoreFile {
if (KeyValue.Type.Put.getCode() == kv.getTypeByte()) {
earliestPutTs = Math.min(earliestPutTs, kv.getTimestamp());
}
- if (!timeRangeTrackerSet) {
+ if (!isTimeRangeTrackerSet) {
timeRangeTracker.includeTimestamp(kv);
}
}
@@ -1068,7 +1071,7 @@ public class StoreFile {
protected BloomFilter deleteFamilyBloomFilter = null;
protected BloomType bloomFilterType;
private final HFile.Reader reader;
- protected TimeRange timeRange;
+ protected TimeRangeTracker timeRangeTracker = null;
protected long sequenceID = -1;
private byte[] lastBloomKey;
private long deleteFamilyCnt = -1;
@@ -1178,9 +1181,13 @@ public class StoreFile {
* determined by the column family's TTL
* @return false if queried keys definitely don't exist in this StoreFile
*/
- boolean passesTimerangeFilter(TimeRange tr, long oldestUnexpiredTS) {
- return this.timeRange == null? true:
- this.timeRange.includesTimeRange(tr) && this.timeRange.getMax() >= oldestUnexpiredTS;
+ boolean passesTimerangeFilter(Scan scan, long oldestUnexpiredTS) {
+ if (timeRangeTracker == null) {
+ return true;
+ } else {
+ return timeRangeTracker.includesTimeRange(scan.getTimeRange()) &&
+ timeRangeTracker.getMaximumTimestamp() >= oldestUnexpiredTS;
+ }
}
/**
@@ -1572,7 +1579,7 @@ public class StoreFile {
}
public long getMaxTimestamp() {
- return timeRange == null ? Long.MAX_VALUE : timeRange.getMax();
+ return timeRangeTracker == null ? Long.MAX_VALUE : timeRangeTracker.getMaximumTimestamp();
}
public void setBulkLoaded(boolean bulkLoadResult) {
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
index 0a0fed7..4f93b00 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java
@@ -430,7 +430,7 @@ public class StoreFileScanner implements KeyValueScanner {
@Override
public boolean shouldUseScanner(Scan scan, SortedSet<byte[]> columns, long oldestUnexpiredTS) {
- return reader.passesTimerangeFilter(scan.getTimeRange(), oldestUnexpiredTS)
+ return reader.passesTimerangeFilter(scan, oldestUnexpiredTS)
&& reader.passesKeyRangeFilter(scan) && reader.passesBloomFilter(scan, columns);
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
index 55fd92b..a93f828 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
@@ -27,28 +27,20 @@ import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.KeyValue.Type;
import org.apache.hadoop.hbase.io.TimeRange;
import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Writable;
/**
- * Stores minimum and maximum timestamp values. Both timestamps are inclusive.
- * Use this class at write-time ONLY. Too much synchronization to use at read time
- * (TODO: there are two scenarios writing, once when lots of concurrency as part of memstore
- * updates but then later we can make one as part of a compaction when there is only one thread
- * involved -- consider making different version, the synchronized and the unsynchronized).
- * Use {@link TimeRange} at read time instead of this. See toTimeRange() to make TimeRange to use.
- * MemStores use this class to track minimum and maximum timestamps. The TimeRangeTracker made by
- * the MemStore is passed to the StoreFile for it to write out as part a flush in the the file
- * metadata. If no memstore involved -- i.e. a compaction -- then the StoreFile will calculate its
- * own TimeRangeTracker as it appends. The StoreFile serialized TimeRangeTracker is used
- * at read time via an instance of {@link TimeRange} to test if Cells fit the StoreFile TimeRange.
+ * Stores the minimum and maximum timestamp values (both are inclusive).
+ * Can be used to find if any given time range overlaps with its time range
+ * MemStores use this class to track its minimum and maximum timestamps.
+ * When writing StoreFiles, this information is stored in meta blocks and used
+ * at read time to match against the required TimeRange.
*/
@InterfaceAudience.Private
public class TimeRangeTracker implements Writable {
- static final long INITIAL_MIN_TIMESTAMP = Long.MAX_VALUE;
- long minimumTimestamp = INITIAL_MIN_TIMESTAMP;
- static final long INITIAL_MAX_TIMESTAMP = -1;
- long maximumTimestamp = INITIAL_MAX_TIMESTAMP;
+
+ long minimumTimestamp = -1;
+ long maximumTimestamp = -1;
/**
* Default constructor.
@@ -63,8 +55,8 @@ public class TimeRangeTracker implements Writable {
* @param trt source TimeRangeTracker
*/
public TimeRangeTracker(final TimeRangeTracker trt) {
- this.minimumTimestamp = trt.getMin();
- this.maximumTimestamp = trt.getMax();
+ this.minimumTimestamp = trt.getMinimumTimestamp();
+ this.maximumTimestamp = trt.getMaximumTimestamp();
}
public TimeRangeTracker(long minimumTimestamp, long maximumTimestamp) {
@@ -131,14 +123,14 @@ public class TimeRangeTracker implements Writable {
/**
* @return the minimumTimestamp
*/
- public synchronized long getMin() {
+ public synchronized long getMinimumTimestamp() {
return minimumTimestamp;
}
/**
* @return the maximumTimestamp
*/
- public synchronized long getMax() {
+ public synchronized long getMaximumTimestamp() {
return maximumTimestamp;
}
@@ -156,46 +148,4 @@ public class TimeRangeTracker implements Writable {
public synchronized String toString() {
return "[" + minimumTimestamp + "," + maximumTimestamp + "]";
}
-
- /**
- * @return An instance of TimeRangeTracker filled w/ the content of serialized
- * TimeRangeTracker in <code>timeRangeTrackerBytes</code>.
- * @throws IOException
- */
- public static TimeRangeTracker getTimeRangeTracker(final byte [] timeRangeTrackerBytes)
- throws IOException {
- if (timeRangeTrackerBytes == null) return null;
- TimeRangeTracker trt = new TimeRangeTracker();
- Writables.copyWritable(timeRangeTrackerBytes, trt);
- return trt;
- }
-
- /**
- * @return An instance of a TimeRange made from the serialized TimeRangeTracker passed in
- * <code>timeRangeTrackerBytes</code>.
- * @throws IOException
- */
- static TimeRange getTimeRange(final byte [] timeRangeTrackerBytes) throws IOException {
- TimeRangeTracker trt = getTimeRangeTracker(timeRangeTrackerBytes);
- return trt == null? null: trt.toTimeRange();
- }
-
- private boolean isFreshInstance() {
- return getMin() == INITIAL_MIN_TIMESTAMP && getMax() == INITIAL_MAX_TIMESTAMP;
- }
-
- /**
- * @return Make a TimeRange from current state of <code>this</code>.
- */
- TimeRange toTimeRange() throws IOException {
- long min = getMin();
- long max = getMax();
- // Check for the case where the TimeRangeTracker is fresh. In that case it has
- // initial values that are antithetical to a TimeRange... Return an uninitialized TimeRange
- // if passed an uninitialized TimeRangeTracker.
- if (isFreshInstance()) {
- return new TimeRange();
- }
- return new TimeRange(min, max);
- }
}
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
index 68e7288..432080d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
@@ -275,9 +275,10 @@ public class TestHFileOutputFormat {
// unmarshall and check values.
TimeRangeTracker timeRangeTracker = new TimeRangeTracker();
Writables.copyWritable(range, timeRangeTracker);
- LOG.info(timeRangeTracker.getMin() + "...." + timeRangeTracker.getMax());
- assertEquals(1000, timeRangeTracker.getMin());
- assertEquals(2000, timeRangeTracker.getMax());
+ LOG.info(timeRangeTracker.getMinimumTimestamp() +
+ "...." + timeRangeTracker.getMaximumTimestamp());
+ assertEquals(1000, timeRangeTracker.getMinimumTimestamp());
+ assertEquals(2000, timeRangeTracker.getMaximumTimestamp());
rd.close();
} finally {
if (writer != null && context != null) writer.close(context);
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java
index efa52a3..a7f178b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat2.java
@@ -286,9 +286,10 @@ public class TestHFileOutputFormat2 {
// unmarshall and check values.
TimeRangeTracker timeRangeTracker = new TimeRangeTracker();
Writables.copyWritable(range, timeRangeTracker);
- LOG.info(timeRangeTracker.getMin() + "...." + timeRangeTracker.getMax());
- assertEquals(1000, timeRangeTracker.getMin());
- assertEquals(2000, timeRangeTracker.getMax());
+ LOG.info(timeRangeTracker.getMinimumTimestamp() +
+ "...." + timeRangeTracker.getMaximumTimestamp());
+ assertEquals(1000, timeRangeTracker.getMinimumTimestamp());
+ assertEquals(2000, timeRangeTracker.getMaximumTimestamp());
rd.close();
} finally {
if (writer != null && context != null) writer.close(context);
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockStoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockStoreFile.java
index 1b88731..3636c48 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockStoreFile.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockStoreFile.java
@@ -109,11 +109,15 @@ public class MockStoreFile extends StoreFile {
}
public Long getMinimumTimestamp() {
- return (timeRangeTracker == null) ? null : timeRangeTracker.getMin();
+ return (timeRangeTracker == null) ?
+ null :
+ timeRangeTracker.getMinimumTimestamp();
}
-
+
public Long getMaximumTimestamp() {
- return (timeRangeTracker == null) ? null : timeRangeTracker.getMax();
+ return (timeRangeTracker == null) ?
+ null :
+ timeRangeTracker.getMaximumTimestamp();
}
@Override
@@ -129,6 +133,7 @@ public class MockStoreFile extends StoreFile {
@Override
public StoreFile.Reader getReader() {
final long len = this.length;
+ final TimeRangeTracker timeRange = this.timeRangeTracker;
final long entries = this.entryCount;
return new StoreFile.Reader() {
@Override
@@ -138,7 +143,7 @@ public class MockStoreFile extends StoreFile {
@Override
public long getMaxTimestamp() {
- return timeRange == null ? Long.MAX_VALUE : timeRange.getMax();
+ return timeRange == null ? Long.MAX_VALUE : timeRange.maximumTimestamp;
}
@Override
http://git-wip-us.apache.org/repos/asf/hbase/blob/47c19607/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimeRangeTracker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimeRangeTracker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimeRangeTracker.java
index 15b9d14..8fca399 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimeRangeTracker.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestTimeRangeTracker.java
@@ -88,7 +88,7 @@ public class TestTimeRangeTracker {
for (int i = 0; i < threads.length; i++) {
threads[i].join();
}
- System.out.println(trr.getMin() + " " + trr.getMax() + " " +
+ System.out.println(trr.getMinimumTimestamp() + " " + trr.getMaximumTimestamp() + " " +
(System.currentTimeMillis() - start));
}
}