Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGaox committed Oct 18, 2023
1 parent 98362eb commit ee6fc37
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
package org.apache.helix.rest.common;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -19,24 +38,6 @@
import org.apache.helix.rest.server.json.cluster.ClusterTopology;
import org.apache.helix.rest.server.json.instance.StoppableCheck;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
public class StoppableInstancesSelector {
// This type does not belong to real HealthCheck failed reason. Also, if we add this type
// to HealthCheck enum, it could introduce more unnecessary check step since the InstanceServiceImpl
Expand Down Expand Up @@ -116,10 +117,9 @@ public void getStoppableInstancesCrossZones() {
*
* If `isRandom` is true, the order of zones will be randomized regardless of any previous order.
*
* @param isRandom Indicates whether to randomize the order of zones.
* @param random Indicates whether to randomize the order of zones.
*/
public void calculateOrderOfZone(boolean isRandom) {
// If the orderedZones is not specified, we will order all zones by their instances count in descending order.
public void calculateOrderOfZone(boolean random) {
if (_orderOfZone == null) {
_orderOfZone =
new ArrayList<>(getOrderedZoneToInstancesMap(_clusterTopology.toZoneMapping()).keySet());
Expand All @@ -129,7 +129,7 @@ public void calculateOrderOfZone(boolean isRandom) {
return;
}

if (isRandom) {
if (random) {
Collections.shuffle(_orderOfZone);
}
}
Expand Down

0 comments on commit ee6fc37

Please sign in to comment.