aswinshakil opened a new pull request, #5126:
URL: https://github.com/apache/ozone/pull/5126
## What changes were proposed in this pull request?
`ECUnderReplicationHandler` is initialized before initializing
`ReplicationManagerMetrics`, So whenever any ReplicationManagerMetrics is used,
it throws NPE. The behavior is same for all these other classes and will throw
NPEs,
`ECOverReplicationHandler, ECMisReplicationHandler,
RatisUnderReplicationHandler, RatisMisReplicationHandler`
```
ECUnderReplicationHandler(final PlacementPolicy containerPlacement,
final ConfigurationSource conf, ReplicationManager replicationManager)
{
this.containerPlacement = containerPlacement;
this.currentContainerSize = (long) conf
.getStorageSize(ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE,
ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT,
StorageUnit.BYTES);
this.replicationManager = replicationManager;
this.metrics = replicationManager.getMetrics(); --> still null because
replication manager metrics is not initialized yet.
}
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9090
## How was this patch tested?
Manually tested by adding a line and verified it threw NPE.
```
ECUnderReplicationHandler(final PlacementPolicy containerPlacement,
final ConfigurationSource conf, ReplicationManager replicationManager)
{
this.containerPlacement = containerPlacement;
this.currentContainerSize = (long) conf
.getStorageSize(ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE,
ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT,
StorageUnit.BYTES);
this.replicationManager = replicationManager;
this.metrics = replicationManager.getMetrics();
this.metrics.getEcPartialReconstructionNoneOverloadedTotal(); ---> Added
line manually just to check NPE
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]