himanshukandwal commented on code in PR #2650:
URL: https://github.com/apache/helix/pull/2650#discussion_r1353076213
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithm.java:
##########
@@ -100,7 +100,7 @@ public OptimalAssignment calculate(ClusterModel
clusterModel) throws HelixRebala
getNodeWithHighestPoints(replica, nodes, clusterModel.getContext(),
busyInstances,
optimalAssignment);
// stop immediately if any replica cannot find best assignable node
- if (maybeBestNode.isEmpty() || optimalAssignment.hasAnyFailure()) {
+ if (!maybeBestNode.isPresent() || optimalAssignment.hasAnyFailure()) {
Review Comment:
Actually `isEmpty()` has been added in JDK 11.
https://bugs.openjdk.org/browse/JDK-8184693
We get compilation failure, with Java 9.
```
[ERROR]
/Users/hkandwal/Documents/workspaces/projects/helix_os_hk/helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithm.java:[103,24]
cannot find symbol
[ERROR] symbol: method isEmpty()
```
--
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]