Skip to content

Commit

Permalink
Checkstyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pveentjer committed Dec 30, 2024
1 parent e6039b3 commit b5cf57c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,6 @@ public class LogBufferDescriptor
*/
public static final int LOG_DEFAULT_FRAME_HEADER_MAX_LENGTH = CACHE_LINE_LENGTH * 2;


/**
* Offset within the log metadata where the term offset is stored.
*/
public static final int LOG_TERM_OFFSET_OFFSET;

/**
* Offset within the log metadata where the sparse property is stored.
*/
Expand Down Expand Up @@ -291,21 +285,20 @@ public class LogBufferDescriptor
LOG_TERM_LENGTH_OFFSET = LOG_MTU_LENGTH_OFFSET + SIZE_OF_INT;
LOG_PAGE_SIZE_OFFSET = LOG_TERM_LENGTH_OFFSET + SIZE_OF_INT;

LOG_TERM_OFFSET_OFFSET = LOG_PAGE_SIZE_OFFSET + SIZE_OF_INT;
LOG_SOCKET_RCVBUF_LENGTH_OFFSET = LOG_TERM_OFFSET_OFFSET + SIZE_OF_BYTE + 3;
LOG_SOCKET_RCVBUF_LENGTH_OFFSET = LOG_PAGE_SIZE_OFFSET + SIZE_OF_INT;
LOG_SOCKET_SNDBUF_LENGTH_OFFSET = LOG_SOCKET_RCVBUF_LENGTH_OFFSET + SIZE_OF_INT;
LOG_RECEIVER_WINDOW_LENGTH_OFFSET = LOG_SOCKET_SNDBUF_LENGTH_OFFSET + SIZE_OF_INT;
LOG_PUBLICATION_WINDOW_LENGTH_OFFSET = LOG_RECEIVER_WINDOW_LENGTH_OFFSET + SIZE_OF_INT;
LOG_SPIES_SIMULATE_CONNECTION_OFFSET = LOG_PUBLICATION_WINDOW_LENGTH_OFFSET + SIZE_OF_INT;
LOG_MAX_RESEND_OFFSET = LOG_SPIES_SIMULATE_CONNECTION_OFFSET+SIZE_OF_INT;
LOG_MAX_RESEND_OFFSET = LOG_SPIES_SIMULATE_CONNECTION_OFFSET + SIZE_OF_INT;

LOG_IS_SPARSE_OFFSET = LOG_MAX_RESEND_OFFSET + SIZE_OF_INT;
LOG_IS_TETHER_OFFSET = LOG_IS_SPARSE_OFFSET + SIZE_OF_BYTE;
LOG_IS_REJOIN_OFFSET = LOG_IS_TETHER_OFFSET + SIZE_OF_BYTE;
LOG_IS_RELIABLE_OFFSET = LOG_IS_REJOIN_OFFSET + SIZE_OF_BYTE;
LOG_SIGNAL_EOS_OFFSET = LOG_IS_RELIABLE_OFFSET + SIZE_OF_BYTE;

// the last 3 bytes of the current cache line are not used.
// the last 7 bytes of the current cache line are not used.

offset += CACHE_LINE_LENGTH;
LOG_DEFAULT_FRAME_HEADER_OFFSET = offset;
Expand Down Expand Up @@ -983,27 +976,6 @@ public static int computeAssembledFrameLength(final int length, final int maxPay
return HEADER_LENGTH + (numMaxPayloads * maxPayloadSize) + remainingPayload;
}

/**
* Get the term offset from the log metadata.
*
* @param metadataBuffer containing the meta data.
* @return the term offset.
*/
public static int termOffset(final UnsafeBuffer metadataBuffer)
{
return metadataBuffer.getInt(LOG_TERM_OFFSET_OFFSET);
}

/**
* Set the term offset in the log metadata.
*
* @param metadataBuffer containing the meta data.
* @param value the term offset to set.
*/
public static void termOffset(final UnsafeBuffer metadataBuffer, final int value)
{
metadataBuffer.putInt(LOG_TERM_OFFSET_OFFSET, value);
}

/**
* Get whether the log is sparse from the metadata.
Expand Down
13 changes: 7 additions & 6 deletions aeron-driver/src/main/java/io/aeron/driver/DriverConductor.java
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ private void initLogMetadata(
{
final UnsafeBuffer logMetaData = rawLog.metaData();

defaultDataHeader.sessionId(sessionId).streamId(streamId).termId(initialTermId);
defaultDataHeader.sessionId(sessionId).streamId(streamId).termId(initialTermId).termOffset(termOffset);
storeDefaultFrameHeader(logMetaData, defaultDataHeader);

initialTermId(logMetaData, initialTermId);
Expand All @@ -1925,21 +1925,22 @@ private void initLogMetadata(
pageSize(logMetaData, ctx.filePageSize());
correlationId(logMetaData, registrationId);

termOffset(logMetaData, termOffset);
socketRcvbufLength(logMetaData, socketRcvBufLength);
socketSndbufLength(logMetaData, socketSndbufLength);
receiverWindowLength(logMetaData, receiverWindowLength);
publicationWindowLength(logMetaData, publicationWindowLength);
maxResend(logMetaData, maxResend);
spiesSimulateConnection(logMetaData, spiesSimulateConnection);

isTether(logMetaData, tether);
isRejoin(logMetaData, rejoin);
isReliable(logMetaData, reliable);
isSparse(logMetaData, sparse);
publicationWindowLength(logMetaData, publicationWindowLength);
signalEos(logMetaData, signalEos);

untetheredWindowLimitTimeoutNs(logMetaData, untetheredWindowLimitTimeoutNs);
untetheredRestingTimeoutNs(logMetaData, untetheredRestingTimeoutNs);
maxResend(logMetaData, maxResend);
lingerTimeoutNs(logMetaData, lingerTimeoutNs);
signalEos(logMetaData, signalEos);
spiesSimulateConnection(logMetaData, spiesSimulateConnection);

// Acts like a release fence; so this should be the last statement.
endOfStreamPosition(logMetaData, Long.MAX_VALUE);
Expand Down

0 comments on commit b5cf57c

Please sign in to comment.