[Javadocs] Add to remaining o.o.action classes (#3182)
Adds javadocs to remaining undocumented classes in o.o.action package. Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
This commit is contained in:
parent
fc0f446ab2
commit
6ca3278f96
|
@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit;
|
|||
/**
|
||||
* An extension to {@link Future} allowing for simplified "get" operations.
|
||||
*
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface ActionFuture<T> extends Future<T> {
|
||||
|
||||
|
|
|
@ -45,6 +45,8 @@ import java.util.function.Consumer;
|
|||
|
||||
/**
|
||||
* A listener for action responses or failures.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface ActionListener<Response> {
|
||||
/**
|
||||
|
|
|
@ -45,6 +45,8 @@ import java.util.Objects;
|
|||
/**
|
||||
* 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> {
|
||||
|
||||
|
|
|
@ -419,6 +419,8 @@ import static java.util.Collections.unmodifiableMap;
|
|||
|
||||
/**
|
||||
* Builds and binds the generic action map, all {@link TransportAction}s, and {@link ActionFilters}.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ActionModule extends AbstractModule {
|
||||
|
||||
|
|
|
@ -38,6 +38,11 @@ import org.opensearch.transport.TransportRequest;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Base action request
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public abstract class ActionRequest extends TransportRequest {
|
||||
|
||||
public ActionRequest() {
|
||||
|
|
|
@ -37,6 +37,11 @@ import org.opensearch.common.unit.TimeValue;
|
|||
|
||||
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;
|
||||
|
|
|
@ -34,4 +34,9 @@ package org.opensearch.action;
|
|||
|
||||
import org.opensearch.common.ValidationException;
|
||||
|
||||
/**
|
||||
* Base exception for an action request validation
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ActionRequestValidationException extends ValidationException {}
|
||||
|
|
|
@ -39,6 +39,8 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Base class for responses to action requests.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public abstract class ActionResponse extends TransportResponse {
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ import org.opensearch.common.util.concurrent.AbstractRunnable;
|
|||
/**
|
||||
* 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 {
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ import org.opensearch.transport.TransportRequestOptions;
|
|||
|
||||
/**
|
||||
* A generic action. Should strive to make it a singleton.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ActionType<Response extends ActionResponse> {
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ package org.opensearch.action;
|
|||
* 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 {
|
||||
|
||||
|
|
|
@ -37,5 +37,7 @@ package org.opensearch.action;
|
|||
* 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 {}
|
||||
|
|
|
@ -53,6 +53,8 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO;
|
|||
/**
|
||||
* 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 {
|
||||
|
||||
|
|
|
@ -63,6 +63,8 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO;
|
|||
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
|
|
|
@ -39,6 +39,11 @@ import org.opensearch.common.xcontent.XContentBuilder;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Base exception for a failed node
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FailedNodeException extends OpenSearchException {
|
||||
|
||||
private final String nodeId;
|
||||
|
|
|
@ -39,6 +39,8 @@ import org.opensearch.action.support.IndicesOptions;
|
|||
* 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 {
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ import java.util.concurrent.CountDownLatch;
|
|||
/**
|
||||
* 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> {
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ package org.opensearch.action;
|
|||
/**
|
||||
* An {@link ActionFuture} that listeners can be added to.
|
||||
*
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface ListenableActionFuture<T> extends ActionFuture<T> {
|
||||
|
||||
|
|
|
@ -39,6 +39,11 @@ import org.opensearch.rest.RestStatus;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Base exception for no shard available
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class NoShardAvailableActionException extends OpenSearchException {
|
||||
|
||||
public NoShardAvailableActionException(ShardId shardId) {
|
||||
|
|
|
@ -36,6 +36,11 @@ import org.opensearch.common.io.stream.StreamInput;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Base exception for no node found
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class NoSuchNodeException extends FailedNodeException {
|
||||
|
||||
public NoSuchNodeException(String nodeId) {
|
||||
|
|
|
@ -38,6 +38,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
* 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> {
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ import java.util.Arrays;
|
|||
|
||||
/**
|
||||
* Used to keep track of original indices within internal (e.g. shard level) requests
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public final class OriginalIndices implements IndicesRequest {
|
||||
|
||||
|
|
|
@ -37,6 +37,11 @@ import org.opensearch.common.io.stream.StreamInput;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Base exception for a missing action on a primary
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class PrimaryMissingActionException extends OpenSearchException {
|
||||
|
||||
public PrimaryMissingActionException(String message) {
|
||||
|
|
|
@ -35,6 +35,8 @@ package org.opensearch.action;
|
|||
/**
|
||||
* 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 {
|
||||
|
||||
|
|
|
@ -38,6 +38,11 @@ import org.opensearch.index.Index;
|
|||
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;
|
||||
|
|
|
@ -41,6 +41,11 @@ import org.opensearch.rest.RestStatus;
|
|||
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;
|
||||
|
|
|
@ -42,6 +42,7 @@ import java.util.Objects;
|
|||
/**
|
||||
* An exception indicating that a failure occurred performing an operation on the shard.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public abstract class ShardOperationFailedException implements Writeable, ToXContentObject {
|
||||
|
||||
|
|
|
@ -61,6 +61,8 @@ import java.util.function.Consumer;
|
|||
* }, flowListener::onFailure);
|
||||
* }
|
||||
* }</pre>
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
|
||||
public final class StepListener<Response> extends NotifyOnceListener<Response> {
|
||||
|
|
|
@ -52,6 +52,8 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructo
|
|||
* 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";
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
|
||||
package org.opensearch.action;
|
||||
|
||||
/**
|
||||
* Threading model
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public enum ThreadingModel {
|
||||
NONE((byte) 0),
|
||||
OPERATION((byte) 1),
|
||||
|
|
|
@ -38,6 +38,11 @@ import org.opensearch.common.io.stream.StreamOutput;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Base exception for a failed timestamp parse
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TimestampParsingException extends OpenSearchException {
|
||||
|
||||
private final String timestamp;
|
||||
|
|
|
@ -39,6 +39,8 @@ import org.opensearch.transport.TransportService;
|
|||
|
||||
/**
|
||||
* A generic proxy that will execute the given action against a specific node.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportActionNodeProxy<Request extends ActionRequest, Response extends ActionResponse> {
|
||||
|
||||
|
|
|
@ -40,6 +40,11 @@ import org.opensearch.rest.RestStatus;
|
|||
|
||||
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) {
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
|
||||
package org.opensearch.action;
|
||||
|
||||
/**
|
||||
* Validates transport actions
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ValidateActions {
|
||||
|
||||
public static ActionRequestValidationException addValidationError(String error, ActionRequestValidationException validationException) {
|
||||
|
|
|
@ -53,6 +53,8 @@ import java.util.NoSuchElementException;
|
|||
* </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();
|
||||
|
|
|
@ -36,6 +36,11 @@ import org.opensearch.action.ActionType;
|
|||
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();
|
||||
|
|
|
@ -45,6 +45,11 @@ import org.opensearch.index.shard.ShardId;
|
|||
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);
|
||||
|
|
|
@ -67,6 +67,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.throwUnknownFie
|
|||
/**
|
||||
* 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 {
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ import java.util.Arrays;
|
|||
* 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 {
|
||||
|
||||
|
|
|
@ -63,6 +63,8 @@ import java.util.function.Supplier;
|
|||
* requests allowed to be executed in parallel.
|
||||
* <p>
|
||||
* In order to create a new bulk processor, use the {@link Builder}.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class BulkProcessor implements Closeable {
|
||||
|
||||
|
|
|
@ -70,6 +70,8 @@ import static org.opensearch.action.ValidateActions.addValidationError;
|
|||
*
|
||||
* Note that we only support refresh on the bulk request not per item.
|
||||
* @see org.opensearch.client.Client#bulk(BulkRequest)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class BulkRequest extends ActionRequest implements CompositeIndicesRequest, WriteRequest<BulkRequest>, Accountable {
|
||||
|
||||
|
|
|
@ -50,6 +50,8 @@ import org.opensearch.common.xcontent.XContentType;
|
|||
/**
|
||||
* A bulk request holds an ordered {@link IndexRequest}s and {@link DeleteRequest}s and allows to executes
|
||||
* it in a single batch.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class BulkRequestBuilder extends ActionRequestBuilder<BulkRequest, BulkResponse> implements WriteRequestBuilder<BulkRequestBuilder> {
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ import java.util.function.BiConsumer;
|
|||
|
||||
/**
|
||||
* Implements the low-level details of bulk request handling
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public final class BulkRequestHandler {
|
||||
private final Logger logger;
|
||||
|
|
|
@ -61,6 +61,8 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_PRIMARY_TERM
|
|||
|
||||
/**
|
||||
* Helper to parse bulk requests. This should be considered an internal class.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public final class BulkRequestParser {
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.throwUnknownTok
|
|||
* A response of a bulk execution. Holding a response for each item responding (in order) of the
|
||||
* bulk requests. Each item holds the index/type/id is operated on, and if it failed or not (with the
|
||||
* failure message).
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class BulkResponse extends ActionResponse implements Iterable<BulkItemResponse>, StatusToXContentObject {
|
||||
|
||||
|
|
|
@ -47,6 +47,11 @@ import java.util.HashSet;
|
|||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* A bulk shard request targeting a specific shard ID
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class BulkShardRequest extends ReplicatedWriteRequest<BulkShardRequest> implements Accountable {
|
||||
|
||||
public static final Version COMPACT_SHARD_ID_VERSION = LegacyESVersion.V_7_9_0;
|
||||
|
|
|
@ -43,6 +43,11 @@ import org.opensearch.index.shard.ShardId;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Transport response for a bulk shard request
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class BulkShardResponse extends ReplicationResponse implements WriteResponse {
|
||||
|
||||
private static final Version COMPACT_SHARD_ID_VERSION = LegacyESVersion.V_7_9_0;
|
||||
|
|
|
@ -36,6 +36,11 @@ import org.opensearch.action.ActionListener;
|
|||
import org.opensearch.index.mapper.Mapping;
|
||||
import org.opensearch.index.shard.ShardId;
|
||||
|
||||
/**
|
||||
* Updates the mappings on the cluster manager
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public interface MappingUpdatePerformer {
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,6 +49,8 @@ import java.util.function.Predicate;
|
|||
|
||||
/**
|
||||
* Encapsulates synchronous and asynchronous retry logic.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class Retry {
|
||||
private final BackoffPolicy backoffPolicy;
|
||||
|
|
|
@ -112,6 +112,8 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO;
|
|||
/**
|
||||
* Groups bulk request items by shard, optionally creating non-existent indices and
|
||||
* delegates to {@link TransportShardBulkAction} for shard-level bulk execution
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportBulkAction extends HandledTransportAction<BulkRequest, BulkResponse> {
|
||||
|
||||
|
|
|
@ -94,7 +94,11 @@ import java.util.function.Consumer;
|
|||
import java.util.function.Function;
|
||||
import java.util.function.LongSupplier;
|
||||
|
||||
/** Performs shard-level bulk (index, delete or update) operations */
|
||||
/**
|
||||
* Performs shard-level bulk (index, delete or update) operations
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequest, BulkShardRequest, BulkShardResponse> {
|
||||
|
||||
public static final String ACTION_NAME = BulkAction.NAME + "[s]";
|
||||
|
|
|
@ -45,7 +45,11 @@ import org.opensearch.common.io.stream.Writeable;
|
|||
import org.opensearch.tasks.Task;
|
||||
import org.opensearch.transport.TransportService;
|
||||
|
||||
/** use transport bulk action directly */
|
||||
/**
|
||||
* use transport bulk action directly
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class TransportSingleItemBulkWriteAction<
|
||||
Request extends ReplicatedWriteRequest<Request>,
|
||||
|
|
|
@ -34,6 +34,11 @@ package org.opensearch.action.delete;
|
|||
|
||||
import org.opensearch.action.ActionType;
|
||||
|
||||
/**
|
||||
* Transport action to delete a document from an index
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeleteAction extends ActionType<DeleteResponse> {
|
||||
|
||||
public static final DeleteAction INSTANCE = new DeleteAction();
|
||||
|
|
|
@ -64,6 +64,8 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO;
|
|||
* @see DeleteResponse
|
||||
* @see org.opensearch.client.Client#delete(DeleteRequest)
|
||||
* @see org.opensearch.client.Requests#deleteRequest(String)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeleteRequest extends ReplicatedWriteRequest<DeleteRequest>
|
||||
implements
|
||||
|
|
|
@ -40,6 +40,8 @@ import org.opensearch.index.VersionType;
|
|||
|
||||
/**
|
||||
* A delete document action request builder.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeleteRequestBuilder extends ReplicationRequestBuilder<DeleteRequest, DeleteResponse, DeleteRequestBuilder>
|
||||
implements
|
||||
|
|
|
@ -47,6 +47,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT
|
|||
*
|
||||
* @see org.opensearch.action.delete.DeleteRequest
|
||||
* @see org.opensearch.client.Client#delete(DeleteRequest)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeleteResponse extends DocWriteResponse {
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@ import org.opensearch.transport.TransportService;
|
|||
* Performs the delete operation.
|
||||
*
|
||||
* Deprecated use TransportBulkAction with a single item instead
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
@Deprecated
|
||||
public class TransportDeleteAction extends TransportSingleItemBulkWriteAction<DeleteRequest, DeleteResponse> {
|
||||
|
|
|
@ -36,6 +36,8 @@ import org.opensearch.action.ActionType;
|
|||
|
||||
/**
|
||||
* Entry point for the explain feature.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ExplainAction extends ActionType<ExplainResponse> {
|
||||
|
||||
|
|
|
@ -53,6 +53,8 @@ import static org.opensearch.action.ValidateActions.addValidationError;
|
|||
|
||||
/**
|
||||
* Explain request encapsulating the explain query and document identifier to get an explanation for.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ExplainRequest extends SingleShardRequest<ExplainRequest> implements ToXContentObject {
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ import org.opensearch.search.fetch.subphase.FetchSourceContext;
|
|||
|
||||
/**
|
||||
* A builder for {@link ExplainRequest}.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ExplainRequestBuilder extends SingleShardOperationRequestBuilder<ExplainRequest, ExplainResponse, ExplainRequestBuilder> {
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@ import static org.opensearch.common.lucene.Lucene.writeExplanation;
|
|||
|
||||
/**
|
||||
* Response containing the score explanation.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class ExplainResponse extends ActionResponse implements StatusToXContentObject {
|
||||
|
||||
|
|
|
@ -68,6 +68,8 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* Explain transport action. Computes the explain on the targeted shard.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
// TODO: AggregatedDfs. Currently the idf can be different then when executing a normal search with explain.
|
||||
public class TransportExplainAction extends TransportSingleShardAction<ExplainRequest, ExplainResponse> {
|
||||
|
|
|
@ -59,6 +59,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
/**
|
||||
* Describes the capabilities of a field optionally merged across multiple indices.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FieldCapabilities implements Writeable, ToXContentObject {
|
||||
|
||||
|
|
|
@ -34,6 +34,11 @@ package org.opensearch.action.fieldcaps;
|
|||
|
||||
import org.opensearch.action.ActionType;
|
||||
|
||||
/**
|
||||
* Transport action for a field capabilities request
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FieldCapabilitiesAction extends ActionType<FieldCapabilitiesResponse> {
|
||||
|
||||
public static final FieldCapabilitiesAction INSTANCE = new FieldCapabilitiesAction();
|
||||
|
|
|
@ -46,6 +46,11 @@ import org.opensearch.index.shard.ShardId;
|
|||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Transport Request for Retrieving Field Capabilities for an Index
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FieldCapabilitiesIndexRequest extends ActionRequest implements IndicesRequest {
|
||||
|
||||
public static final IndicesOptions INDICES_OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed();
|
||||
|
|
|
@ -44,6 +44,8 @@ import java.util.Objects;
|
|||
|
||||
/**
|
||||
* Response for {@link TransportFieldCapabilitiesIndexAction}.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FieldCapabilitiesIndexResponse extends ActionResponse implements Writeable {
|
||||
private final String indexName;
|
||||
|
|
|
@ -51,6 +51,9 @@ import java.util.HashSet;
|
|||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Transport request for retrieving field capabilities for an explicit list of fields
|
||||
*/
|
||||
public final class FieldCapabilitiesRequest extends ActionRequest implements IndicesRequest.Replaceable, ToXContentObject {
|
||||
public static final String NAME = "field_caps_request";
|
||||
|
||||
|
|
|
@ -36,6 +36,11 @@ import org.opensearch.action.ActionRequestBuilder;
|
|||
import org.opensearch.client.OpenSearchClient;
|
||||
import org.opensearch.index.query.QueryBuilder;
|
||||
|
||||
/**
|
||||
* Transport request builder for retrieving field capabilities
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FieldCapabilitiesRequestBuilder extends ActionRequestBuilder<FieldCapabilitiesRequest, FieldCapabilitiesResponse> {
|
||||
public FieldCapabilitiesRequestBuilder(OpenSearchClient client, FieldCapabilitiesAction action, String... indices) {
|
||||
super(client, action, new FieldCapabilitiesRequest().indices(indices));
|
||||
|
|
|
@ -56,6 +56,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
/**
|
||||
* Response for {@link FieldCapabilitiesRequest} requests.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class FieldCapabilitiesResponse extends ActionResponse implements ToXContentObject {
|
||||
private static final ParseField INDICES_FIELD = new ParseField("indices");
|
||||
|
|
|
@ -46,6 +46,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
/**
|
||||
* Describes the capabilities of a field in a single index.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class IndexFieldCapabilities implements Writeable {
|
||||
|
||||
|
|
|
@ -58,6 +58,11 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Transport action for field capabilities requests
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportFieldCapabilitiesAction extends HandledTransportAction<FieldCapabilitiesRequest, FieldCapabilitiesResponse> {
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
|
|
|
@ -85,6 +85,11 @@ import java.util.function.Predicate;
|
|||
|
||||
import static org.opensearch.action.support.TransportActions.isShardNotAvailableException;
|
||||
|
||||
/**
|
||||
* Transport action for field capabilities request in an index
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportFieldCapabilitiesIndexAction extends HandledTransportAction<
|
||||
FieldCapabilitiesIndexRequest,
|
||||
FieldCapabilitiesIndexResponse> {
|
||||
|
|
|
@ -34,6 +34,11 @@ package org.opensearch.action.get;
|
|||
|
||||
import org.opensearch.action.ActionType;
|
||||
|
||||
/**
|
||||
* Transport action to get a document
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetAction extends ActionType<GetResponse> {
|
||||
|
||||
public static final GetAction INSTANCE = new GetAction();
|
||||
|
|
|
@ -60,6 +60,8 @@ import static org.opensearch.action.ValidateActions.addValidationError;
|
|||
* @see GetResponse
|
||||
* @see org.opensearch.client.Requests#getRequest(String)
|
||||
* @see org.opensearch.client.Client#get(GetRequest)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetRequest extends SingleShardRequest<GetRequest> implements RealtimeRequest {
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ import org.opensearch.search.fetch.subphase.FetchSourceContext;
|
|||
|
||||
/**
|
||||
* A get document action request builder.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetRequestBuilder extends SingleShardOperationRequestBuilder<GetRequest, GetResponse, GetRequestBuilder> {
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ import java.util.Objects;
|
|||
*
|
||||
* @see GetRequest
|
||||
* @see org.opensearch.client.Client#get(GetRequest)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetResponse extends ActionResponse implements Iterable<DocumentField>, ToXContentObject {
|
||||
|
||||
|
|
|
@ -34,6 +34,11 @@ package org.opensearch.action.get;
|
|||
|
||||
import org.opensearch.action.ActionType;
|
||||
|
||||
/**
|
||||
* Transport action for a multi get
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetAction extends ActionType<MultiGetResponse> {
|
||||
|
||||
public static final MultiGetAction INSTANCE = new MultiGetAction();
|
||||
|
|
|
@ -40,6 +40,8 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* A single multi get response.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetItemResponse implements Writeable {
|
||||
|
||||
|
|
|
@ -66,6 +66,11 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Transport request for a multi get.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetRequest extends ActionRequest
|
||||
implements
|
||||
Iterable<MultiGetRequest.Item>,
|
||||
|
|
|
@ -37,6 +37,8 @@ import org.opensearch.client.OpenSearchClient;
|
|||
|
||||
/**
|
||||
* A multi get document action request builder.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetRequestBuilder extends ActionRequestBuilder<MultiGetRequest, MultiGetResponse> {
|
||||
|
||||
|
|
|
@ -52,6 +52,11 @@ import java.util.Arrays;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Transport response for a multi get.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetResponse extends ActionResponse implements Iterable<MultiGetItemResponse>, ToXContentObject {
|
||||
|
||||
private static final ParseField INDEX = new ParseField("_index");
|
||||
|
|
|
@ -42,6 +42,11 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Multi get shards.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetShardRequest extends SingleShardRequest<MultiGetShardRequest> {
|
||||
|
||||
private int shardId;
|
||||
|
|
|
@ -41,6 +41,11 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Transport response for multi get shards.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class MultiGetShardResponse extends ActionResponse {
|
||||
|
||||
final IntArrayList locations;
|
||||
|
|
|
@ -54,6 +54,8 @@ import java.io.IOException;
|
|||
|
||||
/**
|
||||
* Performs the get operation.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportGetAction extends TransportSingleShardAction<GetRequest, GetResponse> {
|
||||
|
||||
|
|
|
@ -50,6 +50,11 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* Perform the multi get action.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportMultiGetAction extends HandledTransportAction<MultiGetRequest, MultiGetResponse> {
|
||||
|
||||
private final ClusterService clusterService;
|
||||
|
|
|
@ -53,6 +53,11 @@ import org.opensearch.transport.TransportService;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Perform the shard multi get action
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class TransportShardMultiGetAction extends TransportSingleShardAction<MultiGetShardRequest, MultiGetShardResponse> {
|
||||
|
||||
private static final String ACTION_NAME = MultiGetAction.NAME + "[shard]";
|
||||
|
|
|
@ -34,6 +34,11 @@ package org.opensearch.action.index;
|
|||
|
||||
import org.opensearch.action.ActionType;
|
||||
|
||||
/**
|
||||
* Transport action for indexing a document.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class IndexAction extends ActionType<IndexResponse> {
|
||||
|
||||
public static final IndexAction INSTANCE = new IndexAction();
|
||||
|
|
|
@ -88,6 +88,8 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO;
|
|||
* @see IndexResponse
|
||||
* @see org.opensearch.client.Requests#indexRequest(String)
|
||||
* @see org.opensearch.client.Client#index(IndexRequest)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class IndexRequest extends ReplicatedWriteRequest<IndexRequest> implements DocWriteRequest<IndexRequest>, CompositeIndicesRequest {
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* An index document action request builder.
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class IndexRequestBuilder extends ReplicationRequestBuilder<IndexRequest, IndexResponse, IndexRequestBuilder>
|
||||
implements
|
||||
|
|
|
@ -48,6 +48,8 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT
|
|||
*
|
||||
* @see IndexRequest
|
||||
* @see org.opensearch.client.Client#index(IndexRequest)
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class IndexResponse extends DocWriteResponse {
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ import org.opensearch.transport.TransportService;
|
|||
* </ul>
|
||||
*
|
||||
* Deprecated use TransportBulkAction with a single item instead
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
@Deprecated
|
||||
public class TransportIndexAction extends TransportSingleItemBulkWriteAction<IndexRequest, IndexResponse> {
|
||||
|
|
|
@ -35,6 +35,11 @@ package org.opensearch.action.ingest;
|
|||
import org.opensearch.action.ActionType;
|
||||
import org.opensearch.action.support.master.AcknowledgedResponse;
|
||||
|
||||
/**
|
||||
* Transport action to delete a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeletePipelineAction extends ActionType<AcknowledgedResponse> {
|
||||
|
||||
public static final DeletePipelineAction INSTANCE = new DeletePipelineAction();
|
||||
|
|
|
@ -40,6 +40,11 @@ import org.opensearch.common.io.stream.StreamOutput;
|
|||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* transport request to delete a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeletePipelineRequest extends AcknowledgedRequest<DeletePipelineRequest> {
|
||||
|
||||
private String id;
|
||||
|
|
|
@ -36,6 +36,11 @@ import org.opensearch.action.ActionRequestBuilder;
|
|||
import org.opensearch.action.support.master.AcknowledgedResponse;
|
||||
import org.opensearch.client.OpenSearchClient;
|
||||
|
||||
/**
|
||||
* Transport request builder to delete a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeletePipelineRequestBuilder extends ActionRequestBuilder<DeletePipelineRequest, AcknowledgedResponse> {
|
||||
|
||||
public DeletePipelineRequestBuilder(OpenSearchClient client, DeletePipelineAction action) {
|
||||
|
|
|
@ -48,6 +48,11 @@ import org.opensearch.transport.TransportService;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Perform the action of deleting a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class DeletePipelineTransportAction extends TransportMasterNodeAction<DeletePipelineRequest, AcknowledgedResponse> {
|
||||
|
||||
private final IngestService ingestService;
|
||||
|
|
|
@ -34,6 +34,11 @@ package org.opensearch.action.ingest;
|
|||
|
||||
import org.opensearch.action.ActionType;
|
||||
|
||||
/**
|
||||
* Transport action to get a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetPipelineAction extends ActionType<GetPipelineResponse> {
|
||||
|
||||
public static final GetPipelineAction INSTANCE = new GetPipelineAction();
|
||||
|
|
|
@ -40,6 +40,11 @@ import org.opensearch.common.io.stream.StreamOutput;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* transport request to get a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetPipelineRequest extends MasterNodeReadRequest<GetPipelineRequest> {
|
||||
|
||||
private String[] ids;
|
||||
|
|
|
@ -35,6 +35,11 @@ package org.opensearch.action.ingest;
|
|||
import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder;
|
||||
import org.opensearch.client.OpenSearchClient;
|
||||
|
||||
/**
|
||||
* Transport request builder to get a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetPipelineRequestBuilder extends MasterNodeReadOperationRequestBuilder<
|
||||
GetPipelineRequest,
|
||||
GetPipelineResponse,
|
||||
|
|
|
@ -53,6 +53,11 @@ import java.util.Map;
|
|||
|
||||
import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken;
|
||||
|
||||
/**
|
||||
* transport response for getting a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetPipelineResponse extends ActionResponse implements StatusToXContentObject {
|
||||
|
||||
private List<PipelineConfiguration> pipelines;
|
||||
|
|
|
@ -48,6 +48,11 @@ import org.opensearch.transport.TransportService;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Perform the action of getting a pipeline
|
||||
*
|
||||
* @opensearch.internal
|
||||
*/
|
||||
public class GetPipelineTransportAction extends TransportMasterNodeReadAction<GetPipelineRequest, GetPipelineResponse> {
|
||||
|
||||
@Inject
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue