(final HBaseClient client, String[] args)
| 126 | |
| 127 | private static final class get implements Cmd { |
| 128 | public void execute(final HBaseClient client, String[] args) throws Exception { |
| 129 | ensureArguments(args, 4, 64); |
| 130 | final GetRequest get = new GetRequest(args[2], args[3]); |
| 131 | if (args.length > 4) { |
| 132 | get.family(args[4]); |
| 133 | } |
| 134 | if (args.length > 5) { |
| 135 | if (args.length == 6) { |
| 136 | get.qualifier(args[5]); |
| 137 | } else { |
| 138 | final byte[][] qualifiers = new byte[args.length - 5][]; |
| 139 | for (int i = 5; i < args.length; i++) { |
| 140 | qualifiers[i - 5] = args[i].getBytes(); |
| 141 | } |
| 142 | get.qualifiers(qualifiers); |
| 143 | } |
| 144 | } |
| 145 | RowLock lock = null; |
| 146 | if (args[1].charAt(0) == 'l') { // locked version of the command |
| 147 | final RowLockRequest rlr = new RowLockRequest(args[2], args[3]); |
| 148 | lock = client.lockRow(rlr).joinUninterruptibly(); |
| 149 | LOG.info("Acquired explicit row lock: " + lock); |
| 150 | } |
| 151 | args = null; |
| 152 | try { |
| 153 | final ArrayList<KeyValue> result = client.get(get).joinUninterruptibly(); |
| 154 | LOG.info("Get result=" + result); |
| 155 | } catch (Exception e) { |
| 156 | LOG.error("Get failed", e); |
| 157 | } finally { |
| 158 | if (lock != null) { |
| 159 | client.unlockRow(lock).joinUninterruptibly(); |
| 160 | LOG.info("Released explicit row lock: " + lock); |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | private static final class icv implements Cmd { |
nothing calls this directly
no test coverage detected