use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.
the class ServiceEndpointCollectorTest method getClouderaManagerUIService.
private ExposedService getClouderaManagerUIService() {
ExposedService clouderaManagerUIService = exposedService("CLOUDERA_MANAGER_UI");
clouderaManagerUIService.setKnoxUrl("/cmf/home/");
clouderaManagerUIService.setPort(443);
return clouderaManagerUIService;
}
use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.
the class ServiceEndpointCollectorTest method testPrepareClusterExposedServices.
@Test
public void testPrepareClusterExposedServices() {
Cluster cluster = createClusterWithComponents(new ExposedService[] { exposedService("ATLAS") }, new ExposedService[] { exposedService("HIVE_SERVER"), exposedService("WEBHDFS") }, GatewayType.INDIVIDUAL);
cluster.getGateway().setGatewayPort(443);
mockBlueprintTextProcessor();
mockComponentLocator(Lists.newArrayList("10.0.0.1"));
Map<String, Collection<ClusterExposedServiceV4Response>> clusterExposedServicesMap = underTest.prepareClusterExposedServices(cluster, "10.0.0.1");
assertEquals(4L, clusterExposedServicesMap.keySet().size());
Collection<ClusterExposedServiceV4Response> topology2ClusterExposedServiceV4Responses = clusterExposedServicesMap.get("topology2");
Optional<ClusterExposedServiceV4Response> webHDFS = topology2ClusterExposedServiceV4Responses.stream().filter(service -> "WEBHDFS".equals(service.getKnoxService())).findFirst();
if (webHDFS.isPresent()) {
assertEquals("https://10.0.0.1/gateway-path/topology2/webhdfs/v1", webHDFS.get().getServiceUrl());
assertEquals("WEBHDFS", webHDFS.get().getKnoxService());
assertEquals("WebHDFS", webHDFS.get().getDisplayName());
assertEquals("NAMENODE", webHDFS.get().getServiceName());
assertTrue(webHDFS.get().isOpen());
}
Optional<ClusterExposedServiceV4Response> sparkHistoryUI = topology2ClusterExposedServiceV4Responses.stream().filter(service -> "SPARKHISTORYUI".equals(service.getKnoxService())).findFirst();
if (sparkHistoryUI.isPresent()) {
assertEquals("https://10.0.0.1/gateway-path/topology2/sparkhistory/", sparkHistoryUI.get().getServiceUrl());
assertEquals("SPARKHISTORYUI", sparkHistoryUI.get().getKnoxService());
assertEquals("Spark 1.x History Server", sparkHistoryUI.get().getDisplayName());
assertEquals("SPARK_YARN_HISTORY_SERVER", sparkHistoryUI.get().getServiceName());
assertFalse(sparkHistoryUI.get().isOpen());
}
Optional<ClusterExposedServiceV4Response> hiveServer = topology2ClusterExposedServiceV4Responses.stream().filter(service -> "HIVE".equals(service.getKnoxService())).findFirst();
if (hiveServer.isPresent()) {
assertEquals("jdbc:hive2://10.0.0.1/;ssl=true;sslTrustStore=/cert/gateway.jks;trustStorePassword=${GATEWAY_JKS_PASSWORD};" + "transportMode=http;httpPath=gateway-path/topology2/hive", hiveServer.get().getServiceUrl());
assertEquals("HIVE", hiveServer.get().getKnoxService());
assertEquals("Hive Server", hiveServer.get().getDisplayName());
assertEquals("HIVE_SERVER", hiveServer.get().getServiceName());
assertTrue(hiveServer.get().isOpen());
}
}
use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.
the class ServiceEndpointCollectorTest method gatewayTopology.
private GatewayTopology gatewayTopology(String name, ExposedService... services) {
GatewayTopologyV4Request gatewayTopologyJson = new GatewayTopologyV4Request();
gatewayTopologyJson.setTopologyName(name);
gatewayTopologyJson.setExposedServices(Arrays.stream(services).map(ExposedService::getKnoxService).collect(Collectors.toList()));
ExposedServices exposedServices = exposedServicesConverter.convert(gatewayTopologyJson);
GatewayTopology gatewayTopology = new GatewayTopology();
gatewayTopology.setTopologyName(name);
gatewayTopology.setExposedServices(new Json(exposedServices));
return gatewayTopology;
}
use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.
the class GrainPropertiesServiceTest method init.
@BeforeEach
public void init() {
ExposedService namenode = new ExposedService();
namenode.setName("NAMENODE");
namenode.setServiceName("NAMENODE");
when(exposedServiceCollector.getNameNodeService()).thenReturn(namenode);
Stack stack = new Stack();
stack.setId(1L);
cluster.setStack(stack);
}
use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.
the class ServiceEndpointCollector method getHBaseJarsUrlFromGatewayTopology.
private String getHBaseJarsUrlFromGatewayTopology(String managerIp, GatewayTopology gt, String hbaseMasterPrivateIp) {
Gateway gateway = gt.getGateway();
ExposedService hbaseJars = exposedServiceCollector.getHBaseJarsService();
if (gatewayListeningOnHttpsPort(gateway)) {
return String.format("https://%s/%s/%s%s%s", managerIp, gateway.getPath(), gt.getTopologyName(), API_TOPOLOGY_POSTFIX, hbaseJars.getKnoxUrl());
} else {
return String.format("https://%s:%s/%s/%s%s%s", managerIp, gateway.getGatewayPort(), gateway.getPath(), gt.getTopologyName(), API_TOPOLOGY_POSTFIX, hbaseJars.getKnoxUrl());
}
}
Aggregations