Interface LogClient


public interface LogClient
Log client.
  • Method Details

    • protocol

      LogProtocol protocol()
      Returns the client log protocol.
      Returns:
      the client log protocol
    • state

      Returns the log client state.
      Returns:
      the log client state
    • getPartitions

      Collection<LogSession> getPartitions()
      Returns the collection of all partitions.
      Returns:
      the collection of all partitions
    • getPartitionIds

      Collection<PartitionId> getPartitionIds()
      Returns the collection of all partition IDs.
      Returns:
      the collection of all partition IDs
    • getPartition

      LogSession getPartition​(PartitionId partitionId)
      Returns the partition with the given identifier.
      Parameters:
      partitionId - the partition with the given identifier
      Returns:
      the partition with the given identifier
    • getPartitionId

      PartitionId getPartitionId​(String key)
      Returns the partition ID for the given key.
      Parameters:
      key - the key for which to return the partition ID
      Returns:
      the partition ID for the given key
    • getPartition

      default LogSession getPartition​(String key)
      Returns the partition for the given key.
      Parameters:
      key - the key for which to return the partition
      Returns:
      the partition for the given key
    • addStateChangeListener

      void addStateChangeListener​(java.util.function.Consumer<PrimitiveState> listener)
      Registers a session state change listener.
      Parameters:
      listener - The callback to call when the session state changes.
    • removeStateChangeListener

      void removeStateChangeListener​(java.util.function.Consumer<PrimitiveState> listener)
      Removes a state change listener.
      Parameters:
      listener - the state change listener to remove
    • connect

      Connects the log client.
      Returns:
      a future to be completed once the log client has been connected
    • close

      Closes the log client.
      Returns:
      a future to be completed once the log client has been closed