private static List<Future<Void>> sniff(final Admin admin, final Sink sink,
    TableDescriptor tableDesc, ExecutorService executor, TaskType taskType, boolean rawScanEnabled,
    LongAdder rwLatency, boolean readAllCF) throws Exception {
    LOG.debug("Reading list of regions for table {}", tableDesc.getTableName());
    List<RegionTask> tasks = new ArrayList<>();
    try (RegionLocator regionLocator =
      admin.getConnection().getRegionLocator(tableDesc.getTableName())) {
      for (HRegionLocation location : regionLocator.getAllRegionLocations()) {
        if (location == null) {
          LOG.warn("Null location for table {}", tableDesc.getTableName());
          continue;
        }
        ServerName rs = location.getServerName();
        RegionInfo region = location.getRegion();
        tasks.add(new RegionTask(admin.getConnection(), region, rs, (RegionStdOutSink) sink,
          taskType, rawScanEnabled, rwLatency, readAllCF));
        Map<String, List<RegionTaskResult>> regionMap = ((RegionStdOutSink) sink).getRegionMap();
        regionMap.put(region.getRegionNameAsString(), new ArrayList<RegionTaskResult>());
      }
      return executor.invokeAll(tasks);
    }
  }
Canary entry point for specified table.
@throws Exception exception
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java