1458451310 commented on code in PR #6187:
URL: https://github.com/apache/hbase/pull/6187#discussion_r1743604321


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryTool.java:
##########
@@ -1699,26 +1699,22 @@ 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());
-    try (Table table = 
admin.getConnection().getTable(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");
-            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>());
+    List<RegionTask> tasks = new ArrayList<>();
+    try (RegionLocator regionLocator =
+      admin.getConnection().getRegionLocator(tableDesc.getTableName())) {

Review Comment:
   if (admin.isTableEnabled(TableName.valueOf(tableName))) {
         return CanaryTool.sniff(admin, sink, 
admin.getDescriptor(TableName.valueOf(tableName)),
           executor, taskType, rawScanEnabled, readLatency, readAllCF);
   
   so I think we never hit the TNFE.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to