Package com.illumon.iris.controller
Class PersistentQueryController
java.lang.Object
com.fishlib.util.process.OnetimeShutdownTask
com.illumon.iris.controller.PersistentQueryController
- All Implemented Interfaces:
com.fishlib.util.process.ShutdownManager.Task
public final class PersistentQueryController
extends com.fishlib.util.process.OnetimeShutdownTask
Stand-alone controller for Iris.
Hosts a configuration PHT, a state PDHT, monitors server status, and dispatches stop/start commands.
Thread-safety notes:
- All changes to IrisQueryInfos are protected by the lock on the associated PDHT's map.
- All PersistentQueryConfiguration instances that are published (in the associated PHT or PersistentQueryInfo) are guaranteed not to be further mutated. Hence, they can be read safely at all times.
- All changes to a PersistentQueryConfiguration (by serial, not by instance, since published instances are immutable) are protected by a serial-specific lock. Query starts/stops are also protected, since they must always use the most up-to-date version of the configuration.
Configuration properties
- PersistentQueryController.host - The hostname of this controller
- PersistentQueryController.port - The port for communication
- PersistentQueryController.useLocalGit (optional) - When set to true use the local filesystem as a repository
- PersistentQueryController.gitGcEnabled (optional) - When set to true a git gc will be periodically performed
- PersistentQueryController.statusCheckTimes - When an AnomalyClient is used, defines the times to check in with status
- PersistentQueryController.failureWindowMillis - How long failures are queued
- PersistentQueryController.failureNumQueriesThreshold - How many failures are required before notifying the AnomalyClient
- PersistentQueryController.failureResendMillis - The minimum gap between failure messages
- PersistentQueryController.commitCheckpointImmediate (optional) - Immediately checkpoint the PDHT state on startup
- RemoteProcessingRequestProfile.defaultProfile - The default JVM args profile to use
- RemoteProcessingRequestProfile.noneProfile - The JVM profile to use when "None" is selected
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
static final int
static final int
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 our presence KV will be removed.static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentQueryController
(String processNameForLogging, String processInfoId, io.deephaven.enterprise.auth.audit.AuditEventLogger auditEventLogger, PersistentQueryStateLogger stateLogLogger, PersistentQueryConfigurationLogger configurationLogLogger, ResourceUtilizationLogger resourceUtilizationLogger, com.fishlib.io.sched.Scheduler scheduler, com.fishlib.net.ConnectionMonitor.Params connectionMonitorParams, com.fishlib.anomalyclient.SimpleAnomalyClientImpl chatBotClient, ScriptPathLoaderManager scriptPathLoaderManager, String errorEmailRecipientAddress, IrisGroupProvider irisGroupProvider, ScheduledExecutorService executorService, io.deephaven.enterprise.auth.AuthenticationClient authClient, Function<String, PublicPrivateKeyEncryption> encryptionFactory, ControllerDispatcherHandler.ConnectionFactory dispatcherConnectionFactory, io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, io.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.Factory presenceLeaseHandlerFactory) -
Method Summary
Modifier and TypeMethodDescriptionio.deephaven.enterprise.auth.AuthenticationClient
static String
getHost()
static String
getName()
static int
getPort()
static void
void
shutdown()
void
start
(io.deephaven.shadow.core.io.grpc.internal.AbstractServerImplBuilder<?> serverBuilder, Supplier<PqStorage> pqStorageFactory, boolean loadStateFromPresenceKvs) Methods inherited from class com.fishlib.util.process.OnetimeShutdownTask
adapt, awaitShutdown, awaitShutdown, invoke, isShutdown
-
Field Details
-
MAX_POSSIBLE_HEAP_GB
public static final int MAX_POSSIBLE_HEAP_GB- See Also:
-
DEFAULT_MAX_HEAP_SIZE_GB
public static final double DEFAULT_MAX_HEAP_SIZE_GB -
MAX_DESYNC_RETRIES
public static final int MAX_DESYNC_RETRIES -
ETCD_PRESENCE_LEASE_TTL_SECONDS
public static final int ETCD_PRESENCE_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 our presence KV will be removed. Any process using our presence KV as sign of liveness will consider us dead. -
ETCD_PRESENCE_LEASE_RENEW_SECONDS
public static final int ETCD_PRESENCE_LEASE_RENEW_SECONDSHow often, in seconds, do we renew our etcd lease. This must be less thanETCD_PRESENCE_LEASE_TTL_SECONDS
; for safety it should be no more than 50% of the TTL value. -
ETCD_PRESENCE_LEASE_RENEW_RETRY_DELAY_SECONDS
public static final int ETCD_PRESENCE_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_PRESENCE_LEASE_KEEPALIVE_TIMEOUT_MS
public static final int ETCD_PRESENCE_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. -
ETCD_PRESENCE_KVS_LOAD_TIMEOUT_SECONDS
public static final int ETCD_PRESENCE_KVS_LOAD_TIMEOUT_SECONDS -
ETCD_PRESENCE_KVS_LOAD_BATCH_SIZE
public static final int ETCD_PRESENCE_KVS_LOAD_BATCH_SIZE
-
-
Constructor Details
-
PersistentQueryController
public PersistentQueryController(@NotNull String processNameForLogging, @NotNull String processInfoId, @NotNull io.deephaven.enterprise.auth.audit.AuditEventLogger auditEventLogger, @NotNull PersistentQueryStateLogger stateLogLogger, @NotNull PersistentQueryConfigurationLogger configurationLogLogger, @NotNull ResourceUtilizationLogger resourceUtilizationLogger, @NotNull com.fishlib.io.sched.Scheduler scheduler, @Nullable com.fishlib.net.ConnectionMonitor.Params connectionMonitorParams, @Nullable com.fishlib.anomalyclient.SimpleAnomalyClientImpl chatBotClient, @NotNull ScriptPathLoaderManager scriptPathLoaderManager, @Nullable String errorEmailRecipientAddress, @NotNull IrisGroupProvider irisGroupProvider, @NotNull ScheduledExecutorService executorService, @NotNull io.deephaven.enterprise.auth.AuthenticationClient authClient, @NotNull Function<String, PublicPrivateKeyEncryption> encryptionFactory, @NotNull ControllerDispatcherHandler.ConnectionFactory dispatcherConnectionFactory, @NotNull io.deephaven.shadow.jetcd.io.etcd.jetcd.Client etcdClient, @NotNull io.deephaven.enterprise.etcdclient.presence.PresenceLeaseHandler.Factory presenceLeaseHandlerFactory) throws IOException, ConfigurationVerificationException
-
-
Method Details
-
getName
-
getHost
-
getPort
public static int getPort() -
getWorkerKindMap
-
start
public void start(@NotNull io.deephaven.shadow.core.io.grpc.internal.AbstractServerImplBuilder<?> serverBuilder, @NotNull Supplier<PqStorage> pqStorageFactory, boolean loadStateFromPresenceKvs) throws IOException, PqStorageException - Throws:
IOException
PqStorageException
-
shutdown
public void shutdown()- Specified by:
shutdown
in classcom.fishlib.util.process.OnetimeShutdownTask
-
main
public static void main(String... args) throws IOException, ClassNotFoundException, ConfigurationVerificationException, PqStorageException -
getConfigurationLogLogger
-
getAuthClient
@NotNull public io.deephaven.enterprise.auth.AuthenticationClient getAuthClient() -
getPresenceManager
-