Class PartitionManagerOptions

  • Direct Known Subclasses:
    AzureStoragePartitionManagerOptions

    public class PartitionManagerOptions
    extends Object
    Options affecting the operation of the partition manager within the event processor host. This class is broken out separately because many of these options also affect the operation of the ILeaseManager and ICheckpointManager implementations, and different implementations may need to subclass and provide different options or defaults.
    • Field Detail

      • DefaultLeaseDurationInSeconds

        public static final int DefaultLeaseDurationInSeconds
        The default duration after which a partition lease will expire unless renewed.
        See Also:
        Constant Field Values
      • DefaultLeaseRenewIntervalInSeconds

        public static final int DefaultLeaseRenewIntervalInSeconds
        The default duration between lease renewals.
        See Also:
        Constant Field Values
      • DefaultCheckpointTimeoutInSeconds

        public static final int DefaultCheckpointTimeoutInSeconds
        The default timeout for checkpoint operations.
        See Also:
        Constant Field Values
      • DefaultStartupScanDelayInSeconds

        public static final int DefaultStartupScanDelayInSeconds
        See Also:
        Constant Field Values
      • DefaultFastScanIntervalInSeconds

        public static final int DefaultFastScanIntervalInSeconds
        See Also:
        Constant Field Values
      • DefaultSlowScanIntervalInSeconds

        public static final int DefaultSlowScanIntervalInSeconds
        See Also:
        Constant Field Values
      • leaseDurationInSeconds

        protected int leaseDurationInSeconds
      • leaseRenewIntervalInSeconds

        protected int leaseRenewIntervalInSeconds
      • checkpointTimeoutInSeconds

        protected int checkpointTimeoutInSeconds
      • startupScanDelayInSeconds

        protected int startupScanDelayInSeconds
      • fastScanIntervalInSeconds

        protected int fastScanIntervalInSeconds
      • slowScanIntervalInSeconds

        protected int slowScanIntervalInSeconds
    • Constructor Detail

      • PartitionManagerOptions

        public PartitionManagerOptions()
        The base class automatically sets members to the static defaults.
    • Method Detail

      • getLeaseDurationInSeconds

        public int getLeaseDurationInSeconds()
        Gets the duration after which a partition lease will expire unless renewed. Defaults to DefaultLeaseDurationInSeconds.
        Returns:
        lease duration
      • setLeaseDurationInSeconds

        public void setLeaseDurationInSeconds​(int duration)
        Sets the duration after which a partition lease will expire unless renewed. Must be greater than 0 and should not be less than the renew interval. When using the default, Azure Storage-based ILeaseManager, the duration cannot be greater than 60.
        Parameters:
        duration - new value for lease duration
      • getLeaseRenewIntervalInSeconds

        public int getLeaseRenewIntervalInSeconds()
        Gets the duration between lease renewals. Defaults to DefaultLeaseRenewIntervalInSeconds.
        Returns:
        how often leases are renewed
      • setLeaseRenewIntervalInSeconds

        public void setLeaseRenewIntervalInSeconds​(int interval)
        Sets the duration between lease renewals. Must be greater than 0 and less than the current lease duration.
        Parameters:
        interval - new value for how often leases are renewed
      • getCheckpointTimeoutInSeconds

        public int getCheckpointTimeoutInSeconds()
        Gets the timeout for checkpoint operations. Defaults to DefaultCheckpointTimeoutInSeconds.
        Returns:
        timeout for checkpoint operations
      • setCheckpointTimeoutInSeconds

        public void setCheckpointTimeoutInSeconds​(int timeout)
        Sets the timeout for checkpoint operations. Must be greater than 0.
        Parameters:
        timeout - new value for checkpoint timeout
      • getStartupScanDelayInSeconds

        public int getStartupScanDelayInSeconds()
        Gets the delay time between the first scan for available partitions and the second. This is part of a startup optimization which allows individual hosts to become visible to other hosts, and thereby get a more accurate count of the number of hosts in the system, before they try to estimate how many partitions they should own. Defaults to DefaultStartupScanDelayInSeconds.
        Returns:
        delay time in seconds
      • setStartupScanDelayInSeconds

        public void setStartupScanDelayInSeconds​(int delay)
        Sets the delay time in seconds between the first scan and the second.
        Parameters:
        delay - new delay time in seconds
      • getFastScanIntervalInSeconds

        public int getFastScanIntervalInSeconds()
        There are two possible interval times between scans for available partitions, fast and slow. The fast (short) interval is used after a scan in which lease stealing has occurred, to promote quicker rebalancing. Defaults to DefaultFastScanIntervalInSeconds.
        Returns:
        interval time in seconds
      • setFastScanIntervalInSeconds

        public void setFastScanIntervalInSeconds​(int interval)
        Sets the time for fast interval.
        Parameters:
        interval - new fast interval in seconds
      • getSlowScanIntervalInSeconds

        public int getSlowScanIntervalInSeconds()
        The slow (long) interval is used after a scan in which lease stealing did not occur, to reduce unnecessary scanning when the system is in steady state. Defaults to DefaultSlowScanIntervalInSeconds.
        Returns:
        interval time in seconds
      • setSlowScanIntervalInSeconds

        public void setSlowScanIntervalInSeconds​(int interval)
        Sets the time for slow interval.
        Parameters:
        interval - new slow interval in seconds