use of com.hortonworks.streamline.streams.cluster.catalog.Service in project streamline by hortonworks.
the class DruidServiceRegistrarTest method testRegisterWithoutOptionalParams.
@Test
public void testRegisterWithoutOptionalParams() throws Exception {
Cluster cluster = getTestCluster(1L);
DruidServiceRegistrar registerer = initializeServiceRegistrar();
Config config = new Config();
config.put(DruidServiceRegistrar.PARAM_ZOOKEEPER_CONNECTION_STRING, "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181");
registerer.register(cluster, config, Collections.emptyList());
Service druidService = environmentService.getServiceByName(cluster.getId(), Constants.Druid.SERVICE_NAME);
assertNotNull(druidService);
ServiceConfiguration commonRuntimePropertiesConf = environmentService.getServiceConfigurationByName(druidService.getId(), CONFIGURATION_NAME_COMMON_RUNTIME_PROPERTIES);
assertNotNull(commonRuntimePropertiesConf);
Map<String, String> confMap = commonRuntimePropertiesConf.getConfigurationMap();
assertEquals(config.get(DruidServiceRegistrar.PARAM_ZOOKEEPER_CONNECTION_STRING), confMap.get(DruidServiceRegistrar.PARAM_ZOOKEEPER_CONNECTION_STRING));
}
use of com.hortonworks.streamline.streams.cluster.catalog.Service in project streamline by hortonworks.
the class HBaseServiceRegistrarTest method testRegister_hbase_site_xml_notPresent.
@Test
public void testRegister_hbase_site_xml_notPresent() throws Exception {
Cluster cluster = getTestCluster(1L);
HBaseServiceRegistrar registrar = initializeServiceRegistrar();
try {
registrar.register(cluster, new Config(), Lists.newArrayList());
fail("Should throw IllegalArgumentException");
} catch (IllegalArgumentException e) {
// OK
Service hbaseService = environmentService.getServiceByName(cluster.getId(), Constants.HBase.SERVICE_NAME);
assertNull(hbaseService);
}
}
use of com.hortonworks.streamline.streams.cluster.catalog.Service in project streamline by hortonworks.
the class HDFSServiceRegistrarTest method testRegister_requiredPropertyNotPresent.
@Test
public void testRegister_requiredPropertyNotPresent() throws Exception {
Cluster cluster = getTestCluster(1L);
HDFSServiceRegistrar registrar = initializeServiceRegistrar();
try (InputStream coreSiteIs = getClass().getClassLoader().getResourceAsStream(CORE_SITE_XML_BADCASE_FILE_PATH);
InputStream hdfsSiteIs = getClass().getClassLoader().getResourceAsStream(HDFS_SITE_XML_BADCASE_FILE_PATH)) {
ManualServiceRegistrar.ConfigFileInfo coreSiteXml = new ManualServiceRegistrar.ConfigFileInfo(CORE_SITE_XML, coreSiteIs);
ManualServiceRegistrar.ConfigFileInfo hdfsSiteXml = new ManualServiceRegistrar.ConfigFileInfo(HDFS_SITE_XML, hdfsSiteIs);
registrar.register(cluster, new Config(), Lists.newArrayList(coreSiteXml, hdfsSiteXml));
fail("Should throw IllegalArgumentException");
} catch (IllegalArgumentException e) {
// OK
Service hdfsService = environmentService.getServiceByName(cluster.getId(), Constants.HDFS.SERVICE_NAME);
assertNull(hdfsService);
}
}
use of com.hortonworks.streamline.streams.cluster.catalog.Service in project streamline by hortonworks.
the class HDFSServiceRegistrarTest method testRegister_core_site_xml_notPresent.
@Test
public void testRegister_core_site_xml_notPresent() throws Exception {
Cluster cluster = getTestCluster(1L);
HDFSServiceRegistrar registrar = initializeServiceRegistrar();
try (InputStream is = getClass().getClassLoader().getResourceAsStream(HDFS_SITE_XML_FILE_PATH)) {
ManualServiceRegistrar.ConfigFileInfo hdfsSiteXml = new ManualServiceRegistrar.ConfigFileInfo(HDFS_SITE_XML, is);
registrar.register(cluster, new Config(), Lists.newArrayList(hdfsSiteXml));
fail("Should throw IllegalArgumentException");
} catch (IllegalArgumentException e) {
// OK
Service hdfsService = environmentService.getServiceByName(cluster.getId(), Constants.HDFS.SERVICE_NAME);
assertNull(hdfsService);
}
}
use of com.hortonworks.streamline.streams.cluster.catalog.Service in project streamline by hortonworks.
the class HiveServiceRegistrarTest method testRegister.
@Test
public void testRegister() throws Exception {
Cluster cluster = getTestCluster(1L);
HiveServiceRegistrar registrar = initializeServiceRegistrar();
try (InputStream is = getClass().getClassLoader().getResourceAsStream(HIVE_SITE_XML_FILE_PATH)) {
ManualServiceRegistrar.ConfigFileInfo hiveSiteXml = new ManualServiceRegistrar.ConfigFileInfo(HIVE_SITE_XML, is);
registrar.register(cluster, new Config(), Lists.newArrayList(hiveSiteXml));
}
Service hiveService = environmentService.getServiceByName(cluster.getId(), Constants.Hive.SERVICE_NAME);
assertNotNull(hiveService);
ServiceConfiguration coreSiteConf = environmentService.getServiceConfigurationByName(hiveService.getId(), CONFIGURATION_NAME_HIVE_SITE);
assertNotNull(coreSiteConf);
}
Aggregations