use of org.apache.helix.ConfigAccessor in project helix by apache.
the class ZkIntegrationTestBase method enablePersistBestPossibleAssignment.
protected void enablePersistBestPossibleAssignment(ZkClient zkClient, String clusterName, Boolean enabled) {
ConfigAccessor configAccessor = new ConfigAccessor(zkClient);
ClusterConfig clusterConfig = configAccessor.getClusterConfig(clusterName);
clusterConfig.setPersistBestPossibleAssignment(enabled);
configAccessor.setClusterConfig(clusterName, clusterConfig);
}
use of org.apache.helix.ConfigAccessor in project helix by apache.
the class ZkIntegrationTestBase method enableTopologyAwareRebalance.
protected void enableTopologyAwareRebalance(ZkClient zkClient, String clusterName, Boolean enabled) {
ConfigAccessor configAccessor = new ConfigAccessor(zkClient);
ClusterConfig clusterConfig = configAccessor.getClusterConfig(clusterName);
clusterConfig.setTopologyAwareEnabled(enabled);
configAccessor.setClusterConfig(clusterName, clusterConfig);
}
use of org.apache.helix.ConfigAccessor in project helix by apache.
the class TestTargetExternalView method beforeClass.
@BeforeClass
public void beforeClass() throws Exception {
_numDbs = 3;
_numParitions = 8;
_numNodes = 4;
_numReplicas = 2;
super.beforeClass();
_configAccessor = new ConfigAccessor(_gZkClient);
_accessor = _manager.getHelixDataAccessor();
}
use of org.apache.helix.ConfigAccessor in project helix by apache.
the class TestBatchEnableInstances method beforeClass.
@BeforeClass
public void beforeClass() throws Exception {
_numDbs = 1;
_numReplicas = 3;
_numNodes = 5;
_numParitions = 4;
super.beforeClass();
_accessor = new ConfigAccessor(_gZkClient);
}
use of org.apache.helix.ConfigAccessor in project helix by apache.
the class TestClusterVerifier method beforeMethod.
@BeforeMethod
public void beforeMethod() throws InterruptedException {
final int NUM_PARTITIONS = 10;
final int NUM_REPLICAS = 3;
// Cluster and resource setup
String className = TestHelper.getTestClassName();
String methodName = TestHelper.getTestMethodName();
_clusterName = className + "_" + methodName;
_setupTool = new ClusterSetup(ZK_ADDR);
_admin = _setupTool.getClusterManagementTool();
_setupTool.addCluster(_clusterName, true);
_setupTool.addResourceToCluster(_clusterName, RESOURCES[0], NUM_PARTITIONS, BuiltInStateModelDefinitions.MasterSlave.name(), RebalanceMode.SEMI_AUTO.toString());
_setupTool.addResourceToCluster(_clusterName, RESOURCES[1], NUM_PARTITIONS, BuiltInStateModelDefinitions.OnlineOffline.name(), RebalanceMode.SEMI_AUTO.toString());
_setupTool.addResourceToCluster(_clusterName, RESOURCES[2], NUM_PARTITIONS, BuiltInStateModelDefinitions.MasterSlave.name(), RebalanceMode.FULL_AUTO.toString());
_setupTool.addResourceToCluster(_clusterName, RESOURCES[3], NUM_PARTITIONS, BuiltInStateModelDefinitions.OnlineOffline.name(), RebalanceMode.FULL_AUTO.toString());
// Enable persist best possible assignment
ConfigAccessor configAccessor = new ConfigAccessor(_gZkClient);
ClusterConfig clusterConfig = configAccessor.getClusterConfig(_clusterName);
clusterConfig.setPersistBestPossibleAssignment(true);
configAccessor.setClusterConfig(_clusterName, clusterConfig);
// Configure and start the participants
_participants = new MockParticipantManager[RESOURCES.length];
for (int i = 0; i < _participants.length; i++) {
String host = "localhost";
int port = 12918 + i;
String id = host + '_' + port;
_setupTool.addInstanceToCluster(_clusterName, id);
_participants[i] = new MockParticipantManager(ZK_ADDR, _clusterName, id);
_participants[i].syncStart();
}
// Rebalance the resources
for (int i = 0; i < RESOURCES.length; i++) {
_setupTool.rebalanceResource(_clusterName, RESOURCES[i], NUM_REPLICAS);
}
// Start the controller
_controller = new ClusterControllerManager(ZK_ADDR, _clusterName, "controller_0");
_controller.syncStart();
Thread.sleep(1000);
}
Aggregations