HDDS-282. Consolidate logging in scm/container-service. Contributed by Elek Marton.
This commit is contained in:
parent
35ce6eb1f5
commit
cd0b9f1380
@ -203,11 +203,11 @@ public void logIfNeeded(Exception ex) {
|
||||
this.incMissed();
|
||||
if (this.getMissedCount() % getLogWarnInterval(conf) ==
|
||||
0) {
|
||||
LOG.warn("Unable to communicate to SCM server at {}. We have not been " +
|
||||
LOG.error("Unable to communicate to SCM server at {}. We have not been " +
|
||||
"able to communicate to this SCM server for past {} seconds.",
|
||||
this.getAddress().getHostString() + ":" + this.getAddress().getPort(),
|
||||
this.getMissedCount() * getScmHeartbeatInterval(
|
||||
this.conf));
|
||||
this.conf), ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,8 +125,7 @@ public EndpointStateMachine.EndPointStates call() throws Exception {
|
||||
rpcEndPoint.setState(nextState);
|
||||
rpcEndPoint.zeroMissedCount();
|
||||
} catch (IOException ex) {
|
||||
rpcEndPoint.logIfNeeded(ex
|
||||
);
|
||||
rpcEndPoint.logIfNeeded(ex);
|
||||
} finally {
|
||||
rpcEndPoint.unlock();
|
||||
}
|
||||
|
@ -119,9 +119,11 @@ public BackgroundTaskQueue getTasks() {
|
||||
// configured.
|
||||
containers = containerSet.chooseContainerForBlockDeletion(
|
||||
containerLimitPerInterval, containerDeletionPolicy);
|
||||
LOG.info("Plan to choose {} containers for block deletion, "
|
||||
+ "actually returns {} valid containers.",
|
||||
containerLimitPerInterval, containers.size());
|
||||
if (containers.size() > 0) {
|
||||
LOG.info("Plan to choose {} containers for block deletion, "
|
||||
+ "actually returns {} valid containers.",
|
||||
containerLimitPerInterval, containers.size());
|
||||
}
|
||||
|
||||
for(ContainerData container : containers) {
|
||||
BlockDeletingTask containerTask =
|
||||
|
@ -155,8 +155,7 @@ public <PAYLOAD, EVENT_TYPE extends Event<PAYLOAD>> void fireEvent(
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
"No event handler registered for event " + event);
|
||||
LOG.warn("No event handler registered for event " + event);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,9 @@ public String getName() {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TypedEvent{" + "payloadType=" + payloadType + ", name='" + name
|
||||
+ '\'' + '}';
|
||||
return "TypedEvent{" +
|
||||
"payloadType=" + payloadType.getSimpleName() +
|
||||
", name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user