Ritesh Shukla created HDDS-9473:
-----------------------------------
Summary: Add metrics around details for container matching in SCM
Key: HDDS-9473
URL: https://issues.apache.org/jira/browse/HDDS-9473
Project: Apache Ozone
Issue Type: Improvement
Components: SCM
Reporter: Ritesh Shukla
Assignee: Muskan Mishra
For create key path, it is essential to have insight into the time it takes to
match containers and optionally create containers.
This came up as part of https://github.com/apache/ozone/pull/5335 which use a
code analysis tool https://github.com/alibaba/arthas which is great but we
should also have metrics that we track in the dashboarding effort.
{code:java}
public ContainerInfo getMatchingContainer(final long size, final String owner,
final Pipeline pipeline, final Set<ContainerID> excludedContainerIDs) {
NavigableSet<ContainerID> containerIDs;
ContainerInfo containerInfo;
try {
synchronized (pipeline.getId()) {
containerIDs = getContainersForOwner(pipeline, owner);
if (containerIDs.size() < getOpenContainerCountPerPipeline(pipeline)) {
allocateContainer(pipeline, owner);
containerIDs = getContainersForOwner(pipeline, owner);
}
containerIDs.removeAll(excludedContainerIDs);
containerInfo = containerStateManager.getMatchingContainer(
size, owner, pipeline.getId(), containerIDs);
if (containerInfo == null) {
containerInfo = allocateContainer(pipeline, owner);
}
return containerInfo;
}
} catch (Exception e) {
LOG.warn("Container allocation failed on pipeline={}", pipeline, e);
return null;
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]