@Override public Cancellable announce(String serviceName, int port, byte[] payload) { return discoveryService.register( ResolvingDiscoverable.of(new Discoverable(serviceName, new InetSocketAddress(hostname, port), payload))); } }
public static ResolvingDiscoverable of(Discoverable discoverable) { return new ResolvingDiscoverable(discoverable); }
@Override public InetSocketAddress getSocketAddress() { return resolve(super.getSocketAddress()); }
@Override public Cancellable announce(final String serviceName, final int port) { return discoveryService.register( ResolvingDiscoverable.of(new Discoverable(serviceName, new InetSocketAddress(hostname, port)))); }
@Override public InetSocketAddress getSocketAddress() { return resolve(super.getSocketAddress()); }
public static ResolvingDiscoverable of(Discoverable discoverable) { return new ResolvingDiscoverable(discoverable); }
@Override public Cancellable announce(String serviceName, int port, byte[] payload) { return discoveryService.register( ResolvingDiscoverable.of(new Discoverable(serviceName, new InetSocketAddress(hostname, port), payload))); } }
@Override public Cancellable announce(final String serviceName, final int port) { return discoveryService.register( ResolvingDiscoverable.of(new Discoverable(serviceName, new InetSocketAddress(hostname, port)))); }
@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()); }
@Override protected void run() throws Exception { waitForOpExecutorToStart(); String announceAddress = cConf.get(Constants.Service.MASTER_SERVICES_ANNOUNCE_ADDRESS, httpService.getBindAddress().getHostName()); int announcePort = cConf.getInt(Constants.Dataset.Manager.ANNOUNCE_PORT, httpService.getBindAddress().getPort()); final InetSocketAddress socketAddress = new InetSocketAddress(announceAddress, announcePort); LOG.info("Announcing DatasetService for discovery..."); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_MANAGER, socketAddress))); LOG.info("DatasetService started successfully on {}", socketAddress); while (isRunning()) { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { // It's triggered by stop Thread.currentThread().interrupt(); break; } } }
@Override protected void run() throws Exception { waitForOpExecutorToStart(); String announceAddress = cConf.get(Constants.Service.MASTER_SERVICES_ANNOUNCE_ADDRESS, httpService.getBindAddress().getHostName()); int announcePort = cConf.getInt(Constants.Dataset.Manager.ANNOUNCE_PORT, httpService.getBindAddress().getPort()); final InetSocketAddress socketAddress = new InetSocketAddress(announceAddress, announcePort); LOG.info("Announcing DatasetService for discovery..."); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.DATASET_MANAGER, socketAddress))); LOG.info("DatasetService started successfully on {}", socketAddress); while (isRunning()) { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { // It's triggered by stop Thread.currentThread().interrupt(); break; } } }
@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."); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS)); LOG.info("Starting Metrics Service..."); httpService.start(); LOG.info("Started Metrics HTTP Service..."); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS, httpService.getBindAddress()))); LOG.info("Metrics 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."); }
cancellables.add(discoveryService.register(ResolvingDiscoverable.of( new Discoverable(serviceName, socketAddress, sslPayload))));
cancellables.add(discoveryService.register(ResolvingDiscoverable.of( new Discoverable(serviceName, socketAddress, sslPayload))));
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.EXPLORE_HTTP_USER_SERVICE)); LOG.info("Starting {}...", ExploreExecutorService.class.getSimpleName()); if (!startOnDemand) { exploreService.startAndWait(); } httpService.start(); cancellable = discoveryService.register(ResolvingDiscoverable.of( new Discoverable(Constants.Service.EXPLORE_HTTP_USER_SERVICE, httpService.getBindAddress()))); LOG.info("{} started successfully on {}", ExploreExecutorService.class.getSimpleName(), httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(Id.Namespace.SYSTEM.getId(), Constants.Logging.COMPONENT_NAME, Constants.Service.METRICS)); LOG.info("Starting Metrics Service..."); httpService.start(); LOG.info("Started Metrics HTTP Service..."); // Register the service cancelDiscovery = discoveryService.register( ResolvingDiscoverable.of(new Discoverable(Constants.Service.METRICS, httpService.getBindAddress()))); LOG.info("Metrics Service started successfully on {}", httpService.getBindAddress()); }
@Override protected void startUp() throws Exception { LoggingContextAccessor.setLoggingContext(new ServiceLoggingContext(NamespaceId.SYSTEM.getNamespace(), Constants.Logging.COMPONENT_NAME, Constants.Service.EXPLORE_HTTP_USER_SERVICE)); LOG.info("Starting {}...", ExploreExecutorService.class.getSimpleName()); if (!startOnDemand) { exploreService.startAndWait(); } httpService.start(); cancellable = discoveryService.register(ResolvingDiscoverable.of( new Discoverable(Constants.Service.EXPLORE_HTTP_USER_SERVICE, httpService.getBindAddress()))); LOG.info("{} started successfully on {}", ExploreExecutorService.class.getSimpleName(), httpService.getBindAddress()); }
@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()); }