(final HBaseClient client, String[] args)
| 295 | |
| 296 | private static final class mscan implements Cmd { |
| 297 | @SuppressWarnings("fallthrough") |
| 298 | public void execute(final HBaseClient client, String[] args) { |
| 299 | ensureArguments(args, 3, 7); |
| 300 | final Scanner scanner = client.newScanner(args[2]); |
| 301 | switch (args.length) { |
| 302 | case 7: scanner.setKeyRegexp(args[6]); |
| 303 | case 6: scanner.setStopKey(args[5]); |
| 304 | case 5: |
| 305 | final String columns = args[4]; |
| 306 | final ArrayList<byte[]> families = new ArrayList<byte[]>(); |
| 307 | final ArrayList<byte[][]> qualifiers = new ArrayList<byte[][]>(); |
| 308 | for (String spec : columns.split("/")) { |
| 309 | final String[] family = spec.split(":"); |
| 310 | families.add(family[0].getBytes()); |
| 311 | if (family.length == 1) { |
| 312 | qualifiers.add(null); |
| 313 | } else { |
| 314 | final String[] quals = family[1].split(","); |
| 315 | final byte[][] qb = new byte[quals.length][]; |
| 316 | for (int i = 0; i < qb.length; i++) { |
| 317 | qb[i] = quals[i].getBytes(); |
| 318 | } |
| 319 | qualifiers.add(qb); |
| 320 | } |
| 321 | } |
| 322 | scanner.setFamilies(families.toArray(new byte[families.size()][]), |
| 323 | qualifiers.toArray(new byte[qualifiers.size()][][])); |
| 324 | case 4: scanner.setStartKey(args[3]); |
| 325 | } |
| 326 | LOG.info("Start scanner=" + scanner); |
| 327 | try { |
| 328 | ArrayList<ArrayList<KeyValue>> rows; |
| 329 | while ((rows = scanner.nextRows().joinUninterruptibly()) != null) { |
| 330 | LOG.info("scanned results=" + rows + " from " + scanner); |
| 331 | } |
| 332 | } catch (Exception e) { |
| 333 | LOG.error("Scan failed", e); |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | private static final class cas implements Cmd { |
nothing calls this directly
no test coverage detected