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.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 Details

    • RESET_ON_STARTUP

      public static final String RESET_ON_STARTUP
      See Also:
    • 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
    • CONTROLLER_PRESENCE_KV_TTL_SECONDS

      public static final int CONTROLLER_PRESENCE_KV_TTL_SECONDS
    • ETCD_STATE_LEASE_TTL_SECONDS

      public static final int ETCD_STATE_LEASE_TTL_SECONDS
      How long does our etcd lease for PQ state 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_STATE_LEASE_RENEW_SECONDS

      public static final int ETCD_STATE_LEASE_RENEW_SECONDS
      How often, in seconds, do we renew our etcd lease for PQ State KVs. This must be less than ETCD_STATE_LEASE_TTL_SECONDS; for safety it should be no more than 50% of the TTL value.
    • ETCD_STATE_LEASE_RENEW_RETRY_DELAY_SECONDS

      public static final int ETCD_STATE_LEASE_RENEW_RETRY_DELAY_SECONDS
      What is the maximum frequency which we will try to renew a PQ State lease. If a lease renewal times out, we will try again more quickly than the standard ETCD_STATE_LEASE_RENEW_SECONDS.
    • ETCD_STATE_LEASE_KEEPALIVE_TIMEOUT_MS

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

      public static final int ETCD_ELECTION_LEASE_TTL_SECONDS
      How long does our etcd lease for leader election last, in seconds? If we do not renew the lease for this many seconds, then etcd will automatically revoke it, and we will lose our leadership and our registration in dh-resolver will be removed.
    • ETCD_ELECTION_LEASE_RENEW_SECONDS

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

      public static final int ETCD_ELECTION_LEASE_RENEW_RETRY_DELAY_SECONDS
      What is the maximum frequency which we will try to renew an election lease. If a lease renewal times out, we will try again more quickly than the standard ETCD_ELECTION_LEASE_RENEW_SECONDS.
    • ETCD_ELECTION_LEASE_KEEPALIVE_TIMEOUT_MS

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

      public static final int ETCD_STATE_KVS_LOAD_TIMEOUT_SECONDS
      How long in seconds the controller wait to load existing worker state.
    • ETCD_STATE_KVS_LOAD_BATCH_SIZE

      public static final int ETCD_STATE_KVS_LOAD_BATCH_SIZE
    • CONTROLLER_ELECTION_CAMPAIGN_KEY

      public static final String CONTROLLER_ELECTION_CAMPAIGN_KEY
      See Also:
    • ELECTION_RPC_TIMEOUT_MILLIS

      public static final long ELECTION_RPC_TIMEOUT_MILLIS
    • ELECTION_OBSERVE_TIMEOUT_MILLIS

      public static final long ELECTION_OBSERVE_TIMEOUT_MILLIS
  • Constructor Details

  • Method Details