HBASE-23687 DEBUG logging cleanup (#1040)
Signed-off-by: Jan Hentschel <janh@apache.org>
This commit is contained in:
parent
499ff32f00
commit
8b7b097905
|
@ -148,7 +148,7 @@ class RootProcedureState<TEnvironment> {
|
|||
subprocStack = new ArrayList<>();
|
||||
}
|
||||
proc.addStackIndex(subprocStack.size());
|
||||
LOG.debug("Add procedure {} as the {}th rollback step", proc, subprocStack.size());
|
||||
LOG.trace("Add procedure {} as the {}th rollback step", proc, subprocStack.size());
|
||||
subprocStack.add(proc);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.fs.FileStatus;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
|
@ -111,8 +113,13 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
|
|||
results.add(new CleanerContext(file));
|
||||
}
|
||||
}
|
||||
if (results.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOG.debug("Old WAL files pending deletion: {}", results);
|
||||
LOG.debug("Old WALs for delete: {}",
|
||||
results.stream().map(cc -> cc.target.getPath().getName()).
|
||||
collect(Collectors.joining(", ")));
|
||||
pendingDelete.addAll(results);
|
||||
|
||||
int deletedFiles = 0;
|
||||
|
@ -140,7 +147,7 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
|
|||
}
|
||||
|
||||
private List<Thread> createOldWalsCleaner(int size) {
|
||||
LOG.info("Creating {} OldWALs cleaner threads", size);
|
||||
LOG.info("Creating {} old WALs cleaner threads", size);
|
||||
|
||||
List<Thread> oldWALsCleaner = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
@ -168,12 +175,12 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
|
|||
Preconditions.checkNotNull(context);
|
||||
FileStatus oldWalFile = context.getTargetToClean();
|
||||
try {
|
||||
LOG.debug("Attempting to delete old WAL file: {}", oldWalFile);
|
||||
LOG.debug("Deleting {}", oldWalFile);
|
||||
boolean succeed = this.fs.delete(oldWalFile.getPath(), false);
|
||||
context.setResult(succeed);
|
||||
} catch (IOException e) {
|
||||
// fs.delete() fails.
|
||||
LOG.warn("Failed to clean old WAL file", e);
|
||||
LOG.warn("Failed to delete old WAL file", e);
|
||||
context.setResult(false);
|
||||
}
|
||||
} catch (InterruptedException ite) {
|
||||
|
@ -184,7 +191,7 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
|
|||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
}
|
||||
LOG.debug("Exiting");
|
||||
LOG.trace("Exiting");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,7 +224,7 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
|
|||
boolean completed = this.remainingResults.await(waitIfNotFinished,
|
||||
TimeUnit.MILLISECONDS);
|
||||
if (!completed) {
|
||||
LOG.warn("Spend too much time [{}ms] to delete old WAL file: {}",
|
||||
LOG.warn("Spent too much time [{}ms] deleting old WAL file: {}",
|
||||
waitIfNotFinished, target);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -347,8 +347,8 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler {
|
|||
|
||||
private static <T extends Comparable<T>> void addToRunQueue(FairQueue<T> fairq, Queue<T> queue,
|
||||
Supplier<String> reason) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Add {} to run queue because: {}", queue, reason.get());
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("Add {} to run queue because: {}", queue, reason.get());
|
||||
}
|
||||
if (!AvlIterableList.isLinked(queue) && !queue.isEmpty()) {
|
||||
fairq.add(queue);
|
||||
|
@ -357,8 +357,8 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler {
|
|||
|
||||
private static <T extends Comparable<T>> void removeFromRunQueue(FairQueue<T> fairq,
|
||||
Queue<T> queue, Supplier<String> reason) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Remove {} from run queue because: {}", queue, reason.get());
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("Remove {} from run queue because: {}", queue, reason.get());
|
||||
}
|
||||
if (AvlIterableList.isLinked(queue)) {
|
||||
fairq.remove(queue);
|
||||
|
|
|
@ -87,7 +87,7 @@ final class RegionProcedureStoreWALRoller extends AbstractWALRoller<Abortable> {
|
|||
Path newFile = new Path(globalWALArchiveDir,
|
||||
file.getName() + MasterProcedureUtil.ARCHIVED_PROC_WAL_SUFFIX);
|
||||
if (fs.rename(file, newFile)) {
|
||||
LOG.info("Successfully moved {} to {}", file, newFile);
|
||||
LOG.info("Moved {} to {}", file, newFile);
|
||||
} else {
|
||||
LOG.warn("Failed to move archived wal from {} to global place {}", file, newFile);
|
||||
}
|
||||
|
@ -124,4 +124,4 @@ final class RegionProcedureStoreWALRoller extends AbstractWALRoller<Abortable> {
|
|||
conf.setFloat(AbstractFSWAL.WAL_ROLL_MULTIPLIER, 0.5f);
|
||||
return new RegionProcedureStoreWALRoller(conf, abortable, fs, walRootDir, globalWALRootDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue