Class ServiceResolver

java.lang.Object
io.deephaven.util.ServiceResolver
All Implemented Interfaces:
SafeCloseable, AutoCloseable

public class ServiceResolver extends Object implements SafeCloseable
  • Constructor Details

    • ServiceResolver

      public ServiceResolver(@NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)
      Create a resolver that can refresh a list of servers for a service when the service registration changes
      Parameters:
      etcdClient - the etcd client to use
      service - the DH service to resolve
    • ServiceResolver

      public ServiceResolver(@NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service, @Nullable Consumer<HostPort[]> notifyUpdate)
      Create a resolver that can refresh a list of servers for a service when the service registration changes
      Parameters:
      etcdClient - the etcd client to use
      service - the DH service to resolve
      notifyUpdate - if not null, a callback to invoke to notify that the list of servers was updated
  • Method Details

    • getEtcdResolverContext

      public static io.deephaven.enterprise.resolver.EtcdResolverContext getEtcdResolverContext(io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, com.fishlib.io.logger.Logger log, DhService service)
    • getServers

      public HostPort[] getServers()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SafeCloseable
    • getServersOneTime

      public static HostPort[] getServersOneTime(@NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)
    • getServiceHostsOneTime

      public static String[] getServiceHostsOneTime(@NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)
    • getServiceHostPortSnapshot

      public static HostPort[] getServiceHostPortSnapshot(@NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)
    • getServiceHostPortSnapshot

      public static HostPort[] getServiceHostPortSnapshot(@NotNull com.fishlib.io.logger.Logger log, @NotNull String logPfx, @NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)
    • getServiceHostSnapshot

      public static String[] getServiceHostSnapshot(@NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)
    • getServiceHostSnapshot

      public static String[] getServiceHostSnapshot(@NotNull com.fishlib.io.logger.Logger log, @NotNull String logPfx, @NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull DhService service)