本文整理汇总了Java中org.apache.helix.ConfigAccessor.getInstanceConfig方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigAccessor.getInstanceConfig方法的具体用法?Java ConfigAccessor.getInstanceConfig怎么用?Java ConfigAccessor.getInstanceConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.helix.ConfigAccessor
的用法示例。
在下文中一共展示了ConfigAccessor.getInstanceConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableDelayRebalanceInInstance
import org.apache.helix.ConfigAccessor; //导入方法依赖的package包/类
protected void enableDelayRebalanceInInstance(ZkClient zkClient, String clusterName,
String instanceName, boolean enabled) {
ConfigAccessor configAccessor = new ConfigAccessor(zkClient);
InstanceConfig instanceConfig = configAccessor.getInstanceConfig(clusterName, instanceName);
instanceConfig.setDelayRebalanceEnabled(enabled);
configAccessor.setInstanceConfig(clusterName, instanceName, instanceConfig);
}
示例2: setDomainId
import org.apache.helix.ConfigAccessor; //导入方法依赖的package包/类
private void setDomainId(String instanceName, ConfigAccessor configAccessor) {
String domain = String.format("Rack=%s, Instance=%s", instanceName, instanceName);
InstanceConfig instanceConfig = configAccessor.getInstanceConfig(CLUSTER_NAME, instanceName);
instanceConfig.setDomain(domain);
configAccessor.setInstanceConfig(CLUSTER_NAME, instanceName, instanceConfig);
}
示例3: setInstanceEnable
import org.apache.helix.ConfigAccessor; //导入方法依赖的package包/类
private void setInstanceEnable(String instanceName, boolean enabled,
ConfigAccessor configAccessor) {
InstanceConfig instanceConfig = configAccessor.getInstanceConfig(CLUSTER_NAME, instanceName);
instanceConfig.setInstanceEnabled(enabled);
configAccessor.setInstanceConfig(CLUSTER_NAME, instanceName, instanceConfig);
}
示例4: beforeClass
import org.apache.helix.ConfigAccessor; //导入方法依赖的package包/类
@BeforeClass
public void beforeClass() throws Exception {
System.out.println("START " + CLASS_NAME + " at " + new Date(System.currentTimeMillis()));
String namespace = "/" + CLUSTER_NAME;
if (_gZkClient.exists(namespace)) {
_gZkClient.deleteRecursive(namespace);
}
_setupTool = new ClusterSetup(_gZkClient);
_setupTool.addCluster(CLUSTER_NAME, true);
ConfigAccessor configAccessor = new ConfigAccessor(_gZkClient);
ClusterConfig clusterConfig = configAccessor.getClusterConfig(CLUSTER_NAME);
clusterConfig.setTopology("/instance");
clusterConfig.setFaultZoneType("instance");
configAccessor.setClusterConfig(CLUSTER_NAME, clusterConfig);
for (int i = 0; i < NUM_NODE; i++) {
String storageNodeName = PARTICIPANT_PREFIX + "_" + (START_PORT + i);
_setupTool.addInstanceToCluster(CLUSTER_NAME, storageNodeName);
_nodes.add(storageNodeName);
String tag = "tag-" + i % 2;
_setupTool.getClusterManagementTool().addInstanceTag(CLUSTER_NAME, storageNodeName, tag);
_nodeToTagMap.put(storageNodeName, tag);
InstanceConfig instanceConfig =
configAccessor.getInstanceConfig(CLUSTER_NAME, storageNodeName);
instanceConfig.setDomain("instance=" + storageNodeName);
configAccessor.setInstanceConfig(CLUSTER_NAME, storageNodeName, instanceConfig);
}
// start dummy participants
for (String node : _nodes) {
MockParticipantManager participant = new MockParticipantManager(ZK_ADDR, CLUSTER_NAME, node);
participant.syncStart();
_participants.add(participant);
}
// start controller
String controllerName = CONTROLLER_PREFIX + "_0";
_controller = new ClusterControllerManager(ZK_ADDR, CLUSTER_NAME, controllerName);
_controller.syncStart();
enablePersistBestPossibleAssignment(_gZkClient, CLUSTER_NAME, true);
//enableTopologyAwareRebalance(_gZkClient, CLUSTER_NAME, true);
}