You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2014/02/27 00:13:00 UTC

svn commit: r1572334 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java

Author: stack
Date: Wed Feb 26 23:12:59 2014
New Revision: 1572334

URL: http://svn.apache.org/r1572334
Log:
HBASE-10598 Written data can not be read out because MemStore#timeRangeTracker might be updated concurrently (cuijianwei)

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java?rev=1572334&r1=1572333&r2=1572334&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java Wed Feb 26 23:12:59 2014
@@ -95,7 +95,7 @@ public class TimeRangeTracker implements
    * If required, update the current TimestampRange to include timestamp
    * @param timestamp the timestamp value to include
    */
-  private void includeTimestamp(final long timestamp) {
+  private synchronized void includeTimestamp(final long timestamp) {
     if (maximumTimestamp == -1) {
       minimumTimestamp = timestamp;
       maximumTimestamp = timestamp;
@@ -114,7 +114,7 @@ public class TimeRangeTracker implements
    * @param tr TimeRange
    * @return True if there is overlap, false otherwise
    */
-  public boolean includesTimeRange(final TimeRange tr) {
+  public synchronized boolean includesTimeRange(final TimeRange tr) {
     return (this.minimumTimestamp < tr.getMax() &&
         this.maximumTimestamp >= tr.getMin());
   }
@@ -122,14 +122,14 @@ public class TimeRangeTracker implements
   /**
    * @return the minimumTimestamp
    */
-  public long getMinimumTimestamp() {
+  public synchronized long getMinimumTimestamp() {
     return minimumTimestamp;
   }
 
   /**
    * @return the maximumTimestamp
    */
-  public long getMaximumTimestamp() {
+  public synchronized long getMaximumTimestamp() {
     return maximumTimestamp;
   }