Skip to content

Commit

Permalink
[Java] Improve checkstyle config for javadoc and apply changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Dec 3, 2024
1 parent 9acf5fa commit e3769b3
Show file tree
Hide file tree
Showing 88 changed files with 380 additions and 384 deletions.
20 changes: 10 additions & 10 deletions aeron-agent/src/main/java/io/aeron/agent/ArchiveEventLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ public void logRecordingSignal(final DirectBuffer buffer, final int offset, fina
}

/**
* Log a state change event for an archive replay session
* Log a state change event for an archive replay session.
*
* @param <E> type representing the state change.
* @param oldState before the change.
* @param newState after the change.
* @param sessionId identity for the replay session on the Archive.
* @param recordingId recording id on the Archive.
* @param position position of state change ({@link io.aeron.archive.client.AeronArchive#NULL_POSITION}
* if not relevant)
* @param reason a string indicating the reason for the state change
* if not relevant).
* @param reason a string indicating the reason for the state change.
*/
public <E extends Enum<E>> void logReplaySessionStateChange(
final E oldState,
Expand Down Expand Up @@ -155,15 +155,15 @@ public <E extends Enum<E>> void logReplaySessionStateChange(
}

/**
* Log a state change event for an archive recording session
* Log a state change event for an archive recording session.
*
* @param <E> type representing the state change.
* @param oldState before the change.
* @param newState after the change.
* @param recordingId recording id on the Archive.
* @param position position of state change ({@link io.aeron.archive.client.AeronArchive#NULL_POSITION}
* if not relevant)
* @param reason a string indicating the reason for the state change
* if not relevant).
* @param reason a string indicating the reason for the state change.
*/
public <E extends Enum<E>> void logRecordingSessionStateChange(
final E oldState,
Expand Down Expand Up @@ -201,7 +201,7 @@ public <E extends Enum<E>> void logRecordingSessionStateChange(
}

/**
* Log a state change event for an archive replication session
* Log a state change event for an archive replication session.
*
* @param <E> type representing the state change.
* @param oldState before the change.
Expand All @@ -210,8 +210,8 @@ public <E extends Enum<E>> void logRecordingSessionStateChange(
* @param srcRecordingId source recording id on the Archive.
* @param dstRecordingId destination recording id on the Archive.
* @param position position of state change ({@link io.aeron.archive.client.AeronArchive#NULL_POSITION}
* if not relevant)
* @param reason a string indicating the reason for the state change
* if not relevant).
* @param reason a string indicating the reason for the state change.
*/
public <E extends Enum<E>> void logReplicationSessionStateChange(
final E oldState,
Expand Down Expand Up @@ -253,7 +253,7 @@ public <E extends Enum<E>> void logReplicationSessionStateChange(
}

/**
* Log a state change event for an archive control session
* Log a state change event for an archive control session.
*
* @param <E> type representing the state change.
* @param oldState before the change.
Expand Down
24 changes: 12 additions & 12 deletions aeron-agent/src/main/java/io/aeron/agent/ClusterEventCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public enum ClusterEventCode implements EventCode
REQUEST_VOTE(6, ClusterEventDissector::dissectRequestVote),

/**
* Notification of a follower's catchup position
* Notification of a follower's catchup position.
*/
CATCHUP_POSITION(7, ClusterEventDissector::dissectCatchupPosition),

/**
* A request to stop follower catchup
* A request to stop follower catchup.
*/
STOP_CATCHUP(8, ClusterEventDissector::dissectStopCatchup),

Expand All @@ -74,47 +74,47 @@ public enum ClusterEventCode implements EventCode
TRUNCATE_LOG_ENTRY(9, ClusterEventDissector::dissectTruncateLogEntry),

/**
* Event when a new leadership term is replayed
* Event when a new leadership term is replayed.
*/
REPLAY_NEW_LEADERSHIP_TERM(10, ClusterEventDissector::dissectReplayNewLeadershipTerm),

/**
* Event when an append position is received
* Event when an append position is received.
*/
APPEND_POSITION(11, ClusterEventDissector::dissectAppendPosition),

/**
* Event when a commit position is received
* Event when a commit position is received.
*/
COMMIT_POSITION(12, ClusterEventDissector::dissectCommitPosition),

/**
* Event when an event to add a new passive member is received
* Event when an event to add a new passive member is received.
*/
ADD_PASSIVE_MEMBER(13, ClusterEventDissector::dissectAddPassiveMember),

/**
* Event when a session is closed
* Event when a session is closed.
*/
APPEND_SESSION_CLOSE(14, ClusterEventDissector::dissectAppendCloseSession),

/**
* Event when the DynamicJoin changes state (Unused)
* Event when the DynamicJoin changes state (Unused).
*/
DYNAMIC_JOIN_STATE_CHANGE_UNUSED(15, ClusterEventDissector::dissectNoOp),

/**
* Event when the ClusterBackup changes state
* Event when the ClusterBackup changes state.
*/
CLUSTER_BACKUP_STATE_CHANGE(16, ClusterEventDissector::dissectStateChange),

/**
* Event when a node is instructed to terminate
* Event when a node is instructed to terminate.
*/
TERMINATION_POSITION(17, ClusterEventDissector::dissectTerminationPosition),

/**
* Event when a node acks the termination request
* Event when a node acks the termination request.
*/
TERMINATION_ACK(18, ClusterEventDissector::dissectTerminationAck),

Expand All @@ -129,7 +129,7 @@ public enum ClusterEventCode implements EventCode
REPLICATION_ENDED(20, ClusterEventDissector::dissectReplicationEnded),

/**
* Event when a standby snapshot notification has been received by a consensus module
* Event when a standby snapshot notification has been received by a consensus module.
*/
STANDBY_SNAPSHOT_NOTIFICATION(21, ClusterEventDissector::dissectStandbySnapshotNotification),

Expand Down
20 changes: 10 additions & 10 deletions aeron-agent/src/main/java/io/aeron/agent/ClusterEventLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public void logOnRequestVote(
}

/**
* Log the catchup position message
* Log the catchup position message.
*
* @param memberId of the current cluster node.
* @param leadershipTermId leadership term to catch up on
Expand Down Expand Up @@ -359,7 +359,7 @@ public void logOnCatchupPosition(
}

/**
* Log the stop catchup message
* Log the stop catchup message.
*
* @param memberId of the current cluster node.
* @param leadershipTermId current leadershipTermId.
Expand Down Expand Up @@ -593,8 +593,8 @@ public void logOnCommitPosition(
* Log addition of a passive member to the cluster.
*
* @param memberId of the current cluster node.
* @param correlationId correlationId for responding to the addition of the passive member
* @param memberEndpoints the endpoints for the new member
* @param correlationId correlationId for responding to the addition of the passive member.
* @param memberEndpoints the endpoints for the new member.
*/
public void logOnAddPassiveMember(final int memberId, final long correlationId, final String memberEndpoints)
{
Expand Down Expand Up @@ -627,12 +627,12 @@ public void logOnAddPassiveMember(final int memberId, final long correlationId,
/**
* Log the appending of a session close event to the log.
*
* @param memberId member (leader) publishing the event
* @param sessionId session id of the session be closed
* @param closeReason reason to close the session
* @param leadershipTermId current leadership term id
* @param timestamp the current timestamp
* @param timeUnit units for the timestamp
* @param memberId member (leader) publishing the event.
* @param sessionId session id of the session be closed.
* @param closeReason reason to close the session.
* @param leadershipTermId current leadership term id.
* @param timestamp the current timestamp.
* @param timeUnit units for the timestamp.
*/
public void logAppendSessionClose(
final int memberId,
Expand Down
4 changes: 2 additions & 2 deletions aeron-agent/src/main/java/io/aeron/agent/DriverEventCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public enum DriverEventCode implements EventCode
*/
CMD_OUT_EXCLUSIVE_PUBLICATION_READY(33, DriverEventDissector::dissectCommand),
/**
* Error response
* Error response.
*/
CMD_OUT_ERROR(34, DriverEventDissector::dissectCommand),
/**
Expand Down Expand Up @@ -213,7 +213,7 @@ public enum DriverEventCode implements EventCode
(code, buffer, offset, builder) -> DriverEventDissector.dissectResend(buffer, offset, builder)),

/**
* Remove destination by id
* Remove destination by id.
*/
CMD_IN_REMOVE_DESTINATION_BY_ID(56, DriverEventDissector::dissectCommand),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class DriverEventLogger
public static final int MAX_HOST_NAME_LENGTH = 256;

/**
* Maximum length of a Channel URI
* Maximum length of a Channel URI.
*/
public static final int MAX_CHANNEL_URI_LENGTH = 4096;

Expand Down Expand Up @@ -390,9 +390,9 @@ public void logResolve(
*
* @param resolverName simple class name of the resolver
* @param durationNs of the call in nanoseconds.
* @param name host name being resolved
* @param isReLookup address that was resolved to, can be null
* @param resolvedName address that was resolved to, can be null
* @param name host name being resolved.
* @param isReLookup address that was resolved to, can be null.
* @param resolvedName address that was resolved to, can be null.
*/
public void logLookup(
final String resolverName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum EventCodeType
CLUSTER(2),

/**
* Events related to cluster standby operations including standby consensus and transitioning
* Events related to cluster standby operations including standby consensus and transitioning.
*/
STANDBY(3),

Expand Down
42 changes: 21 additions & 21 deletions aeron-annotations/src/main/java/io/aeron/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import java.util.concurrent.TimeUnit;

/**
* Annotation to indicate this is a config option
* Annotation to indicate this is a config option.
*/
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.SOURCE)
public @interface Config
{
/**
* Type is used to indicate whether the annotation is marking a property name or a default value
* Type is used to indicate whether the annotation is marking a property name or a default value.
*/
enum Type
{
Expand All @@ -45,82 +45,82 @@ enum Type
}

/**
* @return what type of field is being annotated
* @return what type of field is being annotated.
*/
Type configType() default Type.UNDEFINED;

/**
* @return the unique id that ties together all the usages of the annotation across fields/methods
* @return the unique id that ties together all the usages of the annotation across fields/methods.
*/
String id() default "";

/**
* @return the uri parameter (if any) associated with this option
* @return the uri parameter (if any) associated with this option.
*/
String uriParam() default "";

/**
* @return whether or not this config option exists in the C code
* @return whether this config option exists in the C code.
*/
boolean existsInC() default true;

/**
* @return the expected C #define name that will be set with the env variable name for this option
* @return the expected C #define name that will be set with the env variable name for this option.
*/
String expectedCEnvVarFieldName() default "";

/**
* @return the expected C env variable name for this option
* @return the expected C env variable name for this option.
*/
String expectedCEnvVar() default "";

/**
* @return the expected C #define name that will be set with the default value for this option
* @return the expected C #define name that will be set with the default value for this option.
*/
String expectedCDefaultFieldName() default "";

/**
* @return the expected C default value for this option
* @return the expected C default value for this option.
*/
String expectedCDefault() default "";

/**
* @return whether to skip validation of the default in C
* @return whether to skip validation of the default in C.
*/
boolean skipCDefaultValidation() default false;

/**
* @return what's the type of default (string, int, etc...)
* @return what's the type of default (string, int, etc...).
*/
DefaultType defaultType() default DefaultType.UNDEFINED;

/**
* @return specify the default boolean, if defaultType is BOOLEAN
* @return specify the default boolean, if defaultType is BOOLEAN.
*/
boolean defaultBoolean() default false;

/**
* @return specify the default int, if defaultType is INT
* @return specify the default int, if defaultType is INT.
*/
int defaultInt() default 0;

/**
* @return specify the default long, if defaultType is LONG
* @return specify the default long, if defaultType is LONG.
*/
long defaultLong() default 0;

/**
* @return specify the default double, if defaultType is DOUBLE
* @return specify the default double, if defaultType is DOUBLE.
*/
double defaultDouble() default 0.0;

/**
* @return specify the default string, if defaultType is STRING
* @return specify the default string, if defaultType is STRING.
*/
String defaultString() default "";

/**
* @return specify a string that acts as a stand-in for the default value when generating documentation
* @return specify a string that acts as a stand-in for the default value when generating documentation.
*/
String defaultValueString() default "";

Expand All @@ -144,17 +144,17 @@ enum IsTimeValue
}

/**
* @return whether the default value is a time value
* @return whether the default value is a time value.
*/
IsTimeValue isTimeValue() default IsTimeValue.UNDEFINED;

/**
* @return the time unit if the default value is a time value of some sort
* @return the time unit if the default value is a time value of some sort.
*/
TimeUnit timeUnit() default TimeUnit.NANOSECONDS;

/**
* @return whether this config option has a 'context'
* @return whether this config option has a 'context'.
*/
boolean hasContext() default true;
}
Loading

0 comments on commit e3769b3

Please sign in to comment.