@VisibleForTesting public InetSocketAddress getBindAddress() { return httpService.getBindAddress(); }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); } }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); } }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); } }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); } }
@Override public String toString() { return Objects.toStringHelper(this) .add("bindAddress", httpService.getBindAddress()) .toString(); } }
/** * Returns the base {@link URI} for talking to this service remotely through HTTP. */ URI getBaseURI() { InetSocketAddress bindAddress = httpServer.getBindAddress(); if (bindAddress == null) { throw new IllegalStateException("SparkDriverHttpService hasn't been started"); } return URI.create(String.format("http://%s:%d", bindAddress.getHostName(), bindAddress.getPort())); } }
/** * Returns the base {@link URI} for talking to this service remotely through HTTP. */ URI getBaseURI() { InetSocketAddress bindAddress = httpServer.getBindAddress(); if (bindAddress == null) { throw new IllegalStateException("SparkDriverHttpService hasn't been started"); } return URI.create(String.format("http://%s:%d", bindAddress.getHostName(), bindAddress.getPort())); } }
/** * Returns the base {@link URI} for talking to this service remotely through HTTP. */ public URI getBaseURI() { InetSocketAddress bindAddress = httpServer.getBindAddress(); if (bindAddress == null) { throw new IllegalStateException("SparkExecutionService hasn't been started"); } return URI.create(String.format("http://%s:%d", bindAddress.getHostName(), bindAddress.getPort())); }
/** * Returns the base {@link URI} for talking to this service remotely through HTTP. */ public URI getBaseURI() { InetSocketAddress bindAddress = httpServer.getBindAddress(); if (bindAddress == null) { throw new IllegalStateException("SparkExecutionService hasn't been started"); } return URI.create(String.format("http://%s:%d", bindAddress.getHostName(), bindAddress.getPort())); }
@Override protected void startUp() throws Exception { LOG.info("Starting Transaction HTTP Service..."); httpService.start(); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.TRANSACTION_HTTP, httpService.getBindAddress()))); LOG.info("Transaction HTTP started successfully on {}", httpService.getBindAddress()); }
private URL getURL(String path) throws MalformedURLException { if (!path.startsWith("/")) { path = "/" + path; } InetSocketAddress addr = httpServer.getBindAddress(); return new URL(String.format("http://%s:%d%s", addr.getHostName(), addr.getPort(), path)); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getEntityName(), Constants.Logging.COMPONENT_NAME, Constants.Service.DATASET_EXECUTOR)); LOG.info("Starting DatasetOpExecutorService..."); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_EXECUTOR, httpService.getBindAddress()))); LOG.info("DatasetOpExecutorService started successfully on {}", httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { httpService.startAndWait(); LOG.info("Dummy service started successfully on {}", httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS_PROCESSOR)); LOG.info("Starting MetricsProcessor Status Service..."); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS_PROCESSOR, httpService.getBindAddress()))); LOG.info("Started MetricsProcessor Status Service."); }
/** * This test failure in creating SSH tunnel */ @Test(expected = IOException.class) public void testFailTunnel() throws Exception { InetSocketAddress httpAddr = httpService.getBindAddress(); // Close the SSH session, hence can't create port forwarding sshSession.close(); // On proxy failure, IOException will be thrown URL url = new URL(String.format("http://%s:%d/ping", httpAddr.getHostName(), httpAddr.getPort())); HttpRequests.execute(co.cask.common.http.HttpRequest.get(url).build()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.LOGSAVER)); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.LOGSAVER, httpService.getBindAddress()))); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.LOGSAVER)); httpService.start(); cancellable = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.LOGSAVER, httpService.getBindAddress()))); }