NihalJain commented on code in PR #6187:
URL: https://github.com/apache/hbase/pull/6187#discussion_r1743245665
##########
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:
does this line thrown TNFE if the table is missing? I am asking since we are
not catching TNFE anymore, just wanted to make sure we never hit it now onwards
--
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]