use of org.apache.accumulo.tserver.log.DfsLogger in project accumulo by apache.
the class Tablet method beginClearingUnusedLogs.
Set<String> beginClearingUnusedLogs() {
Set<String> doomed = new HashSet<>();
ArrayList<String> otherLogsCopy = new ArrayList<>();
ArrayList<String> currentLogsCopy = new ArrayList<>();
// do not hold tablet lock while acquiring the log lock
logLock.lock();
synchronized (this) {
if (removingLogs)
throw new IllegalStateException("Attempted to clear logs when removal of logs in progress");
for (DfsLogger logger : otherLogs) {
otherLogsCopy.add(logger.toString());
doomed.add(logger.getMeta());
}
for (DfsLogger logger : currentLogs) {
currentLogsCopy.add(logger.toString());
doomed.remove(logger.getMeta());
}
otherLogs = Collections.emptySet();
if (doomed.size() > 0)
removingLogs = true;
}
// do debug logging outside tablet lock
for (String logger : otherLogsCopy) {
log.debug("Logs for memory compacted: {} {}", getExtent(), logger.toString());
}
for (String logger : currentLogsCopy) {
log.debug("Logs for current memory: {} {}", getExtent(), logger);
}
for (String logger : doomed) {
log.debug("Logs to be destroyed: {} {}", getExtent(), logger);
}
return doomed;
}
use of org.apache.accumulo.tserver.log.DfsLogger in project accumulo by apache.
the class TabletServer method markUnusedWALs.
private void markUnusedWALs() {
Set<DfsLogger> candidates;
synchronized (closedLogs) {
candidates = new HashSet<>(closedLogs);
}
for (Tablet tablet : getOnlineTablets()) {
candidates.removeAll(tablet.getCurrentLogFiles());
}
try {
TServerInstance session = this.getTabletSession();
for (DfsLogger candidate : candidates) {
log.info("Marking " + candidate.getPath() + " as unreferenced");
walMarker.walUnreferenced(session, candidate.getPath());
}
synchronized (closedLogs) {
closedLogs.removeAll(candidates);
}
} catch (WalMarkerException ex) {
log.info(ex.toString(), ex);
}
}
Aggregations