Class RemoteQueryDispatcher

java.lang.Object
com.illumon.iris.db.tables.remotequery.RemoteQueryDispatcher
All Implemented Interfaces:
io.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.LeaseRecreationListener

public class RemoteQueryDispatcher extends Object implements io.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.LeaseRecreationListener
Dispatcher class to create query workers.
  • Field Details

    • ETCD_LEASE_TTL_SECONDS

      public static final int ETCD_LEASE_TTL_SECONDS
      How long does our etcd lease last in seconds? If we do not renew the lease for this many seconds, then etcd will automatically revoke it; and all of our workers will terminate.
    • ETCD_LEASE_RENEW_SECONDS

      public static final int ETCD_LEASE_RENEW_SECONDS
      How often, in seconds, do we renew our etcd lease. This must be less than ETCD_LEASE_TTL_SECONDS; for safety it should be no more than 50% of the TTL value.
    • ETCD_LEASE_RENEW_RETRY_DELAY_SECONDS

      public static final int ETCD_LEASE_RENEW_RETRY_DELAY_SECONDS
      What is the maximum frequency which we will try to renew a lease. If a lease renewal times out, we will try again more quickly than the standard ETCD_LEASE_RENEW_SECONDS.
    • ETCD_LEASE_KEEPALIVE_TIMEOUT_MS

      public static final int ETCD_LEASE_KEEPALIVE_TIMEOUT_MS
      How long will we wait for our etcd lease to be granted or renewed, in milliseconds before determining that we had a failure.
    • prefixNonce

      public static final long prefixNonce
    • ALLOW_RUN_AS

      public static boolean ALLOW_RUN_AS
  • Constructor Details

  • Method Details

    • getUserWorkspaceRoot

      public static String getUserWorkspaceRoot(String processUserName)
    • getClassDirectoryRoot

      public static File getClassDirectoryRoot(String processUserName)
    • getClassDirectoryRoot

      public static File getClassDirectoryRoot()
    • getCachedClassDirectory

      public static File getCachedClassDirectory(String processUserName)
    • getCachedClassDirectory

      public static File getCachedClassDirectory()
    • getWorkerKindMap

      @NotNull public static Map<String,WorkerKind> getWorkerKindMap(com.fishlib.io.logger.Logger log, com.fishlib.configuration.Configuration configuration)
      Produce the map of worker kind objects that the dispatcher supports.
      Parameters:
      log - the log
      configuration - the configuration object
      Returns:
      a Map from name to WorkerKind
    • generateWorkerKindJson

      public static io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ArrayNode generateWorkerKindJson(@NotNull Map<String,WorkerKind> map, @Nullable String[] myGroups)
      Generate the worker kind JSON.
      Parameters:
      map - map from WorkerKind name to WorkerKind object
      myGroups - the groups to which the requester belongs
      Returns:
      JSON string to send to web API and other clients
    • shutdown

      public boolean shutdown()
    • getWorkerHeapWithOverheadMB

      public static int getWorkerHeapWithOverheadMB(int requestedHeapSizeMb)
    • main

      public static void main(String... args)
    • shouldRecreateLease

      public boolean shouldRecreateLease()
      Specified by:
      shouldRecreateLease in interface io.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.LeaseRecreationListener
    • doRecreateKvs

      public boolean doRecreateKvs()
      Specified by:
      doRecreateKvs in interface io.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.LeaseRecreationListener