Class RemoteQueryDispatcher
java.lang.Object
com.illumon.iris.db.tables.remotequery.RemoteQueryDispatcher
- All Implemented Interfaces:
WorkerLeaseHandler.LeaseRecreationCallback
public class RemoteQueryDispatcher
extends Object
implements WorkerLeaseHandler.LeaseRecreationCallback
Dispatcher class to create query workers.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic final StringThe name of the directory under /etc/sysconfig/deephaven/etcd/client/ that contains our etcd endpoint, user, password, certificate, etc.static final intWhat is the maximum frequency which we will try to renew a lease.static final intHow often, in seconds, do we renew our etcd lease.static final intHow 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 intHow long will we wait for our etcd lease to be granted or renewed, in milliseconds before determining that we had a failure.static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanInvoked After we've recreated the lease, to recreate the status entries for each worker.static io.deephaven.shadow.jackson.com.fasterxml.jackson.databind.node.ArrayNodestatic Filestatic FilegetCachedClassDirectory(String processUserName) static Filestatic FilegetClassDirectoryRoot(String processUserName) static intstatic doublestatic StringgetUserWorkspaceRoot(String processUserName) 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 voidbooleanShould we recreate leases if the lease has failed?booleanshutdown()
-
Field Details
-
DISPATCHER_ETCD_RW_CONTEXT
The name of the directory under /etc/sysconfig/deephaven/etcd/client/ that contains our etcd endpoint, user, password, certificate, etc.- See Also:
-
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. -
LEASE_KEEPALIVE_TIMEOUT_MS
public static final int 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
-
getMemoryOverheadMegabytes
public static int getMemoryOverheadMegabytes() -
getMemoryOverheadPercent
public static double getMemoryOverheadPercent() -
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) - Parameters:
map- map from WorkerKind name to WorkerKind object- Returns:
- JSON string to send to web API and other clients
-
shutdown
public boolean shutdown() -
main
-
shouldRecreateLease
public boolean shouldRecreateLease()Description copied from interface:WorkerLeaseHandler.LeaseRecreationCallbackShould we recreate leases if the lease has failed?- Specified by:
shouldRecreateLeasein interfaceWorkerLeaseHandler.LeaseRecreationCallback- Returns:
- true if we should attempt to recreate leases
-
doRecreateStatuses
public boolean doRecreateStatuses()Description copied from interface:WorkerLeaseHandler.LeaseRecreationCallbackInvoked After we've recreated the lease, to recreate the status entries for each worker.- Specified by:
doRecreateStatusesin interfaceWorkerLeaseHandler.LeaseRecreationCallback- Returns:
- true if all statuses were recreated successfully, false otherwise
-