hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r789193 - /hadoop/hbase/trunk/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java
Date Mon, 29 Jun 2009 02:43:59 GMT
Author: apurtell
Date: Mon Jun 29 02:43:59 2009
New Revision: 789193

URL: http://svn.apache.org/viewvc?rev=789193&view=rev
Log:
remove vestigial and incorrect deletes

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=789193&r1=789192&r2=789193&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
Mon Jun 29 02:43:59 2009
@@ -133,33 +133,7 @@
     }
   }
 
-  private void deleteRow() {
-    HTablePool pool;
-    try {
-      pool = RESTServlet.getInstance().getTablePool(this.table);
-    } catch (IOException e) {
-      throw new WebApplicationException(e, 
-                  Response.Status.INTERNAL_SERVER_ERROR);
-    }
-    HTable table = null;
-    try {
-      table = pool.get();
-      table.delete(new Delete(rowspec.getRow()));
-      table.flushCommits();
-    } catch (IOException e) {
-      throw new WebApplicationException(e,
-                  Response.Status.SERVICE_UNAVAILABLE);
-    } finally {
-      if (table != null) {
-        pool.put(table);
-      }
-    }
-  }
-
   private Response update(CellSetModel model, boolean replace) {
-    if (replace) {
-      deleteRow();
-    }
     HTablePool pool;
     try {
       pool = RESTServlet.getInstance().getTablePool(this.table);
@@ -173,11 +147,6 @@
       for (RowModel row: model.getRows()) {
         Put put = new Put(row.getKey());
         for (CellModel cell: row.getCells()) {
-          if (LOG.isDebugEnabled()) {
-            LOG.debug("update cell '" +
-              Bytes.toStringBinary(cell.getColumn()) + "' @" +
-                cell.getTimestamp() + " length " + cell.getValue().length);
-          }
           byte [][] parts = KeyValue.parseColumn(cell.getColumn());
           if (cell.hasUserTimestamp()) {
             put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
@@ -186,6 +155,9 @@
           }
         }
         table.put(put);
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("PUT " + put.toString());
+        }
       }
       table.flushCommits();
       ResponseBuilder response = Response.ok();
@@ -202,9 +174,6 @@
 
   private Response updateBinary(byte[] message, HttpHeaders headers, 
       boolean replace) {
-    if (replace) {
-      deleteRow();
-    }
     HTablePool pool;
     try {
       pool = RESTServlet.getInstance().getTablePool(this.table);
@@ -236,10 +205,6 @@
       if (column == null) {
         throw new WebApplicationException(Response.Status.BAD_REQUEST);
       }
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("update cell '" + Bytes.toStringBinary(column) + "' @" +
-          timestamp + " length " + message.length);
-      }
       Put put = new Put(row);
       byte parts[][] = KeyValue.parseColumn(column);
       if (timestamp >= 0) {
@@ -249,6 +214,9 @@
       }
       table = pool.get();
       table.put(put);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("PUT " + put.toString());
+      }
       table.flushCommits();
       return Response.ok().build();
     } catch (IOException e) {
@@ -328,6 +296,9 @@
     try {
       table = pool.get();
       table.delete(delete);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("DELETE " + delete.toString());
+      }
       table.flushCommits();
     } catch (IOException e) {
       throw new WebApplicationException(e, 



Mime
View raw message