@Test public void testGetCmServerUrlWithAmbariPresentInTopologiesWithCentralGateway() { Cluster cluster = createClusterWithComponents(new ExposedService[]{exposedService("CLOUDERA_MANAGER_UI"), exposedService("ATLAS")}, new ExposedService[]{exposedService("HIVE_SERVER")}, GatewayType.CENTRAL); String result = underTest.getManagerServerUrl(cluster, CLOUDERA_MANAGER_IP); assertEquals("/gateway-path/topology1/cmf/home/", result); }
public String getManagerServerUrl(Cluster cluster, String managerIp) { if (managerIp != null) { String orchestrator = cluster.getStack().getOrchestrator().getType(); if (YARN.equals(orchestrator)) { return String.format("http: } else { Gateway gateway = cluster.getGateway(); if (gateway != null) { ExposedService exposedService = exposedServiceCollector.getClouderaManagerUIService(); Optional<GatewayTopology> gatewayTopology = getGatewayTopologyForService(gateway, exposedService); Optional<String> managerUrl = gatewayTopology .map(t -> getExposedServiceUrl(managerIp, gateway, t.getTopologyName(), exposedService, false)); return managerUrl.orElse(String.format("https: } return String.format("https: } } return null; }
ServiceEndpointCollector { public String getManagerServerUrl(Cluster cluster, String managerIp) { if (managerIp != null) { String orchestrator = cluster.getStack().getOrchestrator().getType(); if (YARN.equals(orchestrator)) { return String.format("http: } else { Gateway gateway = cluster.getGateway(); if (gateway != null) { ExposedService exposedService = exposedServiceCollector.getClouderaManagerUIService(); Optional<GatewayTopology> gatewayTopology = getGatewayTopologyForService(gateway, exposedService); Optional<String> managerUrl = gatewayTopology .map(t -> getExposedServiceUrl(managerIp, gateway, t.getTopologyName(), exposedService, false)); return managerUrl.orElse(String.format("https: } return String.format("https: } } return null; } }
ServiceEndpointCollector { public String getManagerServerUrl(Cluster cluster, String managerIp) { if (managerIp != null) { String orchestrator = cluster.getStack().getOrchestrator().getType(); if (YARN.equals(orchestrator)) { return String.format("http: } else { Gateway gateway = cluster.getGateway(); if (gateway != null) { ExposedService exposedService = exposedServiceCollector.getClouderaManagerUIService(); Optional<GatewayTopology> gatewayTopology = getGatewayTopologyForService(gateway, exposedService); Optional<String> managerUrl = gatewayTopology .map(t -> getExposedServiceUrl(managerIp, gateway, t.getTopologyName(), exposedService, false)); return managerUrl.orElse(String.format("https: } return String.format("https: } } return null; }  }
ServiceEndpointCollector { public String getManagerServerUrl(Cluster cluster, String managerIp) { if (managerIp != null) { String orchestrator = cluster.getStack().getOrchestrator().getType(); if (YARN.equals(orchestrator)) { return String.format("http: } else { Gateway gateway = cluster.getGateway(); if (gateway != null) { ExposedService exposedService = exposedServiceCollector.getClouderaManagerUIService(); Optional<GatewayTopology> gatewayTopology = getGatewayTopologyForService(gateway, exposedService); Optional<String> managerUrl = gatewayTopology .map(t -> getExposedServiceUrl(managerIp, gateway, t.getTopologyName(), exposedService, false)); return managerUrl.orElse(String.format("https: } return String.format("https: } } return null; }  Collection<ExposedServiceV4Response> getKnoxServices(Long workspaceId, String blueprintName); String getManagerServerUrl(Cluster cluster, String managerIp); Map<String, Collection<ClusterExposedServiceV4Response>> prepareClusterExposedServices(Cluster cluster, String managerIp); Map<String, Collection<ClusterExposedServiceView>> prepareClusterExposedServicesViews(Cluster cluster, String managerIp); List<GatewayTopologyV4Response> filterByStackType(StackType stackType, List<GatewayTopologyV4Response> topologies); }
ServiceEndpointCollector { public String getManagerServerUrl(Cluster cluster, String managerIp) { if (managerIp != null) { String orchestrator = cluster.getStack().getOrchestrator().getType(); if (YARN.equals(orchestrator)) { return String.format("http: } else { Gateway gateway = cluster.getGateway(); if (gateway != null) { ExposedService exposedService = exposedServiceCollector.getClouderaManagerUIService(); Optional<GatewayTopology> gatewayTopology = getGatewayTopologyForService(gateway, exposedService); Optional<String> managerUrl = gatewayTopology .map(t -> getExposedServiceUrl(managerIp, gateway, t.getTopologyName(), exposedService, false)); return managerUrl.orElse(String.format("https: } return String.format("https: } } return null; }  Collection<ExposedServiceV4Response> getKnoxServices(Long workspaceId, String blueprintName); String getManagerServerUrl(Cluster cluster, String managerIp); Map<String, Collection<ClusterExposedServiceV4Response>> prepareClusterExposedServices(Cluster cluster, String managerIp); Map<String, Collection<ClusterExposedServiceView>> prepareClusterExposedServicesViews(Cluster cluster, String managerIp); List<GatewayTopologyV4Response> filterByStackType(StackType stackType, List<GatewayTopologyV4Response> topologies);  }