hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r807854 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HTable.java src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Date Wed, 26 Aug 2009 00:03:07 GMT
Author: jdcryans
Date: Wed Aug 26 00:03:06 2009
New Revision: 807854

URL: http://svn.apache.org/viewvc?rev=807854&view=rev
Log:
HBASE-1792  [Regression] Cannot save timestamp in the future
HBASE-1793  [Regression] HTable.get/getRow with a ts is broken

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=807854&r1=807853&r2=807854&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Wed Aug 26 00:03:06 2009
@@ -328,6 +328,8 @@
    HBASE-1791  Timeout in IndexRecordWriter (Bradford Stephens via Andrew
                Purtell)
    HBASE-1737  Regions unbalanced when adding new node (recommit)
+   HBASE-1792  [Regression] Cannot save timestamp in the future
+   HBASE-1793  [Regression] HTable.get/getRow with a ts is broken
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java?rev=807854&r1=807853&r2=807854&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HTable.java Wed Aug
26 00:03:06 2009
@@ -796,9 +796,8 @@
       g.addColumn(fq[0], fq[1]);
     }
     g.setMaxVersions(numVersions);
-    if (timestamp != HConstants.LATEST_TIMESTAMP) {
-      g.setTimeStamp(timestamp);
-    }
+    g.setTimeRange(0, 
+        timestamp == HConstants.LATEST_TIMESTAMP ? timestamp : timestamp+1);
     Result r = get(g);
     return r == null || r.size() <= 0? null: r.getCellValues();
   }
@@ -1054,9 +1053,8 @@
       }
     }
     g.setMaxVersions(numVersions);
-    if (ts != HConstants.LATEST_TIMESTAMP) {
-      g.setTimeStamp(ts);
-    }
+    g.setTimeRange(0,  
+        ts == HConstants.LATEST_TIMESTAMP ? ts : ts+1);
     Result r = get(g);
     return r == null || r.size() <= 0? null: r.getRowResult();
   }
@@ -1310,6 +1308,8 @@
         scan.addColumn(splits[0], splits[1]);
       }
     }
+    scan.setTimeRange(0,  
+        timestamp == HConstants.LATEST_TIMESTAMP ? timestamp : timestamp+1);
     OldClientScanner s = new OldClientScanner(new ClientScanner(scan));
     s.initialize();
     return s;
@@ -1706,7 +1706,8 @@
       final long timestamp, final RowLock rl) throws IOException {
     final Get g = new Get(row, rl);
     g.addColumn(column);
-    g.setTimeStamp(timestamp);
+    g.setTimeRange(0,  
+        timestamp == HConstants.LATEST_TIMESTAMP ? timestamp : timestamp+1);
     return exists(g);
   }
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=807854&r1=807853&r2=807854&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Wed Aug 26 00:03:06 2009
@@ -1331,10 +1331,9 @@
       
   
   /**
-   * Checks if any stamps are > now.  If so, sets them to now.
+   * Checks if any stamps is Long.MAX_VALUE.  If so, sets them to now.
    * <p>
-   * This acts to be prevent users from inserting future stamps as well as
-   * to replace LATEST_TIMESTAMP with now.
+   * This acts to replace LATEST_TIMESTAMP with now.
    * @param keys
    * @param now
    * @return <code>true</code> when updating the time stamp completed.
@@ -1344,7 +1343,9 @@
       return false;
     }
     for(KeyValue key : keys) {
-      key.updateLatestStamp(now);
+      if(key.getTimestamp() == HConstants.LATEST_TIMESTAMP) {
+        key.updateLatestStamp(now);
+      }
     }
     return true;
   }



Mime
View raw message