Skip to content

Commit

Permalink
Merge branch 'main' into accumulo-5096
Browse files Browse the repository at this point in the history
  • Loading branch information
cshannon committed Nov 24, 2024
2 parents 7f48157 + a4b658a commit 6e16159
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -606,16 +606,24 @@ private TableMgmtStats manageTablets(Iterator<TabletManagement> iter,
state, goal, actions, tm.getLogs().size());
}

if (actions.contains(ManagementAction.NEEDS_SPLITTING)) {
final boolean needsSplit = actions.contains(ManagementAction.NEEDS_SPLITTING);
if (needsSplit) {
LOG.debug("{} may need splitting.", tm.getExtent());
manager.getSplitter().initiateSplit(new SeedSplitTask(manager, tm.getExtent()));
}

if (actions.contains(ManagementAction.NEEDS_COMPACTING) && compactionGenerator != null) {
var jobs = compactionGenerator.generateJobs(tm,
TabletManagementIterator.determineCompactionKinds(actions));
LOG.debug("{} may need compacting adding {} jobs", tm.getExtent(), jobs.size());
manager.getCompactionCoordinator().addJobs(tm, jobs);
// Check if tablet needs splitting, priority should be giving to splits over
// compactions because it's best to compact after a split
if (!needsSplit) {
var jobs = compactionGenerator.generateJobs(tm,
TabletManagementIterator.determineCompactionKinds(actions));
LOG.debug("{} may need compacting adding {} jobs", tm.getExtent(), jobs.size());
manager.getCompactionCoordinator().addJobs(tm, jobs);
} else {
LOG.trace("skipping compaction job generation because {} may need splitting.",
tm.getExtent());
}
}

if (actions.contains(ManagementAction.NEEDS_LOCATION_UPDATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,14 @@ public boolean test(TabletMetadata tabletMetadata) {
final FileSystem fs = vol.getFileSystem();
for (ExternalCompactionId ecid : ecidsForTablet) {
final String fileSuffix = "_tmp_" + ecid.canonical();
FileStatus[] files = fs.listStatus(new Path(volPath), (path) -> {
return path.getName().endsWith(fileSuffix);
});
if (files.length > 0) {
FileStatus[] files = null;
try {
files = fs.listStatus(new Path(volPath),
(path) -> path.getName().endsWith(fileSuffix));
} catch (FileNotFoundException e) {
LOG.trace("Failed to list tablet dir {}", volPath, e);
}
if (files != null) {
for (FileStatus file : files) {
if (!fs.delete(file.getPath(), false)) {
LOG.warn("Unable to delete ecid tmp file: {}: ", file.getPath());
Expand Down

0 comments on commit 6e16159

Please sign in to comment.