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

Method execute

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

Source from the content-addressed store, hash-verified

207
208 private static final class put implements Cmd {
209 public void execute(final HBaseClient client, String[] args) throws Exception {
210 ensureArguments(args, 7, 7);
211 RowLock lock = null;
212 if (args[1].charAt(0) == 'l') { // locked version of the command
213 final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
214 lock = client.lockRow(rlr).joinUninterruptibly();
215 LOG.info("Acquired explicit row lock: " + lock);
216 }
217 final PutRequest put = lock == null
218 ? new PutRequest(args[2], args[3], args[4], args[5], args[6])
219 : new PutRequest(args[2], args[3], args[4], args[5], args[6], lock);
220 args = null;
221 try {
222 final Object result = client.put(put).joinUninterruptibly();
223 LOG.info("Put result=" + result);
224 } catch (Exception e) {
225 LOG.error("Put failed", e);
226 } finally {
227 if (lock != null) {
228 client.unlockRow(lock).joinUninterruptibly();
229 LOG.info("Released explicit row lock: " + lock);
230 }
231 }
232 }
233 }
234
235 private static final class delete implements Cmd {

Callers

nothing calls this directly

Calls 4

ensureArgumentsMethod · 0.80
lockRowMethod · 0.80
putMethod · 0.80
unlockRowMethod · 0.80

Tested by

no test coverage detected