use of com.linkedin.pinot.controller.ControllerConf in project pinot by linkedin.
the class PerfBenchmarkDriver method getControllerConf.
private ControllerConf getControllerConf() {
ControllerConf conf = new ControllerConf();
conf.setHelixClusterName(_clusterName);
conf.setZkStr(_zkAddress);
conf.setControllerHost(_controllerHost);
conf.setControllerPort(String.valueOf(_controllerPort));
conf.setDataDir(_controllerDataDir);
conf.setTenantIsolationEnabled(false);
conf.setControllerVipHost("localhost");
conf.setControllerVipProtocol("http");
return conf;
}
use of com.linkedin.pinot.controller.ControllerConf in project pinot by linkedin.
the class PerfBenchmarkDriver method startController.
private void startController() {
if (!_conf.shouldStartController()) {
LOGGER.info("Skipping start controller step. Assumes controller is already started.");
return;
}
ControllerConf conf = getControllerConf();
LOGGER.info("Starting controller at {}", _controllerAddress);
new ControllerStarter(conf).start();
}
use of com.linkedin.pinot.controller.ControllerConf in project pinot by linkedin.
the class StartControllerCommand method readConfigFromFile.
@Override
ControllerConf readConfigFromFile(String configFileName) throws ConfigurationException {
ControllerConf conf = null;
if (configFileName == null) {
return null;
}
File configFile = new File(_configFileName);
if (!configFile.exists()) {
return null;
}
conf = new ControllerConf(configFile);
return (validateConfig(conf)) ? conf : null;
}
use of com.linkedin.pinot.controller.ControllerConf in project pinot by linkedin.
the class StartControllerCommand method execute.
@Override
public boolean execute() throws Exception {
if (_controllerHost == null) {
_controllerHost = NetUtil.getHostAddress();
}
ControllerConf conf = readConfigFromFile(_configFileName);
if (conf == null) {
if (_configFileName != null) {
LOGGER.error("Error: Unable to find file {}.", _configFileName);
return false;
}
conf = new ControllerConf();
conf.setControllerHost(_controllerHost);
conf.setControllerPort(_controllerPort);
conf.setDataDir(_dataDir);
conf.setZkStr(_zkAddress);
conf.setHelixClusterName(_clusterName);
conf.setControllerVipHost(_controllerHost);
conf.setTenantIsolationEnabled(_tenantIsolation);
conf.setRetentionControllerFrequencyInSeconds(3600 * 6);
conf.setValidationControllerFrequencyInSeconds(3600);
}
LOGGER.info("Executing command: " + toString());
final ControllerStarter starter = new ControllerStarter(conf);
starter.start();
String pidFile = ".pinotAdminController-" + String.valueOf(System.currentTimeMillis()) + ".pid";
savePID(System.getProperty("java.io.tmpdir") + File.separator + pidFile);
return true;
}
use of com.linkedin.pinot.controller.ControllerConf in project pinot by linkedin.
the class LLCSegmentCommitTest method testSegmentCommit.
@Test
public void testSegmentCommit() throws Exception {
SegmentCompletionManager.create(createMockHelixManager(), null, new ControllerConf(), new ControllerMetrics(new MetricsRegistry()));
FakeLLCSegmentCommit segmentCommit = new FakeLLCSegmentCommit();
Representation representation;
String strResponse;
JSONObject jsonResponse;
// If commitStart returns failed, upload should not be called, and the client should get 'failed'
segmentCommit._uploadCalled = false;
segmentCommit._scm.commitStartResponse = SegmentCompletionProtocol.RESP_FAILED;
representation = segmentCommit.post(null);
strResponse = representation.getText();
jsonResponse = JSONObject.parseObject(strResponse);
Assert.assertEquals(jsonResponse.get(SegmentCompletionProtocol.STATUS_KEY), SegmentCompletionProtocol.ControllerResponseStatus.FAILED.toString());
Assert.assertFalse(segmentCommit._uploadCalled);
// if commitStart returns continue, and upload fails, then commitEnd should indicate upload failure.
segmentCommit._uploadCalled = false;
segmentCommit._scm.commitStartResponse = SegmentCompletionProtocol.RESP_COMMIT_CONTINUE;
segmentCommit._scm.commitEndResponse = SegmentCompletionProtocol.RESP_FAILED;
segmentCommit._uploadReturnValue = false;
representation = segmentCommit.post(null);
strResponse = representation.getText();
jsonResponse = JSONObject.parseObject(strResponse);
Assert.assertEquals(jsonResponse.get(SegmentCompletionProtocol.STATUS_KEY), SegmentCompletionProtocol.ControllerResponseStatus.FAILED.toString());
Assert.assertTrue(segmentCommit._uploadCalled);
Assert.assertFalse(segmentCommit._scm.uploadSuccess);
// If commitstart returns CONINUE and upload succeeds, we should return whatever commitEnd returns.
segmentCommit._uploadCalled = false;
segmentCommit._scm.commitStartResponse = SegmentCompletionProtocol.RESP_COMMIT_CONTINUE;
segmentCommit._scm.commitEndResponse = SegmentCompletionProtocol.RESP_COMMIT_SUCCESS;
segmentCommit._uploadReturnValue = true;
representation = segmentCommit.post(null);
strResponse = representation.getText();
jsonResponse = JSONObject.parseObject(strResponse);
Assert.assertEquals(jsonResponse.get(SegmentCompletionProtocol.STATUS_KEY), SegmentCompletionProtocol.ControllerResponseStatus.COMMIT_SUCCESS.toString());
Assert.assertTrue(segmentCommit._uploadCalled);
Assert.assertTrue(segmentCommit._scm.uploadSuccess);
}
Aggregations