hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r813579 - /hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
Date Thu, 10 Sep 2009 20:46:38 GMT
Author: apurtell
Date: Thu Sep 10 20:46:37 2009
New Revision: 813579

URL: http://svn.apache.org/viewvc?rev=813579&view=rev
Log:
HBASE-1824 [stargate] default timestamp should be LATEST_TIMESTAMP; minor additional changes

Modified:
    hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java

Modified: hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java?rev=813579&r1=813578&r2=813579&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
(original)
+++ hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
Thu Sep 10 20:46:37 2009
@@ -39,6 +39,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.HTableInterface;
@@ -147,11 +148,7 @@
         Put put = new Put(row.getKey());
         for (CellModel cell: row.getCells()) {
           byte [][] parts = KeyValue.parseColumn(cell.getColumn());
-          if (cell.hasUserTimestamp()) {
-            put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
-          } else {
-            put.add(parts[0], parts[1], cell.getValue());
-          }
+          put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
         }
         table.put(put);
         if (LOG.isDebugEnabled()) {
@@ -188,7 +185,7 @@
       if (columns != null) {
         column = columns[0];
       }
-      long timestamp = -1;
+      long timestamp = HConstants.LATEST_TIMESTAMP;
       List<String> vals = headers.getRequestHeader("X-Row");
       if (vals != null && !vals.isEmpty()) {
         row = Bytes.toBytes(vals.get(0));
@@ -206,11 +203,7 @@
       }
       Put put = new Put(row);
       byte parts[][] = KeyValue.parseColumn(column);
-      if (timestamp >= 0) {
-        put.add(parts[0], parts[1], timestamp, message);
-      } else {
-        put.add(parts[0], parts[1], message);
-      }
+      put.add(parts[0], parts[1], timestamp, message);
       table = pool.getTable(this.table);
       table.put(put);
       if (LOG.isDebugEnabled()) {



Mime
View raw message