MCPcopy Index your code
hub / github.com/OpenTSDB/asynchbase / execute

Method execute

test/Test.java:236–268  ·  view source on GitHub ↗
(final HBaseClient client, String[] args)

Source from the content-addressed store, hash-verified

234
235 private static final class delete implements Cmd {
236 public void execute(final HBaseClient client, String[] args) throws Exception {
237 ensureArguments(args, 4, 6);
238 RowLock lock = null;
239 if (args[1].charAt(0) == 'l') { // locked version of the command
240 ensureArguments(args, 6, 6);
241 final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
242 lock = client.lockRow(rlr).joinUninterruptibly();
243 LOG.info("Acquired explicit row lock: " + lock);
244 }
245 final DeleteRequest delete;
246 if (lock == null) {
247 switch (args.length) {
248 case 4: delete = new DeleteRequest(args[2], args[3]); break;
249 case 5: delete = new DeleteRequest(args[2], args[3], args[4]); break;
250 case 6: delete = new DeleteRequest(args[2], args[3], args[4], args[5]); break;
251 default: throw new AssertionError("Should never be here");
252 }
253 } else {
254 delete = new DeleteRequest(args[2], args[3], args[4], args[5], lock);
255 }
256 args = null;
257 try {
258 final Object result = client.delete(delete).joinUninterruptibly();
259 LOG.info("Delete result=" + result);
260 } catch (Exception e) {
261 LOG.error("Delete failed", e);
262 } finally {
263 if (lock != null) {
264 client.unlockRow(lock).joinUninterruptibly();
265 LOG.info("Released explicit row lock: " + lock);
266 }
267 }
268 }
269 }
270
271 private static final class scan implements Cmd {

Callers

nothing calls this directly

Calls 4

ensureArgumentsMethod · 0.80
lockRowMethod · 0.80
deleteMethod · 0.80
unlockRowMethod · 0.80

Tested by

no test coverage detected