Separate out {From,To}ByteBufMapper
[controller.git] / atomix-storage / src / main / java / io / atomix / storage / journal / JournalSegmentDescriptor.java
index 97dbab72ef3c5ac45c9a0cc3d144ad8b64d91ddf..74fae698726e1b59beb125ab4f1b3392b9b86276 100644 (file)
@@ -24,6 +24,7 @@ import org.eclipse.jdt.annotation.Nullable;
 
 /**
  * Stores information about a {@link JournalSegment} of the log.
+ *
  * <p>
  * The segment descriptor manages metadata related to a single segment of the log. Descriptors are stored within the
  * first {@code 64} bytes of each segment in the following order:
@@ -93,6 +94,7 @@ public record JournalSegmentDescriptor(
 
     /**
      * Returns the segment version.
+     *
      * <p>
      * Versions are monotonically increasing starting at {@code 1}.
      *
@@ -104,6 +106,7 @@ public record JournalSegmentDescriptor(
 
     /**
      * Returns the segment identifier.
+     *
      * <p>
      * The segment ID is a monotonically increasing number within each log. Segments with in-sequence identifiers should
      * contain in-sequence indexes.
@@ -116,9 +119,10 @@ public record JournalSegmentDescriptor(
 
     /**
      * Returns the segment index.
+     *
      * <p>
-     * The index indicates the index at which the first entry should be written to the segment. Indexes are monotonically
-     * increasing thereafter.
+     * The index indicates the index at which the first entry should be written to the segment. Indexes are
+     * monotonically increasing thereafter.
      *
      * @return The segment index.
      */
@@ -146,10 +150,11 @@ public record JournalSegmentDescriptor(
 
     /**
      * Returns last time the segment was updated.
+     *
      * <p>
-     * When the segment is first constructed, the {@code updated} time is {@code 0}. Once all entries in the segment have
-     * been committed, the {@code updated} time should be set to the current time. Log compaction should not result in a
-     * change to {@code updated}.
+     * When the segment is first constructed, the {@code updated} time is {@code 0}. Once all entries in the segment
+     * have been committed, the {@code updated} time should be set to the current time. Log compaction should not result
+     * in a change to {@code updated}.
      *
      * @return The last time the segment was updated in terms of milliseconds since the epoch.
      */
@@ -158,7 +163,7 @@ public record JournalSegmentDescriptor(
     }
 
     /**
-     * Returns this segment as an array of bytes
+     * Returns this segment as an array of bytes.
      *
      * @return bytes
      */
@@ -177,6 +182,7 @@ public record JournalSegmentDescriptor(
 
     /**
      * Returns a descriptor builder.
+     *
      * <p>
      * The descriptor builder will write segment metadata to a {@code 48} byte in-memory buffer.
      *
@@ -219,6 +225,7 @@ public record JournalSegmentDescriptor(
          * @param id The segment identifier.
          * @return The segment descriptor builder.
          */
+        @SuppressWarnings("checkstyle:hiddenField")
         public Builder withId(final long id) {
             this.id = id;
             return this;
@@ -230,6 +237,7 @@ public record JournalSegmentDescriptor(
          * @param index The segment starting index.
          * @return The segment descriptor builder.
          */
+        @SuppressWarnings("checkstyle:hiddenField")
         public Builder withIndex(final long index) {
             this.index = index;
             return this;
@@ -241,6 +249,7 @@ public record JournalSegmentDescriptor(
          * @param maxSegmentSize The maximum count of the segment.
          * @return The segment descriptor builder.
          */
+        @SuppressWarnings("checkstyle:hiddenField")
         public Builder withMaxSegmentSize(final int maxSegmentSize) {
             this.maxSegmentSize = maxSegmentSize;
             return this;
@@ -254,17 +263,19 @@ public record JournalSegmentDescriptor(
          * @deprecated since 3.0.2
          */
         @Deprecated
+        @SuppressWarnings("checkstyle:hiddenField")
         public Builder withMaxEntries(final int maxEntries) {
             this.maxEntries = maxEntries;
             return this;
         }
 
         /**
-         * Sets updated timestamp;
+         * Sets updated timestamp.
          *
          * @param updated Epoch milliseconds
          * @return The segment descriptor builder.
          */
+        @SuppressWarnings("checkstyle:hiddenField")
         public Builder withUpdated(final long updated) {
             this.updated = updated;
             return this;