Skip to content
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
24 changes: 14 additions & 10 deletions server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@
* A single garbage collection performed on a table (Root, MD) or all User tables.
*/
public class GCRun implements GarbageCollectionEnvironment {
// loggers are not static to support unique naming by level
private final Logger log;
private static final String fileActionPrefix = "FILE-ACTION:";
private final Ample.DataLevel level;
private final ServerContext context;
private final AccumuloConfiguration config;
Expand All @@ -97,7 +99,7 @@ public class GCRun implements GarbageCollectionEnvironment {
private long errors = 0;

public GCRun(Ample.DataLevel level, ServerContext context) {
this.log = LoggerFactory.getLogger(level.name() + GCRun.class);
this.log = LoggerFactory.getLogger(GCRun.class.getName() + "." + level.name());
this.level = level;
this.context = context;
this.config = context.getConfiguration();
Expand Down Expand Up @@ -236,9 +238,9 @@ public void deleteConfirmedCandidates(SortedMap<String,String> confirmedDeletes)
System.out.println("SAFEMODE: There are " + confirmedDeletes.size()
+ " data file candidates marked for deletion in " + metadataLocation + ".\n"
+ " Examine the log files to identify them.\n");
log.info("SAFEMODE: Listing all data file candidates for deletion");
log.info("{} SAFEMODE: Listing all data file candidates for deletion", fileActionPrefix);
for (String s : confirmedDeletes.values()) {
log.info("SAFEMODE: {}", s);
log.info("{} SAFEMODE: {}", fileActionPrefix, s);
}
log.info("SAFEMODE: End candidates for deletion");
return;
Expand Down Expand Up @@ -278,7 +280,7 @@ public void deleteConfirmedCandidates(SortedMap<String,String> confirmedDeletes)
}

for (Path pathToDel : GcVolumeUtil.expandAllVolumesUri(fs, fullPath)) {
log.debug("Deleting {}", pathToDel);
log.debug("{} Deleting {}", fileActionPrefix, pathToDel);

if (moveToTrash(pathToDel) || fs.deleteRecursively(pathToDel)) {
// delete succeeded, still want to delete
Expand All @@ -288,7 +290,8 @@ public void deleteConfirmedCandidates(SortedMap<String,String> confirmedDeletes)
// leave the entry in the metadata; we'll try again later
removeFlag = false;
errors++;
log.warn("File exists, but was not deleted for an unknown reason: {}", pathToDel);
log.warn("{} File exists, but was not deleted for an unknown reason: {}",
fileActionPrefix, pathToDel);
break;
} else {
// this failure, we still want to remove the metadata entry
Expand All @@ -303,11 +306,11 @@ public void deleteConfirmedCandidates(SortedMap<String,String> confirmedDeletes)
if (tableState != null && tableState != TableState.DELETING) {
// clone directories don't always exist
if (!tabletDir.startsWith(Constants.CLONE_PREFIX)) {
log.debug("File doesn't exist: {}", pathToDel);
log.debug("{} File doesn't exist: {}", fileActionPrefix, pathToDel);
}
}
} else {
log.warn("Very strange path name: {}", delete);
log.warn("{} Invalid file path format: {}", fileActionPrefix, delete);
}
}
}
Expand All @@ -318,7 +321,7 @@ public void deleteConfirmedCandidates(SortedMap<String,String> confirmedDeletes)
processedDeletes.add(delete);
}
} catch (Exception e) {
log.error("{}", e.getMessage(), e);
log.error("{} Exception while deleting files ", fileActionPrefix, e);
}

};
Expand Down Expand Up @@ -353,7 +356,7 @@ public void deleteTableDirIfEmpty(TableId tableID) throws IOException {

if (tabletDirs.length == 0) {
Path p = new Path(dir + "/" + tableID);
log.debug("Removing table dir {}", p);
log.debug("{} Removing table dir {}", fileActionPrefix, p);
if (!moveToTrash(p)) {
fs.delete(p);
}
Expand Down Expand Up @@ -437,7 +440,8 @@ static void minimizeDeletes(SortedMap<String,String> confirmedDeletes,
}

if (sameVol) {
logger.info("Ignoring {} because {} exist", entry.getValue(), lastDirAbs);
logger.info("{} Ignoring {} because {} exist", fileActionPrefix, entry.getValue(),
lastDirAbs);
processedDeletes.add(entry.getValue());
cdIter.remove();
}
Expand Down