Record Class DurableLogConfig

java.lang.Object
java.lang.Record
org.j7m.middleware.durablelog.DurableLogConfig
Record Components:
directory - log directory owned by the durable log
maxSegmentBytes - maximum segment file size before rotation
maxPayloadBytes - maximum payload size accepted for one record
maxRecordsPerAppend - maximum records accepted in one append call
maxOpenCursors - maximum concurrently open cursors
fsyncPolicy - durability sync policy
groupCommitPolicy - group commit batching policy
integrityPolicy - frame integrity policy
retentionPolicy - segment retention policy
clock - timestamp source

public record DurableLogConfig(Path directory, long maxSegmentBytes, long maxPayloadBytes, int maxRecordsPerAppend, int maxOpenCursors, org.j7m.middleware.api.durablelog.FsyncPolicy fsyncPolicy, org.j7m.middleware.api.durablelog.GroupCommitPolicy groupCommitPolicy, org.j7m.middleware.api.durablelog.LogIntegrityPolicy integrityPolicy, org.j7m.middleware.api.durablelog.RetentionPolicy retentionPolicy, Clock clock) extends Record
Immutable file durable-log configuration.
  • Constructor Details

    • DurableLogConfig

      public DurableLogConfig(Path directory, long maxSegmentBytes, long maxPayloadBytes, int maxRecordsPerAppend, int maxOpenCursors, org.j7m.middleware.api.durablelog.FsyncPolicy fsyncPolicy, org.j7m.middleware.api.durablelog.GroupCommitPolicy groupCommitPolicy, org.j7m.middleware.api.durablelog.LogIntegrityPolicy integrityPolicy, org.j7m.middleware.api.durablelog.RetentionPolicy retentionPolicy, Clock clock)
      Creates validated configuration.
  • Method Details

    • defaults

      public static DurableLogConfig defaults(Path directory)
      Creates default configuration for a directory.
      Parameters:
      directory - log directory
      Returns:
      default durable-log configuration
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • directory

      public Path directory()
      Returns the value of the directory record component.
      Returns:
      the value of the directory record component
    • maxSegmentBytes

      public long maxSegmentBytes()
      Returns the value of the maxSegmentBytes record component.
      Returns:
      the value of the maxSegmentBytes record component
    • maxPayloadBytes

      public long maxPayloadBytes()
      Returns the value of the maxPayloadBytes record component.
      Returns:
      the value of the maxPayloadBytes record component
    • maxRecordsPerAppend

      public int maxRecordsPerAppend()
      Returns the value of the maxRecordsPerAppend record component.
      Returns:
      the value of the maxRecordsPerAppend record component
    • maxOpenCursors

      public int maxOpenCursors()
      Returns the value of the maxOpenCursors record component.
      Returns:
      the value of the maxOpenCursors record component
    • fsyncPolicy

      public org.j7m.middleware.api.durablelog.FsyncPolicy fsyncPolicy()
      Returns the value of the fsyncPolicy record component.
      Returns:
      the value of the fsyncPolicy record component
    • groupCommitPolicy

      public org.j7m.middleware.api.durablelog.GroupCommitPolicy groupCommitPolicy()
      Returns the value of the groupCommitPolicy record component.
      Returns:
      the value of the groupCommitPolicy record component
    • integrityPolicy

      public org.j7m.middleware.api.durablelog.LogIntegrityPolicy integrityPolicy()
      Returns the value of the integrityPolicy record component.
      Returns:
      the value of the integrityPolicy record component
    • retentionPolicy

      public org.j7m.middleware.api.durablelog.RetentionPolicy retentionPolicy()
      Returns the value of the retentionPolicy record component.
      Returns:
      the value of the retentionPolicy record component
    • clock

      public Clock clock()
      Returns the value of the clock record component.
      Returns:
      the value of the clock record component