use of com.hortonworks.streamline.streams.cluster.catalog.ServiceConfiguration in project streamline by hortonworks.
the class KafkaServiceRegistrar method buildServerPropertiesServiceConfiguration.
private ServiceConfiguration buildServerPropertiesServiceConfiguration(Config config) {
ServiceConfiguration serverProperties = new ServiceConfiguration();
serverProperties.setName(CONFIG_SERVER_PROPERTIES);
Map<String, String> confMap = new HashMap<>();
if (config.contains(PARAM_ZOOKEEPER_CONNECT)) {
confMap.put(PARAM_ZOOKEEPER_CONNECT, config.getString(PARAM_ZOOKEEPER_CONNECT));
}
if (config.contains(PARAM_SECURITY_INTER_BROKER_PROTOCOL)) {
confMap.put(PARAM_SECURITY_INTER_BROKER_PROTOCOL, config.getString(PARAM_SECURITY_INTER_BROKER_PROTOCOL));
}
try {
String json = objectMapper.writeValueAsString(confMap);
serverProperties.setConfiguration(json);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return serverProperties;
}
use of com.hortonworks.streamline.streams.cluster.catalog.ServiceConfiguration in project streamline by hortonworks.
the class KafkaServiceRegistrar method buildKafkaEnvServiceConfiguration.
private ServiceConfiguration buildKafkaEnvServiceConfiguration(Config config) {
ServiceConfiguration serverProperties = new ServiceConfiguration();
serverProperties.setName(CONFIG_KAFKA_ENV);
Map<String, String> confMap = new HashMap<>();
try {
String json = objectMapper.writeValueAsString(confMap);
serverProperties.setConfiguration(json);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return serverProperties;
}
use of com.hortonworks.streamline.streams.cluster.catalog.ServiceConfiguration in project streamline by hortonworks.
the class StormServiceRegistrar method buildStormServiceConfiguration.
private ServiceConfiguration buildStormServiceConfiguration(Config config) {
ServiceConfiguration storm = new ServiceConfiguration();
storm.setName(CONF_STORM);
Map<String, String> confMap = new HashMap<>();
if (config.contains(PARAM_NIMBUS_THRIFT_MAX_BUFFER_SIZE)) {
Number thriftMaxBufferSize = readNumberFromConfig(config, PARAM_NIMBUS_THRIFT_MAX_BUFFER_SIZE);
confMap.put(PARAM_NIMBUS_THRIFT_MAX_BUFFER_SIZE, String.valueOf(thriftMaxBufferSize));
}
if (config.contains(PARAM_THRIFT_TRANSPORT)) {
confMap.put(PARAM_THRIFT_TRANSPORT, config.getString(PARAM_THRIFT_TRANSPORT));
}
if (config.contains(PARAM_PRINCIPAL_TO_LOCAL)) {
confMap.put(PARAM_PRINCIPAL_TO_LOCAL, config.getString(PARAM_PRINCIPAL_TO_LOCAL));
}
try {
String json = objectMapper.writeValueAsString(confMap);
storm.setConfiguration(json);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return storm;
}
use of com.hortonworks.streamline.streams.cluster.catalog.ServiceConfiguration in project streamline by hortonworks.
the class ZookeeperServiceRegistrar method buildZooCfgServiceConfiguration.
private ServiceConfiguration buildZooCfgServiceConfiguration(Config config) {
ServiceConfiguration zooCfg = new ServiceConfiguration();
zooCfg.setName(CONFIG_ZOO_CFG);
Map<String, String> confMap = new HashMap<>();
if (config.contains(PARAM_ZOOKEEPER_PORT)) {
Number zookeeperPort = config.getAny(PARAM_ZOOKEEPER_PORT);
confMap.put(PARAM_ZOOKEEPER_PORT, String.valueOf(zookeeperPort));
}
try {
String json = objectMapper.writeValueAsString(confMap);
zooCfg.setConfiguration(json);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return zooCfg;
}
use of com.hortonworks.streamline.streams.cluster.catalog.ServiceConfiguration in project streamline by hortonworks.
the class HBaseServiceRegistrarTest method testRegister.
@Test
public void testRegister() throws Exception {
Cluster cluster = getTestCluster(1L);
HBaseServiceRegistrar registrar = initializeServiceRegistrar();
try (InputStream is = getClass().getClassLoader().getResourceAsStream(HBASE_SITE_XML_FILE_PATH)) {
ManualServiceRegistrar.ConfigFileInfo hiveSiteXml = new ManualServiceRegistrar.ConfigFileInfo(HBASE_SITE_XML, is);
registrar.register(cluster, new Config(), Lists.newArrayList(hiveSiteXml));
}
Service hbaseService = environmentService.getServiceByName(cluster.getId(), Constants.HBase.SERVICE_NAME);
assertNotNull(hbaseService);
ServiceConfiguration hbaseSiteConf = environmentService.getServiceConfigurationByName(hbaseService.getId(), CONFIGURATION_NAME_HBASE_SITE);
assertNotNull(hbaseSiteConf);
}
Aggregations