Class DynamicTCPRemoteCommitProvider

All Implemented Interfaces:
RemoteCommitProvider, Configurable, Closeable
Direct Known Subclasses:
KubernetesTCPRemoteCommitProvider

public abstract class DynamicTCPRemoteCommitProvider extends TCPRemoteCommitProvider
  • Constructor Details

  • Method Details

    • getCacheDurationMillis

      public int getCacheDurationMillis()
    • setCacheDurationMillis

      public void setCacheDurationMillis(int _cacheDurationMillis)
    • setAddresses

      public final void setAddresses(String names) throws UnknownHostException
      Description copied from class: TCPRemoteCommitProvider
      Sets the list of addresses of peers to which this provider will send events to. The peers are semicolon-separated names list in the form of "myhost1:portA;myhost2:portB".
      Overrides:
      setAddresses in class TCPRemoteCommitProvider
      Parameters:
      names - the list of addresses of peers to which this provider will send events to
      Throws:
      UnknownHostException - in case peer name cannot be resolved
    • endConfiguration

      public void endConfiguration()
      Description copied from class: TCPRemoteCommitProvider
      Subclasses that need to perform actions in Configurable.endConfiguration() must invoke this method.
      Specified by:
      endConfiguration in interface Configurable
      Overrides:
      endConfiguration in class TCPRemoteCommitProvider
    • refreshesAddressesOnDemand

      protected boolean refreshesAddressesOnDemand()
      A peer that just came up may connect before the periodic refresh has discovered it, so the addresses are refreshed before a connection from an unknown host is rejected.
      Overrides:
      refreshesAddressesOnDemand in class TCPRemoteCommitProvider
      Returns:
      true if TCPRemoteCommitProvider.refreshAddresses(long) may find further peers
    • refreshAddresses

      protected void refreshAddresses(long acceptedNanos)
      Refreshes the addresses, unless a refresh started after the connection was accepted. Refreshes run one at a time and at most once per second, so that connections from unknown hosts cannot flood the source of the addresses.
      Overrides:
      refreshAddresses in class TCPRemoteCommitProvider
      Parameters:
      acceptedNanos - the System.nanoTime() at which the connection was accepted; a refresh started later already covers this connection
    • fetchDynamicAddresses

      protected abstract List<String> fetchDynamicAddresses()