Skip to content

Commit

Permalink
HBASE-17689 Add support for table.existsAll in thrift2 THBaseservice …
Browse files Browse the repository at this point in the history
…(Yechao Chen)
  • Loading branch information
tedyu committed Feb 27, 2017
1 parent bbc232e commit eabfa39
Show file tree
Hide file tree
Showing 4 changed files with 1,209 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -251,6 +252,23 @@ public boolean exists(ByteBuffer table, TGet get) throws TIOError, TException {
}
}

@Override
public List<Boolean> existsAll(ByteBuffer table, List<TGet> gets) throws TIOError, TException {
Table htable = getTable(table);
try {
boolean[] exists = htable.existsAll(getsFromThrift(gets));
List<Boolean> result = new ArrayList<>(exists.length);
for (boolean exist : exists) {
result.add(exist);
}
return result;
} catch (IOException e) {
throw getTIOError(e);
} finally {
closeTable(htable);
}
}

@Override
public TResult get(ByteBuffer table, TGet get) throws TIOError, TException {
Table htable = getTable(table);
Expand Down
Loading

0 comments on commit eabfa39

Please sign in to comment.