HBASE-7167 Thrift's deleteMultiple() raises exception instead of returning list of failed deletes (Daniel Gomez)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1412594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-11-22 15:58:49 +00:00
parent 7e2e57f48e
commit c3ba700c82
3 changed files with 6 additions and 19 deletions

View File

@ -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.InvocationTargetException;
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 implements THBaseService.Iface {
@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

View File

@ -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();

View File

@ -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 */