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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
static final int
How long will we wait for our etcd lease to be granted or renewed, in milliseconds before determining that we had a failure.static final int
What is the maximum frequency which we will try to renew a lease.static final int
How often, in seconds, do we renew our etcd lease.static final int
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.static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ArrayNode
generateWorkerKindJson
(Map<String, WorkerKind> map, String[] myGroups) Generate the worker kind JSON.static File
static File
getCachedClassDirectory
(String processUserName) static File
static File
getClassDirectoryRoot
(String processUserName) static String
getUserWorkspaceRoot
(String processUserName) static int
getWorkerHeapWithOverheadMB
(int requestedHeapSizeMb) 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.static void
boolean
boolean
shutdown()
-
Field Details
-
ETCD_LEASE_TTL_SECONDS
public static final int ETCD_LEASE_TTL_SECONDSHow 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_SECONDSHow often, in seconds, do we renew our etcd lease. This must be less thanETCD_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_SECONDSWhat 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_MSHow 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
-
RemoteQueryDispatcher
public RemoteQueryDispatcher(IrisLogCreator logCreator, String dispatcherHostName) throws IOException, ExecutionException, InterruptedException, TimeoutException
-
-
Method Details
-
getUserWorkspaceRoot
-
getClassDirectoryRoot
-
getClassDirectoryRoot
-
getCachedClassDirectory
-
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 logconfiguration
- 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 objectmyGroups
- 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
-
shouldRecreateLease
public boolean shouldRecreateLease()- Specified by:
shouldRecreateLease
in interfaceio.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.LeaseRecreationListener
-
doRecreateKvs
public boolean doRecreateKvs()- Specified by:
doRecreateKvs
in interfaceio.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.LeaseRecreationListener
-