Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-28807 Remove some useless code and add some logs for CanaryTool #6187

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
NihalJain marked this conversation as resolved.
Show resolved Hide resolved
for (HRegionLocation location : regionLocator.getAllRegionLocations()) {
if (location == null) {
LOG.warn("Null location for table {}", tableDesc.getTableName());
continue;
}
return executor.invokeAll(tasks);
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>());
}
} catch (TableNotFoundException e) {
return Collections.EMPTY_LIST;
return executor.invokeAll(tasks);
}
}

Expand Down Expand Up @@ -1924,7 +1920,7 @@ private Map<String, List<RegionInfo>> getAllRegionServerByName() {
this.admin.getConnection().getRegionLocator(tableDesc.getTableName())) {
for (HRegionLocation location : regionLocator.getAllRegionLocations()) {
if (location == null) {
LOG.warn("Null location");
LOG.warn("Null location for table {}", tableDesc.getTableName());
continue;
}
ServerName rs = location.getServerName();
Expand Down