Skip to content

Commit

Permalink
Fix rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun Bhima committed Nov 28, 2023
1 parent 66165f9 commit 7c37037
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public class HelixBootstrapUpgradeUtil {
// Allow a host to be filled upto 95%
static final int INSTANCE_MAX_CAPACITY_PERCENTAGE = 95;
static final int PARTITION_BUFFER_CAPACITY_FOR_INDEX_FILES_IN_GB = 2;
static final String DEFAULT_REPLICA_CAPACITY_STR = "defaultReplicaCapacityInBytes";

public enum HelixAdminOperation {
BootstrapCluster,
Expand Down Expand Up @@ -954,12 +955,6 @@ private static void migrateToFullAuto(String dc, String clusterName, HelixAdmin
String commaSeparatedResources, WagedHelixConfig wagedHelixConfig, boolean setPreferenceList,
int maxInstancesInOneResourceForFullAuto, boolean dryRun, boolean addConfigs) {
try {
// 0. Check if all resources in the cluster are full-auto compatible
boolean resourcesAreFullAutoCompatible =
maybeVerifyResourcesAreFullAutoCompatible(dc, clusterName, admin, maxInstancesInOneResourceForFullAuto);
if (!resourcesAreFullAutoCompatible) {
throw new IllegalStateException("Resources are not full auto compatible");
}
ClusterMapConfig config = getClusterMapConfig(clusterName, dc, null);
try (PropertyStoreToDataNodeConfigAdapter propertyStoreAdapter = new PropertyStoreToDataNodeConfigAdapter(
zkConnectStr, config)) {
Expand Down Expand Up @@ -1491,7 +1486,8 @@ private void updateClusterMapInHelix(boolean startValidatingClusterManager) thro
} else {
try {
boolean resourcesAreFullAutoCompatible =
maybeVerifyResourcesAreFullAutoCompatible(dc.getName(), clusterName);
maybeVerifyResourcesAreFullAutoCompatible(dc.getName(), clusterName, adminForDc.get(dc.getName()),
maxInstancesInOneResourceForFullAuto);
if (resourcesAreFullAutoCompatible) {
verifyPartitionPlacementIsFullAutoCompatibleInStatic(dc.getName());
}
Expand Down Expand Up @@ -2158,7 +2154,8 @@ private void addUpdateResources(String dcName, Map<String, Set<String>> partitio
HelixAdmin dcAdmin = adminForDc.get(dcName);
List<String> instancesWithDisabledPartition = new ArrayList<>();
HelixPropertyStore<ZNRecord> helixPropertyStore =
helixAdminOperation == HelixAdminOperation.DisablePartition ? createHelixPropertyStore(dcName) : null;
helixAdminOperation == HelixAdminOperation.DisablePartition ? createHelixPropertyStore(dcName,
dataCenterToZkAddress.get(dcName).getZkConnectStrs().get(0)) : null;
TreeMap<Integer, Set<String>> resourceIdToInstances = dcToResourceIdToInstances.get(dcName);
Map<String, Set<Integer>> instanceNameToResources = dcToInstanceToResourceIds.get(dcName);
Map<Integer, IdealState> resourceIdToIdealState = dcToResourceIdToIdealState.get(dcName);
Expand Down Expand Up @@ -2814,7 +2811,8 @@ private void verifyEquivalencyWithStaticClusterMap(HardwareLayout hardwareLayout
verifyDataNodeAndDiskEquivalencyInDc(dc, clusterName, partitionLayout);
// Remove dc from dcToResourceIdToIdealState, so we fetch all the data from helix again.
dcToResourceIdToIdealState.remove(dc.getName());
maybeVerifyResourcesAreFullAutoCompatible(dc.getName(), clusterName);
maybeVerifyResourcesAreFullAutoCompatible(dc.getName(), clusterName, admin,
maxInstancesInOneResourceForFullAuto);
}
} catch (Throwable t) {
logger.error("[{}] error message: {}", dc.getName().toUpperCase(), t.getMessage());
Expand Down Expand Up @@ -3060,8 +3058,8 @@ private int numReplicasForIdealState(String dcName, IdealState state) {
* @param dcName the datacenter whose information is to be verified.
* @param clusterName the cluster to be verified.
*/
private static boolean maybeVerifyResourcesAreFullAutoCompatible(String dcName, String clusterName,
HelixAdmin helixAdmin, int maxInstancesInOneResourceForFullAuto) {
private boolean maybeVerifyResourcesAreFullAutoCompatible(String dcName, String clusterName, HelixAdmin helixAdmin,
int maxInstancesInOneResourceForFullAuto) {
List<String> resourceNames = helixAdmin.getResourcesInCluster(clusterName);
if (resourceNames == null || resourceNames.isEmpty()) {
info(
Expand Down

0 comments on commit 7c37037

Please sign in to comment.