desaikomal commented on code in PR #2514:
URL: https://github.com/apache/helix/pull/2514#discussion_r1213736645
##########
helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java:
##########
@@ -218,6 +217,8 @@ private void
reportTopStateExistence(ResourceControllerDataProvider cache, Curre
// we observed an entire top state handoff process
reportSingleTopStateHandoff(cache, lastTopStateInstance,
currentTopStateInstance,
Review Comment:
i can do that optimization but i had concern with this code:
// Make sure last top state instance has not bounced during cluster data
cache refresh
if (cache.getLiveInstances().containsKey(lastTopStateInstance)) {
String lastTopStateSession =
cache.getLiveInstances().get(lastTopStateInstance).getEphemeralOwner();
// We need this null check as there are test cases creating incomplete
current state
if (cache.getCurrentState(lastTopStateInstance,
lastTopStateSession).get(resourceName)
!= null) {
startTime =
cache.getCurrentState(lastTopStateInstance,
lastTopStateSession).get(resourceName)
.getStartTime(partition.getPartitionName());
fromTopStateUserLatency =
cache.getCurrentState(lastTopStateInstance,
lastTopStateSession).get(resourceName)
.getEndTime(partition.getPartitionName()) - startTime;
}
}
So i wanted to first make sure change works properly and then optimize it
but code de-dup. i can combine the two into one change.
let me know what you would prefer. i prefer the current approach but i am
ready to hear reviewers choice too.
thanks,
--
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]