Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,18 @@ public void handle(SCMCommand<?> command, OzoneContainer ozoneContainer,
// Remove the Ratis group from the current datanode pipeline, might throw GroupMismatchException as
// well. It is a no-op for XceiverServerSpi implementations (e.g. XceiverServerGrpc)
server.removeGroup(pipelineIdProto);
LOG.info("Close Pipeline {} command on datanode {}.", pipelineID,
dn.getUuidString());
LOG.info("Close Pipeline {} command on datanode {}.", pipelineID, dn);
} else {
LOG.debug("Ignoring close pipeline command for pipeline {} on datanode {} " +
"as it does not exist", pipelineID, dn.getUuidString());
"as it does not exist", pipelineID, dn);
}
} catch (IOException e) {
Throwable gme = HddsClientUtils.containsException(e, GroupMismatchException.class);
if (gme != null) {
// ignore silently since this means that the group has been closed by earlier close pipeline
// command in another datanode
LOG.debug("The group for pipeline {} on datanode {} has been removed by earlier close " +
"pipeline command handled in another datanode", pipelineID, dn.getUuidString());
"pipeline command handled in another datanode", pipelineID, dn);
} else {
LOG.error("Can't close pipeline {}", pipelineID, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ContainerMoveSelection findTargetForContainerMove(
}
}
logger.debug("Container Balancer could not find a target for " +
"source datanode {}", source.getUuidString());
"source datanode {}", source);
return null;
}

Expand Down Expand Up @@ -164,8 +164,7 @@ private boolean containerMoveSatisfiesPlacementPolicy(
boolean isPolicySatisfied = placementStatus.isPolicySatisfied();
if (!isPolicySatisfied) {
logger.debug("Moving container {} from source {} to target {} will not " +
"satisfy placement policy.", containerID, source.getUuidString(),
target.getUuidString());
"satisfy placement policy.", containerID, source, target);
}
return isPolicySatisfied;
}
Expand All @@ -191,7 +190,7 @@ private boolean canSizeEnterTarget(DatanodeDetails target, long size) {
if (sizeEnteringAfterMove > config.getMaxSizeEnteringTarget()) {
logger.debug("{} bytes cannot enter datanode {} because 'size" +
".entering.target.max' limit is {} and {} bytes have already " +
"entered.", size, target.getUuidString(),
"entered.", size, target,
config.getMaxSizeEnteringTarget(),
sizeEnteringNode.get(target));
return false;
Expand All @@ -200,14 +199,13 @@ private boolean canSizeEnterTarget(DatanodeDetails target, long size) {
.calculateUtilization(sizeEnteringAfterMove), upperLimit) > 0) {
logger.debug("{} bytes cannot enter datanode {} because its " +
"utilization will exceed the upper limit of {}.", size,
target.getUuidString(), upperLimit);
target, upperLimit);
return false;
}
return true;
}

