private void retagInstance(String instanceName, String oldTag, String newTag) { _helixAdmin.removeInstanceTag(_helixClusterName, instanceName, oldTag); _helixAdmin.addInstanceTag(_helixClusterName, instanceName, newTag); }
public PinotResourceManagerResponse deleteRealtimeServerTenantFor(String tenantName) { String realtimeTenantTag = TagNameUtils.getRealtimeTagForTenant(tenantName); List<String> instancesInClusterWithTag = HelixHelper.getInstancesWithTag(_helixZkManager, realtimeTenantTag); for (String instanceName : instancesInClusterWithTag) { _helixAdmin.removeInstanceTag(_helixClusterName, instanceName, realtimeTenantTag); if (getTagsForInstance(instanceName).isEmpty()) { _helixAdmin.addInstanceTag(_helixClusterName, instanceName, CommonConstants.Helix.UNTAGGED_SERVER_INSTANCE); } } return PinotResourceManagerResponse.SUCCESS; }
public PinotResourceManagerResponse deleteOfflineServerTenantFor(String tenantName) { String offlineTenantTag = TagNameUtils.getOfflineTagForTenant(tenantName); List<String> instancesInClusterWithTag = HelixHelper.getInstancesWithTag(_helixZkManager, offlineTenantTag); for (String instanceName : instancesInClusterWithTag) { _helixAdmin.removeInstanceTag(_helixClusterName, instanceName, offlineTenantTag); if (getTagsForInstance(instanceName).isEmpty()) { _helixAdmin.addInstanceTag(_helixClusterName, instanceName, CommonConstants.Helix.UNTAGGED_SERVER_INSTANCE); } } return PinotResourceManagerResponse.SUCCESS; }
_helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_0", OFFLINE_TENENT_NAME); _helixAdmin.addInstanceTag(getHelixClusterName(), "Server_localhost_a", OFFLINE_TENENT_NAME); _helixResourceManager.rebalanceTable(TABLE_NAME, CommonConstants.Helix.TableType.OFFLINE, rebalanceUserConfig); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_a", OFFLINE_TENENT_NAME); _helixAdmin.addInstanceTag(getHelixClusterName(), "Server_localhost_0", OFFLINE_TENENT_NAME); _helixResourceManager.rebalanceTable(TABLE_NAME, CommonConstants.Helix.TableType.OFFLINE, rebalanceUserConfig); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_a", OFFLINE_TENENT_NAME); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_d", OFFLINE_TENENT_NAME); targetNumInstancePerPartition = 4; targetNumReplicaGroup = 2; _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_b", OFFLINE_TENENT_NAME); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_c", OFFLINE_TENENT_NAME); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_0", OFFLINE_TENENT_NAME); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_1", OFFLINE_TENENT_NAME); _helixAdmin.removeInstanceTag(getHelixClusterName(), "Server_localhost_2", OFFLINE_TENENT_NAME);
.removeInstanceTag(_helixClusterName, brokerInstance, TagNameUtils.getBrokerTagForTenant(BROKER_TENANT_NAME)); _helixAdmin.addInstanceTag(_helixClusterName, brokerInstance, CommonConstants.Helix.UNTAGGED_BROKER_INSTANCE); .removeInstanceTag(_helixClusterName, brokerInstance, TagNameUtils.getBrokerTagForTenant(BROKER_TENANT_NAME)); _helixAdmin.addInstanceTag(_helixClusterName, brokerInstance, CommonConstants.Helix.UNTAGGED_BROKER_INSTANCE);
@BeforeClass public void setUp() throws Exception { try { startZk(); ControllerConf config = getDefaultControllerConfiguration(); config.setTableMinReplicas(MIN_NUM_REPLICAS); startController(config); ControllerRequestBuilderUtil .addFakeBrokerInstancesToAutoJoinHelixCluster(getHelixClusterName(), ZkStarter.DEFAULT_ZK_STR, NUM_BROKER_INSTANCES, true); ControllerRequestBuilderUtil .addFakeDataInstancesToAutoJoinHelixCluster(getHelixClusterName(), ZkStarter.DEFAULT_ZK_STR, NUM_SERVER_INSTANCES, true); _offlineBuilder.setTableName("testOfflineTable").setTimeColumnName("timeColumn").setTimeType("DAYS") .setRetentionTimeUnit("DAYS").setRetentionTimeValue("5"); setUpTable(); // Join 4 more servers as untagged String[] instanceNames = {"Server_localhost_a", "Server_localhost_b", "Server_localhost_c", "Server_localhost_d"}; for (String instanceName : instanceNames) { ControllerRequestBuilderUtil .addFakeDataInstanceToAutoJoinHelixCluster(getHelixClusterName(), ZkStarter.DEFAULT_ZK_STR, instanceName, true); _helixAdmin.removeInstanceTag(getHelixClusterName(), instanceName, OFFLINE_TENENT_NAME); } } catch (Exception e) { e.printStackTrace(); } }
public void whitelistInstance(String instanceName) { _helixAdmin.removeInstanceTag(_helixClusterName, instanceName, BLACKLIST_TAG); }
String instanceName = cmd.getOptionValues(removeInstanceTag)[1]; String tag = cmd.getOptionValues(removeInstanceTag)[2]; setupTool.getClusterManagementTool().removeInstanceTag(clusterName, instanceName, tag);
String instanceName = cmd.getOptionValues(removeInstanceTag)[1]; String tag = cmd.getOptionValues(removeInstanceTag)[2]; setupTool.getClusterManagementTool().removeInstanceTag(clusterName, instanceName, tag);
.readValue(node.get(InstanceProperties.instanceTags.name()).toString(), OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, String.class))) { admin.removeInstanceTag(clusterId, instanceName, tag);
jsonParameters.verifyCommand(ClusterSetup.removeInstanceTag); String tag = jsonParameters.getParameter(ClusterSetup.instanceGroupTag); setupTool.getClusterManagementTool().removeInstanceTag(clusterName, instanceName, tag); } else { throw new HelixException("Unsupported command: " + command + ". Should be one of ["
helixAdmin.removeInstanceTag(clusterName, "localhost_12918", TAG);