hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1412594 - in /hbase/trunk/hbase-server/src/main: java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
Date Thu, 22 Nov 2012 15:58:50 GMT
Author: tedyu
Date: Thu Nov 22 15:58:49 2012
New Revision: 1412594

URL: http://svn.apache.org/viewvc?rev=1412594&view=rev
Log:
HBASE-7167 Thrift's deleteMultiple() raises exception instead of returning list of failed
deletes (Daniel Gomez)


Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
    hbase/trunk/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java?rev=1412594&r1=1412593&r2=1412594&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java
Thu Nov 22 15:58:49 2012
@@ -19,7 +19,6 @@
 package org.apache.hadoop.hbase.thrift2;
 
 import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.deleteFromThrift;
-import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.deletesFromHBase;
 import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.deletesFromThrift;
 import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.getFromThrift;
 import static org.apache.hadoop.hbase.thrift2.ThriftUtilities.getsFromThrift;
@@ -36,6 +35,7 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.nio.ByteBuffer;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -261,15 +261,14 @@ public class ThriftHBaseServiceHandler i
   @Override
   public List<TDelete> deleteMultiple(ByteBuffer table, List<TDelete> deletes)
throws TIOError, TException {
     HTableInterface htable = getTable(table.array());
-    List<Delete> tempDeletes = deletesFromThrift(deletes);
     try {
-      htable.delete(tempDeletes);
+      htable.delete(deletesFromThrift(deletes));
     } catch (IOException e) {
       throw getTIOError(e);
     } finally {
       closeTable(htable);
     }
-    return deletesFromHBase(tempDeletes);
+    return Collections.emptyList();
   }
 
   @Override

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java?rev=1412594&r1=1412593&r2=1412594&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
Thu Nov 22 15:58:49 2012
@@ -282,18 +282,6 @@ public class ThriftUtilities {
     return out;
   }
 
-  public static List<TDelete> deletesFromHBase(List<Delete> in) {
-    List<TDelete> out = new ArrayList<TDelete>(in.size());
-    for (Delete delete : in) {
-      if (delete == null) {
-        out.add(null);
-      } else {
-        out.add(deleteFromHBase(delete));
-      }
-    }
-    return out;
-  }
-
   public static Scan scanFromThrift(TScan in) throws IOException {
     Scan out = new Scan();
 

Modified: hbase/trunk/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift?rev=1412594&r1=1412593&r2=1412594&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
(original)
+++ hbase/trunk/hbase-server/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
Thu Nov 22 15:58:49 2012
@@ -314,9 +314,9 @@ service THBaseService {
   /**
    * Bulk commit a List of TDeletes to the table.
    *
-   * This returns a list of TDeletes that were not
-   * executed. So if everything succeeds you'll
-   * receive an empty list.
+   * Throws a TIOError if any of the deletes fail.
+   *
+   * Always returns an empty list for backwards compatibility.
    */
   list<TDelete> deleteMultiple(
     /** the table to delete from */



Mime
View raw message