Skip to content

Commit

Permalink
HDDS-10867. Clean Up Unnecessary Logs in Recon. (apache#6703)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArafatKhan2198 authored May 28, 2024
1 parent 879c6ca commit 5179fc3
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void triggerContainerHealthCheck() {
long currentTime = System.currentTimeMillis();
long existingCount = processExistingDBRecords(currentTime,
unhealthyContainerStateStatsMap);
LOG.info("Container Health task thread took {} milliseconds to" +
LOG.debug("Container Health task thread took {} milliseconds to" +
" process {} existing database records.",
Time.monotonicNow() - start, existingCount);

Expand All @@ -163,7 +163,7 @@ private void checkAndProcessContainers(
.forEach(c -> processContainer(c, currentTime,
unhealthyContainerStateStatsMap));
recordSingleRunCompletion();
LOG.info("Container Health task thread took {} milliseconds for" +
LOG.debug("Container Health task thread took {} milliseconds for" +
" processing {} containers.", Time.monotonicNow() - start,
containers.size());
logUnhealthyContainerStats(unhealthyContainerStateStatsMap);
Expand Down Expand Up @@ -492,11 +492,11 @@ public static List<UnhealthyContainers> generateUnhealthyRecords(
populateContainerStats(container, UnHealthyContainerStates.MISSING,
unhealthyContainerStateStatsMap);
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("Empty container {} is missing. Kindly check the " +
"consolidated container stats per UNHEALTHY state logged as " +
"starting with **Container State Stats:**");
}

LOG.debug("Empty container {} is missing. Kindly check the " +
"consolidated container stats per UNHEALTHY state logged as " +
"starting with **Container State Stats:**");

records.add(
recordForState(container, EMPTY_MISSING,
time));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void triggerPipelineSyncTask()
List<Pipeline> pipelinesFromScm = scmClient.getPipelines();
reconPipelineManager.initializePipelines(pipelinesFromScm);
syncOperationalStateOnDeadNodes();
LOG.info("Pipeline sync Thread took {} milliseconds.",
LOG.debug("Pipeline sync Thread took {} milliseconds.",
Time.monotonicNow() - start);
recordSingleRunCompletion();
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) {
// containerId -> key count
Map<Long, Long> containerKeyCountMap = new HashMap<>();
try {
LOG.info("Starting a 'reprocess' run of ContainerKeyMapperTask.");
LOG.debug("Starting a 'reprocess' run of ContainerKeyMapperTask.");
Instant start = Instant.now();

// initialize new container DB
Expand Down Expand Up @@ -137,10 +137,10 @@ public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) {
return new ImmutablePair<>(getTaskName(), false);
}

LOG.info("Completed 'reprocess' of ContainerKeyMapperTask.");
LOG.debug("Completed 'reprocess' of ContainerKeyMapperTask.");
Instant end = Instant.now();
long duration = Duration.between(start, end).toMillis();
LOG.info("It took me {} seconds to process {} keys.",
LOG.debug("It took me {} seconds to process {} keys.",
(double) duration / 1000.0, omKeyCount);
} catch (IOException ioEx) {
LOG.error("Unable to populate Container Key data in Recon DB. ",
Expand Down Expand Up @@ -258,7 +258,7 @@ public Pair<String, Boolean> process(OMUpdateEventBatch events) {
LOG.error("Unable to write Container Key Prefix data in Recon DB.", e);
return new ImmutablePair<>(getTaskName(), false);
}
LOG.info("{} successfully processed {} OM DB update event(s).",
LOG.debug("{} successfully processed {} OM DB update event(s).",
getTaskName(), eventCount);
return new ImmutablePair<>(getTaskName(), true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected synchronized void run() {
try {
int execute =
dslContext.truncate(CONTAINER_COUNT_BY_SIZE).execute();
LOG.info("Deleted {} records from {}", execute,
LOG.debug("Deleted {} records from {}", execute,
CONTAINER_COUNT_BY_SIZE);
} catch (Exception e) {
LOG.error("An error occurred while truncating the table {}: {}",
Expand All @@ -111,7 +111,7 @@ protected synchronized void run() {
endTime = System.nanoTime();
duration = endTime - startTime;
durationMilliseconds = duration / 1_000_000;
LOG.info("Elapsed Time in milliseconds for Process() execution: {}",
LOG.debug("Elapsed Time in milliseconds for Process() execution: {}",
durationMilliseconds);
}
} catch (Throwable t) {
Expand Down Expand Up @@ -197,7 +197,7 @@ public void process(List<ContainerInfo> containers) {
// Write to the database
writeCountsToDB(false, containerSizeCountMap);
containerSizeCountMap.clear();
LOG.info("Completed a 'process' run of ContainerSizeCountTask.");
LOG.debug("Completed a 'process' run of ContainerSizeCountTask.");
} finally {
lock.writeLock().unlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) {

// Delete all records from FILE_COUNT_BY_SIZE table
int execute = dslContext.delete(FILE_COUNT_BY_SIZE).execute();
LOG.info("Deleted {} records from {}", execute, FILE_COUNT_BY_SIZE);
LOG.debug("Deleted {} records from {}", execute, FILE_COUNT_BY_SIZE);

// Call reprocessBucket method for FILE_SYSTEM_OPTIMIZED bucket layout
boolean statusFSO =
Expand All @@ -96,7 +96,7 @@ public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) {
return new ImmutablePair<>(getTaskName(), false);
}
writeCountsToDB(true, fileSizeCountMap);
LOG.info("Completed a 'reprocess' run of FileSizeCountTask.");
LOG.debug("Completed a 'reprocess' run of FileSizeCountTask.");
return new ImmutablePair<>(getTaskName(), true);
}

Expand Down Expand Up @@ -198,7 +198,7 @@ public Pair<String, Boolean> process(OMUpdateEventBatch events) {
}
}
writeCountsToDB(false, fileSizeCountMap);
LOG.info("Completed a 'process' run of FileSizeCountTask.");
LOG.debug("Completed a 'process' run of FileSizeCountTask.");
return new ImmutablePair<>(getTaskName(), true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) {
TimeUnit.NANOSECONDS.toMillis(endTime - startTime);

// Log performance metrics
LOG.info("Task execution time: {} milliseconds", durationInMillis);
LOG.debug("Task execution time: {} milliseconds", durationInMillis);
}

return new ImmutablePair<>(getTaskName(), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public boolean processWithFSO(OMUpdateEventBatch events) {
return false;
}

LOG.info("Completed a process run of NSSummaryTaskWithFSO");
LOG.debug("Completed a process run of NSSummaryTaskWithFSO");
return true;
}

Expand Down Expand Up @@ -210,7 +210,7 @@ public boolean reprocessWithFSO(OMMetadataManager omMetadataManager) {
if (!flushAndCommitNSToDB(nsSummaryMap)) {
return false;
}
LOG.info("Completed a reprocess run of NSSummaryTaskWithFSO");
LOG.debug("Completed a reprocess run of NSSummaryTaskWithFSO");
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public boolean processWithLegacy(OMUpdateEventBatch events) {
return false;
}

LOG.info("Completed a process run of NSSummaryTaskWithLegacy");
LOG.debug("Completed a process run of NSSummaryTaskWithLegacy");
return true;
}

Expand Down Expand Up @@ -294,7 +294,7 @@ public boolean reprocessWithLegacy(OMMetadataManager omMetadataManager) {
if (!flushAndCommitNSToDB(nsSummaryMap)) {
return false;
}
LOG.info("Completed a reprocess run of NSSummaryTaskWithLegacy");
LOG.debug("Completed a reprocess run of NSSummaryTaskWithLegacy");
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public boolean reprocessWithOBS(OMMetadataManager omMetadataManager) {
if (!flushAndCommitNSToDB(nsSummaryMap)) {
return false;
}
LOG.info("Completed a reprocess run of NSSummaryTaskWithOBS");
LOG.debug("Completed a reprocess run of NSSummaryTaskWithOBS");
return true;
}

Expand Down Expand Up @@ -203,7 +203,7 @@ public boolean processWithOBS(OMUpdateEventBatch events) {
return false;
}

LOG.info("Completed a process run of NSSummaryTaskWithOBS");
LOG.debug("Completed a process run of NSSummaryTaskWithOBS");
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Pair<String, Boolean> reprocess(OMMetadataManager omMetadataManager) {
writeDataToDB(replicatedSizeMap);
}

LOG.info("Completed a 'reprocess' run of OmTableInsightTask.");
LOG.debug("Completed a 'reprocess' run of OmTableInsightTask.");
return new ImmutablePair<>(getTaskName(), true);
}

Expand Down Expand Up @@ -208,7 +208,7 @@ public Pair<String, Boolean> process(OMUpdateEventBatch events) {
if (!replicatedSizeMap.isEmpty()) {
writeDataToDB(replicatedSizeMap);
}
LOG.info("Completed a 'process' run of OmTableInsightTask.");
LOG.debug("Completed a 'process' run of OmTableInsightTask.");
return new ImmutablePair<>(getTaskName(), true);
}

Expand Down

0 comments on commit 5179fc3

Please sign in to comment.