ChenSammi commented on code in PR #7010:
URL: https://github.com/apache/ozone/pull/7010#discussion_r1708732583
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/ReplicationManager.java:
##########
@@ -425,8 +430,16 @@ public long getReplicationInFlightLimit() {
// dead. Therefore we simply count the number of healthy nodes and include
// those which are not in service.
int healthyNodes = nodeManager.getNodeCount(null, HEALTHY);
+ double inflightOffPeakRatio = isOffPeakHour() ?
rmConf.getInflightOffPeakRatio() : 1;
+ LOG.debug("Replication inflight limit, time:{}, inflightOffPeakRatio:{}",
LocalDateTime.now(), inflightOffPeakRatio);
return (long) Math.ceil(healthyNodes * rmConf.getDatanodeReplicationLimit()
- * factor);
+ * factor * inflightOffPeakRatio);
+ }
+
+ public boolean isOffPeakHour() {
+ List<String> offPeakHours =
Arrays.stream(rmConf.getInflightOffPeakHour().split(","))
Review Comment:
We can add a off-peak hour defined or not check before starting split
operation.
If off-peak hour is not defined, then we can save the effort of all the
remaining work. I would suggest have a new function getInflightOffPeakRatio()
to include all the related logic.
--
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]