(final HBaseClient client, String[] args)
| 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 { |
nothing calls this directly
no test coverage detected