hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1572331 - /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
Date Wed, 26 Feb 2014 23:11:37 GMT
Author: stack
Date: Wed Feb 26 23:11:37 2014
New Revision: 1572331

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

Modified:
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java?rev=1572331&r1=1572330&r2=1572331&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java
Wed Feb 26 23:11:37 2014
@@ -96,7 +96,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;
@@ -115,7 +115,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());
   }
@@ -123,14 +123,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;
   }
 



Mime
View raw message