logger.warn("No record of how much size has entered datanode {}",
target.getUuidString());
logger.warn("No record of how much size has entered datanode {}", target);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ private boolean initializeIteration() {
if (LOG.isDebugEnabled()) {
LOG.debug("Utilization for node {} with capacity {}B, used {}B, and " +
"remaining {}B is {}",
datanodeUsageInfo.getDatanodeDetails().getUuidString(),
datanodeUsageInfo.getDatanodeDetails(),
datanodeUsageInfo.getScmNodeStat().getCapacity().get(),
datanodeUsageInfo.getScmNodeStat().getScmUsed().get(),
datanodeUsageInfo.getScmNodeStat().getRemaining().get(),
Expand Down Expand Up @@ -683,8 +683,8 @@ private boolean processMoveSelection(DatanodeDetails source,
"{}B from source datanode {} to target datanode {}",
containerID.toString(),
containerInfo.getUsedBytes(),
source.getUuidString(),
moveSelection.getTargetNode().getUuidString());
source,
moveSelection.getTargetNode());

if (moveContainer(source, moveSelection)) {
// consider move successful for now, and update selection criteria
Expand Down Expand Up @@ -792,9 +792,8 @@ private long cancelMovesThatExceedTimeoutDuration() {
if (!entry.getValue().isDone()) {
LOG.warn("Container move timed out for container {} from source {}" +
" to target {}.", entry.getKey().getContainerID(),
containerToSourceMap.get(entry.getKey().getContainerID())
.getUuidString(),
entry.getKey().getTargetNode().getUuidString());
containerToSourceMap.get(entry.getKey().getContainerID()),
entry.getKey().getTargetNode());

entry.getValue().cancel(true);
numCancelled += 1;
Expand All @@ -817,14 +816,14 @@ private ContainerMoveSelection matchSourceWithTarget(DatanodeDetails source) {
if (sourceContainerIDSet.isEmpty()) {
if (LOG.isDebugEnabled()) {
LOG.debug("ContainerBalancer could not find any candidate containers " +
"for datanode {}", source.getUuidString());
"for datanode {}", source);
}
return null;
}

if (LOG.isDebugEnabled()) {
LOG.debug("ContainerBalancer is finding suitable target for source " +
"datanode {}", source.getUuidString());
"datanode {}", source);
}

ContainerMoveSelection moveSelection = null;
Expand All @@ -846,12 +845,11 @@ private ContainerMoveSelection matchSourceWithTarget(DatanodeDetails source) {

if (moveSelection == null) {
LOG.info("ContainerBalancer could not find a suitable target for " +
"source node {}.", source.getUuidString());
"source node {}.", source);
return null;
}
LOG.info("ContainerBalancer matched source datanode {} with target " +
"datanode {} for container move.", source.getUuidString(),
moveSelection.getTargetNode().getUuidString());
"datanode {} for container move.", source, moveSelection.getTargetNode());

return moveSelection;
}
Expand Down Expand Up @@ -947,24 +945,22 @@ private boolean moveContainer(DatanodeDetails source,
if (ex != null) {
LOG.info("Container move for container {} from source {} to " +
"target {} failed with exceptions.",
containerID.toString(),
source.getUuidString(),
moveSelection.getTargetNode().getUuidString(), ex);
containerID, source,
moveSelection.getTargetNode(), ex);
metrics.incrementNumContainerMovesFailedInLatestIteration(1);
} else {
if (result == MoveManager.MoveResult.COMPLETED) {
sizeActuallyMovedInLatestIteration +=
containerInfo.getUsedBytes();
LOG.debug("Container move completed for container {} from " +
"source {} to target {}", containerID,
source.getUuidString(),
moveSelection.getTargetNode().getUuidString());
"source {} to target {}", containerID, source,
moveSelection.getTargetNode());
} else {
LOG.warn(
"Container move for container {} from source {} to target" +
" {} failed: {}",
moveSelection.getContainerID(), source.getUuidString(),
moveSelection.getTargetNode().getUuidString(), result);
moveSelection.getContainerID(), source,
moveSelection.getTargetNode(), result);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,20 @@ public boolean canSizeLeaveSource(DatanodeDetails source, long size) {
//3 after subtracting sizeLeavingAfterMove, the usage is bigger
// than or equal to lowerLimit
if (size <= 0) {
LOG.debug("{} bytes container cannot leave datanode {}", size, source.getUuidString());
LOG.debug("{} bytes container cannot leave datanode {}", size, source);
return false;
}
if (sizeLeavingAfterMove > config.getMaxSizeLeavingSource()) {
LOG.debug("{} bytes cannot leave datanode {} because 'size.leaving" +
".source.max' limit is {} and {} bytes have already left.",
size, source.getUuidString(), config.getMaxSizeLeavingSource(),
size, source, config.getMaxSizeLeavingSource(),
sizeLeavingNode.get(source));
return false;
}
if (Double.compare(nodeManager.getUsageInfo(source)
.calculateUtilization(-sizeLeavingAfterMove), lowerLimit) < 0) {
LOG.debug("{} bytes cannot leave datanode {} because its utilization " +
"will drop below the lower limit of {}.", size,
source.getUuidString(), lowerLimit);
"will drop below the lower limit of {}.", size, source, lowerLimit);
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ CompletableFuture<MoveResult> move(
}
startMove(containerInfo, src, tgt, ret);
LOG.debug("Processed a move request for container {}, from {} to {}",
cid, src.getUuidString(), tgt.getUuidString());
cid, src, tgt);
return ret;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public boolean handle(ContainerCheckRequest request) {
} catch (NotLeaderException e) {
LOG.warn("Failed to delete empty replica with index {} for " +
"container {} on datanode {}", rp.getReplicaIndex(),
cID, rp.getDatanodeDetails().getUuidString(), e);
cID, rp.getDatanodeDetails(), e);
}
});
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private void deleteContainerReplicas(final ContainerInfo containerInfo,
" {} on datanode {}",
rp.getReplicaIndex(),
containerInfo.containerID(),
rp.getDatanodeDetails().getUuidString(), e);
rp.getDatanodeDetails(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onMessage(DatanodeDetails datanodeDetails,
"containers.",
pipelineID, pipeline.getPipelineState(),
HddsProtos.NodeState.HEALTHY_READONLY,
datanodeDetails.getUuidString());
datanodeDetails);
pipelineManager.closePipeline(pipelineID);
} catch (IOException ex) {
LOG.error("Failed to close pipeline {} which uses HEALTHY READONLY " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,7 @@ public RegisteredCommand register(
final DatanodeInfo oldNode = nodeStateManager.getNode(datanodeDetails);
if (updateDnsToDnIdMap(oldNode.getHostName(), oldNode.getIpAddress(),
hostName, ipAddress, dnId)) {
LOG.info("Updating datanode {} from {} to {}",
datanodeDetails.getUuidString(),
oldNode,
datanodeDetails);
LOG.info("Updating datanode from {} to {}", oldNode, datanodeDetails);
clusterMap.update(oldNode, datanodeDetails);
nodeStateManager.updateNode(datanodeDetails, layoutInfo);
DatanodeDetails dn = nodeStateManager.getNode(datanodeDetails);
Expand Down Expand Up @@ -1069,8 +1066,7 @@ private SCMNodeStat getNodeStatInternal(DatanodeDetails datanodeDetails) {
return new SCMNodeStat(capacity, used, remaining, committed,
freeSpaceToSpare);
} catch (NodeNotFoundException e) {
LOG.warn("Cannot generate NodeStat, datanode {} not found.",
datanodeDetails.getUuidString());
LOG.warn("Cannot generate NodeStat, datanode {} not found.", datanodeDetails);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void processPipelineAction(final DatanodeDetails datanode,
final PipelineID pid = PipelineID.getFromProtobuf(info.getPipelineID());

final String logMsg = "Received pipeline action " + action + " for " + pid +
" from datanode " + datanode.getUuidString() + "." +
" from datanode " + datanode + "." +
" Reason : " + info.getDetailedReason();

// We can skip processing Pipeline Action if the current SCM is not leader.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,7 @@ public void closeStalePipelines(DatanodeDetails datanodeDetails) {
List<Pipeline> pipelinesWithStaleIpOrHostname =
getStalePipelines(datanodeDetails);
if (pipelinesWithStaleIpOrHostname.isEmpty()) {
LOG.debug("No stale pipelines for datanode {}",
datanodeDetails.getUuidString());
LOG.debug("No stale pipelines for datanode {}", datanodeDetails);
return;
}
LOG.info("Found {} stale pipelines",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public synchronized Pipeline create(RatisReplicationConfig replicationConfig,

dns.forEach(node -> {
LOG.info("Sending CreatePipelineCommand for pipeline:{} to datanode:{}",
pipeline.getId(), node.getUuidString());
pipeline.getId(), node);
eventPublisher.fireEvent(SCMEvents.DATANODE_COMMAND,
new CommandForDatanode<>(node.getUuid(), createCommand));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ public MockNodeManager(
setContainers(usageInfo.getDatanodeDetails(), entry.getValue());
} catch (NodeNotFoundException e) {
LOG.warn("Could not find Datanode {} for adding containers to it. " +
"Skipping this node.", usageInfo
.getDatanodeDetails().getUuidString());
"Skipping this node.", usageInfo.getDatanodeDetails());
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private Boolean injectDataNodeFailureDuringSCMUpgrade() {
new ArrayList<>(cluster.getHddsDatanodes());
for (HddsDatanodeService ds: currentDataNodes) {
DatanodeDetails dn = ds.getDatanodeDetails();
LOG.info("Restarting datanode {}", dn.getUuidString());
LOG.info("Restarting datanode {}", dn);
cluster.restartHddsDatanode(dn, false);
}
cluster.waitForClusterToBeReady();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public void onMessage(DatanodeDetails datanodeDetails,
try {
nodeManager.addNodeToDB(datanodeDetails);
} catch (IOException e) {
LOG.error("Unable to add new node {} to Node DB.",
datanodeDetails.getUuidString());
LOG.error("Unable to add new node {} to Node DB.", datanodeDetails);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private boolean startDatanode(DatanodeSimulationState dn)
throws IOException {
if (!registerDataNode(dn)) {
LOGGER.info("Failed to register datanode to SCM: {}",
dn.getDatanodeDetails().getUuidString());
dn.getDatanodeDetails());
return false;
}

Expand All @@ -359,7 +359,7 @@ private boolean startDatanode(DatanodeSimulationState dn)
reconHeartbeatInterval, TimeUnit.MILLISECONDS);

LOGGER.info("Successfully registered datanode to SCM: {}",
dn.getDatanodeDetails().getUuidString());
dn.getDatanodeDetails());
return true;
}

Expand Down Expand Up @@ -418,7 +418,7 @@ private void heartbeat(InetSocketAddress endpoint,
}
} catch (Exception e) {
LOGGER.info("Error sending heartbeat for {}: {}",
dn.getDatanodeDetails().getUuidString(), e.getMessage(), e);
dn.getDatanodeDetails(), e.getMessage(), e);
}
}

Expand Down