/**
* 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:
/**
* Returns the segment version.
+ *
* <p>
* Versions are monotonically increasing starting at {@code 1}.
*
/**
* 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.
/**
* 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.
*/
/**
* 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.
*/
}
/**
- * Returns this segment as an array of bytes
+ * Returns this segment as an array of bytes.
*
* @return bytes
*/
/**
* Returns a descriptor builder.
+ *
* <p>
* The descriptor builder will write segment metadata to a {@code 48} byte in-memory buffer.
*
* @param id The segment identifier.
* @return The segment descriptor builder.
*/
+ @SuppressWarnings("checkstyle:hiddenField")
public Builder withId(final long id) {
this.id = id;
return this;
* @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;
* @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;
* @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;