Skip to content

Commit

Permalink
[Javadocs] Add to remaining o.o.action classes (#3182) (#3305)
Browse files Browse the repository at this point in the history
Adds javadocs to remaining undocumented classes in o.o.action package.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
  • Loading branch information
nknize authored May 13, 2022
1 parent e3edebe commit bdb5981
Show file tree
Hide file tree
Showing 278 changed files with 974 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/**
* An extension to {@link Future} allowing for simplified "get" operations.
*
*
* @opensearch.internal
*/
public interface ActionFuture<T> extends Future<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

/**
* A listener for action responses or failures.
*
* @opensearch.internal
*/
public interface ActionListener<Response> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
/**
* A simple base class for action response listeners, defaulting to using the SAME executor (as its
* very common on response handlers).
*
* @opensearch.internal
*/
public class ActionListenerResponseHandler<Response extends TransportResponse> implements TransportResponseHandler<Response> {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/action/ActionModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@

/**
* Builds and binds the generic action map, all {@link TransportAction}s, and {@link ActionFilters}.
*
* @opensearch.internal
*/
public class ActionModule extends AbstractModule {

Expand Down
5 changes: 5 additions & 0 deletions server/src/main/java/org/opensearch/action/ActionRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

import java.io.IOException;

/**
* Base action request
*
* @opensearch.internal
*/
public abstract class ActionRequest extends TransportRequest {

public ActionRequest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@

import java.util.Objects;

/**
* Base Action Request Builder
*
* @opensearch.internal
*/
public abstract class ActionRequestBuilder<Request extends ActionRequest, Response extends ActionResponse> {

protected final ActionType<Response> action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@

import org.opensearch.common.ValidationException;

/**
* Base exception for an action request validation
*
* @opensearch.internal
*/
public class ActionRequestValidationException extends ValidationException {}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

/**
* Base class for responses to action requests.
*
* @opensearch.internal
*/
public abstract class ActionResponse extends TransportResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
/**
* Base class for {@link Runnable}s that need to call {@link ActionListener#onFailure(Exception)} in case an uncaught
* exception or error is thrown while the actual action is run.
*
* @opensearch.internal
*/
public abstract class ActionRunnable<Response> extends AbstractRunnable {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/action/ActionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

/**
* A generic action. Should strive to make it a singleton.
*
* @opensearch.internal
*/
public class ActionType<Response extends ActionResponse> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
* one or more indices and one or more aliases. Meant to be used for aliases management requests (e.g. add/remove alias,
* get aliases) that hold aliases and indices in separate fields.
* Allows to retrieve which indices and aliases the action relates to.
*
* @opensearch.internal
*/
public interface AliasesRequest extends IndicesRequest.Replaceable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
* multiple sub-requests which relate to one or more indices. A composite request is executed by its own transport action class
* (e.g. {@link org.opensearch.action.search.TransportMultiSearchAction}), which goes through all sub-requests and delegates their
* execution to the appropriate transport action (e.g. {@link org.opensearch.action.search.TransportSearchAction}) for each single item.
*
* @opensearch.internal
*/
public interface CompositeIndicesRequest {}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
/**
* Generic interface to group ActionRequest, which perform writes to a single document
* Action requests implementing this can be part of {@link org.opensearch.action.bulk.BulkRequest}
*
* @opensearch.internal
*/
public interface DocWriteRequest<T> extends IndicesRequest, Accountable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

/**
* A base class for the response of a write operation that involves a single doc
*
* @opensearch.internal
*/
public abstract class DocWriteResponse extends ReplicationResponse implements WriteResponse, StatusToXContentObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

import java.io.IOException;

/**
* Base exception for a failed node
*
* @opensearch.internal
*/
public class FailedNodeException extends OpenSearchException {

private final String nodeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
* one or more indices. Allows to retrieve which indices the action relates to.
* In case of internal requests originated during the distributed execution of an external request,
* they will still return the indices that the original request related to.
*
* @opensearch.internal
*/
public interface IndicesRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
/**
* An action listener that allows passing in a {@link CountDownLatch} that
* will be counted down after onResponse or onFailure is called
*
* @opensearch.internal
*/
public class LatchedActionListener<T> implements ActionListener<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/**
* An {@link ActionFuture} that listeners can be added to.
*
*
* @opensearch.internal
*/
public interface ListenableActionFuture<T> extends ActionFuture<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

import java.io.IOException;

/**
* Base exception for no shard available
*
* @opensearch.internal
*/
public class NoShardAvailableActionException extends OpenSearchException {

public NoShardAvailableActionException(ShardId shardId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@

import java.io.IOException;

/**
* Base exception for no node found
*
* @opensearch.internal
*/
public class NoSuchNodeException extends FailedNodeException {

public NoSuchNodeException(String nodeId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
* A listener that ensures that only one of onResponse or onFailure is called. And the method
* the is called is only called once. Subclasses should implement notification logic with
* innerOnResponse and innerOnFailure.
*
* @opensearch.internal
*/
public abstract class NotifyOnceListener<Response> implements ActionListener<Response> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

/**
* Used to keep track of original indices within internal (e.g. shard level) requests
*
* @opensearch.internal
*/
public final class OriginalIndices implements IndicesRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@

import java.io.IOException;

/**
* Base exception for a missing action on a primary
*
* @opensearch.internal
*/
public class PrimaryMissingActionException extends OpenSearchException {

public PrimaryMissingActionException(String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
/**
* Indicates that a request can execute in realtime (reads from the translog).
* All {@link ActionRequest} that are realtime should implement this interface.
*
* @opensearch.internal
*/
public interface RealtimeRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
import java.util.Collection;
import java.util.Optional;

/**
* Validates transport requests
*
* @opensearch.internal
*/
public class RequestValidators<T extends ActionRequest> {

private final Collection<RequestValidator<T>> validators;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
import java.io.IOException;
import java.util.Objects;

/**
* Base exception for a missing routing
*
* @opensearch.internal
*/
public class RoutingMissingException extends OpenSearchException {

private final String type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
/**
* An exception indicating that a failure occurred performing an operation on the shard.
*
* @opensearch.internal
*/
public abstract class ShardOperationFailedException implements Writeable, ToXContentObject {

Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/org/opensearch/action/StepListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
* }, flowListener::onFailure);
* }
* }</pre>
*
* @opensearch.internal
*/

public final class StepListener<Response> extends NotifyOnceListener<Response> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* Information about task operation failures
*
* The class is final due to serialization limitations
*
* @opensearch.internal
*/
public final class TaskOperationFailure implements Writeable, ToXContentFragment {
private static final String TASK_ID = "task_id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.action;

/**
* Threading model
*
* @opensearch.internal
*/
public enum ThreadingModel {
NONE((byte) 0),
OPERATION((byte) 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@

import java.io.IOException;

/**
* Base exception for a failed timestamp parse
*
* @opensearch.internal
*/
public class TimestampParsingException extends OpenSearchException {

private final String timestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

/**
* A generic proxy that will execute the given action against a specific node.
*
* @opensearch.internal
*/
public class TransportActionNodeProxy<Request extends ActionRequest, Response extends ActionResponse> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

import java.io.IOException;

/**
* Base exception for shards unavailable
*
* @opensearch.internal
*/
public class UnavailableShardsException extends OpenSearchException {

public UnavailableShardsException(@Nullable ShardId shardId, String message, Object... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

package org.opensearch.action;

/**
* Validates transport actions
*
* @opensearch.internal
*/
public class ValidateActions {

public static ActionRequestValidationException addValidationError(String error, ActionRequestValidationException validationException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
* </ul>
*
* Note that backoff policies are exposed as <code>Iterables</code> in order to be consumed multiple times.
*
* @opensearch.internal
*/
public abstract class BackoffPolicy implements Iterable<TimeValue> {
private static final BackoffPolicy NO_BACKOFF = new NoBackoff();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.transport.TransportRequestOptions;

/**
* Transport action for bulk indexing
*
* @opensearch.internal
*/
public class BulkAction extends ActionType<BulkResponse> {

public static final BulkAction INSTANCE = new BulkAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
import java.io.IOException;
import java.util.Objects;

/**
* Transport request for a Single bulk item
*
* @opensearch.internal
*/
public class BulkItemRequest implements Writeable, Accountable {

private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(BulkItemRequest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
/**
* Represents a single item response for an action executed as part of the bulk API. Holds the index/type/id
* of the relevant action, and if it has failed or not (with the failure message in case it failed).
*
* @opensearch.internal
*/
public class BulkItemResponse implements Writeable, StatusToXContentObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
* This is a utility class that holds the per request state needed to perform bulk operations on the primary.
* More specifically, it maintains an index to the current executing bulk item, which allows execution
* to stop and wait for external events such as mapping updates.
*
* @opensearch.internal
*/
class BulkPrimaryExecutionContext {

Expand Down
Loading

0 comments on commit bdb5981

Please sign in to comment.