Upgraded checkstyle is finding these, fix them up.
Change-Id: I5688232baf2b6ba5c19ef6784cb856522cce9ec6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
JournalReader<E> openReader(long index, Mode mode);
/**
- * Compacts the journal up to the given index.
- *
- * <p>
- * The semantics of compaction are not specified by this interface.
+ * Compacts the journal up to the given index. The semantics of compaction are not specified by this interface.
*
* @param index The index up to which to compact the journal.
*/
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:
+ * Stores information about a {@link JournalSegment} of the log. 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:
* <ul>
* <li>{@code id} (64-bit signed integer) - A unique segment identifier. This is a monotonically increasing number
* within each log. Segments with in-sequence identifiers should contain in-sequence indexes.</li>
}
/**
- * Returns the segment version.
- *
- * <p>
- * Versions are monotonically increasing starting at {@code 1}.
+ * Returns the segment version. Versions are monotonically increasing starting at {@code 1}.
*
* @return The segment version.
*/
}
/**
- * 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 identifier. The segment ID is a monotonically increasing number within each log. Segments
+ * with in-sequence identifiers should contain in-sequence indexes.
*
* @return The segment identifier.
*/
}
/**
- * 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.
+ * Returns the segment index. 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
+ * <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}.
*
}
/**
- * Returns a descriptor builder.
- *
- * <p>
- * The descriptor builder will write segment metadata to a {@code 48} byte in-memory buffer.
+ * Returns a descriptor builder. The descriptor builder will write segment metadata to a {@code 48} byte in-memory
+ * buffer.
*
* @return The descriptor builder.
*/
/**
* Registers serializer for the given set of classes.
*
- * <p>
- * When multiple classes are registered with an explicitly provided serializer, the namespace guarantees
+ * <p>When multiple classes are registered with an explicitly provided serializer, the namespace guarantees
* all instances will be serialized with the same type ID.
*
* @param classes list of classes to register
/**
* Sets the maximum number of allows entries per segment, returning the builder for method chaining.
*
- * <p>
- * The maximum entry count dictates when logs should roll over to new segments. As entries are written to a
+ * <p>The maximum entry count dictates when logs should roll over to new segments. As entries are written to a
* segment of the log, if the entry count in that segment meets the configured maximum entry count, the log will
* create a new segment and append new entries to that segment.
*
- * <p>
- * By default, the maximum entries per segment is {@code 1024 * 1024}.
+ * <p>By default, the maximum entries per segment is {@code 1024 * 1024}.
*
* @param maxEntriesPerSegment The maximum number of entries allowed per segment.
* @return The storage builder.
/**
* Sets the journal index density.
*
- * <p>
- * The index density is the frequency at which the position of entries written to the journal will be
+ * <p>The index density is the frequency at which the position of entries written to the journal will be
* recorded in an in-memory index for faster seeking.
*
* @param indexDensity the index density
/**
* Enables flushing buffers to disk when entries are committed to a segment.
*
- * <p>
- * When flush-on-commit is enabled, log entry buffers will be automatically flushed to disk each time
+ * <p>When flush-on-commit is enabled, log entry buffers will be automatically flushed to disk each time
* an entry is committed in a given segment.
*
* @return The builder instance
/**
* Sets whether to flush buffers to disk when entries are committed to a segment.
*
- * <p>
- * When flush-on-commit is enabled, log entry buffers will be automatically flushed to disk each time
+ * <p>When flush-on-commit is enabled, log entry buffers will be automatically flushed to disk each time
* an entry is committed in a given segment.
*
* @param flushOnCommit Whether to flush buffers to disk when entries are committed to a segment.
* Attempt to read the next entry. {@code index} here is really {@code nextIndex} passed by callers, which already
* check it for invariants. If non-null is returned, {@code nextIndex} has already been set to {@code index + 1}.
*
- * <p>
- * This method is shared between 'all entries' and 'committed entries only' variants. The distinction is made by
+ * <p>This method is shared between 'all entries' and 'committed entries only' variants. The distinction is made by
* an additional check in {@link SegmentedCommitsByteBufReader#tryAdvance(long)}.
*
* @param index next index
* Abstract base class for {@link TransactionRequest}s accessing data as visible in the isolated context of a particular
* transaction. The path of the data being accessed is returned via {@link #getPath()}.
*
- * <p>
- * This class is visible outside of this package for the purpose of allowing common instanceof checks
- * and simplified codepaths.
+ * <p>This class is visible outside of this package for the purpose of allowing common instanceof checks and simplified
+ * codepaths.
*
* @param <T> Message type
*/
/**
* Abstract base class for {@link TransactionRequest}s accessing transaction state without modifying it.
*
- * <p>
- * This class is visible outside of this package for the purpose of allowing common instanceof checks
- * and simplified codepaths.
+ * <p>This class is visible outside of this package for the purpose of allowing common instanceof checks and simplified
+ * codepaths.
*
* @param <T> Message type
*/
/**
* Request to connect a frontend instance to the backend. It carries basic information about the frontend:
- * - its coordinates in {@link #getReplyTo()}.
- * - its minimum supported ABI version
- * - its maximum supported ABI version
+ * <ul>
+ * <li>its coordinates in {@link #getReplyTo()}</li>
+ * <li>its minimum supported ABI version</li>
+ * <li>its maximum supported ABI version</li>
+ * </ul>
*
- * <p>
- * It also includes request stream sequencing information.
+ * <p>It also includes request stream sequencing information.
*/
public final class ConnectClientRequest extends Request<ClientIdentifier, ConnectClientRequest> {
interface SerialForm extends Request.SerialForm<ClientIdentifier, ConnectClientRequest> {
* equivalent to {@link TransactionPurgeRequest} for {@link #getTarget()}, but also carries additional sibling
* {@link TransactionIdentifier}s in {@link #getOthers()}.
*
- * <p>
- * This request is sent by the frontend to inform the backend that a set of {@link TransactionIdentifier}s are
+ * <p>This request is sent by the frontend to inform the backend that a set of {@link TransactionIdentifier}s are
* explicitly retired and are guaranteed to never be used by the frontend.
*/
public final class SkipTransactionsRequest extends TransactionRequest<SkipTransactionsRequest> {
* An abstract concept of a Message. This class cannot be instantiated directly, use its specializations {@link Request}
* and {@link Response}.
*
- * <p>
- * Messages have a target and a sequence number. Sequence numbers are expected to be assigned monotonically on a
+ * <p>Messages have a target and a sequence number. Sequence numbers are expected to be assigned monotonically on a
* per-target basis, hence two targets can observe the same sequence number.
*
- * <p>
- * This class includes explicit versioning for forward- and backward- compatibility of serialization format. This is
+ * <p>This class includes explicit versioning for forward- and backward- compatibility of serialization format. This is
* achieved by using the serialization proxy pattern. Subclasses are in complete control of what proxy is used to
* serialize a particular object on the wire. This class can serve as an explicit version marker, hence no further
* action is necessary in the deserialization path.
*
- * <p>
- * For the serialization path an explicit call from the user is required to select the appropriate serialization
+ * <p>For the serialization path an explicit call from the user is required to select the appropriate serialization
* version. This is done via {@link #toVersion(ABIVersion)} method, which should return a copy of this object with
* the requested ABI version recorded and should return the appropriate serialization proxy.
*
- * <p>
- * This workflow allows least disturbance across ABI versions, as all messages not affected by a ABI version bump
+ * <p>This workflow allows least disturbance across ABI versions, as all messages not affected by a ABI version bump
* will remain working with the same serialization format for the new ABI version.
*
- * <p>
- * Note that this class specifies the {@link Immutable} contract, which means that all subclasses must follow this API
- * contract.
+ * <p>Note that this class specifies the {@link Immutable} contract, which means that all subclasses must follow this
+ * API contract.
*
* @param <T> Target identifier type
* @param <C> Message type
* Send a request to the backend and invoke a specified callback when it finishes. This method is safe to invoke
* from any thread.
*
- * <p>
- * Note that unlike {@link #sendRequest(Request, Consumer)}, this method does not exert backpressure, hence it
+ * <p>Note that unlike {@link #sendRequest(Request, Consumer)}, this method does not exert backpressure, hence it
* should never be called from an application thread and serves mostly for moving requests between queues.
*
* @param request Request to send
* rate-limiting strategy in {@link AveragingProgressTracker} does not penalize threads as long as we have not
* reached half of the target.
*
- * <p>
- * By multiplying the advertised maximum by four, our queue steady-state should end up with:
+ * <p>By multiplying the advertised maximum by four, our queue steady-state should end up with:
* - the backend pipeline being full,
* - another full batch of messages being in the queue while not paying any throttling cost
* - another 2 full batches of messages with incremental throttling cost
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.access.client;
import java.util.concurrent.TimeUnit;
* <p>On the other hand, there is no delay when number of open tasks is half the limit or less,
* in order to prevent backend from running out of tasks while there may be waiting frontend threads.
*
- * <p>
- * This class is NOT thread-safe.
+ * <p>This class is NOT thread-safe.
*
* @author Vratko Polak
*/
* Basic information about how to talk to the backend. ClientActorBehavior uses this information to dispatch requests
* to the backend.
*
- * <p>
- * This class is not final so concrete actor behavior implementations may subclass it and track more information about
- * the backend. The {@link #hashCode()} and {@link #equals(Object)} methods are made final to ensure subclasses compare
- * on object identity.
- *
- * @author Robert Varga
+ * <p>This class is not final so concrete actor behavior implementations may subclass it and track more information
+ * about the backend. The {@link #hashCode()} and {@link #equals(Object)} methods are made final to ensure subclasses
+ * compare on object identity.
*/
public class BackendInfo {
private final ABIVersion version;
* by either the client actor (when a message timeout is detected) and by the specific frontend (on explicit
* invalidation or when updated information becomes available).
*
- * <p>
- * If the completion stage returned by this interface's methods fails with a
+ * <p>If the completion stage returned by this interface's methods fails with a
* {@link org.opendaylight.controller.cluster.access.concepts.RequestException}, it will be forwarded to all
* outstanding requests towards the leader. If it fails with a {@link java.util.concurrent.TimeoutException},
* resolution process will be retried. If it fails with any other cause, it will we wrapped as a
* {@link org.opendaylight.controller.cluster.access.concepts.RuntimeRequestException} wrapping that cause.
- *
- * @author Robert Varga
*/
public abstract class BackendInfoResolver<T extends BackendInfo> implements AutoCloseable {
/**
@Override
public void close() {
+ // No-op by default
}
}
* during connection transitions. Optimistic read-side of the lock is taken when new connections are introduced
* into the map.
*
- * <p>
- * The lock detects potential AB/BA deadlock scenarios and will force the reader side out by throwing
+ * <p>The lock detects potential AB/BA deadlock scenarios and will force the reader side out by throwing
* a {@link InversibleLockException} -- which must be propagated up, releasing locks as it propagates. The initial
* entry point causing the the conflicting lookup must then call {@link InversibleLockException#awaitResolution()}
* before retrying the operation.
/**
* An actor context associated with this {@link AbstractClientActor}.
*
- * <p>
- * Time-keeping in a client actor is based on monotonic time. The precision of this time can be expected to be the
+ * <p>Time-keeping in a client actor is based on monotonic time. The precision of this time can be expected to be the
* same as {@link System#nanoTime()}, but it is not tied to that particular clock. Actor clock is exposed as
* a {@link Ticker}, which can be obtained via {@link #ticker()}. This class is thread-safe.
*/
* This queue is internally split into two queues for performance reasons, both memory efficiency and copy
* operations.
*
- * <p>
- * Entries are always appended to the end, but then they are transmitted to the remote end and do not necessarily
- * complete in the order in which they were sent -- hence the head of the queue does not increase linearly,
- * but can involve spurious removals of non-head entries.
+ * <p>Entries are always appended to the end, but then they are transmitted to the remote end and do not necessarily
+ * complete in the order in which they were sent -- hence the head of the queue does not increase linearly, but can
+ * involve spurious removals of non-head entries.
*
- * <p>
- * For memory efficiency we want to pre-allocate both queues -- which points to ArrayDeque, but that is very
- * inefficient when entries are removed from the middle. In the typical case we expect the number of in-flight
- * entries to be an order of magnitude lower than the number of enqueued entries, hence the split.
+ * <p>For memory efficiency we want to pre-allocate both queues -- which points to ArrayDeque, but that is very
+ * inefficient when entries are removed from the middle. In the typical case we expect the number of in-flight entries
+ * to be an order of magnitude lower than the number of enqueued entries, hence the split.
*
- * <p>
- * Note that in transient case of reconnect, when the backend gives us a lower number of maximum in-flight entries
+ * <p>Note that in transient case of reconnect, when the backend gives us a lower number of maximum in-flight entries
* than the previous incarnation, we may end up still moving the pending queue -- but that is a very exceptional
* scenario, hence we consciously ignore it to keep the design relatively simple.
*
- * <p>
- * This class is not thread-safe, as it is expected to be guarded by {@link AbstractClientConnection}.
+ * <p>This class is not thread-safe, as it is expected to be guarded by {@link AbstractClientConnection}.
*/
abstract sealed class TransmitQueue {
static final class Halted extends TransmitQueue {
import org.opendaylight.yangtools.yang.common.Empty;
/**
- * Service used to bring up/down the Entity Ownership Service service in individual datacenters.
- * Active datacenter in native eos terms means that the candidates from this datacenter can become owners of entities.
- * Additionally the singleton component makings ownership decisions, runs only in an active datacenter.
+ * Service used to bring up/down the Entity Ownership Service service in individual datacenters. Active datacenter
+ * in native eos terms means that the candidates from this datacenter can become owners of entities. Additionally
+ * the singleton component makings ownership decisions, runs only in an active datacenter.
*
- * <p>
- * Caller must make sure that only one datacenter is active at a time, otherwise the singleton actors
- * in each datacenter will interfere with each other. The methods provided byt this service can be called
- * on any node from the datacenter to be activated. Datacenters only need to brought up when using non-default
- * datacenter or multiple datacenters.
+ * <p>Caller must make sure that only one datacenter is active at a time, otherwise the singleton actors in each
+ * datacenter will interfere with each other. The methods provided byt this service can be called on any node from
+ * the datacenter to be activated. Datacenters only need to brought up when using non-default datacenter or multiple
+ * datacenters.
*/
public interface DataCenterControl {
/**
* This is a sample implementation of a Role Change Listener which is an actor, which registers itself
* to the ClusterRoleChangeNotifier.
*
- * <p>
- * The Role Change listener receives a SetNotifiers message with the notifiers to register itself with.
+ * <p>The Role Change listener receives a SetNotifiers message with the notifiers to register itself with.
*
- * <p>
- * It kicks of a scheduler which sends registration messages to the notifiers, till it gets a
+ * <p>It kicks of a scheduler which sends registration messages to the notifiers, till it gets a
* RegisterRoleChangeListenerReply.
*
- * <p>
- * If all the notifiers have been regsitered with, then it cancels the scheduler.
+ * <p>If all the notifiers have been regsitered with, then it cancels the scheduler.
* It starts the scheduler again when it receives a new registration
*/
public class ExampleRoleChangeListener extends AbstractUntypedActor implements AutoCloseable {
* printNodes
* printState
*
- * <p>
- * Note: when run on IDE and on debug log level, the debug logs in
- * AbstractUptypedActor and AbstractUptypedPersistentActor would need to be commented out.
- * Also RaftActor handleCommand(), debug log which prints for every command other than AE/AER
+ * <p>Note: when run on IDE and on debug log level, the debug logs in AbstractUptypedActor and
+ * AbstractUptypedPersistentActor would need to be commented out.
+ * Also RaftActor handleCommand(), debug log which prints for every command other than AE/AER
*/
public static void main(final String[] args) throws Exception {
/**
- * The interval at which a heart beat message will be sent to the remote
- * RaftActor.
+ * The interval at which a heart beat message will be sent to the remote RaftActor.
*
- * <p>
- * Since this is set to 100 milliseconds the Election timeout should be
- * at least 200 milliseconds
+ * <p>Since this is set to 100 milliseconds the Election timeout should be at least 200 milliseconds.
*/
public static final FiniteDuration HEART_BEAT_INTERVAL =
new FiniteDuration(100, TimeUnit.MILLISECONDS);
import org.eclipse.jdt.annotation.Nullable;
/**
- * ElectionTerm contains information about a RaftActors election term.
+ * ElectionTerm contains information about a RaftActors election term. This information includes the last known current
+ * term of the RaftActor and which candidate was voted for by the RaftActor in that term.
*
- * <p>
- * This information includes the last known current term of the RaftActor
- * and which candidate was voted for by the RaftActor in that term.
- *
- * <p>
- * This class ensures that election term information is persisted.
+ * <p>This class ensures that election term information is persisted.
*/
public interface ElectionTerm {
/**
import org.opendaylight.yangtools.concepts.Immutable;
/**
- * RaftActor encapsulates a state machine that needs to be kept synchronized
- * in a cluster. It implements the RAFT algorithm as described in the paper
+ * RaftActor encapsulates a state machine that needs to be kept synchronized in a cluster. It implements the RAFT
+ * algorithm as described in the paper
* <a href='https://ramcloud.stanford.edu/wiki/download/attachments/11370504/raft.pdf'>
* In Search of an Understandable Consensus Algorithm</a>
*
- * <p>
- * RaftActor has 3 states and each state has a certain behavior associated
- * with it. A Raft actor can behave as,
+ * <p>RaftActor has 3 states and each state has a certain behavior associated with it. A Raft actor can behave as,
* <ul>
* <li> A Leader </li>
* <li> A Follower (or) </li>
* <li> A Candidate </li>
* </ul>
*
- * <p>
- * A RaftActor MUST be a Leader in order to accept requests from clients to
- * change the state of it's encapsulated state machine. Once a RaftActor becomes
- * a Leader it is also responsible for ensuring that all followers ultimately
+ * <p>A RaftActor MUST be a Leader in order to accept requests from clients to change the state of it's encapsulated
+ * state machine. Once a RaftActor becomes a Leader it is also responsible for ensuring that all followers ultimately
* have the same log and therefore the same state machine as itself.
*
- * <p>
- * The current behavior of a RaftActor determines how election for leadership
- * is initiated and how peer RaftActors react to request for votes.
+ * <p>The current behavior of a RaftActor determines how election for leadership is initiated and how peer RaftActors
+ * react to request for votes.
*
- * <p>
- * Each RaftActor also needs to know the current election term. It uses this
- * information for a couple of things. One is to simply figure out who it
- * voted for in the last election. Another is to figure out if the message
- * it received to update it's state is stale.
+ * <p>Each RaftActor also needs to know the current election term. It uses this information for a couple of things.
+ * One is to simply figure out who it voted for in the last election. Another is to figure out if the message it
+ * received to update it's state is stale.
*
- * <p>
- * The RaftActor uses akka-persistence to store it's replicated log.
- * Furthermore through it's behaviors a Raft Actor determines
+ * <p>The RaftActor uses akka-persistence to store it's replicated log. Furthermore through it's behaviors a Raft Actor
+ * determines
* <ul>
* <li> when a log entry should be persisted </li>
* <li> when a log entry should be applied to the state machine (and) </li>
/**
* setPeerAddress sets the address of a known peer at a later time.
*
- * <p>
- * This is to account for situations where a we know that a peer
+ * <p>This is to account for situations where a we know that a peer
* exists but we do not know an address up-front. This may also be used in
* situations where a known peer starts off in a different location and we
* need to change it's address
*
- * <p>
- * Note that if the peerId does not match the list of peers passed to
+ * <p>Note that if the peerId does not match the list of peers passed to
* this actor during construction an IllegalStateException will be thrown.
*/
protected void setPeerAddress(final String peerId, final String peerAddress) {
* given Runnable to proceed with the given operation. <b>Important:</b> the run method must be called on
* this actor's thread dispatcher as as it modifies internal state.
*
- * <p>
- * The default implementation immediately runs the operation.
+ * <p>The default implementation immediately runs the operation.
*
* @param operation the operation to run
*/
* This method is invoked when the actions hooked to the leader becoming paused failed to execute and the leader
* should resume normal operations.
*
- * <p>
- * Note this method can be invoked even before the operation supplied to {@link #pauseLeader(Runnable)} is invoked.
+ * <p>Note this method can be invoked even before the operation supplied to {@link #pauseLeader(Runnable)} is
+ * invoked.
*/
protected void unpauseLeader() {
* A raft actor support class that participates in leadership transfer. An instance is created upon
* initialization of leadership transfer.
*
- * <p>
- * The transfer process is as follows:
+ * <p>The transfer process is as follows:
* <ol>
* <li>Send a LeaderStateChanged message with a null leader Id to the local RoleChangeNotifier to notify
* clients that we no longer have a working leader.</li>
* <li>On notification of the new leader from the RaftActor or on time out, notify {@link OnComplete} callbacks.</li>
* </ol>
*
- * <p>
- * NOTE: All methods on this class must be called on the actor's thread dispatcher as they may access/modify
+ * <p>NOTE: All methods on this class must be called on the actor's thread dispatcher as they may access/modify
* internal state.
*
* @author Thomas Pantelis
/**
* Removes entries from the in-memory log and the persisted log starting at the given index.
*
- * <p>
- * The persisted information would then be used during recovery to properly
- * reconstruct the state of the in-memory replicated log
+ * <p>The persisted information would then be used during recovery to properly reconstruct the state
+ * of the in-memory replicated log
*
* @param index the index of the first log entry to remove
* @return true if entries were removed, false otherwise
import scala.concurrent.duration.FiniteDuration;
/**
- * An abstract class that implements a Runnable operation with a timer such that if the run method isn't
- * invoked within a timeout period, the operation is cancelled via {@link #doCancel}.
+ * An abstract class that implements a Runnable operation with a timer such that if the run method is not invoked within
+ * a timeout period, the operation is cancelled via {@link #doCancel}.
*
- * <p>
- * <b>Note:</b> this class is not thread safe and is intended for use only within the context of the same
- * actor that's passed on construction. The run method must be called on this actor's thread dispatcher as it
- * modifies internal state.
+ * <p><b>Note:</b> this class is not thread safe and is intended for use only within the context of the same actor that
+ * is passed on construction. The run method must be called on this actor's thread dispatcher as it modifies internal
+ * state.
*
* @author Thomas Pantelis
*/
/**
* The behavior of a RaftActor when it is in the Leader state.
*
- * <p>
- * Leaders:
+ * <p>Leaders:
* <ul>
* <li> Upon election: send initial empty AppendEntries RPCs
* (heartbeat) to each server; repeat during idle periods to
}
/**
- * Initiates a snapshot capture to install on a follower.
- *
- * <p>
- * Install Snapshot works as follows
- * 1. Leader initiates the capture snapshot by calling createSnapshot on the RaftActor.
- * 2. On receipt of the CaptureSnapshotReply message, the RaftActor persists the snapshot and makes a call to
- * the Leader's handleMessage with a SendInstallSnapshot message.
- * 3. The Leader obtains and stores the Snapshot from the SendInstallSnapshot message and sends it in chunks to
- * the Follower via InstallSnapshot messages.
- * 4. For each chunk, the Follower sends back an InstallSnapshotReply.
- * 5. On receipt of the InstallSnapshotReply for the last chunk, the Leader marks the install complete for that
- * follower.
- * 6. If another follower requires a snapshot and a snapshot has been collected (via SendInstallSnapshot)
- * then send the existing snapshot in chunks to the follower.
+ * Initiates a snapshot capture to install on a follower. Install Snapshot works as follows:
+ * <ol>
+ * <li>Leader initiates the capture snapshot by calling createSnapshot on the RaftActor.</li>
+ * <li>On receipt of the CaptureSnapshotReply message, the RaftActor persists the snapshot and makes a call to
+ * the Leader's handleMessage with a SendInstallSnapshot message.</li>
+ * <li>The Leader obtains and stores the Snapshot from the SendInstallSnapshot message and sends it in chunks to
+ * the Follower via InstallSnapshot messages.</li>
+ * <li>For each chunk, the Follower sends back an InstallSnapshotReply.</li>
+ * <li>On receipt of the InstallSnapshotReply for the last chunk, the Leader marks the install complete for that
+ * follower.</li>
+ * <li>If another follower requires a snapshot and a snapshot has been collected (via SendInstallSnapshot)
+ * then send the existing snapshot in chunks to the follower.</li>
+ * </ol>
*
* @param followerId the id of the follower.
* @return true if capture was initiated, false otherwise.
/**
* The behavior of a RaftActor when it is in the Candidate raft state.
*
- * <p>
- * Candidates (§5.2):
+ * <p>Candidates (§5.2):
* <ul>
* <li> On conversion to candidate, start election:
* <ul>
/**
* Leader which is termed as isolated.
*
- * <p>
- * If the reply from the majority of the followers is not received then the leader changes its behavior
+ * <p>If the reply from the majority of the followers is not received then the leader changes its behavior
* to IsolatedLeader. An isolated leader may have followers and they would continue to receive replicated messages.
*
- * <p>
- * A schedule is run, at an interval of (10 * Heartbeat-time-interval), in the Leader
+ * <p>A schedule is run, at an interval of (10 * Heartbeat-time-interval), in the Leader
* to check if its isolated or not.
*
- * <p>
- * In the Isolated Leader , on every AppendEntriesReply, we aggressively check if the leader is isolated.
+ * <p>In the Isolated Leader , on every AppendEntriesReply, we aggressively check if the leader is isolated.
* If no, then the state is switched back to Leader.
*/
public class IsolatedLeader extends AbstractLeader {
/**
* The behavior of a RaftActor when it is in the Leader state.
*
- * <p>
- * Leaders:
+ * <p>Leaders:
* <ul>
* <li> Upon election: send initial empty AppendEntries RPCs
* (heartbeat) to each server; repeat during idle periods to
* indirectly. Once all entries are committed, ie commitIndex matches the last log index, it switches to the
* normal Leader state.
*
- * <p>
- * The use of a no-op entry in this manner is outlined in the last paragraph in §8 of the
+ * <p>The use of a no-op entry in this manner is outlined in the last paragraph in §8 of the
* <a href="https://raft.github.io/raft.pdf">extended raft version</a>.
*
* @author Thomas Pantelis
*/
public class PreLeader extends AbstractLeader {
-
public PreLeader(RaftActorContext context) {
super(context, RaftState.PreLeader);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.raft.client.messages;
import com.google.common.annotations.VisibleForTesting;
* respond with a {@link FindLeaderReply} containing the address of the leader, as it is known to that particular
* actor.
*
- * <p>
- * This message is intended for testing purposes only.
+ * <p>This message is intended for testing purposes only.
*/
@VisibleForTesting
public final class FindLeader implements Serializable {
* sent the message. If the responding actor does not have knowledge of the leader, {@link #getLeaderActor()} will
* return {@link Optional#empty()}.
*
- * <p>
- * This message is intended for testing purposes only.
+ * <p>This message is intended for testing purposes only.
*/
@VisibleForTesting
public final class FindLeaderReply implements Serializable {
/**
* An instance of a {@link Payload} class is meant to be used as the Payload for {@link AppendEntries}.
*
- * <p>
- * When an actor which is derived from RaftActor attempts to persistData it must pass an instance of the Payload class.
- * Similarly when state needs to be applied to the derived RaftActor it will be passed an instance of the Payload class.
+ * <p>When an actor which is derived from RaftActor attempts to persistData it must pass an instance of the Payload
+ * class. Similarly when state needs to be applied to the derived RaftActor it will be passed an instance of the
+ * Payload class.
*/
public abstract class Payload implements Serializable {
@java.io.Serial
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.raft.policy;
/**
- * The RaftPolicy is intended to change the default behavior of Raft. For example
- * we may want to be able to determine which Raft replica should become the leader - with Raft elections are
- * randomized so it is not possible to specify which replica should be the leader. The ability to specify
- * the leader would be quite useful when testing a raft cluster.
+ * The RaftPolicy is intended to change the default behavior of Raft. For example we may want to be able to determine
+ * which Raft replica should become the leader - with Raft elections are randomized so it is not possible to specify
+ * which replica should be the leader. The ability to specify the leader would be quite useful when testing a raft
+ * cluster.
*
- * <p>
- * Similarly we may want to customize when exactly we apply a modification to the state - with Raft a modification
- * is only applied to the state when the modification is replicated to a majority of the replicas. The ability to
- * apply a modification to the state before consensus would be useful in scenarios where you have only 2 nodes
- * in a Raft cluster and one of them is down but you still want the RaftActor to apply a modification to the state.
+ * <p>Similarly we may want to customize when exactly we apply a modification to the state - with Raft a modification
+ * is only applied to the state when the modification is replicated to a majority of the replicas. The ability to apply
+ * a modification to the state before consensus would be useful in scenarios where you have only 2 nodes in a Raft
+ * cluster and one of them is down but you still want the RaftActor to apply a modification to the state.
*/
public interface RaftPolicy {
/**
* Kryo serializer for {@link DataJournalEntry}. Each {@link SegmentedJournalActor} has its own instance, as well as
* a nested JavaSerializer to handle the payload.
*
- * <p>
- * Since we are persisting only parts of {@link PersistentRepr}, this class asymmetric by design:
+ * <p>Since we are persisting only parts of {@link PersistentRepr}, this class asymmetric by design:
* {@link #write(EntryOutput, DataJournalEntry)} only accepts {@link ToPersistence} subclass, which is a wrapper
* around a {@link PersistentRepr}, while {@link #read(EntryInput)} produces an {@link FromPersistence}, which
* needs further processing to reconstruct a {@link PersistentRepr}.
* <li>A simple file journal, containing sequence numbers of last deleted entry</li>
* </ul>
*
- * <p>
- * This is a conscious design decision to minimize the amount of data that is being stored in the data journal while
+ * <p>This is a conscious design decision to minimize the amount of data that is being stored in the data journal while
* speeding up normal operations. Since the SegmentedJournal is an append-only linear log and Akka requires the ability
* to delete persistence entries, we need ability to mark a subset of a SegmentedJournal as deleted. While we could
* treat such delete requests as normal events, this leads to a mismatch between SegmentedJournal indices (as exposed by
* index corresponding to a particular sequence number, or maintain moderately-complex logic and data structures to
* perform that mapping in sub-linear time complexity.
*
- * <p>
- * Split-file approach allows us to treat sequence numbers and indices as equivalent, without maintaining any explicit
- * mapping information. The only additional information we need to maintain is the last deleted sequence number.
+ * <p>Split-file approach allows us to treat sequence numbers and indices as equivalent, without maintaining any
+ * explicit mapping information. The only additional information we need to maintain is the last deleted sequence
+ * number.
*/
abstract sealed class SegmentedJournalActor extends AbstractActor {
abstract static sealed class AsyncMessage<T> {
* A {@link SegmentedJournalActor} which delays issuing a flush operation until a watermark is reached or when the
* queue is empty.
*
- * <p>
- * The problem we are addressing is that there is a queue sitting in from of the actor, which we have no direct
+ * <p>The problem we are addressing is that there is a queue sitting in from of the actor, which we have no direct
* access to. Since a flush involves committing data to durable storage, that operation can easily end up dominating
* workloads.
*
- * <p>
- * We solve this by having an additional queue in which we track which messages were written and trigger a flush
+ * <p>We solve this by having an additional queue in which we track which messages were written and trigger a flush
* only when the number of bytes we have written exceeds specified limit. The other part is that each time this
* queue becomes non-empty, we send a dedicated message to self. This acts as a actor queue probe -- when we receive
* it, we know we have processed all messages that were in the queue when we first delayed the write.
*
- * <p>
- * The combination of these mechanisms ensure we use a minimal delay while also ensuring we take advantage of
+ * <p>The combination of these mechanisms ensure we use a minimal delay while also ensuring we take advantage of
* batching opportunities.
*/
private static final class Delayed extends SegmentedJournalActor {
*
* </pre>
*
- * <p>
- * This class is NOT thread-safe.
+ * <p>This class is NOT thread-safe.
*/
@Beta
public final class MessageTracker {
import scala.runtime.BoxedUnit;
/**
- * Represents behaviour that can be exhibited by actors of type {@link AbstractActor}
- *
- * <p>
- * This behaviour meters actor's default behaviour. It captures 2 metrics:
+ * Represents behaviour that can be exhibited by actors of type {@link AbstractActor}. This behaviour meters actor's
+ * default behaviour. It captures 2 metrics:
* <ul>
* <li>message processing rate of actor's receive block</li>
* <li>message processing rate by message type</li>
* Uses 2 timers to measure message processing rate. One for overall message processing rate and
* another to measure rate by message type. The timers are re-used if they were previously created.
*
- * <p>
- * {@link com.codahale.metrics.MetricRegistry} maintains a reservoir for different timers where
+ * <p>{@link com.codahale.metrics.MetricRegistry} maintains a reservoir for different timers where
* collected timings are kept. It exposes various metrics for each timer based on collected
* data. Eg: count of messages, 99, 95, 50... percentiles, max, mean etc.
*
- * <p>
- * These metrics are exposed as JMX bean.
+ * <p>These metrics are exposed as JMX bean.
*
* @see <a href="http://dropwizard.github.io/metrics/manual/core/#timers">
* http://dropwizard.github.io/metrics/manual/core/#timers</a>
import com.typesafe.config.Config;
/**
- * Represents a unified view of configuration.
- *
- * <p>
- * It merges configuration from:
+ * Represents a unified view of configuration. It merges configuration from:
* <ul>
* <li>Config subsystem</li>
* <li>Akka configuration files</li>
* Configurations defined in config subsystem takes precedence.
*/
public interface UnifiedConfig {
-
/**
* Returns an immutable instance of unified configuration.
*
* a fixed maximum size. This is generally preferable to {@link ByteArrayOutputStream}, as that can result in huge
* byte arrays -- which can create unnecessary pressure on the GC (as well as lot of copying).
*
- * <p>
- * This class takes a different approach: it recognizes that result of buffering will be collected at some point, when
- * the stream is already closed (and thus unmodifiable). Thus it splits the process into two steps:
+ * <p>This class takes a different approach: it recognizes that result of buffering will be collected at some point,
+ * when the stream is already closed (and thus unmodifiable). Thus it splits the process into two steps:
* <ul>
* <li>Data acquisition, during which we start with an initial (power-of-two) size and proceed to fill it up. Once the
* buffer is full, we stash it, allocate a new buffer twice its size and repeat the process. Once we hit
* final collection of buffers.</li>
* </ul>
*
- * <p>
- * The data acquisition strategy results in predictably-sized buffers, which are growing exponentially in size until
+ * <p>The data acquisition strategy results in predictably-sized buffers, which are growing exponentially in size until
* they hit maximum size. Intrinsic property here is that the total capacity of chunks created during the ramp up is
* guaranteed to fit into {@code maxChunkSize}, hence they can readily be compacted into a single buffer, which replaces
* them. Combined with the requirement to trim the last buffer to have accurate length, this algorithm guarantees total
* message doesn't need to be sliced, ie its serialized size is less than the maximum message slice size, then
* the original message is sent. Otherwise the first message slice is sent.
*
- * <p>
- * <b>Note:</b> a {@link FileBackedOutputStreamFactory} must be set in the {@link MessageSlicer}.
+ * <p><b>Note:</b> a {@link FileBackedOutputStreamFactory} must be set in the {@link MessageSlicer}.
*
* @param newMessage the message
* @param <T> the Serializable message type
* The RoleChangeNotifier is responsible for receiving Raft role and leader state change messages and notifying
* the listeners (within the same node), which are registered with it.
*
- * <p>
- * The RoleChangeNotifier is instantiated by the Shard and injected into the RaftActor.
+ * <p>The RoleChangeNotifier is instantiated by the Shard and injected into the RaftActor.
*/
public class RoleChangeNotifier extends AbstractUntypedActor implements AutoCloseable {
-
- private final String memberId;
private final Map<ActorPath, ActorRef> registeredListeners = new HashMap<>();
+ private final String memberId;
+
private RoleChangeNotification latestRoleChangeNotification = null;
private LeaderStateChanged latestLeaderStateChanged;
import com.google.common.cache.LoadingCache;
/**
- * Maintains metrics registry that is provided to reporters.
- * At the moment only one reporter exists {@code JmxReporter}.
+ * Maintains metrics registry that is provided to reporters. At the moment only one reporter exists {@code JmxReporter}.
* More reporters can be added.
*
- * <p>
- * The consumers of this class will only be interested in {@code MetricsRegistry}
- * where metrics for that consumer gets stored.
+ * <p>The consumers of this class will only be interested in {@code MetricsRegistry} where metrics for that consumer
+ * gets stored.
*/
public class MetricsReporter implements AutoCloseable {
import org.slf4j.LoggerFactory;
/**
- * Abstract base for an MXBean implementation class.
- *
- * <p>
- * This class is not intended for use outside of MD-SAL and its part of private
- * implementation (still exported as public to be reused across MD-SAL implementation
- * components) and may be removed in subsequent
- * releases.
+ * Abstract base for an MXBean implementation class. This class is not intended for use outside of MD-SAL and its part
+ * of private implementation (still exported as public to be reused across MD-SAL implementation components) and may be
+ * removed in subsequent releases.
*
* @author Thomas Pantelis
*/
* {@link ClientActorBehavior} acting as an intermediary between the backend actors and the DistributedDataStore
* frontend.
*
- * <p>
- * This class is not visible outside of this package because it breaks the actor containment. Services provided to
+ * <p>This class is not visible outside of this package because it breaks the actor containment. Services provided to
* Java world outside of actor containment are captured in {@link DataStoreClient}.
*
- * <p>
- * IMPORTANT: this class breaks actor containment via methods implementing {@link DataStoreClient} contract.
- * When touching internal state, be mindful of the execution context from which execution context, Actor
- * or POJO, is the state being accessed or modified.
+ * <p>IMPORTANT: this class breaks actor containment via methods implementing {@link DataStoreClient} contract.
+ * When touching internal state, be mindful of the execution context from which execution context, Actor
+ * or POJO, is the state being accessed or modified.
*
- * <p>
- * THREAD SAFETY: this class must always be kept thread-safe, so that both the Actor System thread and the application
- * threads can run concurrently. All state transitions must be made in a thread-safe manner. When in
- * doubt, feel free to synchronize on this object.
+ * <p>THREAD SAFETY: this class must always be kept thread-safe, so that both the Actor System thread and the
+ * application threads can run concurrently. All state transitions must be made in a thread-safe
+ * manner. When in doubt, feel free to synchronize on this object.
*
- * <p>
- * PERFORMANCE: this class lies in a performance-critical fast path. All code needs to be concise and efficient, but
- * performance must not come at the price of correctness. Any optimizations need to be carefully analyzed
- * for correctness and performance impact.
+ * <p>PERFORMANCE: this class lies in a performance-critical fast path. All code needs to be concise and efficient, but
+ * performance must not come at the price of correctness. Any optimizations need to be carefully
+ * analyzed for correctness and performance impact.
*
- * <p>
- * TRADE-OFFS: part of the functionality runs in application threads without switching contexts, which makes it ideal
- * for performing work and charging applications for it. That has two positive effects:
- * - CPU usage is distributed across applications, minimizing work done in the actor thread
- * - CPU usage provides back-pressure towards the application.
- *
- * @author Robert Varga
+ * <p>TRADE-OFFS: part of the functionality runs in application threads without switching contexts, which makes it ideal
+ * for performing work and charging applications for it. That has two positive effects:
+ * - CPU usage is distributed across applications, minimizing work done in the actor thread
+ * - CPU usage provides back-pressure towards the application.
*/
abstract class AbstractDataStoreClientBehavior extends ClientActorBehavior<ShardBackendInfo>
implements DataStoreClient {
/**
* Class translating transaction operations towards a particular backend shard.
*
- * <p>
- * This class is not safe to access from multiple application threads, as is usual for transactions. Internal state
+ * <p>This class is not safe to access from multiple application threads, as is usual for transactions. Internal state
* transitions coming from interactions with backend are expected to be thread-safe.
*
- * <p>
- * This class interacts with the queueing mechanism in ClientActorBehavior, hence once we arrive at a decision
- * to use either a local or remote implementation, we are stuck with it. We can re-evaluate on the next transaction.
+ * <p>This class interacts with the queueing mechanism in ClientActorBehavior, hence once we arrive at a decision to use
+ * either a local or remote implementation, we are stuck with it. We can re-evaluate on the next transaction.
*/
abstract sealed class AbstractProxyTransaction implements Identifiable<TransactionIdentifier>
permits LocalProxyTransaction, RemoteProxyTransaction {
* between the old connection (potentially being accessed by the user) and the new connection (being cleaned up
* by the actor.
*
- * <p>
- * When a user operation encounters this state, it synchronizes on the it and wait until reconnection completes,
+ * <p>When a user operation encounters this state, it synchronizes on the it and wait until reconnection completes,
* at which point the request is routed to the successor transaction. This is a relatively heavy-weight solution
* to the problem of state transfer, but the user will observe it only if the race condition is hit.
*/
* Transaction has been sealed by the user, but it has not completed flushing to the backed, yet. This is
* a transition state, as we are waiting for the user to initiate commit procedures.
*
- * <p>
- * Since the reconnect mechanics relies on state replay for transactions, this state needs to be flushed into the
+ * <p>Since the reconnect mechanics relies on state replay for transactions, this state needs to be flushed into the
* queue to re-create state in successor transaction (which may be based on different messages as locality may have
* changed). Hence the transition to {@link #FLUSHED} state needs to be handled in a thread-safe manner.
*/
* the backend. At this point the transaction does not hold any state besides successful requests, all other state
* is held either in the connection's queue or the successor object.
*
- * <p>
- * Transition to this state indicates we have all input from the user we need to initiate the correct commit
+ * <p>Transition to this state indicates we have all input from the user we need to initiate the correct commit
* protocol.
*/
private static final State FLUSHED = new State("FLUSHED");
* Invoked from {@link #replayMessages(AbstractProxyTransaction, Iterable)} to have successor adopt an in-flight
* request.
*
- * <p>
- * Note: this method is invoked by the predecessor on the successor.
+ * <p>Note: this method is invoked by the predecessor on the successor.
*
* @param request Request which needs to be forwarded
* @param callback Callback to be invoked once the request completes
/**
* Invoked from {@link LocalProxyTransaction} when it replays its successful requests to its successor.
*
- * <p>
- * Note: this method is invoked by the predecessor on the successor.
+ * <p>Note: this method is invoked by the predecessor on the successor.
*
* @param request Request which needs to be forwarded
* @param callback Callback to be invoked once the request completes
/**
* Invoked from {@link RemoteProxyTransaction} when it replays its successful requests to its successor.
*
- * <p>
- * Note: this method is invoked by the predecessor on the successor.
+ * <p>Note: this method is invoked by the predecessor on the successor.
*
* @param request Request which needs to be forwarded
* @param callback Callback to be invoked once the request completes
* shard is assigned a single cookie and this mapping is stored in a bidirectional map. Information about corresponding
* shard leader is resolved via {@link ActorUtils}. The product of resolution is {@link ShardBackendInfo}.
*
- * <p>
- * This class is thread-safe.
- *
- * @author Robert Varga
+ * <p>This class is thread-safe.
*/
abstract class AbstractShardBackendResolver extends BackendInfoResolver<ShardBackendInfo> {
static final class ShardState {
* Client-side view of a local history. This class tracks all state related to a particular history and routes
* frontend requests towards the backend.
*
- * <p>
- * This interface is used by the world outside of the actor system and in the actor system it is manifested via
- * its client actor. That requires some state transfer with {@link AbstractDataStoreClientBehavior}. In order to
- * reduce request latency, all messages are carbon-copied (and enqueued first) to the client actor.
- *
- * @author Robert Varga
+ * <p>This interface is used by the world outside of the actor system and in the actor system it is manifested via its
+ * client actor. That requires some state transfer with {@link AbstractDataStoreClientBehavior}. In order to reduce
+ * request latency, all messages are carbon-copied (and enqueued first) to the client actor.
*/
@Beta
public class ClientLocalHistory extends AbstractClientHistory implements AutoCloseable {
/**
* Client-side view of a transaction.
*
- * <p>
- * This interface is used by the world outside of the actor system and in the actor system it is manifested via
+ * <p>This interface is used by the world outside of the actor system and in the actor system it is manifested via
* its client actor. That requires some state transfer with {@link DistributedDataStoreClientBehavior}. In order to
* reduce request latency, all messages are carbon-copied (and enqueued first) to the client actor.
*
- * <p>
- * It is internally composed of multiple {@link RemoteProxyTransaction}s, each responsible for a component shard.
+ * <p>It is internally composed of multiple {@link RemoteProxyTransaction}s, each responsible for a component shard.
*
- * <p>
- * Implementation is quite a bit complex, and involves cooperation with {@link AbstractClientHistory} for tracking
+ * <p>Implementation is quite a bit complex, and involves cooperation with {@link AbstractClientHistory} for tracking
* gaps in transaction identifiers seen by backends.
*
- * <p>
- * These gaps need to be accounted for in the transaction setup message sent to a particular backend, so it can verify
- * that the requested transaction is in-sequence. This is critical in ensuring that transactions (which are independent
- * entities from message queueing perspective) do not get reodered -- thus allowing multiple in-flight transactions.
+ * <p>These gaps need to be accounted for in the transaction setup message sent to a particular backend, so it can
+ * verify that the requested transaction is in-sequence. This is critical in ensuring that transactions (which are
+ * independent entities from message queueing perspective) do not get reodered -- thus allowing multiple in-flight
+ * transactions.
*
- * <p>
- * Alternative would be to force visibility by sending an abort request to all potential backends, but that would mean
- * that even empty transactions increase load on all shards -- which would be a scalability issue.
+ * <p>Alternative would be to force visibility by sending an abort request to all potential backends, but that would
+ * mean that even empty transactions increase load on all shards -- which would be a scalability issue.
*
- * <p>
- * Yet another alternative would be to introduce inter-transaction dependencies to the queueing layer in client actor,
- * but that would require additional indirection and complexity.
- *
- * @author Robert Varga
+ * <p>Yet another alternative would be to introduce inter-transaction dependencies to the queueing layer in client
+ * actor, but that would require additional indirection and complexity.
*/
@Beta
public class ClientTransaction extends AbstractClientHandle<AbstractProxyTransaction> {
* Client interface for interacting with the frontend actor. This interface is the primary access point through
* which the DistributedDataStore frontend interacts with backend Shards.
*
- * <p>
- * Keep this interface as clean as possible, as it needs to be implemented in thread-safe and highly-efficient manner.
- *
- * @author Robert Varga
+ * <p>Keep this interface as clean as possible, as it needs to be implemented in thread-safe and highly-efficient
+ * manner.
*/
@Beta
@NonNullByDefault
* An {@link AbstractTransactionCommitCohort} for use with empty transactions. This relies on the fact that no backends
* have been touched, hence all state book-keeping needs to happen only locally and shares fate with the coordinator.
*
- * <p>
- * Therefore all methods can finish immediately without any effects.
- *
- * @author Robert Varga
+ * <p>Therefore all methods can finish immediately without any effects.
*/
final class EmptyTransactionCommitCohort extends AbstractTransactionCommitCohort {
EmptyTransactionCommitCohort(final AbstractClientHistory parent, final TransactionIdentifier txId) {
* Common interface for client histories and client transactions, which can be aborted immediately without replicating
* the effect to the backend. This is needed for abrupt shutdowns.
*
- * <p>
- * Since classes which need to expose this functionality do not need a base class, this is an abstract class and not
+ * <p>Since classes which need to expose this functionality do not need a base class, this is an abstract class and not
* an interface -- which allows us to not leak the {@link #localAbort(Throwable)} method.
- *
- * @author Robert Varga
*/
abstract class LocalAbortable {
/**
* An {@link AbstractProxyTransaction} for dispatching a transaction towards a shard leader which is co-located with
* the client instance. This class is NOT thread-safe.
*
- * <p>
- * It requires a {@link DataTreeSnapshot}, which is used to instantiated a new {@link DataTreeModification}. Operations
- * are then performed on this modification and once the transaction is submitted, the modification is sent to the shard
- * leader.
+ * <p>It requires a {@link DataTreeSnapshot}, which is used to instantiated a new {@link DataTreeModification}.
+ * Operations are then performed on this modification and once the transaction is submitted, the modification is sent
+ * to the shard leader.
*
- * <p>
- * This class is not thread-safe as usual with transactions. Since it does not interact with the backend until the
+ * <p>This class is not thread-safe as usual with transactions. Since it does not interact with the backend until the
* transaction is submitted, at which point this class gets out of the picture, this is not a cause for concern.
*/
abstract sealed class LocalProxyTransaction extends AbstractProxyTransaction
* An {@link AbstractProxyTransaction} for dispatching a transaction towards a shard leader which is co-located with
* the client instance. This class is NOT thread-safe.
*
- * <p>
- * It requires a {@link DataTreeSnapshot}, which is used to instantiated a new {@link DataTreeModification}. Operations
- * are then performed on this modification and once the transaction is submitted, the modification is sent to the shard
- * leader.
+ * <p>It requires a {@link DataTreeSnapshot}, which is used to instantiated a new {@link DataTreeModification}.
+ * Operations are then performed on this modification and once the transaction is submitted, the modification is sent
+ * to the shard leader.
*
- * <p>
- * This class is not thread-safe as usual with transactions. Since it does not interact with the backend until the
+ * <p>This class is not thread-safe as usual with transactions. Since it does not interact with the backend until the
* transaction is submitted, at which point this class gets out of the picture, this is not a cause for concern.
*
* @author Robert Varga
* offending call site, but that exposes inconsistency in behavior during initial connection, when we go through
* {@link RemoteProxyTransaction}, which detects this sort of issues at canCommit/directCommit time on the backend.
*
- * <p>
- * We therefore do not report incurred exceptions directly, but report them once the user attempts to commit
+ * <p>We therefore do not report incurred exceptions directly, but report them once the user attempts to commit
* this transaction.
*/
private Exception recordedFailure;
* shard is assigned a single cookie and this mapping is stored in a bidirectional map. Information about corresponding
* shard leader is resolved via {@link ActorUtils}. The product of resolution is {@link ShardBackendInfo}.
*
- * <p>
- * This class is thread-safe.
- *
- * @author Robert Varga
+ * <p>This class is thread-safe.
*/
final class ModuleShardBackendResolver extends AbstractShardBackendResolver {
private static final Logger LOG = LoggerFactory.getLogger(ModuleShardBackendResolver.class);
* An {@link AbstractProxyTransaction} for dispatching a transaction towards a shard leader whose location is currently
* not known or is known to be not co-located with the client.
*
- * <p>
- * It packages operations and sends them via the client actor queue to the shard leader. That queue is responsible for
- * maintaining any submitted operations until the leader is discovered.
+ * <p>It packages operations and sends them via the client actor queue to the shard leader. That queue is responsible
+ * for maintaining any submitted operations until the leader is discovered.
*
- * <p>
- * This class is not safe to access from multiple application threads, as is usual for transactions. Its internal state
- * transitions based on backend responses are thread-safe.
+ * <p>This class is not safe to access from multiple application threads, as is usual for transactions. Its internal
+ * state transitions based on backend responses are thread-safe.
*/
final class RemoteProxyTransaction extends AbstractProxyTransaction {
private static final Logger LOG = LoggerFactory.getLogger(RemoteProxyTransaction.class);
* an exception. This exception corresponds to the cause reported by the first 'no' vote, with all subsequent votes
* added as suppressed exceptions.
*
- * <p>
- * Implementation is geared toward positive votes. Negative votes have to synchronize and therefore are more likely
+ * <p>Implementation is geared toward positive votes. Negative votes have to synchronize and therefore are more likely
* to see contention.
*
- * @author Robert Varga
- *
* @param <T> Type of value returned on success
*/
class VotingFuture<T> extends AbstractFuture<T> {
* This method is exposed for sake of {@link ShardTransaction}, which is an actor. We need to ensure that
* the parent is updated to reflect the transaction has been closed, but no journal actions may be invoked.
*
- * <p>
- * ShardTransaction is responsible for additionally sending a request to persist an {@link AbortTransactionPayload}
- * via a message to the Shard actor.
+ * <p>ShardTransaction is responsible for additionally sending a request to persist an
+ * {@link AbortTransactionPayload} via a message to the Shard actor.
*/
final void abortFromTransactionActor() {
if (close()) {
/**
* A Shard represents a portion of the logical data tree.
*
- * <p>
- * Our Shard uses InMemoryDataTree as it's internal representation and delegates all requests it
+ * <p>Our Shard uses InMemoryDataTree as its internal representation and delegates all requests it
*/
// FIXME: non-final for testing?
public class Shard extends RaftActor {
* Internal shard state, similar to a DOMStore, but optimized for use in the actor system, e.g. it does not expose
* public interfaces and assumes it is only ever called from a single thread.
*
- * <p>
- * This class is not part of the API contract and is subject to change at any time. It is NOT thread-safe.
+ * <p>This class is not part of the API contract and is subject to change at any time. It is NOT thread-safe.
*/
@VisibleForTesting
// non-final for mocking
/**
* CompositeModification contains a list of modifications that need to be applied to the DOMStore.
*
- * <p>
- * A CompositeModification gets stored in the transaction log for a Shard. During recovery when the transaction log
+ * <p>A CompositeModification gets stored in the transaction log for a Shard. During recovery when the transaction log
* is being replayed a DOMStoreWriteTransaction could be created and a CompositeModification could be applied to it.
*/
@Deprecated(since = "9.0.0", forRemoval = true)
/**
* Represents a modification to the data store.
*
- * <p>
- * Simple modifications can be of type,
+ * <p>Simple modifications can be of type,
* <ul>
* <li> {@link org.opendaylight.controller.cluster.datastore.modification.WriteModification}
* <li> {@link org.opendaylight.controller.cluster.datastore.modification.MergeModification}
* <li> {@link org.opendaylight.controller.cluster.datastore.modification.DeleteModification}
* </ul>
*
- * <p>
- * Modifications can in turn be lumped into a single
+ * <p>Modifications can in turn be lumped into a single
* {@link org.opendaylight.controller.cluster.datastore.modification.CompositeModification}
* which can then be applied to a write transaction.
*/
/**
* {@inheritDoc}
*
- * <p>
- * The default implementation is canonical and should never be overridden.
+ * <p>The default implementation is canonical and should never be overridden.
*/
@Override
default void readExternal(final ObjectInput in) throws IOException {
/**
* {@inheritDoc}
*
- * <p>
- * The default implementation is canonical and should never be overridden.
+ * <p>The default implementation is canonical and should never be overridden.
*/
@Override
default void writeExternal(final ObjectOutput out) throws IOException {
* <li>serialization format is changed</li>
* </ul>
*
- * <p>
- * This version effectively defines the protocol version between actors participating on a particular shard. A shard
+ * <p>This version effectively defines the protocol version between actors participating on a particular shard. A shard
* participant instance should oppose RAFT candidates which produce persistence of an unsupported version. If a follower
* encounters an unsupported version it must not become fully-operational, as it does not have an accurate view
* of shard state.
* we need to force {@link #writeReplace()} to be abstract. We do that by making it final and exposing a protected
* {@link #externalizableProxy()} method.
*
- * <p>
- * All concrete subclasses of this class should be final so as to form a distinct set of possible metadata. Since
+ * <p>All concrete subclasses of this class should be final so as to form a distinct set of possible metadata. Since
* metadata is serialized along with {@link MetadataShardDataTreeSnapshot}, this set is part of the serialization format
* guarded by {@link PayloadVersion}.
*
- * <p>
- * If a new metadata type is introduced or a type is removed, {@link PayloadVersion} needs to be bumped to ensure
+ * <p>If a new metadata type is introduced or a type is removed, {@link PayloadVersion} needs to be bumped to ensure
* compatibility.
- *
- * @author Robert Varga
*/
public abstract class ShardDataTreeSnapshotMetadata<T extends ShardDataTreeSnapshotMetadata<T>>
implements Serializable {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.datastore.shardstrategy;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
/**
* Find the name of the shard in which the data pointed to by the specified path belongs in.
*
- * <p>
- * Should return the name of the default shard DefaultShardStrategy.DEFAULT_SHARD
- * if no matching shard was found
+ * <p>Should return the name of the default shard DefaultShardStrategy.DEFAULT_SHARD if no matching shard was found
*
* @param path the location of the data in the logical tree
* @return the corresponding shard name.
/**
* {@inheritDoc}
*
- * <p>
- * Implementations of this method return a deterministic value.
+ * <p>Implementations of this method return a deterministic value.
*/
@Override
public abstract int hashCode();
* A class holding an equivalent of {@code Set<UnsignedLong>}. It is geared towards efficiently tracking ranges of
* objects, similar to what a {@link RangeSet} would do.
*
- * <p>
- * Unlike a {@code RangeSet}, though, this class takes advantage of knowing that an unsigned long is a discrete unit
+ * <p>Unlike a {@code RangeSet}, though, this class takes advantage of knowing that an unsigned long is a discrete unit
* and can be stored in a simple {@code long}.
- *
- * @author Robert Varga
*/
abstract class UnsignedLongSet {
@Beta
* {@link DOMRpcService#invokeRpc(SchemaPath, NormalizedNode)} and
* {@link DOMActionService#invokeAction(SchemaPath, DOMDataTreeIdentifier, ContainerNode)}.
*
- * <p>
- * Note that while the two interfaces are very similar, invocation strategies are slightly different due to historic
+ * <p>Note that while the two interfaces are very similar, invocation strategies are slightly different due to historic
* behavior of RPCs:
* <ul>
* <li>RPCs allow both null input and output, and this is passed to the infrastructure. Furthermore any invocation
/**
* Registry to look up cluster nodes that have registered for a given Action.
*
- * <p>
- * It uses {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor} to maintain this
- * cluster wide information.
+ * <p>It uses {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor} to maintain this
+ * cluster-wide information.
*/
public class ActionRegistry extends BucketStoreActor<ActionRoutingTable> {
private final ActorRef rpcRegistrar;
/**
* Registry to look up cluster nodes that have registered for a given RPC.
*
- * <p>
- * It uses {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor} to maintain this
- * cluster wide information.
+ * <p>It uses {@link org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor} to maintain this
+ * cluster-wide information.
*/
public class RpcRegistry extends BucketStoreActor<RoutingTable> {
private final ActorRef rpcRegistrar;
* It maintains a {@link org.opendaylight.controller.remote.rpc.registry.gossip.Bucket} per node. Buckets are versioned.
* A node can write ONLY to its bucket. This way, write conflicts are avoided.
*
- * <p>
- * Buckets are sync'ed across nodes using Gossip protocol (http://en.wikipedia.org/wiki/Gossip_protocol).
+ * <p>Buckets are sync'ed across nodes using Gossip protocol (http://en.wikipedia.org/wiki/Gossip_protocol).
* This store uses a {@link org.opendaylight.controller.remote.rpc.registry.gossip.Gossiper}.
*/
public abstract class BucketStoreActor<T extends BucketData<T>> extends
/**
* Gossiper that syncs bucket store across nodes in the cluster.
*
- * <p>
- * It keeps a local scheduler that periodically sends Gossip ticks to
+ * <p>It keeps a local scheduler that periodically sends Gossip ticks to
* itself to send bucket store's bucket versions to a randomly selected remote
* gossiper.
*
- * <p>
- * When bucket versions are received from a remote gossiper, it is compared
+ * <p>When bucket versions are received from a remote gossiper, it is compared
* with bucket store's bucket versions. Which ever buckets are newer
* locally, are sent to remote gossiper. If any bucket is older in bucket store,
* a gossip status is sent to remote gossiper so that it can send the newer buckets.
*
- * <p>
- * When a bucket is received from a remote gossiper, its sent to the bucket store
+ * <p>When a bucket is received from a remote gossiper, its sent to the bucket store
* for update.
*/
public class Gossiper extends AbstractUntypedActorWithMetering {
EntryReader openCommitsReader(long index);
/**
- * Compacts the journal up to the given index.
- *
- * <p>
- * The semantics of compaction are not specified by this interface.
+ * Compacts the journal up to the given index. The semantics of compaction are not specified by this interface.
*
* @param index The index up to which to compact the journal.
*/