diff --git a/pom.xml b/pom.xml index 5199dc80..bd798610 100644 --- a/pom.xml +++ b/pom.xml @@ -54,10 +54,6 @@ UTF-8 UTF-8 UTF-8 - - all,-missing diff --git a/src/main/java/org/codelibs/fesen/client/action/HttpResolveIndexAction.java b/src/main/java/org/codelibs/fesen/client/action/HttpResolveIndexAction.java index c6375222..d068f432 100644 --- a/src/main/java/org/codelibs/fesen/client/action/HttpResolveIndexAction.java +++ b/src/main/java/org/codelibs/fesen/client/action/HttpResolveIndexAction.java @@ -253,6 +253,12 @@ protected static List readStringArray(final XContentParser parser) throw * Internal container holding the parsed fields of a resolved index entry. */ protected static class ResolvedIndexData { + /** + * Creates a new ResolvedIndexData. + */ + protected ResolvedIndexData() { + } + String name; List aliases = new ArrayList<>(); List attributes = new ArrayList<>(); @@ -263,6 +269,12 @@ protected static class ResolvedIndexData { * Internal container holding the parsed fields of a resolved alias entry. */ protected static class ResolvedAliasData { + /** + * Creates a new ResolvedAliasData. + */ + protected ResolvedAliasData() { + } + String name; List indices = new ArrayList<>(); } @@ -271,6 +283,12 @@ protected static class ResolvedAliasData { * Internal container holding the parsed fields of a resolved data stream entry. */ protected static class ResolvedDataStreamData { + /** + * Creates a new ResolvedDataStreamData. + */ + protected ResolvedDataStreamData() { + } + String name; List backingIndices = new ArrayList<>(); String timestampField; diff --git a/src/main/java/org/codelibs/fesen/opensearch/Build.java b/src/main/java/org/codelibs/fesen/opensearch/Build.java index cae8d761..dc6a18dc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/Build.java +++ b/src/main/java/org/codelibs/fesen/opensearch/Build.java @@ -61,15 +61,38 @@ public class Build { */ public enum Type { + /** + * The DEB value. + */ DEB("deb"), + /** + * The DOCKER value. + */ DOCKER("docker"), + /** + * The RPM value. + */ RPM("rpm"), + /** + * The TAR value. + */ TAR("tar"), + /** + * The ZIP value. + */ ZIP("zip"), + /** + * The UNKNOWN value. + */ UNKNOWN("unknown"); final String displayName; + /** + * Returns the display name. + * + * @return the display name + */ public String displayName() { return displayName; } @@ -78,6 +101,13 @@ public String displayName() { this.displayName = displayName; } + /** + * Creates an instance from display name. + * + * @param displayName the display name + * @param strict the strict + * @return the new display name + */ public static Type fromDisplayName(final String displayName, final boolean strict) { switch (displayName) { case "deb": @@ -189,6 +219,16 @@ static URL getOpenSearchCodeSourceLocation() { private final String version; private final String distribution; + /** + * Creates a new Build. + * + * @param type the type + * @param hash the hash + * @param date the date + * @param isSnapshot the is snapshot + * @param version the version + * @param distribution the distribution + */ public Build(final Type type, final String hash, final String date, boolean isSnapshot, String version, String distribution) { this.type = type; this.hash = hash; @@ -198,10 +238,20 @@ public Build(final Type type, final String hash, final String date, boolean isSn this.distribution = distribution; } + /** + * Returns the hash. + * + * @return the hash + */ public String hash() { return hash; } + /** + * Returns the date. + * + * @return the date + */ public String date() { return date; } @@ -227,10 +277,20 @@ public String getQualifiedVersion() { return version; } + /** + * Returns the type. + * + * @return the type + */ public Type type() { return type; } + /** + * Returns the snapshot flag. + * + * @return the snapshot flag + */ public boolean isSnapshot() { return isSnapshot; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/ExceptionsHelper.java b/src/main/java/org/codelibs/fesen/opensearch/ExceptionsHelper.java index 33e112d0..26dc5ca7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/ExceptionsHelper.java +++ b/src/main/java/org/codelibs/fesen/opensearch/ExceptionsHelper.java @@ -110,6 +110,12 @@ private ErrorMessages() { // utility class: no ctor private ExceptionsHelper() {} + /** + * Returns the status. + * + * @param t the t + * @return the status + */ public static RestStatus status(Throwable t) { return switch (t) { case OpenSearchException ose -> ose.status(); @@ -122,6 +128,12 @@ public static RestStatus status(Throwable t) { }; } + /** + * Returns the summary message. + * + * @param t the t + * @return the summary message + */ public static String summaryMessage(Throwable t) { return switch (t) { case OpenSearchException ose -> getExceptionSimpleClassName(t) + "[" + ose.getMessage() + "]"; @@ -133,6 +145,12 @@ public static String summaryMessage(Throwable t) { }; } + /** + * Unwraps the cause. + * + * @param t the t + * @return this instance + */ public static Throwable unwrapCause(Throwable t) { int counter = 0; Throwable result = t; @@ -173,6 +191,8 @@ public static Throwable unwrapToOpenSearchException(Throwable e) { } /** + * @param t the t + * @return the detailed message * @deprecated Don't swallow exceptions, allow them to propagate. */ @Deprecated @@ -201,6 +221,12 @@ public static String detailedMessage(Throwable t) { } } + /** + * Returns the stack trace. + * + * @param e the exception + * @return the stack trace + */ public static String stackTrace(Throwable e) { StringWriter stackTraceStringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stackTraceStringWriter); @@ -208,6 +234,12 @@ public static String stackTrace(Throwable e) { return stackTraceStringWriter.toString(); } + /** + * Formats the stack trace. + * + * @param stackTrace the stack trace + * @return this instance + */ public static String formatStackTrace(final StackTraceElement[] stackTrace) { return Arrays.stream(stackTrace).skip(1).map(e -> "\tat " + e).collect(Collectors.joining("\n")); } @@ -215,6 +247,9 @@ public static String formatStackTrace(final StackTraceElement[] stackTrace) { /** * Throws a runtime exception with all given exceptions added as suppressed. * If the given list is empty no exception is thrown + * + * @param the element type + * @param exceptions the exceptions */ public static void maybeThrowRuntimeAndSuppress(List exceptions) { T main = null; @@ -226,6 +261,14 @@ public static void maybeThrowRuntimeAndSuppress(List ex } } + /** + * Returns the use or suppress. + * + * @param the element type + * @param first the first + * @param second the second + * @return the use or suppress + */ public static T useOrSuppress(T first, T second) { if (first == null) { return second; @@ -268,6 +311,9 @@ public static Throwable unwrap(Throwable t, Class... clazzes) { /** * Throws the specified exception. If null if specified then true is returned. + * + * @param e the exception + * @return the re throw if not null */ public static boolean reThrowIfNotNull(@Nullable Throwable e) { if (e != null) { @@ -280,6 +326,14 @@ public static boolean reThrowIfNotNull(@Nullable Throwable e) { return true; } + /** + * Unwraps the causes and suppressed. + * + * @param the element type + * @param cause the cause + * @param predicate the predicate + * @return this instance + */ @SuppressWarnings("unchecked") public static Optional unwrapCausesAndSuppressed(Throwable cause, Predicate predicate) { if (predicate.test(cause)) { @@ -317,6 +371,9 @@ public static Optional maybeError(final Throwable cause) { /** * Deduplicate the failures by exception message and index. + * + * @param failures the failures + * @return the group by */ public static ShardOperationFailedException[] groupBy(ShardOperationFailedException[] failures) { List uniqueFailures = new ArrayList<>(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchException.java b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchException.java index ab19568e..abb9ad38 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchException.java @@ -75,6 +75,9 @@ @PublicApi(since = "1.0.0") public class OpenSearchException extends RuntimeException implements Writeable, ToXContentFragment { + /** + * The UNKNOWN_VERSION_ADDED constant. + */ protected static final Version UNKNOWN_VERSION_ADDED = Version.fromId(0); /** @@ -89,6 +92,9 @@ public class OpenSearchException extends RuntimeException implements Writeable, * internal only and not available as a URL parameter. Use the {@code error_trace} parameter instead. */ public static final String REST_EXCEPTION_SKIP_STACK_TRACE = "rest.exception.stacktrace.skip"; + /** + * The REST_EXCEPTION_SKIP_STACK_TRACE_DEFAULT constant. + */ public static final boolean REST_EXCEPTION_SKIP_STACK_TRACE_DEFAULT = true; private static final boolean REST_EXCEPTION_SKIP_CAUSE_DEFAULT = false; private static final String RESOURCE_METADATA_TYPE_KEY = "opensearch.resource.type"; @@ -96,18 +102,30 @@ public class OpenSearchException extends RuntimeException implements Writeable, private static final String INDEX_METADATA_KEY = "opensearch.index"; private static final String INDEX_METADATA_KEY_UUID = "opensearch.index_uuid"; private static final String SHARD_METADATA_KEY = "opensearch.shard"; + /** + * The OPENSEARCH_PREFIX_KEY constant. + */ public static final String OPENSEARCH_PREFIX_KEY = "opensearch."; private static final String TYPE = "type"; private static final String REASON = "reason"; private static final String CAUSED_BY = "caused_by"; private static final ParseField SUPPRESSED = new ParseField("suppressed"); + /** + * The STACK_TRACE constant. + */ public static final String STACK_TRACE = "stack_trace"; private static final String HEADER = "header"; private static final String ERROR = "error"; private static final String ROOT_CAUSE = "root_cause"; + /** + * The metadata. + */ protected final Map> metadata = new HashMap<>(); + /** + * The headers. + */ protected final Map> headers = new HashMap<>(); static { @@ -163,6 +181,8 @@ public class OpenSearchException extends RuntimeException implements Writeable, /** * Construct a OpenSearchException with the specified cause exception. + * + * @param cause the cause */ public OpenSearchException(Throwable cause) { super(cause); @@ -196,6 +216,12 @@ public OpenSearchException(String msg, Throwable cause, Object... args) { super(LoggerMessageFormat.format(msg, args), cause); } + /** + * Creates a new OpenSearchException by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public OpenSearchException(StreamInput in) throws IOException { this(in.readOptionalString(), in.readException()); readStackTrace(this, in); @@ -215,6 +241,9 @@ public void writeTo(final StreamOutput out) throws IOException { /** * Adds a new piece of metadata with the given key. * If the provided key is already present, the corresponding metadata will be replaced + * + * @param key the key + * @param values the values */ public void addMetadata(String key, String... values) { addMetadata(key, Arrays.asList(values)); @@ -223,6 +252,9 @@ public void addMetadata(String key, String... values) { /** * Adds a new piece of metadata with the given key. * If the provided key is already present, the corresponding metadata will be replaced + * + * @param key the key + * @param values the values */ public void addMetadata(String key, List values) { // we need to enforce this otherwise bw comp doesn't work properly, as "opensearch." @@ -235,6 +267,8 @@ public void addMetadata(String key, List values) { /** * Returns a set of all metadata keys on this exception + * + * @return the metadata keys */ public Set getMetadataKeys() { return metadata.keySet(); @@ -243,6 +277,9 @@ public Set getMetadataKeys() { /** * Returns the list of metadata values for the given key or {@code null} if no metadata for the * given key exists. + * + * @param key the key + * @return the metadata */ public List getMetadata(String key) { return metadata.get(key); @@ -250,6 +287,8 @@ public List getMetadata(String key) { /** * Returns the map of metadata keys and values. + * + * @return the metadata */ public Map> getMetadata() { return metadata; @@ -258,6 +297,9 @@ public Map> getMetadata() { /** * Adds a new header with the given key. * This method will replace existing header if a header with the same key already exists + * + * @param key the key + * @param value the value */ public void addHeader(String key, List value) { // we need to enforce this otherwise bw comp doesn't work properly, as "opensearch." @@ -271,6 +313,9 @@ public void addHeader(String key, List value) { /** * Adds a new header with the given key. * This method will replace existing header if a header with the same key already exists + * + * @param key the key + * @param value the value */ public void addHeader(String key, String... value) { addHeader(key, Arrays.asList(value)); @@ -278,6 +323,8 @@ public void addHeader(String key, String... value) { /** * Returns a set of all header keys on this exception + * + * @return the header keys */ public Set getHeaderKeys() { return headers.keySet(); @@ -286,6 +333,9 @@ public Set getHeaderKeys() { /** * Returns the list of header values for the given key or {@code null} if no header for the * given key exists. + * + * @param key the key + * @return the header */ public List getHeader(String key) { return headers.get(key); @@ -293,6 +343,8 @@ public List getHeader(String key) { /** * Returns the map of header keys and values. + * + * @return the headers */ public Map> getHeaders() { return headers; @@ -300,6 +352,8 @@ public Map> getHeaders() { /** * Returns the rest status code associated with this exception. + * + * @return the status */ public RestStatus status() { Throwable cause = unwrapCause(); @@ -314,6 +368,7 @@ public RestStatus status() { * Unwraps the actual cause from the exception for cases when the exception is a * {@link OpenSearchWrapperException}. * + * @return this instance * @see ExceptionsHelper#unwrapCause(Throwable) */ public Throwable unwrapCause() { @@ -323,6 +378,8 @@ public Throwable unwrapCause() { /** * Return the detail message, including the message from the nested exception * if there is one. + * + * @return the detailed message */ public String getDetailedMessage() { if (getCause() != null) { @@ -341,6 +398,8 @@ public String getDetailedMessage() { /** * Retrieve the innermost cause of this exception, if none, returns the current exception. + * + * @return the root cause */ public Throwable getRootCause() { Throwable rootCause = this; @@ -352,6 +411,15 @@ public Throwable getRootCause() { return rootCause; } + /** + * Reads the exception. + * + * @param the element type + * @param input the input + * @param id the identifier + * @return the exception + * @throws IOException if an I/O error occurs + */ @SuppressWarnings("unchecked") public static OpenSearchException readException(T input, int id) throws IOException { CheckedFunction opensearchException = (CheckedFunction< @@ -366,6 +434,10 @@ public static OpenSearchException readException(T input, /** * Returns true iff the given class is a registered for an exception to be read. + * + * @param exception the exception + * @param version the version + * @return the registered flag */ public static boolean isRegistered(final Class exception, Version version) { return OpenSearchExceptionHandleRegistry.isRegistered(exception, version); @@ -377,6 +449,9 @@ static Set> getRegisteredKeys() { // for te /** * Returns the serialization id the given exception. + * + * @param exception the exception + * @return the identifier */ public static int getId(final Class exception) { return OpenSearchExceptionHandleRegistry.getId(exception); @@ -392,6 +467,19 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Performs the inner to XContent step. + * + * @param builder the content builder + * @param params the serialization parameters + * @param throwable the throwable + * @param type the type + * @param message the message + * @param headers the headers + * @param metadata the metadata + * @param cause the cause + * @throws IOException if an I/O error occurs + */ protected static void innerToXContent( XContentBuilder builder, ToXContent.Params params, @@ -446,6 +534,14 @@ protected static void innerToXContent( } } + /** + * Performs the header to XContent step. + * + * @param builder the content builder + * @param key the key + * @param values the values + * @throws IOException if an I/O error occurs + */ protected static void headerToXContent(XContentBuilder builder, String key, List values) throws IOException { if (values != null && values.isEmpty() == false) { if (values.size() == 1) { @@ -462,6 +558,10 @@ protected static void headerToXContent(XContentBuilder builder, String key, List /** * Renders additional per exception information into the XContent + * + * @param builder the content builder + * @param params the serialization parameters + * @throws IOException if an I/O error occurs */ protected void metadataToXContent(XContentBuilder builder, Params params) throws IOException {} @@ -471,6 +571,10 @@ protected void metadataToXContent(XContentBuilder builder, Params params) throws * the type, the reason and the cause of the exception. It also recursively parses the * tree structure of the cause, returning it as a tree structure of {@link OpenSearchException} * instances. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs */ public static OpenSearchException fromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.nextToken(); @@ -478,6 +582,14 @@ public static OpenSearchException fromXContent(XContentParser parser) throws IOE return innerFromXContent(parser, false); } + /** + * Returns the inner from XContent. + * + * @param parser the parser + * @param parseRootCauses the parse root causes + * @return the inner from XContent + * @throws IOException if an I/O error occurs + */ public static OpenSearchException innerFromXContent(XContentParser parser, boolean parseRootCauses) throws IOException { XContentParser.Token token = parser.currentToken(); ensureExpectedToken(XContentParser.Token.FIELD_NAME, token, parser); @@ -597,6 +709,11 @@ public static OpenSearchException innerFromXContent(XContentParser parser, boole *

* This method is usually used when the {@link Throwable} is rendered as a part of another XContent object, and its result can * be parsed back using the {@code OpenSearchException.fromXContent(XContentParser)} method. + * + * @param builder the content builder + * @param params the serialization parameters + * @param t the t + * @throws IOException if an I/O error occurs */ public static void generateThrowableXContent(XContentBuilder builder, ToXContent.Params params, Throwable t) throws IOException { t = ExceptionsHelper.unwrapCause(t); @@ -616,6 +733,12 @@ public static void generateThrowableXContent(XContentBuilder builder, ToXContent *

* This method is usually used when the {@link Exception} is rendered as a full XContent object, and its output can be parsed * by the {@code #OpenSearchException.failureFromXContent(XContentParser)} method. + * + * @param builder the content builder + * @param params the serialization parameters + * @param e the exception + * @param detailed the detailed + * @throws IOException if an I/O error occurs */ public static void generateFailureXContent(XContentBuilder builder, ToXContent.Params params, @Nullable Exception e, boolean detailed) throws IOException { @@ -650,6 +773,10 @@ public static void generateFailureXContent(XContentBuilder builder, ToXContent.P /** * Parses the output of {@link #generateFailureXContent(XContentBuilder, Params, Exception, boolean)} + * + * @param parser the parser + * @return the failure from XContent + * @throws IOException if an I/O error occurs */ public static OpenSearchException failureFromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); @@ -670,6 +797,8 @@ public static OpenSearchException failureFromXContent(XContentParser parser) thr /** * Returns the root cause of this exception or multiple if different shards caused different exceptions + * + * @return the guess root causes */ public OpenSearchException[] guessRootCauses() { final Throwable cause = getCause(); @@ -683,6 +812,9 @@ public OpenSearchException[] guessRootCauses() { * Returns the root cause of this exception or multiple if different shards caused different exceptions. * If the given exception is not an instance of {@link OpenSearchException} an empty array * is returned. + * + * @param t the t + * @return the guess root causes */ public static OpenSearchException[] guessRootCauses(Throwable t) { Throwable ex = ExceptionsHelper.unwrapCause(t); @@ -714,12 +846,20 @@ protected String getExceptionName() { } }; } + /** + * Returns the exception name. + * + * @return the exception name + */ protected String getExceptionName() { return getExceptionName(this); } /** * Returns an underscore case name for the given exception. This method strips {@code OpenSearch} prefixes from exception names. + * + * @param ex the ex + * @return the exception name */ public static String getExceptionName(Throwable ex) { String simpleName = getExceptionSimpleClassName(ex); @@ -730,6 +870,12 @@ public static String getExceptionName(Throwable ex) { return toUnderscoreCase(simpleName); } + /** + * Returns the exception simple class name. + * + * @param ex the ex + * @return the exception simple class name + */ public static String getExceptionSimpleClassName(final Throwable ex) { String simpleName = ex.getClass().getSimpleName(); if (Strings.isEmpty(simpleName)) { @@ -765,6 +911,12 @@ public String toString() { /** * Deserializes stacktrace elements as well as suppressed exceptions from the given output stream and * adds it to the given exception. + * + * @param the element type + * @param throwable the throwable + * @param in the input to read from + * @return the stack trace + * @throws IOException if an I/O error occurs */ public static T readStackTrace(T throwable, StreamInput in) throws IOException { throwable.setStackTrace(in.readArray(i -> { @@ -784,6 +936,14 @@ public static T readStackTrace(T throwable, StreamInput in /** * Serializes the given exceptions stacktrace elements as well as it's suppressed exceptions to the given output stream. + * + * @param the source type + * @param the element type + * @param throwable the throwable + * @param out the output to write to + * @param exceptionWriter the exception writer + * @return this instance + * @throws IOException if an I/O error occurs */ public static T writeStackTraces( T throwable, @@ -800,16 +960,32 @@ public static T writeStackTraces( return throwable; } + /** + * Sets the resources. + * + * @param type the type + * @param id the identifier + */ public void setResources(String type, String... id) { assert type != null; addMetadata(RESOURCE_METADATA_ID_KEY, id); addMetadata(RESOURCE_METADATA_TYPE_KEY, type); } + /** + * Returns the resource identifier. + * + * @return the resource identifier + */ public List getResourceId() { return getMetadata(RESOURCE_METADATA_ID_KEY); } + /** + * Returns the resource type. + * + * @return the resource type + */ public String getResourceType() { List header = getMetadata(RESOURCE_METADATA_TYPE_KEY); if (header != null && header.isEmpty() == false) { @@ -879,6 +1055,11 @@ static Tuple>[] classes() { return ts; } + /** + * Returns the index. + * + * @return the index + */ public Index getIndex() { List index = getMetadata(INDEX_METADATA_KEY); if (index != null && index.isEmpty() == false) { @@ -889,6 +1070,11 @@ public Index getIndex() { return null; } + /** + * Sets the index. + * + * @param index the index + */ public void setIndex(Index index) { if (index != null) { addMetadata(INDEX_METADATA_KEY, index.getName()); @@ -896,12 +1082,22 @@ public void setIndex(Index index) { } } + /** + * Sets the index. + * + * @param index the index + */ public void setIndex(String index) { if (index != null) { setIndex(new Index(index, Strings.UNKNOWN_UUID_VALUE)); } } + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public ShardId getShardId() { List shard = getMetadata(SHARD_METADATA_KEY); if (shard != null && shard.isEmpty() == false) { @@ -910,6 +1106,11 @@ public ShardId getShardId() { return null; } + /** + * Sets the shard. + * + * @param shardId the shard identifier + */ public void setShard(ShardId shardId) { if (shardId != null) { setIndex(shardId.getIndex()); @@ -952,6 +1153,12 @@ OpenSearchExceptionHandle( * @opensearch.internal */ public static class OpenSearchExceptionHandleRegistry { + /** + * Creates a new OpenSearchExceptionHandleRegistry. + */ + public OpenSearchExceptionHandleRegistry() { + } + /** Registry mapping from unique Ordinal to the Exception Constructor */ private static final Map< Integer, @@ -961,33 +1168,61 @@ public static class OpenSearchExceptionHandleRegistry { Class, OpenSearchExceptionHandle> CLASS_TO_OPENSEARCH_EXCEPTION_HANDLE_REGISTRY = new ConcurrentHashMap<>(); - /** returns the Exception constructor function from a given ordinal */ + /** + * returns the Exception constructor function from a given ordinal + * + * @param id the identifier + * @return the supplier + */ public static CheckedFunction getSupplier(final int id) { return ID_TO_SUPPLIER_REGISTRY.get(id); } - /** registers the Exception handler */ + /** + * registers the Exception handler + * + * @param handle the handle + */ public static void registerExceptionHandle(final OpenSearchExceptionHandle handle) { ID_TO_SUPPLIER_REGISTRY.put(handle.id, handle.constructor); CLASS_TO_OPENSEARCH_EXCEPTION_HANDLE_REGISTRY.put(handle.exceptionClass, handle); } - /** Gets the unique ordinal id of the Exception from the given class */ + /** + * Gets the unique ordinal id of the Exception from the given class + * + * @param exception the exception + * @return the identifier + */ public static int getId(final Class exception) { return CLASS_TO_OPENSEARCH_EXCEPTION_HANDLE_REGISTRY.get(exception).id; } - /** returns a set of ids */ + /** + * returns a set of ids + * + * @return the identifiers + */ public static Set ids() { return ID_TO_SUPPLIER_REGISTRY.keySet(); } - /** returns a collection of handles */ + /** + * returns a collection of handles + * + * @return the handles + */ public static Collection handles() { return CLASS_TO_OPENSEARCH_EXCEPTION_HANDLE_REGISTRY.values(); } - /** checks that the exception class is registered */ + /** + * checks that the exception class is registered + * + * @param exception the exception + * @param version the version + * @return the registered flag + */ public static boolean isRegistered(final Class exception, final Version version) { OpenSearchExceptionHandle openSearchExceptionHandle = CLASS_TO_OPENSEARCH_EXCEPTION_HANDLE_REGISTRY.get(exception); if (openSearchExceptionHandle != null) { @@ -996,7 +1231,11 @@ public static boolean isRegistered(final Class exception, f return false; } - /** returns a set of registered exception classes */ + /** + * returns a set of registered exception classes + * + * @return the registered keys + */ public static Set> getRegisteredKeys() { // for testing return CLASS_TO_OPENSEARCH_EXCEPTION_HANDLE_REGISTRY.keySet(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchGenerationException.java b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchGenerationException.java index 198e24ab..70f05197 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchGenerationException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchGenerationException.java @@ -45,10 +45,21 @@ @PublicApi(since = "1.0.0") public class OpenSearchGenerationException extends OpenSearchException { + /** + * Creates a new OpenSearchGenerationException. + * + * @param msg the msg + */ public OpenSearchGenerationException(String msg) { super(msg); } + /** + * Creates a new OpenSearchGenerationException. + * + * @param msg the msg + * @param cause the cause + */ public OpenSearchGenerationException(String msg, Throwable cause) { super(msg, cause); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchParseException.java b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchParseException.java index a41f0105..038bee25 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchParseException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchParseException.java @@ -46,14 +46,33 @@ @PublicApi(since = "1.0.0") public class OpenSearchParseException extends OpenSearchException { + /** + * Creates a new OpenSearchParseException. + * + * @param msg the msg + * @param args the args + */ public OpenSearchParseException(String msg, Object... args) { super(msg, args); } + /** + * Creates a new OpenSearchParseException. + * + * @param msg the msg + * @param cause the cause + * @param args the args + */ public OpenSearchParseException(String msg, Throwable cause, Object... args) { super(msg, cause, args); } + /** + * Creates a new OpenSearchParseException by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public OpenSearchParseException(StreamInput in) throws IOException { super(in); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchStatusException.java b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchStatusException.java index 265e0984..0265178a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchStatusException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchStatusException.java @@ -45,10 +45,18 @@ * @opensearch.internal */ public class OpenSearchStatusException extends OpenSearchException { + /** + * The status. + */ private final RestStatus status; /** * Build the exception with a specific status and cause. + * + * @param msg the msg + * @param status the status + * @param cause the cause + * @param args the args */ public OpenSearchStatusException(String msg, RestStatus status, Throwable cause, Object... args) { super(msg, cause, args); diff --git a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchTimeoutException.java b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchTimeoutException.java index c615d21c..18773795 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchTimeoutException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchTimeoutException.java @@ -44,6 +44,11 @@ */ public class OpenSearchTimeoutException extends OpenSearchException { + /** + * Creates a new OpenSearchTimeoutException. + * + * @param cause the cause + */ public OpenSearchTimeoutException(Throwable cause) { super(cause); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchWrapperException.java b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchWrapperException.java index 202901d6..46c67bee 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/OpenSearchWrapperException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/OpenSearchWrapperException.java @@ -40,5 +40,10 @@ * @opensearch.internal */ public interface OpenSearchWrapperException { + /** + * Returns the cause. + * + * @return the cause + */ Throwable getCause(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/ResourceNotFoundException.java b/src/main/java/org/codelibs/fesen/opensearch/ResourceNotFoundException.java index 2711657b..829104de 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/ResourceNotFoundException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/ResourceNotFoundException.java @@ -43,10 +43,23 @@ */ public class ResourceNotFoundException extends OpenSearchException { + /** + * Creates a new ResourceNotFoundException. + * + * @param msg the msg + * @param args the args + */ public ResourceNotFoundException(String msg, Object... args) { super(msg, args); } + /** + * Creates a new ResourceNotFoundException. + * + * @param msg the msg + * @param cause the cause + * @param args the args + */ public ResourceNotFoundException(String msg, Throwable cause, Object... args) { super(msg, cause, args); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/Version.java b/src/main/java/org/codelibs/fesen/opensearch/Version.java index d9c88b59..682feca1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/Version.java +++ b/src/main/java/org/codelibs/fesen/opensearch/Version.java @@ -61,6 +61,9 @@ public class Version implements Comparable, ToXContentFragment { * Exception thrown when an unsupported version ID is encountered. */ public static class UnsupportedVersionException extends RuntimeException { + /** + * The version string. + */ private final String versionString; private UnsupportedVersionException(int versionId) { @@ -68,6 +71,11 @@ private UnsupportedVersionException(int versionId) { this.versionString = legacyFriendlyIdToString(versionId); } + /** + * Returns the version string. + * + * @return the version string + */ public String getVersionString() { return versionString; } @@ -108,75 +116,270 @@ private static String legacyFriendlyIdToString(int versionId) { * The unreleased last minor is the current major with a upped minor: 2._5_.0 * The unreleased revision is the very release with a upped revision 2.4._1_ */ + /** + * The V_EMPTY_ID constant. + */ public static final int V_EMPTY_ID = 0; + /** + * The V_EMPTY constant. + */ public static final Version V_EMPTY = new Version(V_EMPTY_ID, org.apache.lucene.util.Version.LATEST); // RELEASED + /** + * The V_2_0_0 constant. + */ public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0); + /** + * The V_2_0_1 constant. + */ public static final Version V_2_0_1 = new Version(2000199, org.apache.lucene.util.Version.LUCENE_9_1_0); + /** + * The V_2_1_0 constant. + */ public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_2_0); + /** + * The V_2_2_0 constant. + */ public static final Version V_2_2_0 = new Version(2020099, org.apache.lucene.util.Version.LUCENE_9_3_0); + /** + * The V_2_2_1 constant. + */ public static final Version V_2_2_1 = new Version(2020199, org.apache.lucene.util.Version.LUCENE_9_3_0); + /** + * The V_2_3_0 constant. + */ public static final Version V_2_3_0 = new Version(2030099, org.apache.lucene.util.Version.LUCENE_9_3_0); + /** + * The V_2_4_0 constant. + */ public static final Version V_2_4_0 = new Version(2040099, org.apache.lucene.util.Version.LUCENE_9_4_1); + /** + * The V_2_4_1 constant. + */ public static final Version V_2_4_1 = new Version(2040199, org.apache.lucene.util.Version.LUCENE_9_4_2); + /** + * The V_2_5_0 constant. + */ public static final Version V_2_5_0 = new Version(2050099, org.apache.lucene.util.Version.LUCENE_9_4_2); + /** + * The V_2_5_1 constant. + */ public static final Version V_2_5_1 = new Version(2050199, org.apache.lucene.util.Version.LUCENE_9_4_2); // UNRELEASED + /** + * The V_2_4_2 constant. + */ public static final Version V_2_4_2 = new Version(2040299, org.apache.lucene.util.Version.LUCENE_9_4_2); + /** + * The V_2_6_0 constant. + */ public static final Version V_2_6_0 = new Version(2060099, org.apache.lucene.util.Version.LUCENE_9_5_0); + /** + * The V_2_6_1 constant. + */ public static final Version V_2_6_1 = new Version(2060199, org.apache.lucene.util.Version.LUCENE_9_5_0); + /** + * The V_2_7_0 constant. + */ public static final Version V_2_7_0 = new Version(2070099, org.apache.lucene.util.Version.LUCENE_9_5_0); + /** + * The V_2_7_1 constant. + */ public static final Version V_2_7_1 = new Version(2070199, org.apache.lucene.util.Version.LUCENE_9_5_0); + /** + * The V_2_8_0 constant. + */ public static final Version V_2_8_0 = new Version(2080099, org.apache.lucene.util.Version.LUCENE_9_6_0); + /** + * The V_2_8_1 constant. + */ public static final Version V_2_8_1 = new Version(2080199, org.apache.lucene.util.Version.LUCENE_9_6_0); + /** + * The V_2_9_0 constant. + */ public static final Version V_2_9_0 = new Version(2090099, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_9_1 constant. + */ public static final Version V_2_9_1 = new Version(2090199, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_10_0 constant. + */ public static final Version V_2_10_0 = new Version(2100099, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_10_1 constant. + */ public static final Version V_2_10_1 = new Version(2100199, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_11_0 constant. + */ public static final Version V_2_11_0 = new Version(2110099, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_11_1 constant. + */ public static final Version V_2_11_1 = new Version(2110199, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_11_2 constant. + */ public static final Version V_2_11_2 = new Version(2110299, org.apache.lucene.util.Version.LUCENE_9_7_0); + /** + * The V_2_12_0 constant. + */ public static final Version V_2_12_0 = new Version(2120099, org.apache.lucene.util.Version.LUCENE_9_9_2); + /** + * The V_2_12_1 constant. + */ public static final Version V_2_12_1 = new Version(2120199, org.apache.lucene.util.Version.LUCENE_9_9_2); + /** + * The V_2_13_0 constant. + */ public static final Version V_2_13_0 = new Version(2130099, org.apache.lucene.util.Version.LUCENE_9_10_0); + /** + * The V_2_13_1 constant. + */ public static final Version V_2_13_1 = new Version(2130199, org.apache.lucene.util.Version.LUCENE_9_10_0); + /** + * The V_2_14_0 constant. + */ public static final Version V_2_14_0 = new Version(2140099, org.apache.lucene.util.Version.LUCENE_9_10_0); + /** + * The V_2_14_1 constant. + */ public static final Version V_2_14_1 = new Version(2140199, org.apache.lucene.util.Version.LUCENE_9_10_0); + /** + * The V_2_15_0 constant. + */ public static final Version V_2_15_0 = new Version(2150099, org.apache.lucene.util.Version.LUCENE_9_10_0); + /** + * The V_2_15_1 constant. + */ public static final Version V_2_15_1 = new Version(2150199, org.apache.lucene.util.Version.LUCENE_9_10_0); + /** + * The V_2_16_0 constant. + */ public static final Version V_2_16_0 = new Version(2160099, org.apache.lucene.util.Version.LUCENE_9_11_1); + /** + * The V_2_16_1 constant. + */ public static final Version V_2_16_1 = new Version(2160199, org.apache.lucene.util.Version.LUCENE_9_11_1); + /** + * The V_2_17_0 constant. + */ public static final Version V_2_17_0 = new Version(2170099, org.apache.lucene.util.Version.LUCENE_9_11_1); + /** + * The V_2_17_1 constant. + */ public static final Version V_2_17_1 = new Version(2170199, org.apache.lucene.util.Version.LUCENE_9_11_1); + /** + * The V_2_17_2 constant. + */ public static final Version V_2_17_2 = new Version(2170299, org.apache.lucene.util.Version.LUCENE_9_11_1); + /** + * The V_2_18_0 constant. + */ public static final Version V_2_18_0 = new Version(2180099, org.apache.lucene.util.Version.LUCENE_9_12_0); + /** + * The V_2_18_1 constant. + */ public static final Version V_2_18_1 = new Version(2180199, org.apache.lucene.util.Version.LUCENE_9_12_1); + /** + * The V_2_19_0 constant. + */ public static final Version V_2_19_0 = new Version(2190099, org.apache.lucene.util.Version.LUCENE_9_12_1); + /** + * The V_2_19_1 constant. + */ public static final Version V_2_19_1 = new Version(2190199, org.apache.lucene.util.Version.LUCENE_9_12_1); + /** + * The V_2_19_2 constant. + */ public static final Version V_2_19_2 = new Version(2190299, org.apache.lucene.util.Version.LUCENE_9_12_1); + /** + * The V_2_19_3 constant. + */ public static final Version V_2_19_3 = new Version(2190399, org.apache.lucene.util.Version.LUCENE_9_12_2); + /** + * The V_2_19_4 constant. + */ public static final Version V_2_19_4 = new Version(2190499, org.apache.lucene.util.Version.LUCENE_9_12_3); + /** + * The V_2_19_5 constant. + */ public static final Version V_2_19_5 = new Version(2190599, org.apache.lucene.util.Version.LUCENE_9_12_3); + /** + * The V_2_19_6 constant. + */ public static final Version V_2_19_6 = new Version(2190699, org.apache.lucene.util.Version.LUCENE_9_12_3); + /** + * The V_3_0_0 constant. + */ public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_10_1_0); + /** + * The V_3_1_0 constant. + */ public static final Version V_3_1_0 = new Version(3010099, org.apache.lucene.util.Version.LUCENE_10_2_1); + /** + * The V_3_2_0 constant. + */ public static final Version V_3_2_0 = new Version(3020099, org.apache.lucene.util.Version.LUCENE_10_2_2); + /** + * The V_3_3_0 constant. + */ public static final Version V_3_3_0 = new Version(3030099, org.apache.lucene.util.Version.LUCENE_10_3_1); + /** + * The V_3_3_1 constant. + */ public static final Version V_3_3_1 = new Version(3030199, org.apache.lucene.util.Version.LUCENE_10_3_1); + /** + * The V_3_3_2 constant. + */ public static final Version V_3_3_2 = new Version(3030299, org.apache.lucene.util.Version.LUCENE_10_3_1); + /** + * The V_3_4_0 constant. + */ public static final Version V_3_4_0 = new Version(3040099, org.apache.lucene.util.Version.LUCENE_10_3_2); + /** + * The V_3_5_0 constant. + */ public static final Version V_3_5_0 = new Version(3050099, org.apache.lucene.util.Version.LUCENE_10_3_2); + /** + * The V_3_5_1 constant. + */ public static final Version V_3_5_1 = new Version(3050199, org.apache.lucene.util.Version.LUCENE_10_3_2); + /** + * The V_3_6_0 constant. + */ public static final Version V_3_6_0 = new Version(3060099, org.apache.lucene.util.Version.LUCENE_10_4_0); + /** + * The V_3_6_1 constant. + */ public static final Version V_3_6_1 = new Version(3060199, org.apache.lucene.util.Version.LUCENE_10_4_0); + /** + * The V_3_7_0 constant. + */ public static final Version V_3_7_0 = new Version(3070099, org.apache.lucene.util.Version.LUCENE_10_4_0); + /** + * The V_3_7_1 constant. + */ public static final Version V_3_7_1 = new Version(3070199, org.apache.lucene.util.Version.LUCENE_10_4_0); + /** + * The V_3_8_0 constant. + */ public static final Version V_3_8_0 = new Version(3080099, org.apache.lucene.util.Version.LUCENE_10_5_0); + /** + * The CURRENT constant. + */ public static final Version CURRENT = V_3_8_0; + /** + * The identifier to version. + */ protected static final Map idToVersion; + /** + * The string to version. + */ protected static final Map stringToVersion; static { final Map builder = new HashMap<>(); @@ -246,6 +449,12 @@ private static String legacyFriendlyIdToString(int versionId) { stringToVersion = Map.copyOf(builderByString); } + /** + * Creates an instance from identifier. + * + * @param id the identifier + * @return the new identifier + */ public static Version fromId(int id) { if (id != 0 && (id & MASK) == 0) { throw new UnsupportedVersionException(id); @@ -285,6 +494,10 @@ private static Version fromIdSlow(int id) { /** * Returns the minimum version between the 2. + * + * @param version1 the version1 + * @param version2 the version2 + * @return the min */ public static Version min(Version version1, Version version2) { return version1.id < version2.id ? version1 : version2; @@ -292,6 +505,10 @@ public static Version min(Version version1, Version version2) { /** * Returns the maximum version between the 2 + * + * @param version1 the version1 + * @param version2 the version2 + * @return the max */ public static Version max(Version version1, Version version2) { return version1.id > version2.id ? version1 : version2; @@ -299,6 +516,9 @@ public static Version max(Version version1, Version version2) { /** * Returns the version given its string representation, current version if the argument is null or empty + * + * @param version the version + * @return the new string */ public static Version fromString(String version) { if (Strings.hasLength(version) == false) { @@ -355,12 +575,33 @@ private static Version fromStringSlow(String version) { } } + /** + * The MASK constant. + */ public static final int MASK = 0x08000000; + /** + * The identifier. + */ public final int id; + /** + * The major. + */ public final byte major; + /** + * The minor. + */ public final byte minor; + /** + * The revision. + */ public final byte revision; + /** + * The build. + */ public final byte build; + /** + * The lucene version. + */ public final org.apache.lucene.util.Version luceneVersion; Version(int id, org.apache.lucene.util.Version luceneVersion) { @@ -381,18 +622,42 @@ private static Version fromStringSlow(String version) { this.minIndexCompatVersion = null; } + /** + * Returns the after. + * + * @param version the version + * @return the after + */ public boolean after(Version version) { return version.id < id; } + /** + * Handles the or after event. + * + * @param version the version + * @return the on or after + */ public boolean onOrAfter(Version version) { return version.id <= id; } + /** + * Returns the before. + * + * @param version the version + * @return the before + */ public boolean before(Version version) { return version.id > id; } + /** + * Handles the or before event. + * + * @param version the version + * @return the on or before + */ public boolean onOrBefore(Version version) { return version.id >= id; } @@ -418,10 +683,16 @@ static class DeclaredVersionsHolder { // lazy initialized because we don't yet have the declared versions ready when instantiating the cached Version // instances + /** + * The min compat version. + */ protected Version minCompatVersion = null; // lazy initialized because we don't yet have the declared versions ready when instantiating the cached Version // instances + /** + * The min index compat version. + */ protected Version minIndexCompatVersion = null; /** @@ -430,6 +701,8 @@ static class DeclaredVersionsHolder { * to communicate with a node running the current version. The returned version * is in most of the cases the smallest major version release unless the current version * is a beta or RC release then the version itself is returned. + * + * @return the minimum compatibility version */ public Version minimumCompatibilityVersion() { Version res = minCompatVersion; @@ -440,6 +713,11 @@ public Version minimumCompatibilityVersion() { return res; } + /** + * Computes the min compat version. + * + * @return the min compat version + */ protected Version computeMinCompatVersion() { if (major >= 3) { // all major versions from 3 onwards are compatible with last minor series of the previous major @@ -462,6 +740,9 @@ protected Version computeMinCompatVersion() { /** * this is used to ensure the version id for new versions of OpenSearch are always less than the predecessor versions + * + * @param id the identifier + * @return the mask identifier */ protected int maskId(final int id) { return MASK ^ id; @@ -471,6 +752,8 @@ protected int maskId(final int id) { * Returns the minimum created index version that this version supports. Indices created with lower versions * can't be used with this version. This should also be used for file based serialization backwards compatibility ie. on serialization * code that is used to read / write file formats like transaction logs, cluster state, and index metadata. + * + * @return the minimum index compatibility version */ public Version minimumIndexCompatibilityVersion() { Version res = minIndexCompatVersion; @@ -481,6 +764,11 @@ public Version minimumIndexCompatibilityVersion() { return res; } + /** + * Computes the min index compat version. + * + * @return the min index compat version + */ protected Version computeMinIndexCompatVersion() { final int bwcMajor = major - 1; final int bwcMinor = 0; @@ -527,6 +815,11 @@ public int hashCode() { return id; } + /** + * Returns the beta flag. + * + * @return the beta flag + */ public boolean isBeta() { return build >= 25 && build < 50; } @@ -535,11 +828,18 @@ public boolean isBeta() { * Returns true iff this version is an alpha version * Note: This has been introduced in version 5 of the OpenSearch predecessor. Previous versions will never * have an alpha version. + * + * @return the alpha flag */ public boolean isAlpha() { return build < 25; } + /** + * Returns the release flag. + * + * @return the release flag + */ public boolean isRelease() { return build == 99; } @@ -548,6 +848,9 @@ public boolean isRelease() { * Extracts a sorted list of declared version constants from a class. * The argument would normally be Version.class but is exposed for * testing with other classes-containing-version-constants. + * + * @param versionClass the version class + * @return the declared versions */ public static List getDeclaredVersions(final Class versionClass) { final Field[] fields = versionClass.getFields(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequest.java index 12199f2c..7874bd20 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequest.java @@ -47,6 +47,9 @@ @PublicApi(since = "1.0.0") public abstract class ActionRequest extends TransportRequest { + /** + * Creates a new ActionRequest. + */ public ActionRequest() { super(); // this does not set the listenerThreaded API, if needed, its up to the caller to set it @@ -54,14 +57,27 @@ public ActionRequest() { // this.listenerThreaded = request.listenerThreaded(); } + /** + * Creates a new ActionRequest by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ActionRequest(StreamInput in) throws IOException { super(in); } + /** + * Validates this instance. + * + * @return this instance + */ public abstract ActionRequestValidationException validate(); /** * Should this task store its result after it has finished? + * + * @return the should store result */ public boolean getShouldStoreResult() { return false; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestBuilder.java index 807277fb..d67e8de9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestBuilder.java @@ -43,14 +43,32 @@ /** * Base Action Request Builder * + * @param the request type + * @param the response type * @opensearch.api */ public abstract class ActionRequestBuilder { + /** + * The action. + */ protected final ActionType action; + /** + * The request. + */ protected final Request request; + /** + * The client. + */ protected final OpenSearchClient client; + /** + * Creates a new ActionRequestBuilder. + * + * @param client the client + * @param action the action + * @param request the request + */ protected ActionRequestBuilder(OpenSearchClient client, ActionType action, Request request) { Objects.requireNonNull(action, "action must not be null"); this.action = action; @@ -58,16 +76,28 @@ protected ActionRequestBuilder(OpenSearchClient client, ActionType act this.client = client; } + /** + * Returns the request. + * + * @return the request + */ public Request request() { return this.request; } + /** + * Executes this instance. + * + * @return this instance + */ public ActionFuture execute() { return client.execute(action, request); } /** * Short version of execute().actionGet(). + * + * @return the value */ public Response get() { return execute().actionGet(); @@ -75,6 +105,9 @@ public Response get() { /** * Short version of execute().actionGet(). + * + * @param timeout the timeout + * @return the value */ public Response get(TimeValue timeout) { return execute().actionGet(timeout); @@ -82,11 +115,19 @@ public Response get(TimeValue timeout) { /** * Short version of execute().actionGet(). + * + * @param timeout the timeout + * @return the value */ public Response get(String timeout) { return execute().actionGet(timeout); } + /** + * Executes this instance. + * + * @param listener the listener + */ public void execute(ActionListener listener) { client.execute(action, request, listener); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestValidationException.java b/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestValidationException.java index f3f56367..fc0e6e85 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestValidationException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ActionRequestValidationException.java @@ -41,4 +41,10 @@ * @opensearch.api */ @PublicApi(since = "1.0.0") -public class ActionRequestValidationException extends ValidationException {} +public class ActionRequestValidationException extends ValidationException { + /** + * Creates a new ActionRequestValidationException. + */ + public ActionRequestValidationException() { + } +} diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ActionType.java b/src/main/java/org/codelibs/fesen/opensearch/action/ActionType.java index 1ca3ea1a..1af05498 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ActionType.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ActionType.java @@ -40,6 +40,7 @@ /** * A generic action. Should strive to make it a singleton. * + * @param the response type * @opensearch.api */ @PublicApi(since = "1.0.0") @@ -49,6 +50,8 @@ public class ActionType { private final Writeable.Reader responseReader; /** + * Creates a new ActionType. + * * @param name The name of the action, must be unique across actions. * @param responseReader A reader for the response type */ @@ -59,6 +62,8 @@ public ActionType(String name, Writeable.Reader responseReader) { /** * The name of the action. Must be unique across actions. + * + * @return the name */ public String name() { return this.name; @@ -66,6 +71,8 @@ public String name() { /** * Get a reader that can create a new instance of the class from a {@link StreamInput} + * + * @return the response reader */ public Writeable.Reader getResponseReader() { return responseReader; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/AliasesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/AliasesRequest.java index 97b20299..ef1a9acb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/AliasesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/AliasesRequest.java @@ -47,11 +47,15 @@ public interface AliasesRequest extends IndicesRequest.Replaceable { /** * Returns the array of aliases that the action relates to + * + * @return the aliases */ String[] aliases(); /** * Returns the aliases as they were originally requested, before any potential name resolution + * + * @return the original aliases */ String[] getOriginalAliases(); @@ -59,11 +63,15 @@ public interface AliasesRequest extends IndicesRequest.Replaceable { * Replaces current aliases with the provided aliases. *

* Sometimes aliases expressions need to be resolved to concrete aliases prior to executing the transport action. + * + * @param aliases the aliases */ void replaceAliases(String... aliases); /** * Returns true if wildcards expressions among aliases should be resolved, false otherwise + * + * @return this instance */ boolean expandAliasesWildcards(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteRequest.java index 3d2db606..10f3b22b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteRequest.java @@ -56,16 +56,21 @@ * Generic interface to group ActionRequest, which perform writes to a single document * Action requests implementing this can be part of {@link org.codelibs.fesen.opensearch.action.bulk.BulkRequest} * + * @param the element type * @opensearch.api */ @PublicApi(since = "1.0.0") public interface DocWriteRequest extends IndicesRequest, DocRequest, Accountable { // Flag set for disallowing index auto creation for an individual write request. + /** + * The require alias. + */ String REQUIRE_ALIAS = "require_alias"; /** * Set the index for this request + * @param index the index * @return the Request */ T index(String index); @@ -79,6 +84,7 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta /** * Set the routing for this request + * @param routing the routing value * @return the Request */ T routing(String routing); @@ -98,6 +104,9 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta /** * Sets the version, which will perform the operation only if a matching * version exists and no changes happened on the doc since then. + * + * @param version the version + * @return the version */ T version(long version); @@ -109,6 +118,9 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta /** * Sets the versioning type. Defaults to {@link VersionType#INTERNAL}. + * + * @param versionType the version type + * @return the version type */ T versionType(VersionType versionType); @@ -118,6 +130,9 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta * * If the document last modification was assigned a different sequence number a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @param seqNo the seq no + * @return this instance */ T setIfSeqNo(long seqNo); @@ -127,6 +142,9 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta * * If the document last modification was assigned a different term a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @param term the term + * @return this instance */ T setIfPrimaryTerm(long term); @@ -134,6 +152,8 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta * If set, only perform this request if the document was last modification was assigned this sequence number. * If the document last modification was assigned a different sequence number a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @return the if seq no */ long ifSeqNo(); @@ -142,6 +162,8 @@ public interface DocWriteRequest extends IndicesRequest, DocRequest, Accounta *

* If the document last modification was assigned a different term a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @return the if primary term */ long ifPrimaryTerm(); @@ -187,14 +209,30 @@ enum OpType { this.lowercase = this.toString().toLowerCase(Locale.ROOT); } + /** + * Returns the identifier. + * + * @return the identifier + */ public byte getId() { return op; } + /** + * Returns the lowercase. + * + * @return the lowercase + */ public String getLowercase() { return lowercase; } + /** + * Creates an instance from identifier. + * + * @param id the identifier + * @return the new identifier + */ public static OpType fromId(byte id) { switch (id) { case 0: @@ -210,6 +248,12 @@ public static OpType fromId(byte id) { } } + /** + * Creates an instance from string. + * + * @param sOpType the s op type + * @return the new string + */ public static OpType fromString(String sOpType) { String lowerCase = sOpType.toLowerCase(Locale.ROOT); for (OpType opType : OpType.values()) { @@ -226,6 +270,9 @@ public static OpType fromString(String sOpType) { * * @param shardId shard id of the request. {@code null} when reading as part of a {@link org.codelibs.fesen.opensearch.action.bulk.BulkRequest} * that does not have a unique shard id + * @param in the input to read from + * @return the document request + * @throws IOException if an I/O error occurs */ static DocWriteRequest readDocumentRequest(@Nullable ShardId shardId, StreamInput in) throws IOException { byte type = in.readByte(); @@ -261,7 +308,13 @@ static ActionRequestValidationException validateDocIdLength(String id, ActionReq return validationException; } - /** write a document write (index/delete/update) request*/ + /** + * write a document write (index/delete/update) request + * + * @param out the output to write to + * @param request the request + * @throws IOException if an I/O error occurs + */ static void writeDocumentRequest(StreamOutput out, DocWriteRequest request) throws IOException { switch (request) { case IndexRequest indexRequest -> { @@ -280,6 +333,13 @@ static void writeDocumentRequest(StreamOutput out, DocWriteRequest request) t } } + /** + * Validates the seq no based cas params. + * + * @param request the request + * @param validationException the validation exception + * @return this instance + */ static ActionRequestValidationException validateSeqNoBasedCASParams( DocWriteRequest request, ActionRequestValidationException validationException diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteResponse.java index 95c38eaa..4369ddac 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/DocWriteResponse.java @@ -86,10 +86,25 @@ public abstract class DocWriteResponse extends ReplicationResponse implements Wr */ @PublicApi(since = "1.0.0") public enum Result implements Writeable { + /** + * The CREATED value. + */ CREATED(0), + /** + * The UPDATED value. + */ UPDATED(1), + /** + * The DELETED value. + */ DELETED(2), + /** + * The NOT_FOUND value. + */ NOT_FOUND(3), + /** + * The NOOP value. + */ NOOP(4); private final byte op; @@ -100,10 +115,22 @@ public enum Result implements Writeable { this.lowercase = this.name().toLowerCase(Locale.ROOT); } + /** + * Returns the lowercase. + * + * @return the lowercase + */ public String getLowercase() { return lowercase; } + /** + * Reads this instance from the given input. + * + * @param in the input to read from + * @return the from + * @throws IOException if an I/O error occurs + */ public static Result readFrom(StreamInput in) throws IOException { Byte opcode = in.readByte(); switch (opcode) { @@ -134,8 +161,21 @@ public void writeTo(StreamOutput out) throws IOException { private final long seqNo; private final long primaryTerm; private boolean forcedRefresh; + /** + * The result. + */ protected final Result result; + /** + * Creates a new DocWriteResponse. + * + * @param shardId the shard identifier + * @param id the identifier + * @param seqNo the seq no + * @param primaryTerm the primary term + * @param version the version + * @param result the result + */ public DocWriteResponse(ShardId shardId, String id, long seqNo, long primaryTerm, long version, Result result) { this.shardId = Objects.requireNonNull(shardId); this.id = Objects.requireNonNull(id); @@ -146,6 +186,13 @@ public DocWriteResponse(ShardId shardId, String id, long seqNo, long primaryTerm } // needed for deserialization + /** + * Creates a new DocWriteResponse. + * + * @param shardId the shard identifier + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ protected DocWriteResponse(ShardId shardId, StreamInput in) throws IOException { super(in); this.shardId = shardId; @@ -164,6 +211,9 @@ protected DocWriteResponse(ShardId shardId, StreamInput in) throws IOException { /** * Needed for deserialization of single item requests in {@link org.codelibs.fesen.opensearch.action.index.IndexAction} and BwC * deserialization path + * + * @param in the input to read from + * @throws IOException if an I/O error occurs */ protected DocWriteResponse(StreamInput in) throws IOException { super(in); @@ -182,6 +232,8 @@ protected DocWriteResponse(StreamInput in) throws IOException { /** * The change that occurred to the document. + * + * @return the result */ public Result getResult() { return result; @@ -189,6 +241,8 @@ public Result getResult() { /** * The index the document was changed in. + * + * @return the index */ public String getIndex() { return this.shardId.getIndexName(); @@ -196,6 +250,8 @@ public String getIndex() { /** * The id of the document changed. + * + * @return the identifier */ public String getId() { return this.id; @@ -203,6 +259,8 @@ public String getId() { /** * Returns the current version of the doc. + * + * @return the version */ public long getVersion() { return this.version; @@ -211,6 +269,8 @@ public long getVersion() { /** * Returns the sequence number assigned for this change. Returns {@link SequenceNumbers#UNASSIGNED_SEQ_NO} if the operation * wasn't performed (i.e., an update operation that resulted in a NOOP). + * + * @return the seq no */ public long getSeqNo() { return seqNo; @@ -236,6 +296,12 @@ public RestStatus status() { return getShardInfo().status(); } + /** + * Writes the thin. + * + * @param out the output to write to + * @throws IOException if an I/O error occurs + */ public void writeThin(StreamOutput out) throws IOException { super.writeTo(out); writeWithoutShardId(out); @@ -268,6 +334,14 @@ public final XContentBuilder toXContent(XContentBuilder builder, Params params) return builder; } + /** + * Returns the inner to XContent. + * + * @param builder the content builder + * @param params the serialization parameters + * @return the inner to XContent + * @throws IOException if an I/O error occurs + */ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) throws IOException { ReplicationResponse.ShardInfo shardInfo = getShardInfo(); builder.field(_INDEX, shardId.getIndexName()); @@ -289,6 +363,10 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t * This method is intended to be called by subclasses and must be called multiple times to parse all the information concerning * {@link DocWriteResponse} objects. It always parses the current token, updates the given parsing context accordingly * if needed and then immediately returns. + * + * @param parser the parser + * @param context the context + * @throws IOException if an I/O error occurs */ protected static void parseInnerToXContent(XContentParser parser, Builder context) throws IOException { XContentParser.Token token = parser.currentToken(); @@ -339,56 +417,140 @@ protected static void parseInnerToXContent(XContentParser parser, Builder contex * @opensearch.internal */ public abstract static class Builder { + /** + * Creates a new Builder. + */ + public Builder() { + } + /** + * The shard identifier. + */ protected ShardId shardId = null; + /** + * The identifier. + */ protected String id = null; + /** + * The version. + */ protected Long version = null; + /** + * The result. + */ protected Result result = null; + /** + * The forced refresh. + */ protected boolean forcedRefresh; + /** + * The shard info. + */ protected ShardInfo shardInfo = null; + /** + * The seq no. + */ protected long seqNo = UNASSIGNED_SEQ_NO; + /** + * The primary term. + */ protected long primaryTerm = UNASSIGNED_PRIMARY_TERM; + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public ShardId getShardId() { return shardId; } + /** + * Sets the shard identifier. + * + * @param shardId the shard identifier + */ public void setShardId(ShardId shardId) { this.shardId = shardId; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String getId() { return id; } + /** + * Sets the identifier. + * + * @param id the identifier + */ public void setId(String id) { this.id = id; } + /** + * Sets the version. + * + * @param version the version + */ public void setVersion(Long version) { this.version = version; } + /** + * Sets the result. + * + * @param result the result + */ public void setResult(Result result) { this.result = result; } + /** + * Sets the forced refresh. + * + * @param forcedRefresh the forced refresh + */ public void setForcedRefresh(boolean forcedRefresh) { this.forcedRefresh = forcedRefresh; } + /** + * Sets the shard info. + * + * @param shardInfo the shard info + */ public void setShardInfo(ShardInfo shardInfo) { this.shardInfo = shardInfo; } + /** + * Sets the seq no. + * + * @param seqNo the seq no + */ public void setSeqNo(long seqNo) { this.seqNo = seqNo; } + /** + * Sets the primary term. + * + * @param primaryTerm the primary term + */ public void setPrimaryTerm(long primaryTerm) { this.primaryTerm = primaryTerm; } + /** + * Builds this instance. + * + * @return the new instance + */ public abstract DocWriteResponse build(); } } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/FailedNodeException.java b/src/main/java/org/codelibs/fesen/opensearch/action/FailedNodeException.java index 3c025490..2f774724 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/FailedNodeException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/FailedNodeException.java @@ -46,8 +46,17 @@ */ public class FailedNodeException extends OpenSearchException { + /** + * The node identifier. + */ private final String nodeId; + /** + * Creates a new FailedNodeException by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public FailedNodeException(StreamInput in) throws IOException { super(in); nodeId = in.readOptionalString(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/IndicesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/IndicesRequest.java index cb88a863..89ea17b6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/IndicesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/IndicesRequest.java @@ -48,12 +48,16 @@ public interface IndicesRequest { /** * Returns the array of indices that the action relates to + * + * @return the indices */ String[] indices(); /** * Returns the indices options used to resolve indices. They tell for instance whether a single index is * accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed. + * + * @return the indices options */ IndicesOptions indicesOptions(); @@ -61,6 +65,8 @@ public interface IndicesRequest { * Determines whether the request should be applied to data streams. When {@code false}, none of the names or * wildcard expressions in {@link #indices} should be applied to or expanded to any data streams. All layers * involved in the request's fulfillment including security, name resolution, etc., should respect this flag. + * + * @return this instance */ default boolean includeDataStreams() { return false; @@ -74,6 +80,9 @@ default boolean includeDataStreams() { interface Replaceable extends IndicesRequest { /** * Sets the indices that the action relates to. + * + * @param indices the indices + * @return the indices */ IndicesRequest indices(String... indices); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/OriginalIndices.java b/src/main/java/org/codelibs/fesen/opensearch/action/OriginalIndices.java index 336e73be..dcddb463 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/OriginalIndices.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/OriginalIndices.java @@ -49,11 +49,20 @@ public final class OriginalIndices implements IndicesRequest { // constant to use when original indices are not applicable and will not be serialized across the wire + /** + * The NONE constant. + */ public static final OriginalIndices NONE = new OriginalIndices(null, null); private final String[] indices; private final IndicesOptions indicesOptions; + /** + * Creates a new OriginalIndices. + * + * @param indices the indices + * @param indicesOptions the indices options + */ public OriginalIndices(String[] indices, IndicesOptions indicesOptions) { this.indices = indices; this.indicesOptions = indicesOptions; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/RealtimeRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/RealtimeRequest.java index 24240157..dcbc087d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/RealtimeRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/RealtimeRequest.java @@ -41,7 +41,11 @@ public interface RealtimeRequest { /** + * Returns the realtime. + * * @param realtime Controls whether this request should be realtime by reading from the translog. + * @param the result type + * @return the realtime */ R realtime(boolean realtime); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/RoutingMissingException.java b/src/main/java/org/codelibs/fesen/opensearch/action/RoutingMissingException.java index 5456bac2..3040a930 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/RoutingMissingException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/RoutingMissingException.java @@ -48,14 +48,33 @@ */ public class RoutingMissingException extends OpenSearchException { + /** + * The type. + */ private final String type; + /** + * The identifier. + */ private final String id; + /** + * Creates a new RoutingMissingException. + * + * @param index the index + * @param id the identifier + */ public RoutingMissingException(String index, String id) { this(index, MapperService.SINGLE_MAPPING_NAME, id); } + /** + * Creates a new RoutingMissingException. + * + * @param index the index + * @param type the type + * @param id the identifier + */ public RoutingMissingException(String index, String type, String id) { super("routing is required for [" + index + "]/[" + id + "]"); Objects.requireNonNull(index, "index must not be null"); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/TaskOperationFailure.java b/src/main/java/org/codelibs/fesen/opensearch/action/TaskOperationFailure.java index b56699c4..e17059b6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/TaskOperationFailure.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/TaskOperationFailure.java @@ -86,6 +86,13 @@ public final class TaskOperationFailure implements Writeable, ToXContentFragment PARSER.declareObject(constructorArg(), (parser, c) -> OpenSearchException.fromXContent(parser), new ParseField(REASON)); } + /** + * Creates a new TaskOperationFailure. + * + * @param nodeId the node identifier + * @param taskId the task identifier + * @param e the exception + */ public TaskOperationFailure(String nodeId, long taskId, Exception e) { this.nodeId = nodeId; this.taskId = taskId; @@ -95,6 +102,9 @@ public TaskOperationFailure(String nodeId, long taskId, Exception e) { /** * Read from a stream. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs */ public TaskOperationFailure(StreamInput in) throws IOException { nodeId = in.readString(); @@ -111,14 +121,29 @@ public void writeTo(StreamOutput out) throws IOException { RestStatus.writeTo(out, status); } + /** + * Returns the node identifier. + * + * @return the node identifier + */ public String getNodeId() { return this.nodeId; } + /** + * Returns the task identifier. + * + * @return the task identifier + */ public long getTaskId() { return this.taskId; } + /** + * Returns the cause. + * + * @return the cause + */ public Exception getCause() { return reason; } @@ -128,6 +153,12 @@ public String toString() { return "[" + nodeId + "][" + taskId + "] failed, reason [" + reason + "]"; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static TaskOperationFailure fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ValidateActions.java b/src/main/java/org/codelibs/fesen/opensearch/action/ValidateActions.java index ff6636b9..53734ccc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ValidateActions.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ValidateActions.java @@ -38,7 +38,19 @@ * @opensearch.internal */ public class ValidateActions { + /** + * Creates a new ValidateActions. + */ + public ValidateActions() { + } + /** + * Adds the validation error. + * + * @param error the error + * @param validationException the validation exception + * @return this instance + */ public static ActionRequestValidationException addValidationError(String error, ActionRequestValidationException validationException) { if (validationException == null) { validationException = new ActionRequestValidationException(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java index a9a3f21f..40dfa242 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java @@ -41,7 +41,13 @@ */ public class ClusterAllocationExplainAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterAllocationExplainAction INSTANCE = new ClusterAllocationExplainAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/allocation/explain"; private ClusterAllocationExplainAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java index c541b586..2e8d66bb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java @@ -113,6 +113,8 @@ public ActionRequestValidationException validate() { /** * Returns {@code true} iff the first unassigned shard is to be used + * + * @return the use any unassigned shard */ public boolean useAnyUnassignedShard() { return this.index == null && this.shard == null && this.primary == null && this.currentNode == null; @@ -120,6 +122,9 @@ public boolean useAnyUnassignedShard() { /** * Sets the index name of the shard to explain. + * + * @param index the index + * @return this instance */ public ClusterAllocationExplainRequest setIndex(String index) { this.index = index; @@ -128,6 +133,8 @@ public ClusterAllocationExplainRequest setIndex(String index) { /** * Returns the index name of the shard to explain, or {@code null} to use any unassigned shard (see {@link #useAnyUnassignedShard()}). + * + * @return the index */ @Nullable public String getIndex() { @@ -136,6 +143,9 @@ public String getIndex() { /** * Sets the shard id of the shard to explain. + * + * @param shard the shard + * @return this instance */ public ClusterAllocationExplainRequest setShard(Integer shard) { this.shard = shard; @@ -144,6 +154,8 @@ public ClusterAllocationExplainRequest setShard(Integer shard) { /** * Returns the shard id of the shard to explain, or {@code null} to use any unassigned shard (see {@link #useAnyUnassignedShard()}). + * + * @return the shard */ @Nullable public Integer getShard() { @@ -153,6 +165,9 @@ public Integer getShard() { /** * Sets whether to explain the allocation of the primary shard or a replica shard copy * for the shard id (see {@link #getShard()}). + * + * @param primary the primary + * @return this instance */ public ClusterAllocationExplainRequest setPrimary(Boolean primary) { this.primary = primary; @@ -163,6 +178,8 @@ public ClusterAllocationExplainRequest setPrimary(Boolean primary) { * Returns {@code true} if explaining the primary shard for the shard id (see {@link #getShard()}), * {@code false} if explaining a replica shard copy for the shard id, or {@code null} to use any * unassigned shard (see {@link #useAnyUnassignedShard()}). + * + * @return the primary flag */ @Nullable public Boolean isPrimary() { @@ -172,6 +189,9 @@ public Boolean isPrimary() { /** * Requests the explain API to explain an already assigned replica shard currently allocated to * the given node. + * + * @param currentNodeId the current node identifier + * @return this instance */ public ClusterAllocationExplainRequest setCurrentNode(String currentNodeId) { this.currentNode = currentNodeId; @@ -181,6 +201,8 @@ public ClusterAllocationExplainRequest setCurrentNode(String currentNodeId) { /** * Returns {@code true} if yes decisions should be included. Otherwise only "no" and "throttle" * decisions are returned. + * + * @return this instance */ public boolean includeYesDecisions() { return this.includeYesDecisions; @@ -188,6 +210,8 @@ public boolean includeYesDecisions() { /** * Returns {@code true} if information about disk usage and shard sizes should also be returned. + * + * @return this instance */ public boolean includeDiskInfo() { return this.includeDiskInfo; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java index c7af09da..a251aded 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java @@ -47,23 +47,44 @@ public class ClusterAllocationExplainRequestBuilder extends ClusterManagerNodeOp ClusterAllocationExplainResponse, ClusterAllocationExplainRequestBuilder> { + /** + * Creates a new ClusterAllocationExplainRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterAllocationExplainRequestBuilder(OpenSearchClient client, ClusterAllocationExplainAction action) { super(client, action, new ClusterAllocationExplainRequest()); } - /** The index name to use when finding the shard to explain */ + /** + * The index name to use when finding the shard to explain + * + * @param index the index + * @return this instance + */ public ClusterAllocationExplainRequestBuilder setIndex(String index) { request.setIndex(index); return this; } - /** The shard number to use when finding the shard to explain */ + /** + * The shard number to use when finding the shard to explain + * + * @param shard the shard + * @return this instance + */ public ClusterAllocationExplainRequestBuilder setShard(int shard) { request.setShard(shard); return this; } - /** Whether the primary or replica should be explained */ + /** + * Whether the primary or replica should be explained + * + * @param primary the primary + * @return this instance + */ public ClusterAllocationExplainRequestBuilder setPrimary(boolean primary) { request.setPrimary(primary); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java index 138d46d8..ae799236 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java @@ -49,11 +49,22 @@ public class ClusterAllocationExplainResponse extends ActionResponse { private ClusterAllocationExplanation cae; + /** + * Creates a new ClusterAllocationExplainResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClusterAllocationExplainResponse(StreamInput in) throws IOException { super(in); this.cae = new ClusterAllocationExplanation(in); } + /** + * Creates a new ClusterAllocationExplainResponse. + * + * @param cae the cae + */ public ClusterAllocationExplainResponse(ClusterAllocationExplanation cae) { this.cae = cae; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java index 13125b0b..de97e2eb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java @@ -70,6 +70,15 @@ public final class ClusterAllocationExplanation implements ToXContentObject, Wri private final ClusterInfo clusterInfo; private final ShardAllocationDecision shardAllocationDecision; + /** + * Creates a new ClusterAllocationExplanation. + * + * @param shardRouting the shard routing + * @param currentNode the current node + * @param relocationTargetNode the relocation target node + * @param clusterInfo the cluster info + * @param shardAllocationDecision the shard allocation decision + */ public ClusterAllocationExplanation( ShardRouting shardRouting, @Nullable DiscoveryNode currentNode, @@ -84,6 +93,12 @@ public ClusterAllocationExplanation( this.shardAllocationDecision = shardAllocationDecision; } + /** + * Creates a new ClusterAllocationExplanation by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClusterAllocationExplanation(StreamInput in) throws IOException { this.shardRouting = new ShardRouting(in); this.currentNode = in.readOptionalWriteable(DiscoveryNode::new); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/crypto/CryptoSettings.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/crypto/CryptoSettings.java index a0681ada..9bf3f419 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/crypto/CryptoSettings.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/crypto/CryptoSettings.java @@ -37,6 +37,11 @@ public class CryptoSettings implements Writeable, ToXContentObject { private String keyProviderType; private Settings settings = EMPTY_SETTINGS; + /** + * Creates a new CryptoSettings. + * + * @param keyProviderName the key provider name + */ public CryptoSettings(String keyProviderName) { this.keyProviderName = keyProviderName; } @@ -59,6 +64,7 @@ public ActionRequestValidationException validate() { /** * Constructs a new crypto settings with provided key provider name. * @param keyProviderName Name of the key provider + * @return the key provider name */ public CryptoSettings keyProviderName(String keyProviderName) { this.keyProviderName = keyProviderName; @@ -68,6 +74,7 @@ public CryptoSettings keyProviderName(String keyProviderName) { /** * Constructs a new crypto settings with provided key provider type. * @param keyProviderType Type of key provider to be used in encryption. + * @return the key provider type */ public CryptoSettings keyProviderType(String keyProviderType) { this.keyProviderType = keyProviderType; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthAction.java index e2b26d2c..0bfbc157 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthAction.java @@ -41,7 +41,13 @@ */ public class ClusterHealthAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterHealthAction INSTANCE = new ClusterHealthAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/health"; private ClusterHealthAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthRequest.java index 65b1c0a4..0dd3a929 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthRequest.java @@ -87,6 +87,9 @@ public class ClusterHealthRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new ClusterHealthRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterHealthRequestBuilder(OpenSearchClient client, ClusterHealthAction action) { super(client, action, new ClusterHealthRequest()); } + /** + * Sets the indices. + * + * @param indices the indices + * @return this instance + */ public ClusterHealthRequestBuilder setIndices(String... indices) { request.indices(indices); return this; } + /** + * Sets the wait for yellow status. + * + * @return this instance + */ public ClusterHealthRequestBuilder setWaitForYellowStatus() { request.waitForYellowStatus(); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthResponse.java index 3ba623b8..c6add54c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/health/ClusterHealthResponse.java @@ -194,8 +194,17 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo private ClusterHealthStatus clusterHealthStatus; private ClusterAwarenessHealth clusterAwarenessHealth; + /** + * Creates a new ClusterHealthResponse. + */ public ClusterHealthResponse() {} + /** + * Creates a new ClusterHealthResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClusterHealthResponse(StreamInput in) throws IOException { super(in); clusterName = in.readString(); @@ -213,11 +222,28 @@ public ClusterHealthResponse(StreamInput in) throws IOException { } } - /** needed for plugins BWC */ + /** + * needed for plugins BWC + * + * @param clusterName the cluster name + * @param concreteIndices the concrete indices + * @param clusterState the cluster state + */ public ClusterHealthResponse(String clusterName, String[] concreteIndices, ClusterState clusterState) { this(clusterName, concreteIndices, clusterState, -1, -1, -1, TimeValue.timeValueHours(0)); } + /** + * Creates a new ClusterHealthResponse. + * + * @param clusterName the cluster name + * @param concreteIndices the concrete indices + * @param clusterState the cluster state + * @param numberOfPendingTasks the number of pending tasks + * @param numberOfInFlightFetch the number of in flight fetch + * @param delayedUnassignedShards the delayed unassigned shards + * @param taskMaxWaitingTime the task max waiting time + */ public ClusterHealthResponse( String clusterName, String[] concreteIndices, @@ -236,6 +262,17 @@ public ClusterHealthResponse( this.clusterHealthStatus = clusterStateHealth.getStatus(); } + /** + * Creates a new ClusterHealthResponse. + * + * @param clusterName the cluster name + * @param concreteIndices the concrete indices + * @param clusterHealthRequest the cluster health request + * @param clusterState the cluster state + * @param numberOfPendingTasks the number of pending tasks + * @param numberOfInFlightFetch the number of in flight fetch + * @param taskMaxWaitingTime the task max waiting time + */ public ClusterHealthResponse( String clusterName, String[] concreteIndices, @@ -278,6 +315,11 @@ public ClusterHealthResponse( this.clusterHealthStatus = clusterStateHealth.getStatus(); } + /** + * Returns the cluster name. + * + * @return the cluster name + */ public String getClusterName() { return clusterName; } @@ -287,42 +329,92 @@ ClusterStateHealth getClusterStateHealth() { return clusterStateHealth; } + /** + * Returns the active shards. + * + * @return the active shards + */ public int getActiveShards() { return clusterStateHealth.getActiveShards(); } + /** + * Returns the relocating shards. + * + * @return the relocating shards + */ public int getRelocatingShards() { return clusterStateHealth.getRelocatingShards(); } + /** + * Returns the active primary shards. + * + * @return the active primary shards + */ public int getActivePrimaryShards() { return clusterStateHealth.getActivePrimaryShards(); } + /** + * Returns the initializing shards. + * + * @return the initializing shards + */ public int getInitializingShards() { return clusterStateHealth.getInitializingShards(); } + /** + * Returns the unassigned shards. + * + * @return the unassigned shards + */ public int getUnassignedShards() { return clusterStateHealth.getUnassignedShards(); } + /** + * Returns the number of nodes. + * + * @return the number of nodes + */ public int getNumberOfNodes() { return clusterStateHealth.getNumberOfNodes(); } + /** + * Returns the number of data nodes. + * + * @return the number of data nodes + */ public int getNumberOfDataNodes() { return clusterStateHealth.getNumberOfDataNodes(); } + /** + * Returns the discovered cluster manager flag. + * + * @return the discovered cluster manager flag + */ public boolean hasDiscoveredClusterManager() { return clusterStateHealth.hasDiscoveredClusterManager(); } + /** + * Returns the number of pending tasks. + * + * @return the number of pending tasks + */ public int getNumberOfPendingTasks() { return this.numberOfPendingTasks; } + /** + * Returns the number of in flight fetch. + * + * @return the number of in flight fetch + */ public int getNumberOfInFlightFetch() { return this.numberOfInFlightFetch; } @@ -331,6 +423,8 @@ public int getNumberOfInFlightFetch() { * The number of unassigned shards that are currently being delayed (for example, * due to node leaving the cluster and waiting for a timeout for the node to come * back in order to allocate the shards back to it). + * + * @return the delayed unassigned shards */ public int getDelayedUnassignedShards() { return this.delayedUnassignedShards; @@ -338,15 +432,27 @@ public int getDelayedUnassignedShards() { /** * {@code true} if the waitForXXX has timeout out and did not match. + * + * @return the timed out flag */ public boolean isTimedOut() { return this.timedOut; } + /** + * Sets the timed out. + * + * @param timedOut the timed out + */ public void setTimedOut(boolean timedOut) { this.timedOut = timedOut; } + /** + * Returns the status. + * + * @return the status + */ public ClusterHealthStatus getStatus() { return clusterHealthStatus; } @@ -363,11 +469,17 @@ public void setStatus(ClusterHealthStatus status) { this.clusterHealthStatus = status; } + /** + * Returns the indices. + * + * @return the indices + */ public Map getIndices() { return clusterStateHealth.getIndices(); } /** + * Returns the task max waiting time. * * @return The maximum wait time of all tasks in the queue */ @@ -377,15 +489,29 @@ public TimeValue getTaskMaxWaitingTime() { /** * The percentage of active shards, should be 100% in a green system + * + * @return the active shards percent */ public double getActiveShardsPercent() { return clusterStateHealth.getActiveShardsPercent(); } + /** + * Returns the cluster awareness health. + * + * @return the cluster awareness health + */ public ClusterAwarenessHealth getClusterAwarenessHealth() { return clusterAwarenessHealth; } + /** + * Reads the response from. + * + * @param in the input to read from + * @return the response from + * @throws IOException if an I/O error occurs + */ public static ClusterHealthResponse readResponseFrom(StreamInput in) throws IOException { return new ClusterHealthResponse(in); } @@ -461,6 +587,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ClusterHealthResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java index 6e621886..099c9d8d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java @@ -53,11 +53,22 @@ public class NodeHotThreads extends BaseNodeResponse { hotThreads = in.readString(); } + /** + * Creates a new NodeHotThreads. + * + * @param node the node + * @param hotThreads the hot threads + */ public NodeHotThreads(DiscoveryNode node, String hotThreads) { super(node); this.hotThreads = hotThreads; } + /** + * Returns the hot threads. + * + * @return the hot threads + */ public String getHotThreads() { return this.hotThreads; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java index b0dedc89..18fad79f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java @@ -41,7 +41,13 @@ */ public class NodesHotThreadsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final NodesHotThreadsAction INSTANCE = new NodesHotThreadsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/nodes/hot_threads"; private NodesHotThreadsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java index ba2e82c1..1ea4782c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java @@ -58,47 +58,98 @@ public class NodesHotThreadsRequest extends BaseNodesRequest { + /** + * Creates a new NodesHotThreadsRequestBuilder. + * + * @param client the client + * @param action the action + */ public NodesHotThreadsRequestBuilder(OpenSearchClient client, NodesHotThreadsAction action) { super(client, action, new NodesHotThreadsRequest()); } + /** + * Sets the threads. + * + * @param threads the threads + * @return this instance + */ public NodesHotThreadsRequestBuilder setThreads(int threads) { request.threads(threads); return this; } + /** + * Sets the ignore idle threads. + * + * @param ignoreIdleThreads the ignore idle threads + * @return this instance + */ public NodesHotThreadsRequestBuilder setIgnoreIdleThreads(boolean ignoreIdleThreads) { request.ignoreIdleThreads(ignoreIdleThreads); return this; } + /** + * Sets the type. + * + * @param type the type + * @return this instance + */ public NodesHotThreadsRequestBuilder setType(String type) { request.type(type); return this; } + /** + * Sets the interval. + * + * @param interval the interval + * @return this instance + */ public NodesHotThreadsRequestBuilder setInterval(TimeValue interval) { request.interval(interval); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java index 30f25e19..a726bdc3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java @@ -50,10 +50,23 @@ @PublicApi(since = "1.0.0") public class NodesHotThreadsResponse extends BaseNodesResponse { + /** + * Creates a new NodesHotThreadsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public NodesHotThreadsResponse(StreamInput in) throws IOException { super(in); } + /** + * Creates a new NodesHotThreadsResponse. + * + * @param clusterName the cluster name + * @param nodes the nodes + * @param failures the failures + */ public NodesHotThreadsResponse(ClusterName clusterName, List nodes, List failures) { super(clusterName, nodes, failures); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodeInfo.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodeInfo.java index 8fba0cb9..77151d94 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodeInfo.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodeInfo.java @@ -79,6 +79,12 @@ public class NodeInfo extends BaseNodeResponse { @Nullable private ByteSizeValue totalIndexingBuffer; + /** + * Creates a new NodeInfo by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public NodeInfo(StreamInput in) throws IOException { super(in); version = in.readVersion(); @@ -105,6 +111,25 @@ public NodeInfo(StreamInput in) throws IOException { } } + /** + * Creates a new NodeInfo. + * + * @param version the version + * @param build the build + * @param node the node + * @param settings the settings + * @param os the OS + * @param process the process + * @param jvm the JVM + * @param threadPool the thread pool + * @param transport the transport + * @param http the HTTP + * @param plugins the plugins + * @param ingest the ingest + * @param aggsInfo the aggs info + * @param totalIndexingBuffer the total indexing buffer + * @param searchPipelineInfo the search pipeline info + */ public NodeInfo( Version version, Build build, @@ -141,6 +166,8 @@ public NodeInfo( /** * The current OpenSearch version + * + * @return the version */ public Version getVersion() { return version; @@ -148,6 +175,8 @@ public Version getVersion() { /** * The build version of the node. + * + * @return the build */ public Build getBuild() { return this.build; @@ -155,6 +184,8 @@ public Build getBuild() { /** * The settings of the node. + * + * @return the settings */ @Nullable public Settings getSettings() { @@ -175,6 +206,11 @@ public T getInfo(Class clazz) { return clazz.cast(infoMap.get(clazz)); } + /** + * Returns the total indexing buffer. + * + * @return the total indexing buffer + */ @Nullable public ByteSizeValue getTotalIndexingBuffer() { return totalIndexingBuffer; @@ -221,6 +257,14 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Returns the builder. + * + * @param version the version + * @param build the build + * @param node the node + * @return the builder + */ public static NodeInfo.Builder builder(Version version, Build build, DiscoveryNode node) { return new Builder(version, build, node); } @@ -252,6 +296,11 @@ private Builder(Version version, Build build, DiscoveryNode node) { private ByteSizeValue totalIndexingBuffer; private SearchPipelineInfo searchPipelineInfo; + /** + * Builds this instance. + * + * @return the new instance + */ public NodeInfo build() { return new NodeInfo( version, diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoAction.java index 7fde0dcf..07dcce24 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoAction.java @@ -41,7 +41,13 @@ */ public class NodesInfoAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final NodesInfoAction INSTANCE = new NodesInfoAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/nodes/info"; private NodesInfoAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java index 2f4d3ba8..acbd6926 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java @@ -58,6 +58,8 @@ public class NodesInfoRequest extends BaseNodesRequest { /** * Get information from nodes based on the nodes ids specified. If none are passed, information * for all nodes will be returned. + * + * @param nodesIds the nodes identifiers */ public NodesInfoRequest(String... nodesIds) { super(nodesIds); @@ -68,6 +70,8 @@ public NodesInfoRequest(String... nodesIds) { * Sets to return data for default metrics only. * See {@link Metric} * See {@link Metric#defaultMetrics()}. + * + * @return the default metrics */ public NodesInfoRequest defaultMetrics() { requestedMetrics.addAll(Metric.defaultMetrics()); @@ -76,6 +80,8 @@ public NodesInfoRequest defaultMetrics() { /** * Get the names of requested metrics + * + * @return the requested metrics */ public Set requestedMetrics() { return new HashSet<>(requestedMetrics); @@ -93,17 +99,53 @@ public void writeTo(StreamOutput out) throws IOException { * pluggable. */ public enum Metric { + /** + * The SETTINGS value. + */ SETTINGS("settings"), + /** + * The OS value. + */ OS("os"), + /** + * The PROCESS value. + */ PROCESS("process"), + /** + * The JVM value. + */ JVM("jvm"), + /** + * The THREAD_POOL value. + */ THREAD_POOL("thread_pool"), + /** + * The TRANSPORT value. + */ TRANSPORT("transport"), + /** + * The HTTP value. + */ HTTP("http"), + /** + * The PLUGINS value. + */ PLUGINS("plugins"), + /** + * The INGEST value. + */ INGEST("ingest"), + /** + * The AGGREGATIONS value. + */ AGGREGATIONS("aggregations"), + /** + * The INDICES value. + */ INDICES("indices"), + /** + * The SEARCH_PIPELINES value. + */ SEARCH_PIPELINES("search_pipelines"); private String metricName; @@ -112,6 +154,11 @@ public enum Metric { this.metricName = name; } + /** + * Returns the metric name. + * + * @return the metric name + */ public String metricName() { return this.metricName; } @@ -119,6 +166,8 @@ public String metricName() { /** * Return all available metrics. * See {@link Metric} + * + * @return the all metrics */ public static Set allMetrics() { return Arrays.stream(values()).map(Metric::metricName).collect(Collectors.toSet()); @@ -132,6 +181,8 @@ public static Set allMetrics() { * size at bay. Metrics that are NOT included in the default set were typically introduced later * and are considered to contain specific type of information that is not usually useful unless you * know that you really need it. + * + * @return the default metrics */ public static Set defaultMetrics() { return allMetrics().stream().filter(metric -> !(metric.equals(SEARCH_PIPELINES.metricName()))).collect(Collectors.toSet()); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java index 413c65d8..858c1ca4 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java @@ -44,6 +44,12 @@ @PublicApi(since = "1.0.0") public class NodesInfoRequestBuilder extends NodesOperationRequestBuilder { + /** + * Creates a new NodesInfoRequestBuilder. + * + * @param client the client + * @param action the action + */ public NodesInfoRequestBuilder(OpenSearchClient client, NodesInfoAction action) { super(client, action, new NodesInfoRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java index d5f45ce3..332f130e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java @@ -65,10 +65,23 @@ @PublicApi(since = "1.0.0") public class NodesInfoResponse extends BaseNodesResponse implements ToXContentFragment { + /** + * Creates a new NodesInfoResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public NodesInfoResponse(StreamInput in) throws IOException { super(in); } + /** + * Creates a new NodesInfoResponse. + * + * @param clusterName the cluster name + * @param nodes the nodes + * @param failures the failures + */ public NodesInfoResponse(ClusterName clusterName, List nodes, List failures) { super(clusterName, nodes, failures); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/PluginsAndModules.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/PluginsAndModules.java index 6b87ec65..3bfc7820 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/PluginsAndModules.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/info/PluginsAndModules.java @@ -53,6 +53,12 @@ public class PluginsAndModules implements ReportingService.Info { private final List plugins; private final List modules; + /** + * Creates a new PluginsAndModules by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public PluginsAndModules(StreamInput in) throws IOException { this.plugins = Collections.unmodifiableList(in.readList(PluginInfo::new)); this.modules = Collections.unmodifiableList(in.readList(PluginInfo::new)); @@ -66,6 +72,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Returns an ordered list based on plugins name + * + * @return the plugin infos */ public List getPluginInfos() { List plugins = new ArrayList<>(this.plugins); @@ -75,6 +83,8 @@ public List getPluginInfos() { /** * Returns an ordered list based on modules name + * + * @return the module infos */ public List getModuleInfos() { List modules = new ArrayList<>(this.modules); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodeStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodeStats.java index 7229341f..272396b9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodeStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodeStats.java @@ -189,6 +189,12 @@ public class NodeStats extends BaseNodeResponse implements ToXContentFragment { */ private long totalEstimatedNativeBytes; + /** + * Creates a new NodeStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public NodeStats(StreamInput in) throws IOException { super(in); timestamp = in.readVLong(); @@ -302,6 +308,44 @@ public NodeStats(StreamInput in) throws IOException { } } + /** + * Creates a new NodeStats. + * + * @param node the node + * @param timestamp the timestamp + * @param indices the indices + * @param os the OS + * @param process the process + * @param jvm the JVM + * @param threadPool the thread pool + * @param fs the fs + * @param transport the transport + * @param http the HTTP + * @param breaker the breaker + * @param scriptStats the script stats + * @param discoveryStats the discovery stats + * @param ingestStats the ingest stats + * @param adaptiveSelectionStats the adaptive selection stats + * @param resourceUsageStats the resource usage stats + * @param scriptCacheStats the script cache stats + * @param indexingPressureStats the indexing pressure stats + * @param shardIndexingPressureStats the shard indexing pressure stats + * @param searchBackpressureStats the search backpressure stats + * @param clusterManagerThrottlingStats the cluster manager throttling stats + * @param weightedRoutingStats the weighted routing stats + * @param fileCacheStats the file cache stats + * @param fileCacheOnlyStats the file cache only stats + * @param blockCacheOnlyStats the block cache only stats + * @param taskCancellationStats the task cancellation stats + * @param searchPipelineStats the search pipeline stats + * @param segmentReplicationRejectionStats the segment replication rejection stats + * @param repositoriesStats the repositories stats + * @param admissionControlStats the admission control stats + * @param nodeCacheStats the node cache stats + * @param remoteStoreNodeStats the remote store node stats + * @param nativeAllocatorStats the native allocator stats + * @param totalEstimatedNativeBytes the total estimated native bytes + */ public NodeStats( DiscoveryNode node, long timestamp, @@ -374,12 +418,19 @@ public NodeStats( this.totalEstimatedNativeBytes = totalEstimatedNativeBytes; } + /** + * Returns the timestamp. + * + * @return the timestamp + */ public long getTimestamp() { return this.timestamp; } /** * Indices level stats. + * + * @return the indices */ @Nullable public NodeIndicesStats getIndices() { @@ -388,6 +439,8 @@ public NodeIndicesStats getIndices() { /** * Operating System level statistics. + * + * @return the OS */ @Nullable public OsStats getOs() { @@ -396,6 +449,8 @@ public OsStats getOs() { /** * Process level statistics. + * + * @return the process */ @Nullable public ProcessStats getProcess() { @@ -404,6 +459,8 @@ public ProcessStats getProcess() { /** * JVM level statistics. + * + * @return the JVM */ @Nullable public JvmStats getJvm() { @@ -412,6 +469,8 @@ public JvmStats getJvm() { /** * Thread Pool level statistics. + * + * @return the thread pool */ @Nullable public ThreadPoolStats getThreadPool() { @@ -420,125 +479,247 @@ public ThreadPoolStats getThreadPool() { /** * File system level stats. + * + * @return the fs */ @Nullable public FsInfo getFs() { return fs; } + /** + * Returns the transport. + * + * @return the transport + */ @Nullable public TransportStats getTransport() { return this.transport; } + /** + * Returns the HTTP. + * + * @return the HTTP + */ @Nullable public HttpStats getHttp() { return this.http; } + /** + * Returns the breaker. + * + * @return the breaker + */ @Nullable public AllCircuitBreakerStats getBreaker() { return this.breaker; } + /** + * Returns the script stats. + * + * @return the script stats + */ @Nullable public ScriptStats getScriptStats() { return this.scriptStats; } + /** + * Returns the discovery stats. + * + * @return the discovery stats + */ @Nullable public DiscoveryStats getDiscoveryStats() { return this.discoveryStats; } + /** + * Returns the ingest stats. + * + * @return the ingest stats + */ @Nullable public IngestStats getIngestStats() { return ingestStats; } + /** + * Returns the adaptive selection stats. + * + * @return the adaptive selection stats + */ @Nullable public AdaptiveSelectionStats getAdaptiveSelectionStats() { return adaptiveSelectionStats; } + /** + * Returns the resource usage stats. + * + * @return the resource usage stats + */ @Nullable public NodesResourceUsageStats getResourceUsageStats() { return resourceUsageStats; } + /** + * Returns the script cache stats. + * + * @return the script cache stats + */ @Nullable public ScriptCacheStats getScriptCacheStats() { return scriptCacheStats; } + /** + * Returns the indexing pressure stats. + * + * @return the indexing pressure stats + */ @Nullable public IndexingPressureStats getIndexingPressureStats() { return indexingPressureStats; } + /** + * Returns the shard indexing pressure stats. + * + * @return the shard indexing pressure stats + */ @Nullable public ShardIndexingPressureStats getShardIndexingPressureStats() { return shardIndexingPressureStats; } + /** + * Returns the search backpressure stats. + * + * @return the search backpressure stats + */ @Nullable public SearchBackpressureStats getSearchBackpressureStats() { return searchBackpressureStats; } + /** + * Returns the cluster manager throttling stats. + * + * @return the cluster manager throttling stats + */ @Nullable public ClusterManagerThrottlingStats getClusterManagerThrottlingStats() { return clusterManagerThrottlingStats; } + /** + * Returns the weighted routing stats. + * + * @return the weighted routing stats + */ public WeightedRoutingStats getWeightedRoutingStats() { return weightedRoutingStats; } + /** + * Returns the file cache stats. + * + * @return the file cache stats + */ public AggregateFileCacheStats getFileCacheStats() { return fileCacheStats; } + /** + * Returns the file cache only stats. + * + * @return the file cache only stats + */ @Nullable public AggregateFileCacheStats getFileCacheOnlyStats() { return fileCacheOnlyStats; } + /** + * Returns the block cache only stats. + * + * @return the block cache only stats + */ @Nullable public BlockCacheStats getBlockCacheOnlyStats() { return blockCacheOnlyStats; } + /** + * Returns the task cancellation stats. + * + * @return the task cancellation stats + */ @Nullable public TaskCancellationStats getTaskCancellationStats() { return taskCancellationStats; } + /** + * Returns the search pipeline stats. + * + * @return the search pipeline stats + */ @Nullable public SearchPipelineStats getSearchPipelineStats() { return searchPipelineStats; } + /** + * Returns the segment replication rejection stats. + * + * @return the segment replication rejection stats + */ @Nullable public SegmentReplicationRejectionStats getSegmentReplicationRejectionStats() { return segmentReplicationRejectionStats; } + /** + * Returns the repositories stats. + * + * @return the repositories stats + */ @Nullable public RepositoriesStats getRepositoriesStats() { return repositoriesStats; } + /** + * Returns the admission control stats. + * + * @return the admission control stats + */ @Nullable public AdmissionControlStats getAdmissionControlStats() { return admissionControlStats; } + /** + * Returns the node cache stats. + * + * @return the node cache stats + */ @Nullable public NodeCacheStats getNodeCacheStats() { return nodeCacheStats; } + /** + * Returns the remote store node stats. + * + * @return the remote store node stats + */ @Nullable public RemoteStoreNodeStats getRemoteStoreNodeStats() { return remoteStoreNodeStats; @@ -546,6 +727,8 @@ public RemoteStoreNodeStats getRemoteStoreNodeStats() { /** * Returns the native allocator pool stats (Arrow allocator), or {@code null} if not available. + * + * @return the native allocator stats */ @Nullable public NativeAllocatorPoolStats getNativeAllocatorStats() { @@ -556,6 +739,8 @@ public NativeAllocatorPoolStats getNativeAllocatorStats() { * Returns the process-level native-memory estimate captured on this node * (RssAnon - JVM heap committed - JVM non-heap committed), or {@code -1} when the probe * could not read {@code /proc/self/status}. + * + * @return the total estimated native bytes */ public long getTotalEstimatedNativeBytes() { return totalEstimatedNativeBytes; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java index 8d8ee4ec..94993d71 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java @@ -41,7 +41,13 @@ */ public class NodesStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final NodesStatsAction INSTANCE = new NodesStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/nodes/stats"; private NodesStatsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java index aa71cfda..d5eefa31 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java @@ -59,12 +59,17 @@ public class NodesStatsRequest extends BaseNodesRequest { private final Set requestedMetrics = new HashSet<>(); private boolean fileCacheDetailed = false; + /** + * Creates a new NodesStatsRequest. + */ public NodesStatsRequest() { super((String[]) null); } /** * Sets all the request flags. + * + * @return the all */ public NodesStatsRequest all() { this.indices.all(); @@ -84,6 +89,8 @@ public CommonStatsFlags indices() { /** * Get the names of requested metrics, excluding indices, which are * handled separately. + * + * @return the requested metrics */ public Set requestedMetrics() { return new HashSet<>(requestedMetrics); @@ -91,6 +98,9 @@ public Set requestedMetrics() { /** * Add metric + * + * @param metric the metric + * @return this instance */ public NodesStatsRequest addMetric(String metric) { if (Metric.allMetrics().contains(metric) == false) { @@ -102,6 +112,9 @@ public NodesStatsRequest addMetric(String metric) { /** * Add an array of metric names + * + * @param metrics the metrics + * @return this instance */ public NodesStatsRequest addMetrics(String... metrics) { // use sorted set for reliable ordering in error messages @@ -125,10 +138,21 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Returns the file cache detailed flag. + * + * @return the file cache detailed flag + */ public boolean isFileCacheDetailed() { return fileCacheDetailed; } + /** + * Returns the file cache detailed. + * + * @param detailed the detailed + * @return the file cache detailed + */ public NodesStatsRequest fileCacheDetailed(boolean detailed) { this.fileCacheDetailed = detailed; return this; @@ -139,36 +163,120 @@ public NodesStatsRequest fileCacheDetailed(boolean detailed) { * from the nodes stats endpoint. Eventually this list will be pluggable. */ public enum Metric { + /** + * The OS value. + */ OS("os"), + /** + * The PROCESS value. + */ PROCESS("process"), + /** + * The JVM value. + */ JVM("jvm"), + /** + * The THREAD_POOL value. + */ THREAD_POOL("thread_pool"), + /** + * The FS value. + */ FS("fs"), + /** + * The TRANSPORT value. + */ TRANSPORT("transport"), + /** + * The HTTP value. + */ HTTP("http"), + /** + * The BREAKER value. + */ BREAKER("breaker"), + /** + * The SCRIPT value. + */ SCRIPT("script"), + /** + * The DISCOVERY value. + */ DISCOVERY("discovery"), + /** + * The INGEST value. + */ INGEST("ingest"), + /** + * The ADAPTIVE_SELECTION value. + */ ADAPTIVE_SELECTION("adaptive_selection"), + /** + * The SCRIPT_CACHE value. + */ SCRIPT_CACHE("script_cache"), + /** + * The INDEXING_PRESSURE value. + */ INDEXING_PRESSURE("indexing_pressure"), + /** + * The SHARD_INDEXING_PRESSURE value. + */ SHARD_INDEXING_PRESSURE("shard_indexing_pressure"), + /** + * The SEARCH_BACKPRESSURE value. + */ SEARCH_BACKPRESSURE("search_backpressure"), + /** + * The CLUSTER_MANAGER_THROTTLING value. + */ CLUSTER_MANAGER_THROTTLING("cluster_manager_throttling"), + /** + * The WEIGHTED_ROUTING_STATS value. + */ WEIGHTED_ROUTING_STATS("weighted_routing"), + /** + * The FILE_CACHE_STATS value. + */ FILE_CACHE_STATS("file_cache"), + /** + * The TASK_CANCELLATION value. + */ TASK_CANCELLATION("task_cancellation"), + /** + * The SEARCH_PIPELINE value. + */ SEARCH_PIPELINE("search_pipeline"), + /** + * The RESOURCE_USAGE_STATS value. + */ RESOURCE_USAGE_STATS("resource_usage_stats"), + /** + * The SEGMENT_REPLICATION_BACKPRESSURE value. + */ SEGMENT_REPLICATION_BACKPRESSURE("segment_replication_backpressure"), + /** + * The REPOSITORIES value. + */ REPOSITORIES("repositories"), + /** + * The ADMISSION_CONTROL value. + */ ADMISSION_CONTROL("admission_control"), + /** + * The CACHE_STATS value. + */ CACHE_STATS("caches"), + /** + * The REMOTE_STORE value. + */ REMOTE_STORE("remote_store"), /** @deprecated Use {@link #NATIVE_MEMORY} instead. */ @Deprecated NATIVE_ALLOCATOR("native_allocator"), + /** + * The NATIVE_MEMORY value. + */ NATIVE_MEMORY("native_memory"); private String metricName; @@ -177,6 +285,11 @@ public enum Metric { this.metricName = name; } + /** + * Returns the metric name. + * + * @return the metric name + */ public String metricName() { return this.metricName; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java index 25e13122..bf4e0258 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java @@ -48,12 +48,20 @@ public class NodesStatsRequestBuilder extends NodesOperationRequestBuilder< NodesStatsResponse, NodesStatsRequestBuilder> { + /** + * Creates a new NodesStatsRequestBuilder. + * + * @param client the client + * @param action the action + */ public NodesStatsRequestBuilder(OpenSearchClient client, NodesStatsAction action) { super(client, action, new NodesStatsRequest()); } /** * Sets all the request flags. + * + * @return the all */ public NodesStatsRequestBuilder all() { request.all(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java index 7e62e130..a1b7a351 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java @@ -53,10 +53,23 @@ @PublicApi(since = "1.0.0") public class NodesStatsResponse extends BaseNodesResponse implements ToXContentFragment { + /** + * Creates a new NodesStatsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public NodesStatsResponse(StreamInput in) throws IOException { super(in); } + /** + * Creates a new NodesStatsResponse. + * + * @param clusterName the cluster name + * @param nodes the nodes + * @param failures the failures + */ public NodesStatsResponse(ClusterName clusterName, List nodes, List failures) { super(clusterName, nodes, failures); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java index 81c5b845..8cd858eb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java @@ -41,7 +41,13 @@ */ public class CancelTasksAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final CancelTasksAction INSTANCE = new CancelTasksAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/tasks/cancel"; private CancelTasksAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java index bbdb4c6a..7653da58 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java @@ -50,12 +50,21 @@ @PublicApi(since = "1.0.0") public class CancelTasksRequest extends BaseTasksRequest { + /** + * The DEFAULT_REASON constant. + */ public static final String DEFAULT_REASON = "by user request"; + /** + * The DEFAULT_WAIT_FOR_COMPLETION constant. + */ public static final boolean DEFAULT_WAIT_FOR_COMPLETION = false; private String reason = DEFAULT_REASON; private boolean waitForCompletion = DEFAULT_WAIT_FOR_COMPLETION; + /** + * Creates a new CancelTasksRequest. + */ public CancelTasksRequest() {} @Override diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java index 1ec6b876..7c9fe8a5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java @@ -44,6 +44,12 @@ @PublicApi(since = "1.0.0") public class CancelTasksRequestBuilder extends TasksRequestBuilder { + /** + * Creates a new CancelTasksRequestBuilder. + * + * @param client the client + * @param action the action + */ public CancelTasksRequestBuilder(OpenSearchClient client, CancelTasksAction action) { super(client, action, new CancelTasksRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java index 578c796f..2d562e01 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java @@ -60,10 +60,23 @@ public class CancelTasksResponse extends ListTasksResponse { CancelTasksResponse::new ); + /** + * Creates a new CancelTasksResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public CancelTasksResponse(StreamInput in) throws IOException { super(in); } + /** + * Creates a new CancelTasksResponse. + * + * @param tasks the tasks + * @param taskFailures the task failures + * @param nodeFailures the node failures + */ public CancelTasksResponse( List tasks, List taskFailures, @@ -77,6 +90,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return super.toXContent(builder, params); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static CancelTasksResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java index 457a4230..512caa87 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java @@ -41,7 +41,13 @@ */ public class GetTaskAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetTaskAction INSTANCE = new GetTaskAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/task/get"; private GetTaskAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java index 66b8e36d..13383556 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java @@ -60,12 +60,20 @@ public class GetTaskRequest extends ActionRequest { */ public GetTaskRequest() {} + /** + * Returns the task identifier. + * + * @return the task identifier + */ public TaskId getTaskId() { return taskId; } /** * Set the TaskId to look up. Required. + * + * @param taskId the task identifier + * @return this instance */ public GetTaskRequest setTaskId(TaskId taskId) { this.taskId = taskId; @@ -74,6 +82,8 @@ public GetTaskRequest setTaskId(TaskId taskId) { /** * Should this request wait for all found tasks to complete? + * + * @return the wait for completion */ public boolean getWaitForCompletion() { return waitForCompletion; @@ -81,6 +91,8 @@ public boolean getWaitForCompletion() { /** * Timeout to wait for any async actions this request must take. It must take anywhere from 0 to 2. + * + * @return the timeout */ public TimeValue getTimeout() { return timeout; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java index bfd26ae2..aa7330e1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java @@ -45,12 +45,21 @@ */ @PublicApi(since = "1.0.0") public class GetTaskRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new GetTaskRequestBuilder. + * + * @param client the client + * @param action the action + */ public GetTaskRequestBuilder(OpenSearchClient client, GetTaskAction action) { super(client, action, new GetTaskRequest()); } /** * Set the TaskId to look up. Required. + * + * @param taskId the task identifier + * @return this instance */ public final GetTaskRequestBuilder setTaskId(TaskId taskId) { request.setTaskId(taskId); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java index c2355508..65a26712 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java @@ -56,10 +56,21 @@ public class GetTaskResponse extends ActionResponse implements ToXContentObject private final TaskResult task; + /** + * Creates a new GetTaskResponse. + * + * @param task the task + */ public GetTaskResponse(TaskResult task) { this.task = requireNonNull(task, "task is required"); } + /** + * Creates a new GetTaskResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetTaskResponse(StreamInput in) throws IOException { super(in); task = in.readOptionalWriteable(TaskResult::new); @@ -72,6 +83,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Get the actual result of the fetch. + * + * @return the task */ public TaskResult getTask() { return task; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java index 03ba82c5..bf624097 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java @@ -41,7 +41,13 @@ */ public class ListTasksAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ListTasksAction INSTANCE = new ListTasksAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/tasks/lists"; private ListTasksAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java index d58087e2..b84ba438 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java @@ -50,6 +50,9 @@ public class ListTasksRequest extends BaseTasksRequest { private boolean detailed = false; private boolean waitForCompletion = false; + /** + * Creates a new ListTasksRequest. + */ public ListTasksRequest() {} @Override @@ -61,6 +64,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Should the detailed task information be returned. + * + * @return the detailed */ public boolean getDetailed() { return this.detailed; @@ -68,6 +73,8 @@ public boolean getDetailed() { /** * Should this request wait for all found tasks to complete? + * + * @return the wait for completion */ public boolean getWaitForCompletion() { return waitForCompletion; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java index bc0e9c2f..eda5aa97 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java @@ -44,6 +44,12 @@ @PublicApi(since = "1.0.0") public class ListTasksRequestBuilder extends TasksRequestBuilder { + /** + * Creates a new ListTasksRequestBuilder. + * + * @param client the client + * @param action the action + */ public ListTasksRequestBuilder(OpenSearchClient client, ListTasksAction action) { super(client, action, new ListTasksRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java index 8c822276..3e1b2921 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java @@ -73,6 +73,13 @@ public class ListTasksResponse extends BaseTasksResponse implements ToXContentOb private final List tasks; + /** + * Creates a new ListTasksResponse. + * + * @param tasks the tasks + * @param taskFailures the task failures + * @param nodeFailures the node failures + */ public ListTasksResponse( List tasks, List taskFailures, @@ -82,6 +89,12 @@ public ListTasksResponse( this.tasks = tasks == null ? Collections.emptyList() : Collections.unmodifiableList(new ArrayList<>(tasks)); } + /** + * Creates a new ListTasksResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ListTasksResponse(StreamInput in) throws IOException { super(in); tasks = Collections.unmodifiableList(in.readList(TaskInfo::new)); @@ -93,6 +106,14 @@ public void writeTo(StreamOutput out) throws IOException { out.writeList(tasks); } + /** + * Returns the setup parser. + * + * @param the element type + * @param name the name + * @param ctor the ctor + * @return the setup parser + */ protected static ConstructingObjectParser setupParser( String name, TriFunction, List, List, T> ctor @@ -120,6 +141,8 @@ protected static ConstructingObjectParser setupParser( /** * Get the tasks found by this request. + * + * @return the tasks */ public List getTasks() { return tasks; @@ -127,6 +150,11 @@ public List getTasks() { /** * Presents a flat list of tasks + * + * @param builder the content builder + * @param params the serialization parameters + * @return the XContent grouped by none + * @throws IOException if an I/O error occurs */ public XContentBuilder toXContentGroupedByNone(XContentBuilder builder, Params params) throws IOException { toXContentCommon(builder, params); @@ -148,6 +176,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ListTasksResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodeUsage.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodeUsage.java index 3247d499..677440d2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodeUsage.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodeUsage.java @@ -54,6 +54,12 @@ public class NodeUsage extends BaseNodeResponse implements ToXContentFragment { private final Map restUsage; private final Map aggregationUsage; + /** + * Creates a new NodeUsage by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ @SuppressWarnings("unchecked") public NodeUsage(StreamInput in) throws IOException { super(in); @@ -64,6 +70,8 @@ public NodeUsage(StreamInput in) throws IOException { } /** + * Creates a new NodeUsage. + * * @param node * the node these statistics were collected from * @param timestamp @@ -74,6 +82,7 @@ public NodeUsage(StreamInput in) throws IOException { * @param restUsage * a map containing the counts of the number of times each REST * endpoint has been called + * @param aggregationUsage the aggregation usage */ public NodeUsage( DiscoveryNode node, @@ -90,6 +99,8 @@ public NodeUsage( } /** + * Returns the timestamp. + * * @return the timestamp for when these statistics were collected */ public long getTimestamp() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java index 042914a4..62436144 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java @@ -41,9 +41,18 @@ */ public class NodesUsageAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final NodesUsageAction INSTANCE = new NodesUsageAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/nodes/usage"; + /** + * Creates a new NodesUsageAction. + */ protected NodesUsageAction() { super(NAME, NodesUsageResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java index 6ba040d2..aed2f7c3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java @@ -53,6 +53,8 @@ public class NodesUsageRequest extends BaseNodesRequest { /** * Get usage from nodes based on the nodes ids specified. If none are * passed, usage for all nodes will be returned. + * + * @param nodesIds the nodes identifiers */ public NodesUsageRequest(String... nodesIds) { super(nodesIds); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java index 3f1ed422..f94cd3dc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java @@ -48,6 +48,12 @@ public class NodesUsageRequestBuilder extends NodesOperationRequestBuilder< NodesUsageResponse, NodesUsageRequestBuilder> { + /** + * Creates a new NodesUsageRequestBuilder. + * + * @param client the client + * @param action the action + */ public NodesUsageRequestBuilder(OpenSearchClient client, ActionType action) { super(client, action, new NodesUsageRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java index 490c7b3e..6f3ad127 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java @@ -54,10 +54,23 @@ @PublicApi(since = "1.0.0") public class NodesUsageResponse extends BaseNodesResponse implements ToXContentFragment { + /** + * Creates a new NodesUsageResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public NodesUsageResponse(StreamInput in) throws IOException { super(in); } + /** + * Creates a new NodesUsageResponse. + * + * @param clusterName the cluster name + * @param nodes the nodes + * @param failures the failures + */ public NodesUsageResponse(ClusterName clusterName, List nodes, List failures) { super(clusterName, nodes, failures); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoAction.java index 851d3775..fbba8626 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoAction.java @@ -41,7 +41,13 @@ */ public final class RemoteInfoAction extends ActionType { + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/remote/info"; + /** + * The INSTANCE constant. + */ public static final RemoteInfoAction INSTANCE = new RemoteInfoAction(); private RemoteInfoAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java index adaef65b..db69d04d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java @@ -45,6 +45,9 @@ */ public final class RemoteInfoRequest extends ActionRequest { + /** + * Creates a new RemoteInfoRequest. + */ public RemoteInfoRequest() {} @Override diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java index d276f704..ea5a1de6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java @@ -59,10 +59,20 @@ public final class RemoteInfoResponse extends ActionResponse implements ToXConte infos = in.readList(RemoteConnectionInfo::new); } + /** + * Creates a new RemoteInfoResponse. + * + * @param infos the infos + */ public RemoteInfoResponse(Collection infos) { this.infos = Collections.unmodifiableList(new ArrayList<>(infos)); } + /** + * Returns the infos. + * + * @return the infos + */ public List getInfos() { return infos; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataAction.java index c4bc98bb..b9678c0e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataAction.java @@ -16,7 +16,13 @@ * @opensearch.internal */ public class RemoteStoreMetadataAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final RemoteStoreMetadataAction INSTANCE = new RemoteStoreMetadataAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/remote_store/metadata"; private RemoteStoreMetadataAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequest.java index b3a11618..2b153ebc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequest.java @@ -24,6 +24,9 @@ public class RemoteStoreMetadataRequest extends BroadcastRequest { private String[] shards; + /** + * Creates a new RemoteStoreMetadataRequest. + */ public RemoteStoreMetadataRequest() { super((String[]) null); shards = new String[0]; @@ -35,6 +38,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeStringArray(shards); } + /** + * Returns the shards. + * + * @return the shards + */ public String[] shards() { return this.shards; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequestBuilder.java index e35ff16d..9bd5f4f1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataRequestBuilder.java @@ -24,6 +24,12 @@ public class RemoteStoreMetadataRequestBuilder extends BroadcastOperationRequest RemoteStoreMetadataResponse, RemoteStoreMetadataRequestBuilder> { + /** + * Creates a new RemoteStoreMetadataRequestBuilder. + * + * @param client the client + * @param action the action + */ public RemoteStoreMetadataRequestBuilder(OpenSearchClient client, RemoteStoreMetadataAction action) { super(client, action, new RemoteStoreMetadataRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataResponse.java index 115b48cf..faf79d86 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreMetadataResponse.java @@ -32,11 +32,26 @@ public class RemoteStoreMetadataResponse extends BroadcastResponse { private final RemoteStoreShardMetadata[] remoteStoreShardMetadata; + /** + * Creates a new RemoteStoreMetadataResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public RemoteStoreMetadataResponse(StreamInput in) throws IOException { super(in); remoteStoreShardMetadata = in.readArray(RemoteStoreShardMetadata::new, RemoteStoreShardMetadata[]::new); } + /** + * Creates a new RemoteStoreMetadataResponse. + * + * @param remoteStoreShardMetadata the remote store shard metadata + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param failedShards the failed shards + * @param shardFailures the shard failures + */ public RemoteStoreMetadataResponse( RemoteStoreShardMetadata[] remoteStoreShardMetadata, int totalShards, diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreShardMetadata.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreShardMetadata.java index 3c839e26..fd76516c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreShardMetadata.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/metadata/RemoteStoreShardMetadata.java @@ -33,6 +33,16 @@ public class RemoteStoreShardMetadata implements Writeable, ToXContentFragment { private final String latestSegmentMetadataFileName; private final String latestTranslogMetadataFileName; + /** + * Creates a new RemoteStoreShardMetadata. + * + * @param indexName the index name + * @param shardId the shard identifier + * @param segmentMetadataFiles the segment metadata files + * @param translogMetadataFiles the translog metadata files + * @param latestSegmentMetadataFileName the latest segment metadata file name + * @param latestTranslogMetadataFileName the latest translog metadata file name + */ public RemoteStoreShardMetadata( String indexName, int shardId, @@ -49,6 +59,12 @@ public RemoteStoreShardMetadata( this.latestTranslogMetadataFileName = latestTranslogMetadataFileName; } + /** + * Creates a new RemoteStoreShardMetadata by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ @SuppressWarnings("unchecked") public RemoteStoreShardMetadata(StreamInput in) throws IOException { this.indexName = in.readString(); @@ -107,26 +123,56 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder.endObject(); } + /** + * Returns the index name. + * + * @return the index name + */ public String getIndexName() { return indexName; } + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public int getShardId() { return shardId; } + /** + * Returns the segment metadata files. + * + * @return the segment metadata files + */ public Map> getSegmentMetadataFiles() { return segmentMetadataFiles; } + /** + * Returns the translog metadata files. + * + * @return the translog metadata files + */ public Map> getTranslogMetadataFiles() { return translogMetadataFiles; } + /** + * Returns the latest segment metadata file name. + * + * @return the latest segment metadata file name + */ public String getLatestSegmentMetadataFileName() { return latestSegmentMetadataFileName; } + /** + * Returns the latest translog metadata file name. + * + * @return the latest translog metadata file name + */ public String getLatestTranslogMetadataFileName() { return latestTranslogMetadataFileName; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStats.java index 329f7c45..262b3c90 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStats.java @@ -44,6 +44,11 @@ public class RemoteStoreStats implements Writeable, ToXContentFragment { this.shardRouting = new ShardRouting(in); } + /** + * Returns the shard routing. + * + * @return the shard routing + */ public ShardRouting getShardRouting() { return shardRouting; } @@ -225,6 +230,12 @@ static final class RoutingFields { * Fields for remote store stats response */ public static final class UploadStatsFields { + /** + * Creates a new UploadStatsFields. + */ + public UploadStatsFields() { + } + /** * Lag in terms of bytes b/w local and remote store */ @@ -352,15 +363,42 @@ static final class DownloadStatsFields { * Reusable sub fields for {@link UploadStatsFields} and {@link DownloadStatsFields} */ public static final class SubFields { + /** + * Creates a new SubFields. + */ + public SubFields() { + } + + /** + * The STARTED constant. + */ public static final String STARTED = "started"; + /** + * The SUCCEEDED constant. + */ public static final String SUCCEEDED = "succeeded"; + /** + * The FAILED constant. + */ public static final String FAILED = "failed"; + /** + * The STARTED_BYTES constant. + */ public static final String STARTED_BYTES = "started_bytes"; + /** + * The SUCCEEDED_BYTES constant. + */ public static final String SUCCEEDED_BYTES = "succeeded_bytes"; + /** + * The FAILED_BYTES constant. + */ public static final String FAILED_BYTES = "failed_bytes"; static final String DOWNLOAD = "download"; + /** + * The UPLOAD constant. + */ public static final String UPLOAD = "upload"; /** diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsAction.java index a61bc318..121bf2ed 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsAction.java @@ -17,7 +17,13 @@ */ public class RemoteStoreStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final RemoteStoreStatsAction INSTANCE = new RemoteStoreStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/_remotestore/stats"; private RemoteStoreStatsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsRequest.java index c0290dc4..6edbcd05 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsRequest.java @@ -26,6 +26,9 @@ public class RemoteStoreStatsRequest extends BroadcastRequest { + /** + * Creates a new RemoteStoreStatsRequestBuilder. + * + * @param client the client + * @param action the action + */ public RemoteStoreStatsRequestBuilder(OpenSearchClient client, RemoteStoreStatsAction action) { super(client, action, new RemoteStoreStatsRequest()); } /** * Sets shards preference of request. + * + * @param shards the shards + * @return this instance */ public final RemoteStoreStatsRequestBuilder setShards(String... shards) { request.shards(shards); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsResponse.java index 8570e7db..a2dc981c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/remotestore/stats/RemoteStoreStatsResponse.java @@ -33,11 +33,26 @@ public class RemoteStoreStatsResponse extends BroadcastResponse { private final RemoteStoreStats[] remoteStoreStats; + /** + * Creates a new RemoteStoreStatsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public RemoteStoreStatsResponse(StreamInput in) throws IOException { super(in); remoteStoreStats = in.readArray(RemoteStoreStats::new, RemoteStoreStats[]::new); } + /** + * Creates a new RemoteStoreStatsResponse. + * + * @param remoteStoreStats the remote store stats + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param failedShards the failed shards + * @param shardFailures the shard failures + */ public RemoteStoreStatsResponse( RemoteStoreStats[] remoteStoreStats, int totalShards, @@ -49,6 +64,11 @@ public RemoteStoreStatsResponse( this.remoteStoreStats = remoteStoreStats; } + /** + * Returns the group by index and shards. + * + * @return the group by index and shards + */ public Map>> groupByIndexAndShards() { Map>> indexWiseStats = new HashMap<>(); for (RemoteStoreStats shardStat : remoteStoreStats) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java index 3b1d94cf..b1194d4c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java @@ -42,7 +42,13 @@ */ public class DeleteRepositoryAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeleteRepositoryAction INSTANCE = new DeleteRepositoryAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/repository/delete"; private DeleteRepositoryAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java index 1bcfbc9a..af4899f9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java @@ -54,6 +54,9 @@ public class DeleteRepositoryRequest extends AcknowledgedRequest { + /** + * The INSTANCE constant. + */ public static final GetRepositoriesAction INSTANCE = new GetRepositoriesAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/repository/get"; private GetRepositoriesAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java index b6082cf6..2a195a42 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java @@ -53,6 +53,9 @@ public class GetRepositoriesRequest extends ClusterManagerNodeReadRequest { + /** + * The INSTANCE constant. + */ public static final PutRepositoryAction INSTANCE = new PutRepositoryAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/repository/put"; private PutRepositoryAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java index 4f59defc..873fd9e5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java @@ -73,10 +73,15 @@ public class PutRepositoryRequest extends AcknowledgedRequest { + /** + * The INSTANCE constant. + */ public static final VerifyRepositoryAction INSTANCE = new VerifyRepositoryAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/repository/verify"; private VerifyRepositoryAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java index 22d1d1f7..8f133924 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java @@ -52,6 +52,9 @@ public class VerifyRepositoryRequest extends AcknowledgedRequest getNodes() { return nodes; } + /** + * Sets the nodes. + * + * @param nodes the nodes + */ protected void setNodes(List nodes) { this.nodes = nodes; } @@ -177,6 +213,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static VerifyRepositoryResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java index 60d506a0..f8af98b0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java @@ -41,7 +41,13 @@ */ public class ClusterRerouteAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterRerouteAction INSTANCE = new ClusterRerouteAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/reroute"; private ClusterRerouteAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java index 89df33e3..8b4d356a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java @@ -55,11 +55,16 @@ public class ClusterRerouteRequest extends AcknowledgedRequest { + /** + * Creates a new ClusterRerouteRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterRerouteRequestBuilder(OpenSearchClient client, ClusterRerouteAction action) { super(client, action, new ClusterRerouteRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java index fea189f3..558c7418 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java @@ -41,7 +41,13 @@ */ public class ClusterUpdateSettingsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterUpdateSettingsAction INSTANCE = new ClusterUpdateSettingsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/settings/update"; private ClusterUpdateSettingsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java index 014b88a5..34db29ea 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java @@ -78,6 +78,9 @@ public class ClusterUpdateSettingsRequest extends AcknowledgedRequest { + /** + * Creates a new ClusterUpdateSettingsRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterUpdateSettingsRequestBuilder(OpenSearchClient client, ClusterUpdateSettingsAction action) { super(client, action, new ClusterUpdateSettingsRequest()); } /** * Sets the transient settings to be updated. They will not survive a full cluster restart + * + * @param settings the settings + * @return this instance */ public ClusterUpdateSettingsRequestBuilder setTransientSettings(Settings settings) { request.transientSettings(settings); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java index 78d2316b..ba043f92 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java @@ -103,6 +103,12 @@ protected void addCustomFields(XContentBuilder builder, Params params) throws IO builder.endObject(); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ClusterUpdateSettingsResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java index c00db46e..d21d1aa0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java @@ -41,7 +41,13 @@ */ public class ClusterSearchShardsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterSearchShardsAction INSTANCE = new ClusterSearchShardsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/shards/search_shards"; private ClusterSearchShardsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java index 3701ba31..ff91144d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java @@ -65,6 +65,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeArray((o, s) -> s.writeToThin(o), shards); } + /** + * Returns the shards. + * + * @return the shards + */ public ShardRouting[] getShards() { return shards; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java index 6c9ec589..2801b225 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java @@ -66,6 +66,9 @@ public class ClusterSearchShardsRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new ClusterSearchShardsRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterSearchShardsRequestBuilder(OpenSearchClient client, ClusterSearchShardsAction action) { super(client, action, new ClusterSearchShardsRequest()); } /** * Sets the indices the search will be executed on. + * + * @param indices the indices + * @return this instance */ public ClusterSearchShardsRequestBuilder setIndices(String... indices) { request.indices(indices); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java index 0e92422f..16594d45 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java @@ -57,6 +57,12 @@ public class ClusterSearchShardsResponse extends ActionResponse implements ToXCo private final DiscoveryNode[] nodes; private final Map indicesAndFilters; + /** + * Creates a new ClusterSearchShardsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClusterSearchShardsResponse(StreamInput in) throws IOException { super(in); groups = in.readArray(ClusterSearchShardsGroup::new, ClusterSearchShardsGroup[]::new); @@ -71,6 +77,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeMap(indicesAndFilters, StreamOutput::writeString, (o, s) -> s.writeTo(o)); } + /** + * Creates a new ClusterSearchShardsResponse. + * + * @param groups the groups + * @param nodes the nodes + * @param indicesAndFilters the indices and filters + */ public ClusterSearchShardsResponse( ClusterSearchShardsGroup[] groups, DiscoveryNode[] nodes, @@ -81,10 +94,20 @@ public ClusterSearchShardsResponse( this.indicesAndFilters = indicesAndFilters; } + /** + * Returns the groups. + * + * @return the groups + */ public ClusterSearchShardsGroup[] getGroups() { return groups; } + /** + * Returns the nodes. + * + * @return the nodes + */ public DiscoveryNode[] getNodes() { return nodes; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java index 649b820f..ed9a74ea 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java @@ -41,7 +41,13 @@ */ public class CreateSnapshotAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final CreateSnapshotAction INSTANCE = new CreateSnapshotAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/snapshot/create"; private CreateSnapshotAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java index 5d069b47..62815ecb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java @@ -84,6 +84,9 @@ public class CreateSnapshotRequest extends ClusterManagerNodeRequest userMetadata; + /** + * Creates a new CreateSnapshotRequest. + */ public CreateSnapshotRequest() {} /** @@ -165,6 +171,12 @@ public ActionRequestValidationException validate() { return validationException; } + /** + * Returns the metadata size. + * + * @param userMetadata the user metadata + * @return the metadata size + */ public static int metadataSize(Map userMetadata) { if (userMetadata == null) { return 0; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java index dd7546e5..d4a64be6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java @@ -54,6 +54,11 @@ public class CreateSnapshotRequestBuilder extends ClusterManagerNodeOperationReq /** * Constructs a new create snapshot request builder with specified repository and snapshot names + * + * @param client the client + * @param action the action + * @param repository the repository + * @param snapshot the snapshot */ public CreateSnapshotRequestBuilder(OpenSearchClient client, CreateSnapshotAction action, String repository, String snapshot) { super(client, action, new CreateSnapshotRequest(repository, snapshot)); @@ -66,6 +71,7 @@ public CreateSnapshotRequestBuilder(OpenSearchClient client, CreateSnapshotActio * prefix "test" except index "test42". Aliases are supported. An empty list or {"_all"} will snapshot all open * indices in the cluster. * + * @param indices the indices * @return this builder */ public CreateSnapshotRequestBuilder setIndices(String... indices) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java index abb04f74..7e0f7cb0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java @@ -76,6 +76,12 @@ public class CreateSnapshotResponse extends ActionResponse implements ToXContent CreateSnapshotResponse() {} + /** + * Creates a new CreateSnapshotResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public CreateSnapshotResponse(StreamInput in) throws IOException { super(in); snapshotInfo = in.readOptionalWriteable(SnapshotInfo::new); @@ -112,6 +118,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static CreateSnapshotResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java index 47c0da25..b567ae7c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java @@ -42,7 +42,13 @@ */ public class DeleteSnapshotAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeleteSnapshotAction INSTANCE = new DeleteSnapshotAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/snapshot/delete"; private DeleteSnapshotAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java index cd78d008..a9be76c8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java @@ -50,6 +50,11 @@ public class DeleteSnapshotRequestBuilder extends ClusterManagerNodeOperationReq /** * Constructs delete snapshot request builder with specified repository and snapshot names + * + * @param client the client + * @param action the action + * @param repository the repository + * @param snapshots the snapshots */ public DeleteSnapshotRequestBuilder(OpenSearchClient client, DeleteSnapshotAction action, String repository, String... snapshots) { super(client, action, new DeleteSnapshotRequest(repository, snapshots)); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java index 1a3f948c..d67cd931 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java @@ -41,7 +41,13 @@ */ public class GetSnapshotsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetSnapshotsAction INSTANCE = new GetSnapshotsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/snapshot/get"; private GetSnapshotsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java index b82fdb1c..ce39c0be 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java @@ -51,6 +51,9 @@ @PublicApi(since = "1.0.0") public class GetSnapshotsRequest extends ClusterManagerNodeRequest { + /** + * The DEFAULT_VERBOSE_MODE constant. + */ public static final boolean DEFAULT_VERBOSE_MODE = true; private String repository; @@ -61,6 +64,9 @@ public class GetSnapshotsRequest extends ClusterManagerNodeRequest snapshots; + /** + * Creates a new GetSnapshotsResponse. + * + * @param snapshots the snapshots + */ public GetSnapshotsResponse(List snapshots) { this.snapshots = Collections.unmodifiableList(snapshots); } @@ -111,6 +116,13 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static GetSnapshotsResponse fromXContent(XContentParser parser) throws IOException { return GET_SNAPSHOT_PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java index a718a669..dcb0ad4f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java @@ -41,7 +41,13 @@ */ public class RestoreSnapshotAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final RestoreSnapshotAction INSTANCE = new RestoreSnapshotAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/snapshot/restore"; private RestoreSnapshotAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index d7bf5d7c..804f9e75 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -83,7 +83,13 @@ public class RestoreSnapshotRequest extends ClusterManagerNodeRequest PARSER = new ConstructingObjectParser<>( "restore_snapshot", true, @@ -118,6 +132,13 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par PARSER.declareBoolean(optionalConstructorArg(), new ParseField("accepted")); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static RestoreSnapshotResponse fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java index ad454802..e18b6cca 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java @@ -70,6 +70,12 @@ public class SnapshotIndexShardStatus extends BroadcastShardResponse implements private String failure; + /** + * Creates a new SnapshotIndexShardStatus by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public SnapshotIndexShardStatus(StreamInput in) throws IOException { super(in); stage = SnapshotIndexShardStage.fromValue(in.readByte()); @@ -123,6 +129,8 @@ public SnapshotIndexShardStatus(StreamInput in) throws IOException { /** * Returns snapshot stage + * + * @return the stage */ public SnapshotIndexShardStage getStage() { return stage; @@ -130,6 +138,8 @@ public SnapshotIndexShardStage getStage() { /** * Returns snapshot stats + * + * @return the stats */ public SnapshotStats getStats() { return stats; @@ -137,6 +147,8 @@ public SnapshotStats getStats() { /** * Returns node id of the node where snapshot is currently running + * + * @return the node identifier */ public String getNodeId() { return nodeId; @@ -144,6 +156,8 @@ public String getNodeId() { /** * Returns reason for snapshot failure + * + * @return the failure */ public String getFailure() { return failure; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java index f51a68d5..7b5175c1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java @@ -81,6 +81,14 @@ public class SnapshotIndexStatus implements Iterable, this.indexShards = unmodifiableMap(indexShards); } + /** + * Creates a new SnapshotIndexStatus. + * + * @param index the index + * @param indexShards the index shards + * @param shardsStats the shards stats + * @param stats the stats + */ public SnapshotIndexStatus( String index, Map indexShards, @@ -95,6 +103,8 @@ public SnapshotIndexStatus( /** * Returns the index name + * + * @return the index */ public String getIndex() { return this.index; @@ -102,6 +112,8 @@ public String getIndex() { /** * A shard id to index snapshot shard status map + * + * @return the shards */ public Map getShards() { return this.indexShards; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java index 70720a93..ee0f7da3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java @@ -85,6 +85,16 @@ public class SnapshotShardsStats implements ToXContentObject { } } + /** + * Creates a new SnapshotShardsStats. + * + * @param initializingShards the initializing shards + * @param startedShards the started shards + * @param finalizingShards the finalizing shards + * @param doneShards the done shards + * @param failedShards the failed shards + * @param totalShards the total shards + */ public SnapshotShardsStats( int initializingShards, int startedShards, @@ -103,6 +113,8 @@ public SnapshotShardsStats( /** * Number of shards with the snapshot in the initializing stage + * + * @return the initializing shards */ public int getInitializingShards() { return initializingShards; @@ -110,6 +122,8 @@ public int getInitializingShards() { /** * Number of shards with the snapshot in the started stage + * + * @return the started shards */ public int getStartedShards() { return startedShards; @@ -117,6 +131,8 @@ public int getStartedShards() { /** * Number of shards with the snapshot in the finalizing stage + * + * @return the finalizing shards */ public int getFinalizingShards() { return finalizingShards; @@ -124,6 +140,8 @@ public int getFinalizingShards() { /** * Number of shards with completed snapshot + * + * @return the done shards */ public int getDoneShards() { return doneShards; @@ -131,6 +149,8 @@ public int getDoneShards() { /** * Number of shards with failed snapshot + * + * @return the failed shards */ public int getFailedShards() { return failedShards; @@ -138,6 +158,8 @@ public int getFailedShards() { /** * Total number of shards + * + * @return the total shards */ public int getTotalShards() { return totalShards; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java index 5380b9ec..e97a3cbe 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java @@ -104,6 +104,8 @@ public class SnapshotStats implements Writeable, ToXContentObject { /** * Returns time when snapshot started + * + * @return the start time */ public long getStartTime() { return startTime; @@ -111,6 +113,8 @@ public long getStartTime() { /** * Returns snapshot running time + * + * @return the time */ public long getTime() { return time; @@ -118,6 +122,8 @@ public long getTime() { /** * Returns incremental file count of the snapshot + * + * @return the incremental file count */ public int getIncrementalFileCount() { return incrementalFileCount; @@ -125,6 +131,8 @@ public int getIncrementalFileCount() { /** * Returns total number of files in the snapshot + * + * @return the total file count */ public int getTotalFileCount() { return totalFileCount; @@ -132,6 +140,8 @@ public int getTotalFileCount() { /** * Returns number of files in the snapshot that were processed so far + * + * @return the processed file count */ public int getProcessedFileCount() { return processedFileCount; @@ -139,6 +149,8 @@ public int getProcessedFileCount() { /** * Return incremental files size of the snapshot + * + * @return the incremental size */ public long getIncrementalSize() { return incrementalSize; @@ -146,6 +158,8 @@ public long getIncrementalSize() { /** * Returns total size of files in the snapshot + * + * @return the total size */ public long getTotalSize() { return totalSize; @@ -153,6 +167,8 @@ public long getTotalSize() { /** * Returns total size of files in the snapshot that were processed so far + * + * @return the processed size */ public long getProcessedSize() { return processedSize; @@ -228,6 +244,13 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par return builder.endObject(); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static SnapshotStats fromXContent(XContentParser parser) throws IOException { // Parse this old school style instead of using the ObjectParser since there's an impedance mismatch between how the // object has historically been written as JSON versus how it is structured in Java. diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java index 0bbb5974..5908f621 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java @@ -119,6 +119,8 @@ private SnapshotStatus( /** * Returns list of snapshot indices + * + * @return the indices */ public Map getIndices() { if (this.indicesStatus != null) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java index 4d876020..9cf584e6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java @@ -41,7 +41,13 @@ */ public class SnapshotsStatusAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final SnapshotsStatusAction INSTANCE = new SnapshotsStatusAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/snapshot/status"; private SnapshotsStatusAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java index 468e7f5e..858b96ca 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java @@ -60,6 +60,9 @@ public class SnapshotsStatusRequest extends ClusterManagerNodeRequest snapshots; + /** + * Creates a new SnapshotsStatusResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public SnapshotsStatusResponse(StreamInput in) throws IOException { super(in); snapshots = Collections.unmodifiableList(in.readList(SnapshotStatus::new)); @@ -107,6 +113,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws PARSER.declareObjectArray(constructorArg(), SnapshotStatus.PARSER, new ParseField("snapshots")); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static SnapshotsStatusResponse fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateAction.java index 9b6ab07d..dbfd1462 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateAction.java @@ -41,7 +41,13 @@ */ public class ClusterStateAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterStateAction INSTANCE = new ClusterStateAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/state"; private ClusterStateAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateRequest.java index a0804e0f..53eb48f8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateRequest.java @@ -52,6 +52,9 @@ @PublicApi(since = "1.0.0") public class ClusterStateRequest extends ClusterManagerNodeReadRequest implements IndicesRequest.Replaceable { + /** + * The DEFAULT_WAIT_FOR_NODE_TIMEOUT constant. + */ public static final TimeValue DEFAULT_WAIT_FOR_NODE_TIMEOUT = TimeValue.timeValueMinutes(1); private boolean routingTable = true; @@ -64,6 +67,9 @@ public class ClusterStateRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new ClusterStateRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterStateRequestBuilder(OpenSearchClient client, ClusterStateAction action) { super(client, action, new ClusterStateRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateResponse.java index 6c2c9a62..115d278c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/state/ClusterStateResponse.java @@ -55,6 +55,12 @@ public class ClusterStateResponse extends ActionResponse { private ClusterState clusterState; private boolean waitForTimedOut = false; + /** + * Creates a new ClusterStateResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClusterStateResponse(StreamInput in) throws IOException { super(in); clusterName = new ClusterName(in); @@ -62,6 +68,13 @@ public ClusterStateResponse(StreamInput in) throws IOException { waitForTimedOut = in.readBoolean(); } + /** + * Creates a new ClusterStateResponse. + * + * @param clusterName the cluster name + * @param clusterState the cluster state + * @param waitForTimedOut the wait for timed out + */ public ClusterStateResponse(ClusterName clusterName, ClusterState clusterState, boolean waitForTimedOut) { this.clusterName = clusterName; this.clusterState = clusterState; @@ -71,6 +84,8 @@ public ClusterStateResponse(ClusterName clusterName, ClusterState clusterState, /** * The requested cluster state. Only the parts of the cluster state that were * requested are included in the returned {@link ClusterState} instance. + * + * @return the state */ public ClusterState getState() { return this.clusterState; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/AnalysisStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/AnalysisStats.java index 73f7ec31..b48ac7a3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/AnalysisStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/AnalysisStats.java @@ -69,6 +69,9 @@ public final class AnalysisStats implements ToXContentFragment, Writeable { /** * Create {@link AnalysisStats} from the given cluster state. + * + * @param state the state + * @return the new instance */ public static AnalysisStats of(ClusterState state) { final Map usedCharFilterTypes = new HashMap<>(); @@ -215,6 +218,12 @@ private static Set sort(Collection set) { this.usedBuiltInAnalyzers = sort(usedBuiltInAnalyzers); } + /** + * Creates a new AnalysisStats by reading it from the given input. + * + * @param input the input + * @throws IOException if an I/O error occurs + */ public AnalysisStats(StreamInput input) throws IOException { usedCharFilters = Collections.unmodifiableSet(new LinkedHashSet<>(input.readList(IndexFeatureStats::new))); usedTokenizers = Collections.unmodifiableSet(new LinkedHashSet<>(input.readList(IndexFeatureStats::new))); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsAction.java index 3010497f..140e9bd6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsAction.java @@ -41,7 +41,13 @@ */ public class ClusterStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClusterStatsAction INSTANCE = new ClusterStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/stats"; private ClusterStatsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java index 090a0b7e..5da8bae3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java @@ -69,11 +69,26 @@ public class ClusterStatsIndices implements ToXContentFragment { private AnalysisStats analysis; private MappingStats mappings; + /** + * Creates a new ClusterStatsIndices. + * + * @param nodeResponses the node responses + * @param mappingStats the mapping stats + * @param analysisStats the analysis stats + */ public ClusterStatsIndices(List nodeResponses, MappingStats mappingStats, AnalysisStats analysisStats) { this(Set.of(IndexMetric.values()), nodeResponses, mappingStats, analysisStats); } + /** + * Creates a new ClusterStatsIndices. + * + * @param indicesMetrics the indices metrics + * @param nodeResponses the node responses + * @param mappingStats the mapping stats + * @param analysisStats the analysis stats + */ public ClusterStatsIndices( Set indicesMetrics, List nodeResponses, @@ -171,10 +186,20 @@ public ClusterStatsIndices( this.analysis = analysisStats; } + /** + * Returns the mappings. + * + * @return the mappings + */ public MappingStats getMappings() { return mappings; } + /** + * Returns the analysis. + * + * @return the analysis + */ public AnalysisStats getAnalysis() { return analysis; } @@ -242,8 +267,16 @@ public static class ShardStats implements ToXContentFragment { double totalIndexReplication = 0; double maxIndexReplication = -1; + /** + * Creates a new ShardStats. + */ public ShardStats() {} + /** + * Creates a new ShardStats. + * + * @param aggregatedIndexStats the aggregated index stats + */ public ShardStats(ClusterStatsNodeResponse.AggregatedIndexStats aggregatedIndexStats) { this.total = aggregatedIndexStats.total; this.primaries = aggregatedIndexStats.primaries; @@ -251,6 +284,8 @@ public ShardStats(ClusterStatsNodeResponse.AggregatedIndexStats aggregatedIndexS /** * returns how many *redundant* copies of the data the cluster holds - running with no replicas will return 0 + * + * @return the replication */ public double getReplication() { if (primaries == 0) { @@ -261,6 +296,8 @@ public double getReplication() { /** * average number of shards (primary+replicas) across the indices + * + * @return the avg index shards */ public double getAvgIndexShards() { if (this.indices == 0) { @@ -271,6 +308,8 @@ public double getAvgIndexShards() { /** * the average number primary shards across the indices + * + * @return the avg index primary shards */ public double getAvgIndexPrimaryShards() { if (this.indices == 0) { @@ -281,6 +320,8 @@ public double getAvgIndexPrimaryShards() { /** * average replication factor across the indices. See {@link #getReplication} + * + * @return the avg index replication */ public double getAvgIndexReplication() { if (indices == 0) { @@ -289,6 +330,11 @@ public double getAvgIndexReplication() { return this.totalIndexReplication / this.indices; } + /** + * Adds the index shard count. + * + * @param indexShardCount the index shard count + */ public void addIndexShardCount(ShardStats indexShardCount) { this.indices++; this.primaries += indexShardCount.primaries; @@ -313,6 +359,11 @@ public void addIndexShardCount(ShardStats indexShardCount) { } } + /** + * Adds the stats from. + * + * @param incomingStats the incoming stats + */ public void addStatsFrom(ClusterStatsNodeResponse.AggregatedIndexStats incomingStats) { this.total += incomingStats.total; this.primaries += incomingStats.primaries; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java index c3941d38..4ca1c447 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java @@ -69,6 +69,12 @@ public class ClusterStatsNodeResponse extends BaseNodeResponse { private ClusterHealthStatus clusterStatus; private AggregatedNodeLevelStats aggregatedNodeLevelStats; + /** + * Creates a new ClusterStatsNodeResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClusterStatsNodeResponse(StreamInput in) throws IOException { super(in); clusterStatus = null; @@ -85,30 +91,59 @@ public ClusterStatsNodeResponse(StreamInput in) throws IOException { } } + /** + * Returns the node info. + * + * @return the node info + */ public NodeInfo nodeInfo() { return this.nodeInfo; } + /** + * Returns the node stats. + * + * @return the node stats + */ public NodeStats nodeStats() { return this.nodeStats; } /** * Cluster Health Status, only populated on cluster-manager nodes. + * + * @return the cluster status */ @Nullable public ClusterHealthStatus clusterStatus() { return clusterStatus; } + /** + * Returns the shards stats. + * + * @return the shards stats + */ public ShardStats[] shardsStats() { return this.shardsStats; } + /** + * Returns the aggregated node level stats. + * + * @return the aggregated node level stats + */ public AggregatedNodeLevelStats getAggregatedNodeLevelStats() { return aggregatedNodeLevelStats; } + /** + * Reads the node response. + * + * @param in the input to read from + * @return the node response + * @throws IOException if an I/O error occurs + */ public static ClusterStatsNodeResponse readNodeResponse(StreamInput in) throws IOException { return new ClusterStatsNodeResponse(in); } @@ -145,12 +180,24 @@ public class AggregatedNodeLevelStats extends BaseNodeResponse { CommonStats commonStats; Map indexStatsMap; + /** + * Creates a new AggregatedNodeLevelStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ protected AggregatedNodeLevelStats(StreamInput in) throws IOException { super(in); commonStats = in.readOptionalWriteable(CommonStats::new); indexStatsMap = in.readMap(StreamInput::readString, AggregatedIndexStats::new); } + /** + * Creates a new AggregatedNodeLevelStats. + * + * @param node the node + * @param indexShardsStats the index shards stats + */ protected AggregatedNodeLevelStats(DiscoveryNode node, ShardStats[] indexShardsStats) { super(node); this.commonStats = new CommonStats(); @@ -199,14 +246,29 @@ public void writeTo(StreamOutput out) throws IOException { */ @PublicApi(since = "2.16.0") public static class AggregatedIndexStats implements Writeable { + /** + * The total. + */ public int total = 0; + /** + * The primaries. + */ public int primaries = 0; + /** + * Creates a new AggregatedIndexStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public AggregatedIndexStats(StreamInput in) throws IOException { total = in.readVInt(); primaries = in.readVInt(); } + /** + * Creates a new AggregatedIndexStats. + */ public AggregatedIndexStats() {} @Override diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java index 6ffbba00..170b8790 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -89,6 +89,9 @@ public class ClusterStatsNodes implements ToXContentFragment { private final PackagingTypes packagingTypes; private final IngestStats ingestStats; + /** + * The NODE_STATS_METRICS constant. + */ public static final Set NODE_STATS_METRICS = Set.of( // Stats computed from node info and node stat Metric.OS, @@ -436,6 +439,11 @@ private ProcessStats(List nodeStatsList) { this.maxOpenFileDescriptors = maxOpenFileDescriptors; } + /** + * Returns the avg open file descriptors. + * + * @return the avg open file descriptors + */ public long getAvgOpenFileDescriptors() { if (count == 0) { return -1; @@ -443,6 +451,11 @@ public long getAvgOpenFileDescriptors() { return totalOpenFileDescriptors / count; } + /** + * Returns the max open file descriptors. + * + * @return the max open file descriptors + */ public long getMaxOpenFileDescriptors() { if (count == 0) { return -1; @@ -450,6 +463,11 @@ public long getMaxOpenFileDescriptors() { return maxOpenFileDescriptors; } + /** + * Returns the min open file descriptors. + * + * @return the min open file descriptors + */ public long getMinOpenFileDescriptors() { if (count == 0) { return -1; @@ -534,6 +552,8 @@ private JvmStats(List nodeInfos, List nodeStatsList) { /** * Total heap used in the cluster + * + * @return the heap used */ public ByteSizeValue getHeapUsed() { return new ByteSizeValue(heapUsed); @@ -541,6 +561,8 @@ public ByteSizeValue getHeapUsed() { /** * Maximum total heap available to the cluster + * + * @return the heap max */ public ByteSizeValue getHeapMax() { return new ByteSizeValue(heapMax); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java index 04a76348..ed9d7d2c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java @@ -59,6 +59,8 @@ public class ClusterStatsRequest extends BaseNodesRequest { /** * Get stats from nodes based on the nodes ids specified. If none are passed, stats * based on all nodes will be returned. + * + * @param nodesIds the nodes identifiers */ public ClusterStatsRequest(String... nodesIds) { super(nodesIds); @@ -91,15 +93,45 @@ public void writeTo(StreamOutput out) throws IOException { */ @PublicApi(since = "2.18.0") public enum Metric { + /** + * The OS value. + */ OS("os", 0), + /** + * The JVM value. + */ JVM("jvm", 1), + /** + * The FS value. + */ FS("fs", 2), + /** + * The PROCESS value. + */ PROCESS("process", 3), + /** + * The INGEST value. + */ INGEST("ingest", 4), + /** + * The PLUGINS value. + */ PLUGINS("plugins", 5), + /** + * The NETWORK_TYPES value. + */ NETWORK_TYPES("network_types", 6), + /** + * The DISCOVERY_TYPES value. + */ DISCOVERY_TYPES("discovery_types", 7), + /** + * The PACKAGING_TYPES value. + */ PACKAGING_TYPES("packaging_types", 8), + /** + * The INDICES value. + */ INDICES("indices", 9); private String metricName; @@ -111,6 +143,11 @@ public enum Metric { this.index = index; } + /** + * Returns the index. + * + * @return the index + */ public int getIndex() { return index; } @@ -126,15 +163,42 @@ public int getIndex() { @PublicApi(since = "2.18.0") public enum IndexMetric { // Metrics computed from ShardStats + /** + * The SHARDS value. + */ SHARDS("shards", 0), + /** + * The DOCS value. + */ DOCS("docs", 1), + /** + * The STORE value. + */ STORE("store", 2), + /** + * The FIELDDATA value. + */ FIELDDATA("fielddata", 3), + /** + * The QUERY_CACHE value. + */ QUERY_CACHE("query_cache", 4), + /** + * The COMPLETION value. + */ COMPLETION("completion", 5), + /** + * The SEGMENTS value. + */ SEGMENTS("segments", 6), // Metrics computed from ClusterState + /** + * The ANALYSIS value. + */ ANALYSIS("analysis", 7), + /** + * The MAPPINGS value. + */ MAPPINGS("mappings", 8); private String metricName; @@ -146,6 +210,11 @@ public enum IndexMetric { this.index = index; } + /** + * Returns the index. + * + * @return the index + */ public int getIndex() { return this.index; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java index becfcdd8..2a1d5cb5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java @@ -52,6 +52,12 @@ public class ClusterStatsRequestBuilder extends NodesOperationRequestBuilder< ClusterStatsResponse, ClusterStatsRequestBuilder> { + /** + * Creates a new ClusterStatsRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClusterStatsRequestBuilder(OpenSearchClient client, ClusterStatsAction action) { super(client, action, new ClusterStatsRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java index 153d1cd3..79a0eabf 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java @@ -65,6 +65,12 @@ public class ClusterStatsResponse extends BaseNodesResponse fieldTypes = new HashMap<>(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java index 0653c066..b1c3f089 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java @@ -42,7 +42,13 @@ */ public class DeleteStoredScriptAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeleteStoredScriptAction INSTANCE = new DeleteStoredScriptAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/script/delete"; private DeleteStoredScriptAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java index fd4afcb5..45c82c66 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java @@ -69,10 +69,21 @@ public ActionRequestValidationException validate() { return validationException; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String id() { return id; } + /** + * Returns the identifier. + * + * @param id the identifier + * @return the identifier + */ public DeleteStoredScriptRequest id(String id) { this.id = id; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java index a219a5e4..3f09526c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java @@ -48,10 +48,22 @@ public class DeleteStoredScriptRequestBuilder extends AcknowledgedRequestBuilder AcknowledgedResponse, DeleteStoredScriptRequestBuilder> { + /** + * Creates a new DeleteStoredScriptRequestBuilder. + * + * @param client the client + * @param action the action + */ public DeleteStoredScriptRequestBuilder(OpenSearchClient client, DeleteStoredScriptAction action) { super(client, action, new DeleteStoredScriptRequest()); } + /** + * Sets the identifier. + * + * @param id the identifier + * @return this instance + */ public DeleteStoredScriptRequestBuilder setId(String id) { request.id(id); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java index 4d41fea8..5d0ec43c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java @@ -41,7 +41,13 @@ */ public class GetStoredScriptAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetStoredScriptAction INSTANCE = new GetStoredScriptAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/script/get"; private GetStoredScriptAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java index 34d7832d..f9f70b1b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java @@ -50,6 +50,9 @@ @PublicApi(since = "1.0.0") public class GetStoredScriptRequest extends ClusterManagerNodeReadRequest { + /** + * The identifier. + */ protected String id; GetStoredScriptRequest() { @@ -75,10 +78,21 @@ public ActionRequestValidationException validate() { return validationException; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String id() { return id; } + /** + * Returns the identifier. + * + * @param id the identifier + * @return the identifier + */ public GetStoredScriptRequest id(String id) { this.id = id; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java index 75b61492..a2d50650 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java @@ -47,10 +47,22 @@ public class GetStoredScriptRequestBuilder extends ClusterManagerNodeReadOperati GetStoredScriptResponse, GetStoredScriptRequestBuilder> { + /** + * Creates a new GetStoredScriptRequestBuilder. + * + * @param client the client + * @param action the action + */ public GetStoredScriptRequestBuilder(OpenSearchClient client, GetStoredScriptAction action) { super(client, action, new GetStoredScriptRequest()); } + /** + * Sets the identifier. + * + * @param id the identifier + * @return this instance + */ public GetStoredScriptRequestBuilder setId(String id) { request.id(id); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java index e22ada04..6dc3e00a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java @@ -59,8 +59,17 @@ @PublicApi(since = "1.0.0") public class GetStoredScriptResponse extends ActionResponse implements StatusToXContentObject { + /** + * The _ID_PARSE_FIELD constant. + */ public static final ParseField _ID_PARSE_FIELD = new ParseField("_id"); + /** + * The FOUND_PARSE_FIELD constant. + */ public static final ParseField FOUND_PARSE_FIELD = new ParseField("found"); + /** + * The SCRIPT constant. + */ public static final ParseField SCRIPT = new ParseField("script"); private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( @@ -88,6 +97,12 @@ public class GetStoredScriptResponse extends ActionResponse implements StatusToX private String id; private StoredScriptSource source; + /** + * Creates a new GetStoredScriptResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetStoredScriptResponse(StreamInput in) throws IOException { super(in); @@ -106,6 +121,8 @@ public GetStoredScriptResponse(StreamInput in) throws IOException { } /** + * Returns the source. + * * @return if a stored script and if not found null */ public StoredScriptSource getSource() { @@ -132,6 +149,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static GetStoredScriptResponse fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java index 72bbe364..9246d8b5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java @@ -42,7 +42,13 @@ */ public class PutStoredScriptAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final PutStoredScriptAction INSTANCE = new PutStoredScriptAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/script/put"; private PutStoredScriptAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java index 738eada1..d2c4b842 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java @@ -66,6 +66,9 @@ public class PutStoredScriptRequest extends AcknowledgedRequest { + /** + * Creates a new PutStoredScriptRequestBuilder. + * + * @param client the client + * @param action the action + */ public PutStoredScriptRequestBuilder(OpenSearchClient client, PutStoredScriptAction action) { super(client, action, new PutStoredScriptRequest()); } + /** + * Sets the identifier. + * + * @param id the identifier + * @return this instance + */ public PutStoredScriptRequestBuilder setId(String id) { request.id(id); return this; @@ -61,6 +73,10 @@ public PutStoredScriptRequestBuilder setId(String id) { /** * Set the source of the script along with the content type of the source + * + * @param source the source + * @param mediaType the media type + * @return this instance */ public PutStoredScriptRequestBuilder setContent(BytesReference source, MediaType mediaType) { request.content(source, mediaType); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java index 5dc9e799..93e9980c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java @@ -41,7 +41,13 @@ */ public class PendingClusterTasksAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final PendingClusterTasksAction INSTANCE = new PendingClusterTasksAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/task"; private PendingClusterTasksAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java index b2c5ce61..76d7f2dd 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java @@ -47,6 +47,9 @@ @PublicApi(since = "1.0.0") public class PendingClusterTasksRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new PendingClusterTasksRequest. + */ public PendingClusterTasksRequest() {} @Override diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java index 46f82dd4..11ec30ad 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java @@ -47,6 +47,12 @@ public class PendingClusterTasksRequestBuilder extends ClusterManagerNodeReadOpe PendingClusterTasksResponse, PendingClusterTasksRequestBuilder> { + /** + * Creates a new PendingClusterTasksRequestBuilder. + * + * @param client the client + * @param action the action + */ public PendingClusterTasksRequestBuilder(OpenSearchClient client, PendingClusterTasksAction action) { super(client, action, new PendingClusterTasksRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java index a056c866..c8ba5e5c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java @@ -54,17 +54,30 @@ public class PendingClusterTasksResponse extends ActionResponse implements Itera private final List pendingTasks; + /** + * Creates a new PendingClusterTasksResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public PendingClusterTasksResponse(StreamInput in) throws IOException { super(in); pendingTasks = in.readList(PendingClusterTask::new); } + /** + * Returns the pending tasks. + * + * @return the pending tasks + */ public List pendingTasks() { return pendingTasks; } /** * The pending cluster tasks + * + * @return the pending tasks */ public List getPendingTasks() { return pendingTasks(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsAction.java index 4a063642..e4f64944 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsAction.java @@ -16,7 +16,13 @@ * @opensearch.experimental */ public class WlmStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final WlmStatsAction INSTANCE = new WlmStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/wlm/stats"; private WlmStatsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java index a05c3a74..31bcc0fd 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsRequest.java @@ -29,6 +29,10 @@ public class WlmStatsRequest extends BaseNodesRequest { /** * Get WorkloadGroup stats from nodes based on the nodes ids specified. If none are passed, stats * for all nodes will be returned. + * + * @param nodesIds the nodes identifiers + * @param workloadGroupIds the workload group identifiers + * @param breach the breach */ public WlmStatsRequest(String[] nodesIds, Set workloadGroupIds, Boolean breach) { super(nodesIds); @@ -36,6 +40,9 @@ public WlmStatsRequest(String[] nodesIds, Set workloadGroupIds, Boolean this.breach = breach; } + /** + * Creates a new WlmStatsRequest. + */ public WlmStatsRequest() { super((String[]) null); workloadGroupIds = new HashSet<>(); @@ -49,10 +56,20 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalBoolean(breach); } + /** + * Returns the workload group identifiers. + * + * @return the workload group identifiers + */ public Set getWorkloadGroupIds() { return workloadGroupIds; } + /** + * Returns the breach flag. + * + * @return the breach flag + */ public Boolean isBreach() { return breach; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java index 2f26bc10..54688cd0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/cluster/wlm/WlmStatsResponse.java @@ -33,6 +33,13 @@ public class WlmStatsResponse extends BaseNodesResponse implements ToX super(in); } + /** + * Creates a new WlmStatsResponse. + * + * @param clusterName the cluster name + * @param nodes the nodes + * @param failures the failures + */ public WlmStatsResponse(ClusterName clusterName, List nodes, List failures) { super(clusterName, nodes, failures); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/Alias.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/Alias.java index de69b7d6..222ff7ed 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/Alias.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/Alias.java @@ -84,12 +84,20 @@ public class Alias implements Writeable, ToXContentFragment { @Nullable private Boolean isHidden; + /** + * Creates a new Alias. + * + * @param name the name + */ public Alias(String name) { this.name = name; } /** * Associates a filter to the alias + * + * @param filter the filter + * @return this instance */ public Alias filter(Map filter) { if (filter == null || filter.isEmpty()) { @@ -108,6 +116,9 @@ public Alias filter(Map filter) { /** * Associates a routing value to the alias + * + * @param routing the routing value + * @return the routing */ public Alias routing(String routing) { this.indexRouting = routing; @@ -117,6 +128,9 @@ public Alias routing(String routing) { /** * Associates an index routing value to the alias + * + * @param indexRouting the index routing + * @return this instance */ public Alias indexRouting(String indexRouting) { this.indexRouting = indexRouting; @@ -125,6 +139,9 @@ public Alias indexRouting(String indexRouting) { /** * Associates a search routing value to the alias + * + * @param searchRouting the search routing + * @return this instance */ public Alias searchRouting(String searchRouting) { this.searchRouting = searchRouting; @@ -133,6 +150,9 @@ public Alias searchRouting(String searchRouting) { /** * Sets whether an alias is pointing to a write-index + * + * @param writeIndex the write index + * @return this instance */ public Alias writeIndex(@Nullable Boolean writeIndex) { this.writeIndex = writeIndex; @@ -141,6 +161,9 @@ public Alias writeIndex(@Nullable Boolean writeIndex) { /** * Sets whether this alias is hidden + * + * @param isHidden the is hidden + * @return the hidden flag */ public Alias isHidden(@Nullable Boolean isHidden) { this.isHidden = isHidden; @@ -159,6 +182,10 @@ public void writeTo(StreamOutput out) throws IOException { /** * Parses an alias and returns its parsed representation + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs */ public static Alias fromXContent(XContentParser parser) throws IOException { Alias alias = new Alias(parser.currentName()); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesAction.java index eb6f7004..75f69a3a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesAction.java @@ -42,7 +42,13 @@ */ public class IndicesAliasesAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final IndicesAliasesAction INSTANCE = new IndicesAliasesAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/aliases"; private IndicesAliasesAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java index a85b4285..f836cf71 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java @@ -86,6 +86,9 @@ public class IndicesAliasesRequest extends AcknowledgedRequest parser(String name, Supplier filter) { if (filter == null || filter.isEmpty()) { this.filter = null; @@ -401,6 +471,12 @@ public AliasActions filter(Map filter) { } } + /** + * Writes the index. + * + * @param writeIndex the write index + * @return this instance + */ public AliasActions writeIndex(Boolean writeIndex) { if (type != AliasActions.Type.ADD) { throw new IllegalArgumentException("[is_write_index] is unsupported for [" + type + "]"); @@ -409,6 +485,12 @@ public AliasActions writeIndex(Boolean writeIndex) { return this; } + /** + * Returns the hidden flag. + * + * @param isHidden the is hidden + * @return the hidden flag + */ public AliasActions isHidden(Boolean isHidden) { if (type != AliasActions.Type.ADD) { throw new IllegalArgumentException("[" + IS_HIDDEN.getPreferredName() + "] is unsupported for [" + type + "]"); @@ -417,6 +499,12 @@ public AliasActions isHidden(Boolean isHidden) { return this; } + /** + * Returns the exist flag. + * + * @param mustExist the must exist + * @return the exist flag + */ public AliasActions mustExist(Boolean mustExist) { if (type != Type.REMOVE) { throw new IllegalArgumentException("[" + MUST_EXIST.getPreferredName() + "] is unsupported for [" + type + "]"); @@ -545,6 +633,9 @@ public int hashCode() { /** * Add the action to this request and validate it. + * + * @param aliasAction the alias action + * @return this instance */ public IndicesAliasesRequest addAliasAction(AliasActions aliasAction) { aliasAction.validate(); @@ -581,6 +672,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * The PARSER constant. + */ public static final ObjectParser PARSER = new ObjectParser<>("aliases", IndicesAliasesRequest::new); static { PARSER.declareObjectArray((request, actions) -> { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java index 226d841e..5b12e86e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java @@ -51,6 +51,12 @@ public class IndicesAliasesRequestBuilder extends AcknowledgedRequestBuilder< AcknowledgedResponse, IndicesAliasesRequestBuilder> { + /** + * Creates a new IndicesAliasesRequestBuilder. + * + * @param client the client + * @param action the action + */ public IndicesAliasesRequestBuilder(OpenSearchClient client, IndicesAliasesAction action) { super(client, action, new IndicesAliasesRequest()); } @@ -60,6 +66,7 @@ public IndicesAliasesRequestBuilder(OpenSearchClient client, IndicesAliasesActio * * @param index The index * @param alias The alias + * @return this instance */ public IndicesAliasesRequestBuilder addAlias(String index, String alias) { request.addAliasAction(IndicesAliasesRequest.AliasActions.add().index(index).alias(alias)); @@ -72,6 +79,7 @@ public IndicesAliasesRequestBuilder addAlias(String index, String alias) { * @param index The index * @param alias The alias * @param filter The filter + * @return this instance */ public IndicesAliasesRequestBuilder addAlias(String index, String alias, String filter) { request.addAliasAction(IndicesAliasesRequest.AliasActions.add().index(index).alias(alias).filter(filter)); @@ -83,6 +91,7 @@ public IndicesAliasesRequestBuilder addAlias(String index, String alias, String * * @param index The index * @param alias The alias + * @return this instance */ public IndicesAliasesRequestBuilder removeAlias(String index, String alias) { request.addAliasAction(IndicesAliasesRequest.AliasActions.remove().index(index).alias(alias)); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java index b6f2bdd3..d6f8b40c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java @@ -42,6 +42,8 @@ /** * Base request builder for listing index aliases * + * @param the response type + * @param the builder type * @opensearch.internal */ public abstract class BaseAliasesRequestBuilder< @@ -51,16 +53,35 @@ public abstract class BaseAliasesRequestBuilder< Response, Builder> { + /** + * Creates a new BaseAliasesRequestBuilder. + * + * @param client the client + * @param action the action + * @param aliases the aliases + */ public BaseAliasesRequestBuilder(OpenSearchClient client, ActionType action, String... aliases) { super(client, action, new GetAliasesRequest(aliases)); } + /** + * Sets the aliases. + * + * @param aliases the aliases + * @return this instance + */ @SuppressWarnings("unchecked") public Builder setAliases(String... aliases) { request.aliases(aliases); return (Builder) this; } + /** + * Sets the indices. + * + * @param indices the indices + * @return this instance + */ @SuppressWarnings("unchecked") public Builder setIndices(String... indices) { request.indices(indices); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesAction.java index 4cd6bd6d..191b2307 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesAction.java @@ -41,7 +41,13 @@ */ public class GetAliasesAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetAliasesAction INSTANCE = new GetAliasesAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/aliases/get"; private GetAliasesAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java index d04236a4..7a001b6b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java @@ -55,11 +55,19 @@ public class GetAliasesRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new GetAliasesRequestBuilder. + * + * @param client the client + * @param action the action + * @param aliases the aliases + */ public GetAliasesRequestBuilder(OpenSearchClient client, GetAliasesAction action, String... aliases) { super(client, action, aliases); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java index 8fc6f4f7..8b6d8e36 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java @@ -54,11 +54,22 @@ public class GetAliasesResponse extends ActionResponse { private final Map> aliases; + /** + * Creates a new GetAliasesResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetAliasesResponse(StreamInput in) throws IOException { super(in); aliases = in.readMap(StreamInput::readString, i -> i.readList(AliasMetadata::new)); } + /** + * Returns the aliases. + * + * @return the aliases + */ public Map> getAliases() { return aliases; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeAction.java index 8ec76a0f..2a3f9258 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeAction.java @@ -68,7 +68,13 @@ @PublicApi(since = "1.0.0") public class AnalyzeAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final AnalyzeAction INSTANCE = new AnalyzeAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/analyze"; private AnalyzeAction() { @@ -94,6 +100,9 @@ public static class Request extends SingleShardRequest { private String[] attributes = Strings.EMPTY_ARRAY; private String normalizer; + /** + * Creates a new Request. + */ public Request() {} /** @@ -105,83 +114,184 @@ public Request(String index) { this.index(index); } + /** + * Returns the text. + * + * @return the text + */ public String[] text() { return this.text; } + /** + * Returns the text. + * + * @param text the text + * @return the text + */ public Request text(String... text) { this.text = text; return this; } + /** + * Returns the text. + * + * @param text the text + * @return the text + */ public Request text(List text) { this.text = text.toArray(new String[] {}); return this; } + /** + * Returns the analyzer. + * + * @param analyzer the analyzer + * @return the analyzer + */ public Request analyzer(String analyzer) { this.analyzer = analyzer; return this; } + /** + * Returns the analyzer. + * + * @return the analyzer + */ public String analyzer() { return this.analyzer; } + /** + * Performs the tokenizer step. + * + * @param tokenizer the tokenizer + */ public void tokenizer(NameOrDefinition tokenizer) { this.tokenizer = tokenizer; } + /** + * Returns the tokenizer. + * + * @return the tokenizer + */ public NameOrDefinition tokenizer() { return this.tokenizer; } + /** + * Sets the token filters. + * + * @param tokenFilters the token filters + */ public void setTokenFilters(List tokenFilters) { this.tokenFilters.addAll(tokenFilters); } + /** + * Returns the token filters. + * + * @return the token filters + */ public List tokenFilters() { return this.tokenFilters; } + /** + * Sets the char filters. + * + * @param charFilters the char filters + */ public void setCharFilters(List charFilters) { this.charFilters.addAll(charFilters); } + /** + * Returns the char filters. + * + * @return the char filters + */ public List charFilters() { return this.charFilters; } + /** + * Returns the field. + * + * @param field the field + * @return the field + */ public Request field(String field) { this.field = field; return this; } + /** + * Returns the field. + * + * @return the field + */ public String field() { return this.field; } + /** + * Returns the explain. + * + * @param explain the explain + * @return the explain + */ public Request explain(boolean explain) { this.explain = explain; return this; } + /** + * Returns the explain. + * + * @return the explain + */ public boolean explain() { return this.explain; } + /** + * Performs the attributes step. + * + * @param attributes the attributes + */ public void attributes(List attributes) { this.attributes = attributes.toArray(new String[] {}); } + /** + * Returns the attributes. + * + * @return the attributes + */ public String[] attributes() { return this.attributes; } + /** + * Returns the normalizer. + * + * @return the normalizer + */ public String normalizer() { return this.normalizer; } + /** + * Returns the normalizer. + * + * @param normalizer the normalizer + * @return the normalizer + */ public Request normalizer(String normalizer) { this.normalizer = normalizer; return this; @@ -262,6 +372,12 @@ public static class Response extends ActionResponse implements ToXContentObject private final DetailAnalyzeResponse detail; private final List tokens; + /** + * Creates a new Response. + * + * @param tokens the tokens + * @param detail the detail + */ public Response(List tokens, DetailAnalyzeResponse detail) { if (tokens == null && detail == null) { throw new IllegalArgumentException("Neither token nor detail set on AnalysisAction.Response"); @@ -270,12 +386,23 @@ public Response(List tokens, DetailAnalyzeResponse detail) { this.detail = detail; } + /** + * Creates a new Response by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public Response(StreamInput in) throws IOException { AnalyzeToken[] tokenArray = in.readOptionalArray(AnalyzeToken::new, AnalyzeToken[]::new); tokens = tokenArray != null ? Arrays.asList(tokenArray) : null; detail = in.readOptionalWriteable(DetailAnalyzeResponse::new); } + /** + * Returns the tokens. + * + * @return the tokens + */ public List getTokens() { return this.tokens; } @@ -389,6 +516,17 @@ public int hashCode() { return Objects.hash(term, startOffset, endOffset, position, positionLength, attributes, type); } + /** + * Creates a new AnalyzeToken. + * + * @param term the term + * @param position the position + * @param startOffset the start offset + * @param endOffset the end offset + * @param positionLength the position length + * @param type the type + * @param attributes the attributes + */ public AnalyzeToken( String term, int position, @@ -422,30 +560,65 @@ public AnalyzeToken( attributes = in.readMap(); } + /** + * Returns the term. + * + * @return the term + */ public String getTerm() { return this.term; } + /** + * Returns the start offset. + * + * @return the start offset + */ public int getStartOffset() { return this.startOffset; } + /** + * Returns the end offset. + * + * @return the end offset + */ public int getEndOffset() { return this.endOffset; } + /** + * Returns the position. + * + * @return the position + */ public int getPosition() { return this.position; } + /** + * Returns the position length. + * + * @return the position length + */ public int getPositionLength() { return this.positionLength; } + /** + * Returns the type. + * + * @return the type + */ public String getType() { return this.type; } + /** + * Returns the attributes. + * + * @return the attributes + */ public Map getAttributes() { return this.attributes; } @@ -497,10 +670,22 @@ public static class DetailAnalyzeResponse implements Writeable, ToXContentFragme private final AnalyzeTokenList tokenizer; private final AnalyzeTokenList[] tokenfilters; + /** + * Creates a new DetailAnalyzeResponse. + * + * @param analyzer the analyzer + */ public DetailAnalyzeResponse(AnalyzeTokenList analyzer) { this(false, analyzer, null, null, null); } + /** + * Creates a new DetailAnalyzeResponse. + * + * @param charfilters the charfilters + * @param tokenizer the tokenizer + * @param tokenfilters the tokenfilters + */ public DetailAnalyzeResponse(CharFilteredText[] charfilters, AnalyzeTokenList tokenizer, AnalyzeTokenList[] tokenfilters) { this(true, null, charfilters, tokenizer, tokenfilters); } @@ -666,6 +851,12 @@ public int hashCode() { return result; } + /** + * Creates a new AnalyzeTokenList. + * + * @param name the name + * @param tokens the tokens + */ public AnalyzeTokenList(String name, AnalyzeToken[] tokens) { this.name = name; this.tokens = tokens; @@ -715,6 +906,12 @@ public static class CharFilteredText implements Writeable, ToXContentObject { static final String NAME = "name"; static final String FILTERED_TEXT = "filtered_text"; + /** + * Creates a new CharFilteredText. + * + * @param name the name + * @param texts the texts + */ public CharFilteredText(String name, String[] texts) { this.name = name; if (texts != null) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java index 9c621ca1..10d655a6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java @@ -48,10 +48,24 @@ public class AnalyzeRequestBuilder extends SingleShardOperationRequestBuilder< AnalyzeAction.Response, AnalyzeRequestBuilder> { + /** + * Creates a new AnalyzeRequestBuilder. + * + * @param client the client + * @param action the action + */ public AnalyzeRequestBuilder(OpenSearchClient client, AnalyzeAction action) { super(client, action, new AnalyzeAction.Request()); } + /** + * Creates a new AnalyzeRequestBuilder. + * + * @param client the client + * @param action the action + * @param index the index + * @param text the text + */ public AnalyzeRequestBuilder(OpenSearchClient client, AnalyzeAction action, String index, String... text) { super(client, action, new AnalyzeAction.Request(index).text(text)); } @@ -60,6 +74,7 @@ public AnalyzeRequestBuilder(OpenSearchClient client, AnalyzeAction action, Stri * Sets the analyzer name to use in order to analyze the text. * * @param analyzer The analyzer name. + * @return this instance */ public AnalyzeRequestBuilder setAnalyzer(String analyzer) { request.analyzer(analyzer); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java index a260a461..363024cb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java @@ -41,7 +41,13 @@ */ public class ClearIndicesCacheAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClearIndicesCacheAction INSTANCE = new ClearIndicesCacheAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/cache/clear"; private ClearIndicesCacheAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java index 053b54d7..5aaf481c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java @@ -55,22 +55,47 @@ public class ClearIndicesCacheRequest extends BroadcastRequest { + /** + * Creates a new ClearIndicesCacheRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClearIndicesCacheRequestBuilder(OpenSearchClient client, ClearIndicesCacheAction action) { super(client, action, new ClearIndicesCacheRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java index 9d1b973d..335d49dc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java @@ -82,6 +82,12 @@ public class ClearIndicesCacheResponse extends BroadcastResponse { super(totalShards, successfulShards, failedShards, shardFailures); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ClearIndicesCacheResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexAction.java index d9becba5..46089da5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexAction.java @@ -41,7 +41,13 @@ */ public class CloseIndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final CloseIndexAction INSTANCE = new CloseIndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/close"; private CloseIndexAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequest.java index d863db19..0595ed12 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequest.java @@ -58,10 +58,15 @@ public class CloseIndexRequest extends AcknowledgedRequest im private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen(); private ActiveShardCount waitForActiveShards = ActiveShardCount.NONE; + /** + * Creates a new CloseIndexRequest. + */ public CloseIndexRequest() {} /** * Constructs a new close index request for the specified index. + * + * @param indices the indices */ public CloseIndexRequest(String... indices) { this.indices = indices; @@ -107,10 +112,21 @@ public IndicesOptions indicesOptions() { return indicesOptions; } + /** + * Waits the for active shards. + * + * @return this instance + */ public ActiveShardCount waitForActiveShards() { return waitForActiveShards; } + /** + * Waits the for active shards. + * + * @param waitForActiveShards the wait for active shards + * @return this instance + */ public CloseIndexRequest waitForActiveShards(final ActiveShardCount waitForActiveShards) { this.waitForActiveShards = waitForActiveShards; return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java index 6938980d..a4f6cb40 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java @@ -46,6 +46,13 @@ @PublicApi(since = "1.0.0") public class CloseIndexRequestBuilder extends AcknowledgedRequestBuilder { + /** + * Creates a new CloseIndexRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public CloseIndexRequestBuilder(OpenSearchClient client, CloseIndexAction action, String... indices) { super(client, action, new CloseIndexRequest(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexResponse.java index 844bf00e..91ed3d18 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/close/CloseIndexResponse.java @@ -67,11 +67,23 @@ public class CloseIndexResponse extends ShardsAcknowledgedResponse { indices = unmodifiableList(in.readList(IndexResult::new)); } + /** + * Creates a new CloseIndexResponse. + * + * @param acknowledged the acknowledged + * @param shardsAcknowledged the shards acknowledged + * @param indices the indices + */ public CloseIndexResponse(final boolean acknowledged, final boolean shardsAcknowledged, final List indices) { super(acknowledged, shardsAcknowledged); this.indices = unmodifiableList(Objects.requireNonNull(indices)); } + /** + * Returns the indices. + * + * @return the indices + */ public List getIndices() { return indices; } @@ -110,14 +122,31 @@ public static class IndexResult implements Writeable, ToXContentFragment { private final @Nullable Exception exception; private final @Nullable ShardResult[] shards; + /** + * Creates a new IndexResult. + * + * @param index the index + */ public IndexResult(final Index index) { this(index, null, null); } + /** + * Creates a new IndexResult. + * + * @param index the index + * @param failure the failure + */ public IndexResult(final Index index, final Exception failure) { this(index, Objects.requireNonNull(failure), null); } + /** + * Creates a new IndexResult. + * + * @param index the index + * @param shards the shards + */ public IndexResult(final Index index, final ShardResult[] shards) { this(index, null, Objects.requireNonNull(shards)); } @@ -141,6 +170,11 @@ public void writeTo(final StreamOutput out) throws IOException { out.writeOptionalArray(shards); } + /** + * Returns the failures flag. + * + * @return the failures flag + */ public boolean hasFailures() { if (exception != null) { return true; @@ -198,6 +232,12 @@ public static class ShardResult implements Writeable, ToXContentFragment { private final int id; private final Failure[] failures; + /** + * Creates a new ShardResult. + * + * @param id the identifier + * @param failures the failures + */ public ShardResult(final int id, final Failure[] failures) { this.id = id; this.failures = failures; @@ -214,6 +254,11 @@ public void writeTo(final StreamOutput out) throws IOException { out.writeOptionalArray(failures); } + /** + * Returns the failures flag. + * + * @return the failures flag + */ public boolean hasFailures() { return CollectionUtils.isEmpty(failures) == false; } @@ -253,6 +298,14 @@ private Failure(StreamInput in) throws IOException { nodeId = in.readOptionalString(); } + /** + * Creates a new Failure. + * + * @param index the index + * @param shardId the shard identifier + * @param reason the reason + * @param nodeId the node identifier + */ public Failure(final String index, final int shardId, final Throwable reason, final String nodeId) { super(index, shardId, reason); this.nodeId = nodeId; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexAction.java index d3315c6f..b52ba8c7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexAction.java @@ -41,7 +41,13 @@ */ public class CreateIndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final CreateIndexAction INSTANCE = new CreateIndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/create"; private CreateIndexAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequest.java index dd30cbf8..f949e51a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequest.java @@ -87,9 +87,21 @@ @PublicApi(since = "1.0.0") public class CreateIndexRequest extends AcknowledgedRequest implements IndicesRequest { + /** + * The MAPPINGS constant. + */ public static final ParseField MAPPINGS = new ParseField("mappings"); + /** + * The SETTINGS constant. + */ public static final ParseField SETTINGS = new ParseField("settings"); + /** + * The ALIASES constant. + */ public static final ParseField ALIASES = new ParseField("aliases"); + /** + * The CONTEXT constant. + */ public static final ParseField CONTEXT = new ParseField("context"); private String cause = ""; @@ -106,10 +118,15 @@ public class CreateIndexRequest extends AcknowledgedRequest private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT; + /** + * Creates a new CreateIndexRequest. + */ public CreateIndexRequest() {} /** * Constructs a new request to create an index with the specified name. + * + * @param index the index */ public CreateIndexRequest(String index) { this(index, EMPTY_SETTINGS); @@ -117,6 +134,9 @@ public CreateIndexRequest(String index) { /** * Constructs a new request to create an index with the specified name and settings. + * + * @param index the index + * @param settings the settings */ public CreateIndexRequest(String index, Settings settings) { this.index = index; @@ -144,11 +164,19 @@ public IndicesOptions indicesOptions() { /** * The index name to create. + * + * @return this instance */ public String index() { return index; } + /** + * Indexes this instance. + * + * @param index the index + * @return this instance + */ public CreateIndexRequest index(String index) { this.index = index; return this; @@ -156,6 +184,8 @@ public CreateIndexRequest index(String index) { /** * The settings to create the index with. + * + * @return the settings */ public Settings settings() { return settings; @@ -163,6 +193,8 @@ public Settings settings() { /** * The cause for this index creation. + * + * @return the cause */ public String cause() { return cause; @@ -170,6 +202,9 @@ public String cause() { /** * The settings to create the index with. + * + * @param settings the settings + * @return the settings */ public CreateIndexRequest settings(Settings.Builder settings) { this.settings = settings.build(); @@ -178,6 +213,9 @@ public CreateIndexRequest settings(Settings.Builder settings) { /** * The settings to create the index with. + * + * @param settings the settings + * @return the settings */ public CreateIndexRequest settings(Settings settings) { this.settings = settings; @@ -187,6 +225,9 @@ public CreateIndexRequest settings(Settings settings) { /** * The settings to create the index with (either json or yaml format) * + * @param source the source + * @param xContentType the content type + * @return the settings * @deprecated use {@link #settings(String source, MediaType mediaType)} instead */ @Deprecated @@ -197,6 +238,10 @@ public CreateIndexRequest settings(String source, XContentType xContentType) { /** * The settings to create the index with (using a generic MediaType) + * + * @param source the source + * @param mediaType the media type + * @return the settings */ public CreateIndexRequest settings(String source, MediaType mediaType) { this.settings = Settings.builder().loadFromSource(source, mediaType).build(); @@ -205,6 +250,9 @@ public CreateIndexRequest settings(String source, MediaType mediaType) { /** * Allows to set the settings using a json builder. + * + * @param builder the content builder + * @return the settings */ public CreateIndexRequest settings(XContentBuilder builder) { settings(builder.toString(), builder.contentType()); @@ -213,6 +261,9 @@ public CreateIndexRequest settings(XContentBuilder builder) { /** * The settings to create the index with (either json/yaml/properties format) + * + * @param source the source + * @return the settings */ public CreateIndexRequest settings(Map source) { this.settings = Settings.builder().loadFromMap(source).build(); @@ -226,6 +277,9 @@ public CreateIndexRequest settings(Map source) { *

      *     .mapping("{\"_doc\":{\"properties\": ... }}")
      * 
+ * + * @param mapping the mapping + * @return the mapping */ public CreateIndexRequest mapping(String mapping) { this.mappings = mapping; @@ -238,6 +292,7 @@ public CreateIndexRequest mapping(String mapping) { * @param source The mapping source * @param xContentType The content type of the source * + * @return the mapping * @deprecated use {@link #mapping(String source, MediaType mediaType)} instead */ @Deprecated @@ -252,6 +307,7 @@ public CreateIndexRequest mapping(String source, XContentType xContentType) { * * @param source The mapping source * @param mediaType The media type of the source + * @return the mapping */ public CreateIndexRequest mapping(String source, MediaType mediaType) { return mapping(new BytesArray(source), mediaType); @@ -279,6 +335,7 @@ private CreateIndexRequest mapping(BytesReference source, XContentType xContentT * * @param source The mapping source * @param mediaType The media type of the source + * @return the mapping */ public CreateIndexRequest mapping(BytesReference source, MediaType mediaType) { Objects.requireNonNull(mediaType); @@ -290,6 +347,7 @@ public CreateIndexRequest mapping(BytesReference source, MediaType mediaType) { * Adds mapping that will be added when the index gets created. * * @param source The mapping source + * @return the mapping */ public CreateIndexRequest mapping(XContentBuilder source) { return mapping(BytesReference.bytes(source), source.contentType()); @@ -299,6 +357,7 @@ public CreateIndexRequest mapping(XContentBuilder source) { * Set the mapping for this index * * @param source The mapping source + * @return the mapping */ public CreateIndexRequest mapping(Map source) { return mapping(MapperService.SINGLE_MAPPING_NAME, source); @@ -332,6 +391,9 @@ private CreateIndexRequest mapping(String type, Map source) { /** * A specialized simplified mapping source method, takes the form of simple properties definition: * ("field1", "type=string,store=true"). + * + * @param source the source + * @return the simple mapping */ public CreateIndexRequest simpleMapping(String... source) { mapping(PutMappingRequest.simpleMapping(source)); @@ -340,6 +402,9 @@ public CreateIndexRequest simpleMapping(String... source) { /** * The cause for this index creation. + * + * @param cause the cause + * @return the cause */ public CreateIndexRequest cause(String cause) { this.cause = cause; @@ -348,6 +413,9 @@ public CreateIndexRequest cause(String cause) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return the aliases */ public CreateIndexRequest aliases(Map source) { try { @@ -361,6 +429,9 @@ public CreateIndexRequest aliases(Map source) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return the aliases */ public CreateIndexRequest aliases(XContentBuilder source) { return aliases(BytesReference.bytes(source)); @@ -368,6 +439,9 @@ public CreateIndexRequest aliases(XContentBuilder source) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return the aliases */ public CreateIndexRequest aliases(String source) { return aliases(new BytesArray(source)); @@ -375,6 +449,9 @@ public CreateIndexRequest aliases(String source) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return the aliases */ public CreateIndexRequest aliases(BytesReference source) { // EMPTY is safe here because we never call namedObject @@ -392,6 +469,9 @@ public CreateIndexRequest aliases(BytesReference source) { /** * Adds an alias that will be associated with the index when it gets created + * + * @param alias the alias + * @return the alias */ public CreateIndexRequest alias(Alias alias) { this.aliases.add(alias); @@ -401,6 +481,9 @@ public CreateIndexRequest alias(Alias alias) { /** * Sets the settings and mappings as a single source. * + * @param source the source + * @param xContentType the content type + * @return the source * @deprecated use {@link #source(String, MediaType)} instead */ @Deprecated @@ -412,6 +495,10 @@ public CreateIndexRequest source(String source, XContentType xContentType) { * Sets the settings and mappings as a single source. *

* Note that the mapping definition should *not* be nested under a type name. + * + * @param source the source + * @param mediaType the media type + * @return the source */ public CreateIndexRequest source(String source, MediaType mediaType) { return source(new BytesArray(source), mediaType); @@ -419,6 +506,9 @@ public CreateIndexRequest source(String source, MediaType mediaType) { /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @return the source */ public CreateIndexRequest source(XContentBuilder source) { return source(BytesReference.bytes(source), source.contentType()); @@ -427,6 +517,9 @@ public CreateIndexRequest source(XContentBuilder source) { /** * Sets the settings and mappings as a single source. * + * @param source the source + * @param xContentType the content type + * @return the source * @deprecated use {@link #source(byte[], MediaType mediaType)} instead */ @Deprecated @@ -438,6 +531,10 @@ public CreateIndexRequest source(byte[] source, XContentType xContentType) { * Sets the settings and mappings as a single source. *

* Note that the mapping definition should *not* be nested under a type name. + * + * @param source the source + * @param mediaType the media type + * @return the source */ public CreateIndexRequest source(byte[] source, MediaType mediaType) { return source(source, 0, source.length, mediaType); @@ -446,6 +543,11 @@ public CreateIndexRequest source(byte[] source, MediaType mediaType) { /** * Sets the settings and mappings as a single source. * + * @param source the source + * @param offset the offset + * @param length the length + * @param xContentType the content type + * @return the source * @deprecated use {@link #source(byte[], int, int, MediaType)} instead */ @Deprecated @@ -455,6 +557,12 @@ public CreateIndexRequest source(byte[] source, int offset, int length, XContent /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param offset the offset + * @param length the length + * @param mediaType the media type + * @return the source */ public CreateIndexRequest source(byte[] source, int offset, int length, MediaType mediaType) { return source(new BytesArray(source, offset, length), mediaType); @@ -463,6 +571,9 @@ public CreateIndexRequest source(byte[] source, int offset, int length, MediaTyp /** * Sets the settings and mappings as a single source. * + * @param source the source + * @param xContentType the content type + * @return the source * @deprecated use {@link #source(BytesReference, MediaType)} instead */ @Deprecated @@ -474,6 +585,10 @@ public CreateIndexRequest source(BytesReference source, XContentType xContentTyp /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param mediaType the media type + * @return the source */ public CreateIndexRequest source(BytesReference source, MediaType mediaType) { Objects.requireNonNull(mediaType); @@ -483,6 +598,10 @@ public CreateIndexRequest source(BytesReference source, MediaType mediaType) { /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param deprecationHandler the deprecation handler + * @return the source */ @SuppressWarnings("unchecked") public CreateIndexRequest source(Map source, DeprecationHandler deprecationHandler) { @@ -512,14 +631,29 @@ public CreateIndexRequest source(Map source, DeprecationHandler depre return this; } + /** + * Returns the mappings. + * + * @return the mappings + */ public String mappings() { return this.mappings; } + /** + * Returns the aliases. + * + * @return the aliases + */ public Set aliases() { return this.aliases; } + /** + * Waits the for active shards. + * + * @return this instance + */ public ActiveShardCount waitForActiveShards() { return waitForActiveShards; } @@ -537,6 +671,7 @@ public ActiveShardCount waitForActiveShards() { * determine if the requisite shard copies were all started before returning or timing out. * * @param waitForActiveShards number of active shard copies to wait on + * @return this instance */ public CreateIndexRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { this.waitForActiveShards = waitForActiveShards; @@ -547,11 +682,20 @@ public CreateIndexRequest waitForActiveShards(ActiveShardCount waitForActiveShar * A shortcut for {@link #waitForActiveShards(ActiveShardCount)} where the numerical * shard count is passed in, instead of having to first call {@link ActiveShardCount#from(int)} * to get the ActiveShardCount. + * + * @param waitForActiveShards the wait for active shards + * @return this instance */ public CreateIndexRequest waitForActiveShards(final int waitForActiveShards) { return waitForActiveShards(ActiveShardCount.from(waitForActiveShards)); } + /** + * Returns the context. + * + * @param source the source + * @return the context + */ public CreateIndexRequest context(Map source) { try { XContentBuilder builder = XContentFactory.jsonBuilder(); @@ -562,6 +706,12 @@ public CreateIndexRequest context(Map source) { } } + /** + * Returns the context. + * + * @param source the source + * @return the context + */ public CreateIndexRequest context(BytesReference source) { // EMPTY is safe here because we never call namedObject try (XContentParser parser = XContentHelper.createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, source)) { @@ -573,11 +723,22 @@ public CreateIndexRequest context(BytesReference source) { } } + /** + * Returns the context. + * + * @param context the context + * @return the context + */ public CreateIndexRequest context(Context context) { this.context = context; return this; } + /** + * Returns the context. + * + * @return the context + */ public Context context() { return context; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java index e1e82694..9824d7d7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java @@ -58,16 +58,32 @@ public class CreateIndexRequestBuilder extends AcknowledgedRequestBuilder< CreateIndexResponse, CreateIndexRequestBuilder> { + /** + * Creates a new CreateIndexRequestBuilder. + * + * @param client the client + * @param action the action + */ public CreateIndexRequestBuilder(OpenSearchClient client, CreateIndexAction action) { super(client, action, new CreateIndexRequest()); } + /** + * Creates a new CreateIndexRequestBuilder. + * + * @param client the client + * @param action the action + * @param index the index + */ public CreateIndexRequestBuilder(OpenSearchClient client, CreateIndexAction action, String index) { super(client, action, new CreateIndexRequest(index)); } /** * Sets the name of the index to be created + * + * @param index the index + * @return this instance */ public CreateIndexRequestBuilder setIndex(String index) { request.index(index); @@ -76,6 +92,9 @@ public CreateIndexRequestBuilder setIndex(String index) { /** * The settings to create the index with. + * + * @param settings the settings + * @return this instance */ public CreateIndexRequestBuilder setSettings(Settings settings) { request.settings(settings); @@ -84,6 +103,9 @@ public CreateIndexRequestBuilder setSettings(Settings settings) { /** * The settings to create the index with. + * + * @param settings the settings + * @return this instance */ public CreateIndexRequestBuilder setSettings(Settings.Builder settings) { request.settings(settings); @@ -92,6 +114,9 @@ public CreateIndexRequestBuilder setSettings(Settings.Builder settings) { /** * Allows to set the settings using a json builder. + * + * @param builder the content builder + * @return this instance */ public CreateIndexRequestBuilder setSettings(XContentBuilder builder) { request.settings(builder); @@ -100,6 +125,10 @@ public CreateIndexRequestBuilder setSettings(XContentBuilder builder) { /** * The settings to create the index with (either json or yaml format) + * + * @param source the source + * @param mediaType the media type + * @return this instance */ public CreateIndexRequestBuilder setSettings(String source, MediaType mediaType) { request.settings(source, mediaType); @@ -108,6 +137,9 @@ public CreateIndexRequestBuilder setSettings(String source, MediaType mediaType) /** * The settings to create the index with (either json/yaml/properties format) + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setSettings(Map source) { request.settings(source); @@ -118,6 +150,7 @@ public CreateIndexRequestBuilder setSettings(Map source) { * Adds mapping that will be added when the index gets created. * * @param source The mapping source + * @return this instance */ public CreateIndexRequestBuilder setMapping(String source) { request.mapping(source); @@ -128,6 +161,7 @@ public CreateIndexRequestBuilder setMapping(String source) { * Adds mapping that will be added when the index gets created. * * @param source The mapping source + * @return this instance */ public CreateIndexRequestBuilder setMapping(XContentBuilder source) { request.mapping(source); @@ -138,6 +172,7 @@ public CreateIndexRequestBuilder setMapping(XContentBuilder source) { * Adds mapping that will be added when the index gets created. * * @param source The mapping source + * @return this instance */ public CreateIndexRequestBuilder setMapping(Map source) { request.mapping(source); @@ -147,6 +182,9 @@ public CreateIndexRequestBuilder setMapping(Map source) { /** * A specialized simplified mapping source method, takes the form of simple properties definition: * ("field1", "type=string,store=true"). + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setMapping(String... source) { request.simpleMapping(source); @@ -155,6 +193,9 @@ public CreateIndexRequestBuilder setMapping(String... source) { /** * The cause for this index creation. + * + * @param cause the cause + * @return this instance */ public CreateIndexRequestBuilder setCause(String cause) { request.cause(cause); @@ -163,6 +204,9 @@ public CreateIndexRequestBuilder setCause(String cause) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setAliases(Map source) { request.aliases(source); @@ -171,6 +215,9 @@ public CreateIndexRequestBuilder setAliases(Map source) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setAliases(String source) { request.aliases(source); @@ -179,6 +226,9 @@ public CreateIndexRequestBuilder setAliases(String source) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setAliases(XContentBuilder source) { request.aliases(source); @@ -187,6 +237,9 @@ public CreateIndexRequestBuilder setAliases(XContentBuilder source) { /** * Sets the aliases that will be associated with the index when it gets created + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setAliases(BytesReference source) { request.aliases(source); @@ -195,6 +248,9 @@ public CreateIndexRequestBuilder setAliases(BytesReference source) { /** * Adds an alias that will be associated with the index when it gets created + * + * @param alias the alias + * @return this instance */ public CreateIndexRequestBuilder addAlias(Alias alias) { request.alias(alias); @@ -203,6 +259,10 @@ public CreateIndexRequestBuilder addAlias(Alias alias) { /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param mediaType the media type + * @return this instance */ public CreateIndexRequestBuilder setSource(String source, MediaType mediaType) { request.source(source, mediaType); @@ -211,6 +271,10 @@ public CreateIndexRequestBuilder setSource(String source, MediaType mediaType) { /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param mediaType the media type + * @return this instance */ public CreateIndexRequestBuilder setSource(BytesReference source, MediaType mediaType) { request.source(source, mediaType); @@ -219,6 +283,10 @@ public CreateIndexRequestBuilder setSource(BytesReference source, MediaType medi /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param mediaType the media type + * @return this instance */ public CreateIndexRequestBuilder setSource(byte[] source, MediaType mediaType) { request.source(source, mediaType); @@ -227,6 +295,12 @@ public CreateIndexRequestBuilder setSource(byte[] source, MediaType mediaType) { /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @param offset the offset + * @param length the length + * @param xContentType the content type + * @return this instance */ public CreateIndexRequestBuilder setSource(byte[] source, int offset, int length, XContentType xContentType) { request.source(source, offset, length, xContentType); @@ -235,6 +309,9 @@ public CreateIndexRequestBuilder setSource(byte[] source, int offset, int length /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setSource(Map source) { request.source(source, LoggingDeprecationHandler.INSTANCE); @@ -243,6 +320,9 @@ public CreateIndexRequestBuilder setSource(Map source) { /** * Sets the settings and mappings as a single source. + * + * @param source the source + * @return this instance */ public CreateIndexRequestBuilder setSource(XContentBuilder source) { request.source(source); @@ -262,6 +342,7 @@ public CreateIndexRequestBuilder setSource(XContentBuilder source) { * determine if the requisite shard copies were all started before returning or timing out. * * @param waitForActiveShards number of active shard copies to wait on + * @return this instance */ public CreateIndexRequestBuilder setWaitForActiveShards(ActiveShardCount waitForActiveShards) { request.waitForActiveShards(waitForActiveShards); @@ -272,6 +353,9 @@ public CreateIndexRequestBuilder setWaitForActiveShards(ActiveShardCount waitFor * A shortcut for {@link #setWaitForActiveShards(ActiveShardCount)} where the numerical * shard count is passed in, instead of having to first call {@link ActiveShardCount#from(int)} * to get the ActiveShardCount. + * + * @param waitForActiveShards the wait for active shards + * @return this instance */ public CreateIndexRequestBuilder setWaitForActiveShards(final int waitForActiveShards) { return setWaitForActiveShards(ActiveShardCount.from(waitForActiveShards)); @@ -281,6 +365,7 @@ public CreateIndexRequestBuilder setWaitForActiveShards(final int waitForActiveS * Adds context that will be added when the index gets created. * * @param source The mapping source + * @return this instance */ public CreateIndexRequestBuilder setContext(Map source) { request.context(source); @@ -291,6 +376,7 @@ public CreateIndexRequestBuilder setContext(Map source) { * Adds context that will be added when the index gets created. * * @param source The context source + * @return this instance */ public CreateIndexRequestBuilder setContext(Context source) { request.context(source); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexResponse.java index 213a7364..a9c4bf04 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/create/CreateIndexResponse.java @@ -67,6 +67,12 @@ public class CreateIndexResponse extends ShardsAcknowledgedResponse { declareFields(PARSER); } + /** + * Performs the declare fields step. + * + * @param the element type + * @param objectParser the object parser + */ protected static void declareFields(ConstructingObjectParser objectParser) { declareAcknowledgedAndShardsAcknowledgedFields(objectParser); objectParser.declareField(constructorArg(), (parser, context) -> parser.textOrNull(), INDEX, ObjectParser.ValueType.STRING_OR_NULL); @@ -74,11 +80,24 @@ protected static void declareFields(Constructing private final String index; + /** + * Creates a new CreateIndexResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ protected CreateIndexResponse(StreamInput in) throws IOException { super(in, true); index = in.readString(); } + /** + * Creates a new CreateIndexResponse. + * + * @param acknowledged the acknowledged + * @param shardsAcknowledged the shards acknowledged + * @param index the index + */ public CreateIndexResponse(boolean acknowledged, boolean shardsAcknowledged, String index) { super(acknowledged, shardsAcknowledged); this.index = index; @@ -91,6 +110,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(index); } + /** + * Indexes this instance. + * + * @return this instance + */ public String index() { return index; } @@ -101,6 +125,12 @@ protected void addCustomFields(XContentBuilder builder, Params params) throws IO builder.field(INDEX.getPreferredName(), index()); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static CreateIndexResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java index 97952793..0ccc3c30 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java @@ -60,9 +60,18 @@ */ public class DataStreamsStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DataStreamsStatsAction INSTANCE = new DataStreamsStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/data_stream/stats"; + /** + * Creates a new DataStreamsStatsAction. + */ public DataStreamsStatsAction() { super(NAME, DataStreamsStatsAction.Response::new); } @@ -73,6 +82,9 @@ public DataStreamsStatsAction() { * @opensearch.internal */ public static class Request extends BroadcastRequest { + /** + * Creates a new Request. + */ public Request() { super((String[]) null); } @@ -89,6 +101,18 @@ public static class Response extends BroadcastResponse { private final ByteSizeValue totalStoreSize; private final DataStreamStats[] dataStreams; + /** + * Creates a new Response. + * + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param failedShards the failed shards + * @param shardFailures the shard failures + * @param dataStreamCount the data stream count + * @param backingIndices the backing indices + * @param totalStoreSize the total store size + * @param dataStreams the data streams + */ public Response( int totalShards, int successfulShards, @@ -106,6 +130,12 @@ public Response( this.dataStreams = dataStreams; } + /** + * Creates a new Response by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public Response(StreamInput in) throws IOException { super(in); this.dataStreamCount = in.readVInt(); @@ -131,14 +161,29 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t builder.array("data_streams", (Object[]) dataStreams); } + /** + * Returns the data stream count. + * + * @return the data stream count + */ public int getDataStreamCount() { return dataStreamCount; } + /** + * Returns the backing indices. + * + * @return the backing indices + */ public int getBackingIndices() { return backingIndices; } + /** + * Returns the total store size. + * + * @return the total store size + */ public ByteSizeValue getTotalStoreSize() { return totalStoreSize; } @@ -191,6 +236,14 @@ public static class DataStreamStats implements ToXContentObject, Writeable { private final ByteSizeValue storeSize; private final long maximumTimestamp; + /** + * Creates a new DataStreamStats. + * + * @param dataStream the data stream + * @param backingIndices the backing indices + * @param storeSize the store size + * @param maximumTimestamp the maximum timestamp + */ public DataStreamStats(String dataStream, int backingIndices, ByteSizeValue storeSize, long maximumTimestamp) { this.dataStream = dataStream; this.backingIndices = backingIndices; @@ -198,6 +251,12 @@ public DataStreamStats(String dataStream, int backingIndices, ByteSizeValue stor this.maximumTimestamp = maximumTimestamp; } + /** + * Creates a new DataStreamStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DataStreamStats(StreamInput in) throws IOException { this.dataStream = in.readString(); this.backingIndices = in.readVInt(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexAction.java index fb7c7dd1..a8c7c3c3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexAction.java @@ -42,7 +42,13 @@ */ public class DeleteIndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeleteIndexAction INSTANCE = new DeleteIndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/delete"; private DeleteIndexAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequest.java index 51ae63f0..8f453c4b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequest.java @@ -57,6 +57,9 @@ public class DeleteIndexRequest extends AcknowledgedRequest // Delete index should work by default on both open and closed indices. private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false); + /** + * Creates a new DeleteIndexRequest. + */ public DeleteIndexRequest() {} /** @@ -82,6 +85,12 @@ public IndicesOptions indicesOptions() { return indicesOptions; } + /** + * Returns the indices options. + * + * @param indicesOptions the indices options + * @return the indices options + */ public DeleteIndexRequest indicesOptions(IndicesOptions indicesOptions) { this.indicesOptions = indicesOptions; return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java index a40a03ff..e372aa68 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java @@ -49,6 +49,13 @@ public class DeleteIndexRequestBuilder extends AcknowledgedRequestBuilder< AcknowledgedResponse, DeleteIndexRequestBuilder> { + /** + * Creates a new DeleteIndexRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public DeleteIndexRequestBuilder(OpenSearchClient client, DeleteIndexAction action, String... indices) { super(client, action, new DeleteIndexRequest(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java index 4b706ab6..d7949ebc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java @@ -41,7 +41,13 @@ */ public class IndicesExistsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final IndicesExistsAction INSTANCE = new IndicesExistsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/exists"; private IndicesExistsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java index 8da6237a..e13149b6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java @@ -57,10 +57,18 @@ public class IndicesExistsRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new IndicesExistsRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public IndicesExistsRequestBuilder(OpenSearchClient client, IndicesExistsAction action, String... indices) { super(client, action, new IndicesExistsRequest(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java index bbc55718..f80d8d3c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java @@ -54,10 +54,20 @@ public class IndicesExistsResponse extends ActionResponse { exists = in.readBoolean(); } + /** + * Creates a new IndicesExistsResponse. + * + * @param exists the exists + */ public IndicesExistsResponse(boolean exists) { this.exists = exists; } + /** + * Returns the exists flag. + * + * @return the exists flag + */ public boolean isExists() { return this.exists; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushAction.java index df63c67b..ac54bd68 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushAction.java @@ -41,7 +41,13 @@ */ public class FlushAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final FlushAction INSTANCE = new FlushAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/flush"; private FlushAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequest.java index 32830887..3719874c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequest.java @@ -64,6 +64,8 @@ public class FlushRequest extends BroadcastRequest { /** * Constructs a new flush request against one or more indices. If nothing is provided, all indices will * be flushed. + * + * @param indices the indices */ public FlushRequest(String... indices) { super(indices); @@ -72,6 +74,8 @@ public FlushRequest(String... indices) { /** * Returns {@code true} iff a flush should block * if a another flush operation is already running. Otherwise {@code false} + * + * @return this instance */ public boolean waitIfOngoing() { return this.waitIfOngoing; @@ -79,6 +83,8 @@ public boolean waitIfOngoing() { /** * Force flushing, even if one is possibly not needed. + * + * @return this instance */ public boolean force() { return force; @@ -86,6 +92,9 @@ public boolean force() { /** * Force flushing, even if one is possibly not needed. + * + * @param force the force + * @return this instance */ public FlushRequest force(boolean force) { this.force = force; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequestBuilder.java index 7c05fe6c..45ff541e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushRequestBuilder.java @@ -44,10 +44,22 @@ @PublicApi(since = "1.0.0") public class FlushRequestBuilder extends BroadcastOperationRequestBuilder { + /** + * Creates a new FlushRequestBuilder. + * + * @param client the client + * @param action the action + */ public FlushRequestBuilder(OpenSearchClient client, FlushAction action) { super(client, action, new FlushRequest()); } + /** + * Sets the force. + * + * @param force the force + * @return this instance + */ public FlushRequestBuilder setForce(boolean force) { request.force(force); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushResponse.java index 145f4965..13111578 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/flush/FlushResponse.java @@ -73,6 +73,12 @@ public class FlushResponse extends BroadcastResponse { super(totalShards, successfulShards, failedShards, shardFailures); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static FlushResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java index f59a26ad..063d6f17 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java @@ -41,7 +41,13 @@ */ public class ForceMergeAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ForceMergeAction INSTANCE = new ForceMergeAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/forcemerge"; private ForceMergeAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java index 75189c22..f3525054 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java @@ -65,9 +65,27 @@ public class ForceMergeRequest extends BroadcastRequest { * @opensearch.internal */ public static final class Defaults { + /** + * Creates a new Defaults. + */ + public Defaults() { + } + + /** + * The MAX_NUM_SEGMENTS constant. + */ public static final int MAX_NUM_SEGMENTS = -1; + /** + * The ONLY_EXPUNGE_DELETES constant. + */ public static final boolean ONLY_EXPUNGE_DELETES = false; + /** + * The FLUSH constant. + */ public static final boolean FLUSH = true; + /** + * The PRIMARY_ONLY constant. + */ public static final boolean PRIMARY_ONLY = false; } @@ -99,6 +117,8 @@ public ForceMergeRequest(String... indices) { /** * Will merge the index down to <= maxNumSegments. By default, will cause the merge * process to merge down to half the configured number of segments. + * + * @return the max num segments */ public int maxNumSegments() { return maxNumSegments; @@ -107,6 +127,8 @@ public int maxNumSegments() { /** * Should the merge only expunge deletes from the index, without full merging. * Defaults to full merging ({@code false}). + * + * @return the only expunge deletes */ public boolean onlyExpungeDeletes() { return onlyExpungeDeletes; @@ -114,6 +136,8 @@ public boolean onlyExpungeDeletes() { /** * Should flush be performed after the merge. Defaults to {@code true}. + * + * @return this instance */ public boolean flush() { return flush; @@ -121,6 +145,8 @@ public boolean flush() { /** * Should force merge only performed on primary shards. Defaults to {@code false}. + * + * @return the primary only */ public boolean primaryOnly() { return primaryOnly; @@ -128,6 +154,9 @@ public boolean primaryOnly() { /** * Should force merge only performed on primary shards. Defaults to {@code false}. + * + * @param primaryOnly the primary only + * @return the primary only */ public ForceMergeRequest primaryOnly(boolean primaryOnly) { this.primaryOnly = primaryOnly; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java index 911a5bc3..6377483a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java @@ -51,6 +51,12 @@ public class ForceMergeRequestBuilder extends BroadcastOperationRequestBuilder< ForceMergeResponse, ForceMergeRequestBuilder> { + /** + * Creates a new ForceMergeRequestBuilder. + * + * @param client the client + * @param action the action + */ public ForceMergeRequestBuilder(OpenSearchClient client, ForceMergeAction action) { super(client, action, new ForceMergeRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java index dd76a48e..c167316a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java @@ -79,6 +79,12 @@ public class ForceMergeResponse extends BroadcastResponse { super(totalShards, successfulShards, failedShards, shardFailures); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ForceMergeResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexAction.java index c420d9bc..13e081ab 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexAction.java @@ -41,7 +41,13 @@ */ public class GetIndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetIndexAction INSTANCE = new GetIndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/get"; private GetIndexAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequest.java index bf3dbcf8..7f1eae04 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequest.java @@ -55,9 +55,21 @@ public class GetIndexRequest extends ClusterInfoRequest { */ @PublicApi(since = "1.0.0") public enum Feature { + /** + * The ALIASES value. + */ ALIASES((byte) 0), + /** + * The MAPPINGS value. + */ MAPPINGS((byte) 1), + /** + * The SETTINGS value. + */ SETTINGS((byte) 2), + /** + * The CONTEXT value. + */ CONTEXT((byte) 3); private static final Feature[] FEATURES = new Feature[Feature.values().length]; @@ -75,10 +87,21 @@ public enum Feature { this.id = id; } + /** + * Returns the identifier. + * + * @return the identifier + */ public byte id() { return id; } + /** + * Creates an instance from identifier. + * + * @param id the identifier + * @return the new identifier + */ public static Feature fromId(byte id) { if (id < 0 || id >= FEATURES.length) { throw new IllegalArgumentException("No mapping for id [" + id + "]"); @@ -96,6 +119,9 @@ public static Feature fromId(byte id) { private boolean humanReadable = false; private transient boolean includeDefaults = false; + /** + * Creates a new GetIndexRequest. + */ public GetIndexRequest() { } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java index 90c4fb71..4aa1cc38 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java @@ -44,6 +44,13 @@ @PublicApi(since = "1.0.0") public class GetIndexRequestBuilder extends ClusterInfoRequestBuilder { + /** + * Creates a new GetIndexRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public GetIndexRequestBuilder(OpenSearchClient client, GetIndexAction action, String... indices) { super(client, action, new GetIndexRequest().indices(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexResponse.java index d425a468..642c31e8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/get/GetIndexResponse.java @@ -72,6 +72,17 @@ public class GetIndexResponse extends ActionResponse implements ToXContentObject private Map contexts = Map.of(); private final String[] indices; + /** + * Creates a new GetIndexResponse. + * + * @param indices the indices + * @param mappings the mappings + * @param aliases the aliases + * @param settings the settings + * @param defaultSettings the default settings + * @param dataStreams the data streams + * @param contexts the contexts + */ public GetIndexResponse( String[] indices, Map mappings, @@ -177,34 +188,74 @@ public GetIndexResponse( } } + /** + * Returns the indices. + * + * @return the indices + */ public String[] indices() { return indices; } + /** + * Returns the indices. + * + * @return the indices + */ public String[] getIndices() { return indices(); } + /** + * Returns the mappings. + * + * @return the mappings + */ public Map mappings() { return mappings; } + /** + * Returns the mappings. + * + * @return the mappings + */ public Map getMappings() { return mappings(); } + /** + * Returns the aliases. + * + * @return the aliases + */ public Map> aliases() { return aliases; } + /** + * Returns the aliases. + * + * @return the aliases + */ public Map> getAliases() { return aliases(); } + /** + * Returns the settings. + * + * @return the settings + */ public Map settings() { return settings; } + /** + * Returns the settings. + * + * @return the settings + */ public Map getSettings() { return settings(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java index 1fc3d1e7..9bbabce9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java @@ -41,7 +41,13 @@ */ public class GetFieldMappingsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetFieldMappingsAction INSTANCE = new GetFieldMappingsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/mappings/fields/get"; private GetFieldMappingsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java index 07f2e6d9..986e4998 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java @@ -56,6 +56,9 @@ @PublicApi(since = "1.0.0") public class GetFieldMappingsRequest extends ActionRequest implements IndicesRequest.Replaceable { + /** + * The local. + */ protected boolean local = false; private String[] fields = Strings.EMPTY_ARRAY; @@ -66,8 +69,16 @@ public class GetFieldMappingsRequest extends ActionRequest implements IndicesReq private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen(); + /** + * Creates a new GetFieldMappingsRequest. + */ public GetFieldMappingsRequest() {} + /** + * Returns the local. + * + * @return the local + */ public boolean local() { return local; } @@ -93,16 +104,31 @@ public boolean includeDataStreams() { return true; } - /** @param fields a list of fields to retrieve the mapping for */ + /** + * Returns the fields. + * + * @param fields a list of fields to retrieve the mapping for + * @return the fields + */ public GetFieldMappingsRequest fields(String... fields) { this.fields = fields; return this; } + /** + * Returns the fields. + * + * @return the fields + */ public String[] fields() { return fields; } + /** + * Includes the defaults. + * + * @return this instance + */ public boolean includeDefaults() { return includeDefaults; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java index 063845ca..18b6d208 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java @@ -46,16 +46,34 @@ @PublicApi(since = "1.0.0") public class GetFieldMappingsRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new GetFieldMappingsRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public GetFieldMappingsRequestBuilder(OpenSearchClient client, GetFieldMappingsAction action, String... indices) { super(client, action, new GetFieldMappingsRequest().indices(indices)); } + /** + * Sets the indices. + * + * @param indices the indices + * @return this instance + */ public GetFieldMappingsRequestBuilder setIndices(String... indices) { request.indices(indices); return this; } - /** Sets the fields to retrieve. */ + /** + * Sets the fields to retrieve. + * + * @param fields the fields + * @return this instance + */ public GetFieldMappingsRequestBuilder setFields(String... fields) { request.fields(fields); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java index ea173344..e54ab09a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java @@ -136,7 +136,11 @@ public class GetFieldMappingsResponse extends ActionResponse implements ToXConte mappings = unmodifiableMap(indexMapBuilder); } - /** returns the retrieved field mapping. The return map keys are index, type, field (as specified in the request). */ + /** + * returns the retrieved field mapping. The return map keys are index, type, field (as specified in the request). + * + * @return the mappings + */ public Map> mappings() { return mappings; } @@ -197,20 +201,42 @@ public static class FieldMappingMetadata implements ToXContentFragment { private final String fullName; private final BytesReference source; + /** + * Creates a new FieldMappingMetadata. + * + * @param fullName the full name + * @param source the source + */ public FieldMappingMetadata(String fullName, BytesReference source) { this.fullName = fullName; this.source = source; } + /** + * Returns the full name. + * + * @return the full name + */ public String fullName() { return fullName; } - /** Returns the mappings as a map. Note that the returned map has a single key which is always the field's name. */ + /** + * Returns the mappings as a map. Note that the returned map has a single key which is always the field's name. + * + * @return the source as map + */ public Map sourceAsMap() { return XContentHelper.convertToMap(source, true, MediaTypeRegistry.JSON).v2(); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static FieldMappingMetadata fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java index 520d9755..ad2df49b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java @@ -41,7 +41,13 @@ */ public class GetMappingsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetMappingsAction INSTANCE = new GetMappingsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/mappings/get"; private GetMappingsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java index 579b7e2a..97e32dfd 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java @@ -47,6 +47,9 @@ @PublicApi(since = "1.0.0") public class GetMappingsRequest extends ClusterInfoRequest { + /** + * Creates a new GetMappingsRequest. + */ public GetMappingsRequest() {} @Override diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java index 486e019d..33b74c46 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java @@ -47,6 +47,13 @@ public class GetMappingsRequestBuilder extends ClusterInfoRequestBuilder< GetMappingsResponse, GetMappingsRequestBuilder> { + /** + * Creates a new GetMappingsRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public GetMappingsRequestBuilder(OpenSearchClient client, GetMappingsAction action, String... indices) { super(client, action, new GetMappingsRequest().indices(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java index 8529d1f9..8caece65 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java @@ -62,6 +62,11 @@ public class GetMappingsResponse extends ActionResponse implements ToXContentFra private final Map mappings; + /** + * Creates a new GetMappingsResponse. + * + * @param mappings the mappings + */ public GetMappingsResponse(final Map mappings) { this.mappings = Collections.unmodifiableMap(mappings); } @@ -93,10 +98,20 @@ public GetMappingsResponse(final Map mappings) { mappings = Collections.unmodifiableMap(indexMapBuilder); } + /** + * Returns the mappings. + * + * @return the mappings + */ public Map mappings() { return mappings; } + /** + * Returns the mappings. + * + * @return the mappings + */ public Map getMappings() { return mappings(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingAction.java index e5cfc8ec..14d56d3b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingAction.java @@ -42,7 +42,13 @@ */ public class PutMappingAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final PutMappingAction INSTANCE = new PutMappingAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/mapping/put"; private PutMappingAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java index 2b7d9139..a3419bcf 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java @@ -108,11 +108,16 @@ public class PutMappingRequest extends AcknowledgedRequest im private boolean writeIndexOnly; + /** + * Creates a new PutMappingRequest. + */ public PutMappingRequest() {} /** * Constructs a new put mapping request against one or more indices. If nothing is set then * it will be executed against all indices. + * + * @param indices the indices */ public PutMappingRequest(String... indices) { this.indices = indices; @@ -167,12 +172,16 @@ public boolean includeDataStreams() { /** * The mapping source definition. + * + * @return the source */ public String source() { return source; } /** + * Returns the simple mapping. + * * @param source * consisting of field/properties pairs (e.g. "field1", * "type=string,store=true") @@ -232,6 +241,9 @@ public static XContentBuilder simpleMapping(String... source) { /** * The mapping source definition. + * + * @param mappingBuilder the mapping builder + * @return the source */ public PutMappingRequest source(XContentBuilder mappingBuilder) { return source(BytesReference.bytes(mappingBuilder), mappingBuilder.contentType()); @@ -239,6 +251,10 @@ public PutMappingRequest source(XContentBuilder mappingBuilder) { /** * The mapping source definition. + * + * @param mappingSource the mapping source + * @param mediaType the media type + * @return the source */ public PutMappingRequest source(String mappingSource, MediaType mediaType) { return source(new BytesArray(mappingSource), mediaType); @@ -246,6 +262,10 @@ public PutMappingRequest source(String mappingSource, MediaType mediaType) { /** * The mapping source definition. + * + * @param mappingSource the mapping source + * @param mediaType the media type + * @return the source */ public PutMappingRequest source(BytesReference mappingSource, MediaType mediaType) { Objects.requireNonNull(mediaType); @@ -257,11 +277,22 @@ public PutMappingRequest source(BytesReference mappingSource, MediaType mediaTyp } } + /** + * Writes the index only. + * + * @param writeIndexOnly the write index only + * @return this instance + */ public PutMappingRequest writeIndexOnly(boolean writeIndexOnly) { this.writeIndexOnly = writeIndexOnly; return this; } + /** + * Writes the index only. + * + * @return this instance + */ public boolean writeIndexOnly() { return writeIndexOnly; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java index 337db1da..094a5565 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java @@ -54,10 +54,22 @@ public class PutMappingRequestBuilder extends AcknowledgedRequestBuilder< AcknowledgedResponse, PutMappingRequestBuilder> { + /** + * Creates a new PutMappingRequestBuilder. + * + * @param client the client + * @param action the action + */ public PutMappingRequestBuilder(OpenSearchClient client, PutMappingAction action) { super(client, action, new PutMappingRequest()); } + /** + * Sets the indices. + * + * @param indices the indices + * @return this instance + */ public PutMappingRequestBuilder setIndices(String... indices) { request.indices(indices); return this; @@ -65,6 +77,9 @@ public PutMappingRequestBuilder setIndices(String... indices) { /** * The mapping source definition. + * + * @param mappingBuilder the mapping builder + * @return this instance */ public PutMappingRequestBuilder setSource(XContentBuilder mappingBuilder) { request.source(mappingBuilder); @@ -73,6 +88,10 @@ public PutMappingRequestBuilder setSource(XContentBuilder mappingBuilder) { /** * The mapping source definition. + * + * @param mappingSource the mapping source + * @param mediaType the media type + * @return this instance */ public PutMappingRequestBuilder setSource(String mappingSource, MediaType mediaType) { request.source(mappingSource, mediaType); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexAction.java index 18b3bc6b..1357e33f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexAction.java @@ -41,7 +41,13 @@ */ public class OpenIndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final OpenIndexAction INSTANCE = new OpenIndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/open"; private OpenIndexAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequest.java index 215226a0..11d445ea 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequest.java @@ -60,10 +60,15 @@ public class OpenIndexRequest extends AcknowledgedRequest impl private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT; private boolean shouldStoreResult; + /** + * Creates a new OpenIndexRequest. + */ public OpenIndexRequest() {} /** * Constructs a new open index request for the specified index. + * + * @param indices the indices */ public OpenIndexRequest(String... indices) { this.indices = indices; @@ -114,6 +119,11 @@ public boolean includeDataStreams() { return true; } + /** + * Waits the for active shards. + * + * @return this instance + */ public ActiveShardCount waitForActiveShards() { return waitForActiveShards; } @@ -131,6 +141,7 @@ public ActiveShardCount waitForActiveShards() { * determine if the requisite shard copies were all started before returning or timing out. * * @param waitForActiveShards number of active shard copies to wait on + * @return this instance */ public OpenIndexRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { this.waitForActiveShards = waitForActiveShards; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java index 37878ce4..c427a284 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java @@ -46,6 +46,13 @@ @PublicApi(since = "1.0.0") public class OpenIndexRequestBuilder extends AcknowledgedRequestBuilder { + /** + * Creates a new OpenIndexRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public OpenIndexRequestBuilder(OpenSearchClient client, OpenIndexAction action, String... indices) { super(client, action, new OpenIndexRequest(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexResponse.java index 5c4bd2d6..f5a432ad 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/open/OpenIndexResponse.java @@ -59,10 +59,22 @@ public class OpenIndexResponse extends ShardsAcknowledgedResponse { declareAcknowledgedAndShardsAcknowledgedFields(PARSER); } + /** + * Creates a new OpenIndexResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public OpenIndexResponse(StreamInput in) throws IOException { super(in, true); } + /** + * Creates a new OpenIndexResponse. + * + * @param acknowledged the acknowledged + * @param shardsAcknowledged the shards acknowledged + */ public OpenIndexResponse(boolean acknowledged, boolean shardsAcknowledged) { super(acknowledged, shardsAcknowledged); } @@ -73,6 +85,12 @@ public void writeTo(StreamOutput out) throws IOException { writeShardsAcknowledged(out); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static OpenIndexResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryAction.java index f78af1c5..b56aa14e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryAction.java @@ -41,7 +41,13 @@ */ public class RecoveryAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final RecoveryAction INSTANCE = new RecoveryAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/recovery"; private RecoveryAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java index 30c2b5ff..177c4772 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java @@ -46,6 +46,9 @@ public class RecoveryRequestBuilder extends BroadcastOperationRequestBuilder> shardRecoveryStates; + /** + * Creates a new RecoveryResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public RecoveryResponse(StreamInput in) throws IOException { super(in); shardRecoveryStates = in.readMapOfLists(StreamInput::readString, RecoveryState::new); @@ -82,6 +88,11 @@ public RecoveryResponse( this.shardRecoveryStates = shardRecoveryStates; } + /** + * Returns the recoveries flag. + * + * @return the recoveries flag + */ public boolean hasRecoveries() { return shardRecoveryStates.size() > 0; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshAction.java index 55eac16e..cda09799 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshAction.java @@ -41,7 +41,13 @@ */ public class RefreshAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final RefreshAction INSTANCE = new RefreshAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/refresh"; private RefreshAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequest.java index b286935c..16d4d7c3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequest.java @@ -52,6 +52,11 @@ @PublicApi(since = "1.0.0") public class RefreshRequest extends BroadcastRequest { + /** + * Creates a new RefreshRequest. + * + * @param indices the indices + */ public RefreshRequest(String... indices) { super(indices); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java index e883d67c..0f34fba0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java @@ -46,6 +46,12 @@ @PublicApi(since = "1.0.0") public class RefreshRequestBuilder extends BroadcastOperationRequestBuilder { + /** + * Creates a new RefreshRequestBuilder. + * + * @param client the client + * @param action the action + */ public RefreshRequestBuilder(OpenSearchClient client, RefreshAction action) { super(client, action, new RefreshRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshResponse.java index 2cbcbb7e..6b2c40d2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/refresh/RefreshResponse.java @@ -73,6 +73,12 @@ public class RefreshResponse extends BroadcastResponse { super(totalShards, successfulShards, failedShards, shardFailures); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static RefreshResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsAction.java index 7cd38116..fb89712d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsAction.java @@ -16,7 +16,13 @@ * @opensearch.internal */ public class SegmentReplicationStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final SegmentReplicationStatsAction INSTANCE = new SegmentReplicationStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/segment_replication"; private SegmentReplicationStatsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsRequestBuilder.java index 2faa3385..63f8b178 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsRequestBuilder.java @@ -23,6 +23,12 @@ public class SegmentReplicationStatsRequestBuilder extends BroadcastOperationReq SegmentReplicationStatsResponse, SegmentReplicationStatsRequestBuilder> { + /** + * Creates a new SegmentReplicationStatsRequestBuilder. + * + * @param client the client + * @param action the action + */ public SegmentReplicationStatsRequestBuilder(OpenSearchClient client, SegmentReplicationStatsAction action) { super(client, action, new SegmentReplicationStatsRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsResponse.java index b254c0a7..7ffcf69d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/replication/SegmentReplicationStatsResponse.java @@ -31,6 +31,12 @@ public class SegmentReplicationStatsResponse extends BroadcastResponse { private final Map> replicationStats; + /** + * Creates a new SegmentReplicationStatsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public SegmentReplicationStatsResponse(StreamInput in) throws IOException { super(in); replicationStats = in.readMapOfLists(StreamInput::readString, SegmentReplicationPerGroupStats::new); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/resolve/ResolveIndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/resolve/ResolveIndexAction.java index 0539f08a..37427a11 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -61,7 +61,13 @@ @PublicApi(since = "1.0.0") public class ResolveIndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ResolveIndexAction INSTANCE = new ResolveIndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/resolve/index"; private ResolveIndexAction() { @@ -76,15 +82,29 @@ private ResolveIndexAction() { @PublicApi(since = "1.0.0") public static class Request extends ActionRequest implements IndicesRequest.Replaceable { + /** + * The DEFAULT_INDICES_OPTIONS constant. + */ public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpen(); private String[] names; private IndicesOptions indicesOptions = DEFAULT_INDICES_OPTIONS; + /** + * Creates a new Request. + * + * @param names the names + */ public Request(String[] names) { this.names = names; } + /** + * Creates a new Request. + * + * @param names the names + * @param indicesOptions the indices options + */ public Request(String[] names, IndicesOptions indicesOptions) { this.names = names; this.indicesOptions = indicesOptions; @@ -154,10 +174,20 @@ public static class ResolvedIndexAbstraction { this.name = name; } + /** + * Sets the name. + * + * @param name the name + */ protected void setName(String name) { this.name = name; } + /** + * Returns the name. + * + * @return the name + */ public String getName() { return name; } @@ -186,14 +216,29 @@ public static class ResolvedIndex extends ResolvedIndexAbstraction implements Wr this.dataStream = in.readOptionalString(); } + /** + * Returns the aliases. + * + * @return the aliases + */ public String[] getAliases() { return aliases; } + /** + * Returns the attributes. + * + * @return the attributes + */ public String[] getAttributes() { return attributes; } + /** + * Returns the data stream. + * + * @return the data stream + */ public String getDataStream() { return dataStream; } @@ -258,6 +303,11 @@ public static class ResolvedAlias extends ResolvedIndexAbstraction implements Wr this.indices = in.readStringArray(); } + /** + * Returns the indices. + * + * @return the indices + */ public String[] getIndices() { return indices; } @@ -315,10 +365,20 @@ public static class ResolvedDataStream extends ResolvedIndexAbstraction implemen this.timestampField = in.readString(); } + /** + * Returns the backing indices. + * + * @return the backing indices + */ public String[] getBackingIndices() { return backingIndices; } + /** + * Returns the timestamp field. + * + * @return the timestamp field + */ public String getTimestampField() { return timestampField; } @@ -374,20 +434,41 @@ public static class Response extends ActionResponse implements ToXContentObject private final List aliases; private final List dataStreams; + /** + * Creates a new Response by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public Response(StreamInput in) throws IOException { this.indices = in.readList(ResolvedIndex::new); this.aliases = in.readList(ResolvedAlias::new); this.dataStreams = in.readList(ResolvedDataStream::new); } + /** + * Returns the indices. + * + * @return the indices + */ public List getIndices() { return indices; } + /** + * Returns the aliases. + * + * @return the aliases + */ public List getAliases() { return aliases; } + /** + * Returns the data streams. + * + * @return the data streams + */ public List getDataStreams() { return dataStreams; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/Condition.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/Condition.java index 45c6e9ad..299e9668 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/Condition.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/Condition.java @@ -43,18 +43,36 @@ /** * Base class for rollover request conditions * + * @param the element type * @opensearch.api */ @PublicApi(since = "1.0.0") public abstract class Condition implements NamedWriteable, ToXContentFragment { + /** + * The value. + */ protected T value; + /** + * The name. + */ protected final String name; + /** + * Creates a new Condition. + * + * @param name the name + */ protected Condition(String name) { this.name = name; } + /** + * Returns the evaluate. + * + * @param stats the stats + * @return the evaluate + */ public abstract Result evaluate(Stats stats); /** @@ -94,8 +112,17 @@ public final String toString() { */ @PublicApi(since = "1.0.0") public static class Stats { + /** + * The num docs. + */ public final long numDocs; + /** + * The index created. + */ public final long indexCreated; + /** + * The index size. + */ public final ByteSizeValue indexSize; /** @@ -112,6 +139,10 @@ private Stats(Builder builder) { /** * This constructor will be deprecated starting in version 3.4.0. * Use {@link Builder} instead. + * + * @param numDocs the num docs + * @param indexCreated the index created + * @param indexSize the index size */ @Deprecated public Stats(long numDocs, long indexCreated, ByteSizeValue indexSize) { @@ -129,18 +160,39 @@ public static class Builder { private long indexCreated = 0; private ByteSizeValue indexSize = null; + /** + * Creates a new Builder. + */ public Builder() {} + /** + * Returns the num docs. + * + * @param numDocs the num docs + * @return the num docs + */ public Builder numDocs(long numDocs) { this.numDocs = numDocs; return this; } + /** + * Indexes the created. + * + * @param indexCreated the index created + * @return this instance + */ public Builder indexCreated(long indexCreated) { this.indexCreated = indexCreated; return this; } + /** + * Indexes the size. + * + * @param size the size + * @return this instance + */ public Builder indexSize(ByteSizeValue size) { this.indexSize = size; return this; @@ -163,9 +215,21 @@ public Stats build() { */ @PublicApi(since = "1.0.0") public static class Result { + /** + * The condition. + */ public final Condition condition; + /** + * The matched. + */ public final boolean matched; + /** + * Creates a new Result. + * + * @param condition the condition + * @param matched the matched + */ protected Result(Condition condition, boolean matched) { this.condition = condition; this.matched = matched; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxAgeCondition.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxAgeCondition.java index 3d5d2f1b..379c7017 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxAgeCondition.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxAgeCondition.java @@ -47,8 +47,16 @@ * @opensearch.internal */ public class MaxAgeCondition extends Condition { + /** + * The NAME constant. + */ public static final String NAME = "max_age"; + /** + * Creates a new MaxAgeCondition. + * + * @param value the value + */ public MaxAgeCondition(TimeValue value) { super(NAME); this.value = value; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxDocsCondition.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxDocsCondition.java index bf5913aa..97b3629a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxDocsCondition.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxDocsCondition.java @@ -46,8 +46,16 @@ * @opensearch.internal */ public class MaxDocsCondition extends Condition { + /** + * The NAME constant. + */ public static final String NAME = "max_docs"; + /** + * Creates a new MaxDocsCondition. + * + * @param value the value + */ public MaxDocsCondition(Long value) { super(NAME); this.value = value; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxSizeCondition.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxSizeCondition.java index 7a2b7741..cad71562 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxSizeCondition.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/MaxSizeCondition.java @@ -48,8 +48,16 @@ * @opensearch.internal */ public class MaxSizeCondition extends Condition { + /** + * The NAME constant. + */ public static final String NAME = "max_size"; + /** + * Creates a new MaxSizeCondition. + * + * @param value the value + */ public MaxSizeCondition(ByteSizeValue value) { super(NAME); this.value = value; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverAction.java index 842b442f..3989c894 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverAction.java @@ -41,7 +41,13 @@ */ public class RolloverAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final RolloverAction INSTANCE = new RolloverAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/rollover"; private RolloverAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverInfo.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverInfo.java index b75af61a..f4dfe643 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverInfo.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverInfo.java @@ -58,9 +58,18 @@ @PublicApi(since = "1.0.0") public class RolloverInfo extends AbstractDiffable implements Writeable, ToXContentFragment { + /** + * The CONDITION_FIELD constant. + */ public static final ParseField CONDITION_FIELD = new ParseField("met_conditions"); + /** + * The TIME_FIELD constant. + */ public static final ParseField TIME_FIELD = new ParseField("time"); + /** + * The PARSER constant. + */ @SuppressWarnings("unchecked") public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "rollover_info", @@ -80,22 +89,47 @@ public class RolloverInfo extends AbstractDiffable implements Writ private final List> metConditions; private final long time; + /** + * Creates a new RolloverInfo. + * + * @param alias the alias + * @param metConditions the met conditions + * @param time the time + */ public RolloverInfo(String alias, List> metConditions, long time) { this.alias = alias; this.metConditions = metConditions; this.time = time; } + /** + * Creates a new RolloverInfo by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public RolloverInfo(StreamInput in) throws IOException { this.alias = in.readString(); this.time = in.readVLong(); this.metConditions = (List) in.readNamedWriteableList(Condition.class); } + /** + * Returns the alias. + * + * @return the alias + */ public String getAlias() { return alias; } + /** + * Reads the diff from. + * + * @param in the input to read from + * @return the diff from + * @throws IOException if an I/O error occurs + */ public static Diff readDiffFrom(StreamInput in) throws IOException { return readDiffFrom(RolloverInfo::new, in); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequest.java index 29da5401..ad04e9fa 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequest.java @@ -164,6 +164,8 @@ public boolean includeDataStreams() { /** * Sets the rollover target to rollover to another index + * + * @param rolloverTarget the rollover target */ public void setRolloverTarget(String rolloverTarget) { this.rolloverTarget = rolloverTarget; @@ -171,29 +173,53 @@ public void setRolloverTarget(String rolloverTarget) { /** * Sets the alias to rollover to another index + * + * @param newIndexName the new index name */ public void setNewIndexName(String newIndexName) { this.newIndexName = newIndexName; } + /** + * Returns the dry run flag. + * + * @return the dry run flag + */ public boolean isDryRun() { return dryRun; } + /** + * Returns the conditions. + * + * @return the conditions + */ public Map> getConditions() { return conditions; } + /** + * Returns the rollover target. + * + * @return the rollover target + */ public String getRolloverTarget() { return rolloverTarget; } + /** + * Returns the new index name. + * + * @return the new index name + */ public String getNewIndexName() { return newIndexName; } /** * Returns the inner {@link CreateIndexRequest}. Allows to configure mappings, settings and aliases for the new index. + * + * @return the create index request */ public CreateIndexRequest getCreateIndexRequest() { return createIndexRequest; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java index bc7a9f7b..d334be1e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java @@ -50,15 +50,33 @@ public class RolloverRequestBuilder extends ClusterManagerNodeOperationRequestBu RolloverRequest, RolloverResponse, RolloverRequestBuilder> { + /** + * Creates a new RolloverRequestBuilder. + * + * @param client the client + * @param action the action + */ public RolloverRequestBuilder(OpenSearchClient client, RolloverAction action) { super(client, action, new RolloverRequest()); } + /** + * Sets the rollover target. + * + * @param rolloverTarget the rollover target + * @return this instance + */ public RolloverRequestBuilder setRolloverTarget(String rolloverTarget) { this.request.setRolloverTarget(rolloverTarget); return this; } + /** + * Sets the new index name. + * + * @param newIndexName the new index name + * @return this instance + */ public RolloverRequestBuilder setNewIndexName(String newIndexName) { this.request.setNewIndexName(newIndexName); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverResponse.java index ab9b7f8a..925fa9c6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/rollover/RolloverResponse.java @@ -114,6 +114,17 @@ public final class RolloverResponse extends ShardsAcknowledgedResponse implement shardsAcknowledged = in.readBoolean(); } + /** + * Creates a new RolloverResponse. + * + * @param oldIndex the old index + * @param newIndex the new index + * @param conditionResults the condition results + * @param dryRun the dry run + * @param rolledOver the rolled over + * @param acknowledged the acknowledged + * @param shardsAcknowledged the shards acknowledged + */ public RolloverResponse( String oldIndex, String newIndex, @@ -166,6 +177,12 @@ protected void addCustomFields(XContentBuilder builder, Params params) throws IO builder.endObject(); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static RolloverResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexSegments.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexSegments.java index fc2546f5..ba97f964 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexSegments.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexSegments.java @@ -73,6 +73,11 @@ public class IndexSegments implements Iterable { } } + /** + * Returns the index. + * + * @return the index + */ public String getIndex() { return this.index; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexShardSegments.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexShardSegments.java index 75545306..af0830ae 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexShardSegments.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndexShardSegments.java @@ -55,6 +55,11 @@ public class IndexShardSegments implements Iterable { this.shards = shards; } + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public ShardId getShardId() { return this.shardId; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java index aa349662..af4bdd2d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java @@ -69,6 +69,11 @@ public class IndicesSegmentResponse extends BroadcastResponse { shards = in.readArray(ShardSegments::new, ShardSegments[]::new); } + /** + * Returns the indices. + * + * @return the indices + */ public Map getIndices() { if (indicesSegments != null) { return indicesSegments; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java index 95a181b8..819a58b9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java @@ -41,7 +41,13 @@ */ public class IndicesSegmentsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final IndicesSegmentsAction INSTANCE = new IndicesSegmentsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/segments"; private IndicesSegmentsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java index ca291c49..73dc30d5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java @@ -48,12 +48,23 @@ @PublicApi(since = "1.0.0") public class IndicesSegmentsRequest extends BroadcastRequest { + /** + * The verbose. + */ protected boolean verbose = false; + /** + * Creates a new IndicesSegmentsRequest. + */ public IndicesSegmentsRequest() { this(Strings.EMPTY_ARRAY); } + /** + * Creates a new IndicesSegmentsRequest. + * + * @param indices the indices + */ public IndicesSegmentsRequest(String... indices) { super(indices); } @@ -61,6 +72,8 @@ public IndicesSegmentsRequest(String... indices) { /** * true if detailed information about each segment should be returned, * false otherwise. + * + * @return the verbose */ public boolean verbose() { return verbose; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java index 7aa4e7e8..ab7071d6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java @@ -47,6 +47,12 @@ public class IndicesSegmentsRequestBuilder extends BroadcastOperationRequestBuil IndicesSegmentResponse, IndicesSegmentsRequestBuilder> { + /** + * Creates a new IndicesSegmentsRequestBuilder. + * + * @param client the client + * @param action the action + */ public IndicesSegmentsRequestBuilder(OpenSearchClient client, IndicesSegmentsAction action) { super(client, action, new IndicesSegmentsRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/ShardSegments.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/ShardSegments.java index bf6ad688..058f651e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/ShardSegments.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/segments/ShardSegments.java @@ -65,10 +65,20 @@ public Iterator iterator() { return segments.iterator(); } + /** + * Returns the shard routing. + * + * @return the shard routing + */ public ShardRouting getShardRouting() { return this.shardRouting; } + /** + * Returns the number of committed. + * + * @return the number of committed + */ public int getNumberOfCommitted() { int count = 0; for (Segment segment : segments) { @@ -79,6 +89,11 @@ public int getNumberOfCommitted() { return count; } + /** + * Returns the number of search. + * + * @return the number of search + */ public int getNumberOfSearch() { int count = 0; for (Segment segment : segments) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsAction.java index 2b52b7f1..65ba5d5f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsAction.java @@ -41,9 +41,18 @@ */ public class GetSettingsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetSettingsAction INSTANCE = new GetSettingsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/settings/get"; + /** + * Creates a new GetSettingsAction. + */ public GetSettingsAction() { super(NAME, GetSettingsResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java index eab719c0..c0cf8ed2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java @@ -66,6 +66,9 @@ public GetSettingsRequest indices(String... indices) { return this; } + /** + * Creates a new GetSettingsRequest. + */ public GetSettingsRequest() {} @Override @@ -93,14 +96,29 @@ public boolean includeDataStreams() { return true; } + /** + * Returns the names. + * + * @return the names + */ public String[] names() { return names; } + /** + * Returns the human readable. + * + * @return the human readable + */ public boolean humanReadable() { return humanReadable; } + /** + * Includes the defaults. + * + * @return this instance + */ public boolean includeDefaults() { return includeDefaults; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java index 045ccce0..9a606e1d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java @@ -49,10 +49,23 @@ public class GetSettingsRequestBuilder extends ClusterManagerNodeReadOperationRe GetSettingsResponse, GetSettingsRequestBuilder> { + /** + * Creates a new GetSettingsRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public GetSettingsRequestBuilder(OpenSearchClient client, GetSettingsAction action, String... indices) { super(client, action, new GetSettingsRequest().indices(indices)); } + /** + * Sets the indices. + * + * @param indices the indices + * @return this instance + */ public GetSettingsRequestBuilder setIndices(String... indices) { request.indices(indices); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java index dd59bb7a..ce1fd9c8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java @@ -62,11 +62,23 @@ public class GetSettingsResponse extends ActionResponse implements ToXContentObj private final Map indexToSettings; private final Map indexToDefaultSettings; + /** + * Creates a new GetSettingsResponse. + * + * @param indexToSettings the index to settings + * @param indexToDefaultSettings the index to default settings + */ public GetSettingsResponse(Map indexToSettings, Map indexToDefaultSettings) { this.indexToSettings = Collections.unmodifiableMap(indexToSettings); this.indexToDefaultSettings = Collections.unmodifiableMap(indexToDefaultSettings); } + /** + * Creates a new GetSettingsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetSettingsResponse(StreamInput in) throws IOException { super(in); indexToSettings = in.readMap(StreamInput::readString, Settings::readSettingsFromStream); @@ -77,6 +89,8 @@ public GetSettingsResponse(StreamInput in) throws IOException { * Returns a map of index name to {@link Settings} object. The returned {@link Settings} * objects contain only those settings explicitly set on a given index. Any settings * taking effect as defaults must be accessed via {@code #getIndexToDefaultSettings()}. + * + * @return the index to settings */ public Map getIndexToSettings() { return indexToSettings; @@ -88,6 +102,10 @@ public Map getIndexToSettings() { * return a value where the setting was explicitly set on the index. If the includeDefaults * flag was set to true on the GetSettingsRequest, this method will fall back to return the default * value if the setting was not explicitly set. + * + * @param index the index + * @param setting the setting + * @return the setting */ public String getSetting(String index, String setting) { Settings settings = indexToSettings.get(index); @@ -149,6 +167,13 @@ private static void parseIndexEntry( } } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static GetSettingsResponse fromXContent(XContentParser parser) throws IOException { HashMap indexToSettings = new HashMap<>(); HashMap indexToDefaultSettings = new HashMap<>(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java index 5067cf90..b7c22ab8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java @@ -42,7 +42,13 @@ */ public class UpdateSettingsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final UpdateSettingsAction INSTANCE = new UpdateSettingsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/settings/update"; private UpdateSettingsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java index d30970fd..5b1b2041 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java @@ -74,10 +74,15 @@ public class UpdateSettingsRequest extends AcknowledgedRequesttrue iff the settings update should only add but not update settings. If the setting already exists * it should not be overwritten by this update. The default is false + * + * @return the preserve existing flag */ public boolean isPreserveExisting() { return preserveExisting; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java index 17921485..437933f5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java @@ -53,12 +53,22 @@ public class UpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder< AcknowledgedResponse, UpdateSettingsRequestBuilder> { + /** + * Creates a new UpdateSettingsRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public UpdateSettingsRequestBuilder(OpenSearchClient client, UpdateSettingsAction action, String... indices) { super(client, action, new UpdateSettingsRequest(indices)); } /** * Sets the indices the update settings will execute on + * + * @param indices the indices + * @return this instance */ public UpdateSettingsRequestBuilder setIndices(String... indices) { request.indices(indices); @@ -67,6 +77,9 @@ public UpdateSettingsRequestBuilder setIndices(String... indices) { /** * Sets the settings to be updated + * + * @param settings the settings + * @return this instance */ public UpdateSettingsRequestBuilder setSettings(Settings.Builder settings) { request.settings(settings); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java index c9a18b69..b1085e16 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java @@ -50,6 +50,13 @@ public class IndicesShardStoreRequestBuilder extends ClusterManagerNodeReadOpera IndicesShardStoresResponse, IndicesShardStoreRequestBuilder> { + /** + * Creates a new IndicesShardStoreRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public IndicesShardStoreRequestBuilder(OpenSearchClient client, ActionType action, String... indices) { super(client, action, new IndicesShardStoresRequest(indices)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java index 2c196849..18cb99d6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java @@ -45,7 +45,13 @@ */ public class IndicesShardStoresAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final IndicesShardStoresAction INSTANCE = new IndicesShardStoresAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/shard_stores"; private IndicesShardStoresAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java index e65366e4..e469f325 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java @@ -60,11 +60,16 @@ public class IndicesShardStoresRequest extends ClusterManagerNodeReadRequestindices + * + * @param indices the indices */ public IndicesShardStoresRequest(String... indices) { this.indices = indices; } + /** + * Creates a new IndicesShardStoresRequest. + */ public IndicesShardStoresRequest() {} @Override @@ -94,6 +99,8 @@ public boolean includeDataStreams() { /** * Returns the shard criteria to get store information on + * + * @return the shard statuses */ public EnumSet shardStatuses() { return statuses; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java index 26495cb7..b163c6ca 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java @@ -113,6 +113,11 @@ private static AllocationStatus fromId(byte id) { } } + /** + * Returns the value. + * + * @return the value + */ public String value() { switch (id) { case 0: @@ -135,6 +140,12 @@ private void writeTo(StreamOutput out) throws IOException { } } + /** + * Creates a new StoreStatus by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public StoreStatus(StreamInput in) throws IOException { node = new DiscoveryNode(in); allocationId = in.readOptionalString(); @@ -209,6 +220,11 @@ private Failure(StreamInput in) throws IOException { nodeId = in.readString(); } + /** + * Returns the node identifier. + * + * @return the node identifier + */ public String nodeId() { return nodeId; } @@ -233,6 +249,12 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t private final Map>> storeStatuses; private final List failures; + /** + * Creates a new IndicesShardStoresResponse. + * + * @param storeStatuses the store statuses + * @param failures the failures + */ public IndicesShardStoresResponse(final Map>> storeStatuses, List failures) { this.storeStatuses = Collections.unmodifiableMap(storeStatuses); this.failures = failures; @@ -242,6 +264,12 @@ public IndicesShardStoresResponse(final Map>> storeStatuses = in.readMap( diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeAction.java index f6b51564..0787b0e2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeAction.java @@ -41,7 +41,13 @@ */ public class ResizeAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ResizeAction INSTANCE = new ResizeAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/resize"; private ResizeAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequest.java index dd6b37ab..19d30cb7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequest.java @@ -63,6 +63,9 @@ @PublicApi(since = "1.0.0") public class ResizeRequest extends AcknowledgedRequest implements IndicesRequest, ToXContentObject { + /** + * The PARSER constant. + */ public static final ObjectParser PARSER = new ObjectParser<>("resize_request"); private static final ParseField MAX_SHARD_SIZE = new ParseField("max_shard_size"); @@ -94,6 +97,12 @@ public class ResizeRequest extends AcknowledgedRequest implements ResizeRequest() {} + /** + * Creates a new ResizeRequest. + * + * @param targetIndex the target index + * @param sourceIndex the source index + */ public ResizeRequest(String targetIndex, String sourceIndex) { this.targetIndexRequest = new CreateIndexRequest(targetIndex); this.sourceIndex = sourceIndex; @@ -162,6 +171,11 @@ public ActionRequestValidationException validate() { return validationException; } + /** + * Sets the source index. + * + * @param index the index + */ public void setSourceIndex(String index) { this.sourceIndex = index; } @@ -188,12 +202,19 @@ public IndicesOptions indicesOptions() { return IndicesOptions.lenientExpandOpen(); } + /** + * Sets the target index. + * + * @param targetIndexRequest the target index request + */ public void setTargetIndex(CreateIndexRequest targetIndexRequest) { this.targetIndexRequest = Objects.requireNonNull(targetIndexRequest, "target index request must not be null"); } /** * Returns the {@link CreateIndexRequest} for the shrink index + * + * @return the target index request */ public CreateIndexRequest getTargetIndexRequest() { return targetIndexRequest; @@ -201,6 +222,8 @@ public CreateIndexRequest getTargetIndexRequest() { /** * Returns the source index name + * + * @return the source index */ public String getSourceIndex() { return sourceIndex; @@ -208,6 +231,8 @@ public String getSourceIndex() { /** * The type of the resize operation + * + * @param type the type */ public void setResizeType(ResizeType type) { this.type = Objects.requireNonNull(type); @@ -215,6 +240,8 @@ public void setResizeType(ResizeType type) { /** * Returns the type of the resize operation + * + * @return the resize type */ public ResizeType getResizeType() { return type; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java index 0a84fe85..d626748a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java @@ -47,15 +47,33 @@ */ @PublicApi(since = "1.0.0") public class ResizeRequestBuilder extends AcknowledgedRequestBuilder { + /** + * Creates a new ResizeRequestBuilder. + * + * @param client the client + * @param action the action + */ public ResizeRequestBuilder(OpenSearchClient client, ActionType action) { super(client, action, new ResizeRequest()); } + /** + * Sets the target index. + * + * @param request the request + * @return this instance + */ public ResizeRequestBuilder setTargetIndex(CreateIndexRequest request) { this.request.setTargetIndex(request); return this; } + /** + * Sets the source index. + * + * @param index the index + * @return this instance + */ public ResizeRequestBuilder setSourceIndex(String index) { this.request.setSourceIndex(index); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeResponse.java index 06a1f0e9..2717d7da 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeResponse.java @@ -62,10 +62,23 @@ public final class ResizeResponse extends CreateIndexResponse { super(in); } + /** + * Creates a new ResizeResponse. + * + * @param acknowledged the acknowledged + * @param shardsAcknowledged the shards acknowledged + * @param index the index + */ public ResizeResponse(boolean acknowledged, boolean shardsAcknowledged, String index) { super(acknowledged, shardsAcknowledged, index); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ResizeResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeType.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeType.java index 0ab010eb..a61f3ca4 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeType.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/shrink/ResizeType.java @@ -41,7 +41,16 @@ */ @PublicApi(since = "1.0.0") public enum ResizeType { + /** + * The SHRINK value. + */ SHRINK, + /** + * The SPLIT value. + */ SPLIT, + /** + * The CLONE value. + */ CLONE; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/AbstractStatusStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/AbstractStatusStats.java index 04372497..bc18f6be 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/AbstractStatusStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/AbstractStatusStats.java @@ -27,8 +27,14 @@ * @opensearch.internal */ public abstract class AbstractStatusStats implements Writeable, ToXContentFragment { + /** + * The status counter. + */ final protected LongAdder[] statusCounter; + /** + * Creates a new AbstractStatusStats. + */ public AbstractStatusStats() { statusCounter = new LongAdder[5]; for (int i = 0; i < statusCounter.length; ++i) { @@ -36,6 +42,12 @@ public AbstractStatusStats() { } } + /** + * Creates a new AbstractStatusStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public AbstractStatusStats(StreamInput in) throws IOException { statusCounter = in.readArray(i -> { LongAdder adder = new LongAdder(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStats.java index abef09fa..1b4b1769 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStats.java @@ -72,58 +72,114 @@ @PublicApi(since = "1.0.0") public class CommonStats implements Writeable, ToXContentFragment { + /** + * The docs. + */ @Nullable public DocsStats docs; + /** + * The store. + */ @Nullable public StoreStats store; + /** + * The indexing. + */ @Nullable public IndexingStats indexing; + /** + * The get. + */ @Nullable public GetStats get; + /** + * The search. + */ @Nullable public SearchStats search; + /** + * The merge. + */ @Nullable public MergeStats merge; + /** + * The refresh. + */ @Nullable public RefreshStats refresh; + /** + * The flush. + */ @Nullable public FlushStats flush; + /** + * The warmer. + */ @Nullable public WarmerStats warmer; + /** + * The query cache. + */ @Nullable public QueryCacheStats queryCache; + /** + * The field data. + */ @Nullable public FieldDataStats fieldData; + /** + * The completion. + */ @Nullable public CompletionStats completion; + /** + * The segments. + */ @Nullable public SegmentsStats segments; + /** + * The translog. + */ @Nullable public TranslogStats translog; + /** + * The request cache. + */ @Nullable public RequestCacheStats requestCache; + /** + * The recovery stats. + */ @Nullable public RecoveryStats recoveryStats; + /** + * Creates a new CommonStats. + */ public CommonStats() { this(CommonStatsFlags.NONE); } + /** + * Creates a new CommonStats. + * + * @param flags the flags + */ public CommonStats(CommonStatsFlags flags) { CommonStatsFlags.Flag[] setFlags = flags.getFlags(); @@ -183,6 +239,12 @@ public CommonStats(CommonStatsFlags flags) { } } + /** + * Creates a new CommonStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public CommonStats(StreamInput in) throws IOException { docs = in.readOptionalWriteable(DocsStats::new); store = in.readOptionalWriteable(StoreStats::new); @@ -222,6 +284,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(recoveryStats); } + /** + * Adds this instance. + * + * @param stats the stats + */ public void add(CommonStats stats) { if (docs == null) { if (stats.getDocs() != null) { @@ -354,81 +421,161 @@ public void add(CommonStats stats) { } } + /** + * Returns the docs. + * + * @return the docs + */ @Nullable public DocsStats getDocs() { return this.docs; } + /** + * Returns the store. + * + * @return the store + */ @Nullable public StoreStats getStore() { return store; } + /** + * Returns the indexing. + * + * @return the indexing + */ @Nullable public IndexingStats getIndexing() { return indexing; } + /** + * Returns the get. + * + * @return the get + */ @Nullable public GetStats getGet() { return get; } + /** + * Returns the search. + * + * @return the search + */ @Nullable public SearchStats getSearch() { return search; } + /** + * Returns the merge. + * + * @return the merge + */ @Nullable public MergeStats getMerge() { return merge; } + /** + * Returns the refresh. + * + * @return the refresh + */ @Nullable public RefreshStats getRefresh() { return refresh; } + /** + * Returns the flush. + * + * @return the flush + */ @Nullable public FlushStats getFlush() { return flush; } + /** + * Returns the warmer. + * + * @return the warmer + */ @Nullable public WarmerStats getWarmer() { return this.warmer; } + /** + * Returns the query cache. + * + * @return the query cache + */ @Nullable public QueryCacheStats getQueryCache() { return this.queryCache; } + /** + * Returns the field data. + * + * @return the field data + */ @Nullable public FieldDataStats getFieldData() { return this.fieldData; } + /** + * Returns the completion. + * + * @return the completion + */ @Nullable public CompletionStats getCompletion() { return completion; } + /** + * Returns the segments. + * + * @return the segments + */ @Nullable public SegmentsStats getSegments() { return segments; } + /** + * Returns the translog. + * + * @return the translog + */ @Nullable public TranslogStats getTranslog() { return translog; } + /** + * Returns the request cache. + * + * @return the request cache + */ @Nullable public RequestCacheStats getRequestCache() { return requestCache; } + /** + * Returns the recovery stats. + * + * @return the recovery stats + */ @Nullable public RecoveryStats getRecoveryStats() { return recoveryStats; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStatsFlags.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStatsFlags.java index f3ea90fb..3839cd5d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/CommonStatsFlags.java @@ -53,7 +53,13 @@ @PublicApi(since = "1.0.0") public class CommonStatsFlags implements Writeable, Cloneable { + /** + * The ALL constant. + */ public static final CommonStatsFlags ALL = new CommonStatsFlags().all(); + /** + * The NONE constant. + */ public static final CommonStatsFlags NONE = new CommonStatsFlags().clear(); private EnumSet flags = EnumSet.allOf(Flag.class); @@ -70,6 +76,8 @@ public class CommonStatsFlags implements Writeable, Cloneable { private boolean includeIndicesStatsByLevel = false; /** + * Creates a new CommonStatsFlags. + * * @param flags flags to set. If no flags are supplied, default flags will be set. */ public CommonStatsFlags(Flag... flags) { @@ -79,6 +87,12 @@ public CommonStatsFlags(Flag... flags) { } } + /** + * Creates a new CommonStatsFlags by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public CommonStatsFlags(StreamInput in) throws IOException { final long longFlags = in.readLong(); flags.clear(); @@ -135,6 +149,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Sets all flags to return all stats. + * + * @return the all */ public CommonStatsFlags all() { flags = EnumSet.allOf(Flag.class); @@ -152,6 +168,8 @@ public CommonStatsFlags all() { /** * Clears all stats. + * + * @return this instance */ public CommonStatsFlags clear() { flags = EnumSet.noneOf(Flag.class); @@ -167,38 +185,84 @@ public CommonStatsFlags clear() { return this; } + /** + * Returns the any set. + * + * @return the any set + */ public boolean anySet() { return !flags.isEmpty(); } + /** + * Returns the flags. + * + * @return the flags + */ public Flag[] getFlags() { return flags.toArray(new Flag[0]); } + /** + * Returns the include caches. + * + * @return the include caches + */ public Set getIncludeCaches() { return includeCaches; } + /** + * Returns the groups. + * + * @return the groups + */ public String[] groups() { return this.groups; } + /** + * Returns the field data fields. + * + * @return the field data fields + */ public String[] fieldDataFields() { return this.fieldDataFields; } + /** + * Returns the completion data fields. + * + * @return the completion data fields + */ public String[] completionDataFields() { return this.completionDataFields; } + /** + * Includes the unloaded segments. + * + * @return this instance + */ public boolean includeUnloadedSegments() { return this.includeUnloadedSegments; } + /** + * Includes the segment file sizes. + * + * @return this instance + */ public boolean includeSegmentFileSizes() { return this.includeSegmentFileSizes; } + /** + * Returns the set flag. + * + * @param flag the flag + * @return the set flag + */ public boolean isSet(Flag flag) { return flags.contains(flag); } @@ -221,22 +285,70 @@ public CommonStatsFlags clone() { */ @PublicApi(since = "1.0.0") public enum Flag { + /** + * The Store value. + */ Store("store", 0), + /** + * The Indexing value. + */ Indexing("indexing", 1), + /** + * The Get value. + */ Get("get", 2), + /** + * The Search value. + */ Search("search", 3), + /** + * The Merge value. + */ Merge("merge", 4), + /** + * The Flush value. + */ Flush("flush", 5), + /** + * The Refresh value. + */ Refresh("refresh", 6), + /** + * The QueryCache value. + */ QueryCache("query_cache", 7), + /** + * The FieldData value. + */ FieldData("fielddata", 8), + /** + * The Docs value. + */ Docs("docs", 9), + /** + * The Warmer value. + */ Warmer("warmer", 10), + /** + * The Completion value. + */ Completion("completion", 11), + /** + * The Segments value. + */ Segments("segments", 12), + /** + * The Translog value. + */ Translog("translog", 13), // 14 was previously used for Suggest + /** + * The RequestCache value. + */ RequestCache("request_cache", 15), + /** + * The Recovery value. + */ Recovery("recovery", 16); private final String restName; @@ -247,6 +359,11 @@ public enum Flag { this.index = index; } + /** + * Returns the rest name. + * + * @return the rest name + */ public String getRestName() { return restName; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/DocStatusStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/DocStatusStats.java index 1d858134..719faa73 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/DocStatusStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/DocStatusStats.java @@ -25,10 +25,19 @@ @PublicApi(since = "3.4.0") public class DocStatusStats extends AbstractStatusStats { + /** + * Creates a new DocStatusStats. + */ public DocStatusStats() { super(); } + /** + * Creates a new DocStatusStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DocStatusStats(StreamInput in) throws IOException { super(in); } @@ -83,6 +92,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * For this function, I just want to retrieve a point in time snapshot of the DocStatusStats. + * + * @return the snapshot */ public DocStatusStats getSnapshot() { DocStatusStats curSnapshot = new DocStatusStats(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexShardStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexShardStats.java index 2d1dbf3d..35d027bf 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexShardStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexShardStats.java @@ -54,20 +54,42 @@ public class IndexShardStats implements Iterable, Writeable { private final ShardStats[] shards; + /** + * Creates a new IndexShardStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IndexShardStats(StreamInput in) throws IOException { shardId = new ShardId(in); shards = in.readArray(ShardStats::new, ShardStats[]::new); } + /** + * Creates a new IndexShardStats. + * + * @param shardId the shard identifier + * @param shards the shards + */ public IndexShardStats(ShardId shardId, ShardStats[] shards) { this.shardId = shardId; this.shards = shards; } + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public ShardId getShardId() { return this.shardId; } + /** + * Returns the shards. + * + * @return the shards + */ public ShardStats[] getShards() { return shards; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexStats.java index 3b99a7b3..6ae237ad 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndexStats.java @@ -54,22 +54,44 @@ public class IndexStats implements Iterable { private final ShardStats shards[]; + /** + * Creates a new IndexStats. + * + * @param index the index + * @param uuid the UUID + * @param shards the shards + */ public IndexStats(String index, String uuid, ShardStats[] shards) { this.index = index; this.uuid = uuid; this.shards = shards; } + /** + * Returns the index. + * + * @return the index + */ public String getIndex() { return this.index; } + /** + * Returns the UUID. + * + * @return the UUID + */ public String getUuid() { return uuid; } private Map indexShards; + /** + * Returns the index shards. + * + * @return the index shards + */ public Map getIndexShards() { if (indexShards != null) { return indexShards; @@ -100,6 +122,11 @@ public Iterator iterator() { private CommonStats total = null; + /** + * Returns the total. + * + * @return the total + */ public CommonStats getTotal() { if (total != null) { return total; @@ -114,6 +141,11 @@ public CommonStats getTotal() { private CommonStats primary = null; + /** + * Returns the primaries. + * + * @return the primaries + */ public CommonStats getPrimaries() { if (primary != null) { return primary; @@ -138,16 +170,33 @@ public static class IndexStatsBuilder { private final String uuid; private final List shards = new ArrayList<>(); + /** + * Creates a new IndexStatsBuilder. + * + * @param indexName the index name + * @param uuid the UUID + */ public IndexStatsBuilder(String indexName, String uuid) { this.indexName = indexName; this.uuid = uuid; } + /** + * Adds this instance. + * + * @param shardStats the shard stats + * @return this instance + */ public IndexStatsBuilder add(ShardStats shardStats) { shards.add(shardStats); return this; } + /** + * Builds this instance. + * + * @return the new instance + */ public IndexStats build() { return new IndexStats(indexName, uuid, shards.toArray(new ShardStats[0])); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsAction.java index c1d53afa..1f91091d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsAction.java @@ -41,7 +41,13 @@ */ public class IndicesStatsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final IndicesStatsAction INSTANCE = new IndicesStatsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/stats"; private IndicesStatsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequest.java index b4354e2f..a9d98440 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequest.java @@ -54,12 +54,17 @@ public class IndicesStatsRequest extends BroadcastRequest { private CommonStatsFlags flags = new CommonStatsFlags(); + /** + * Creates a new IndicesStatsRequest. + */ public IndicesStatsRequest() { super((String[]) null); } /** * Returns the underlying stats flags. + * + * @return the flags */ public CommonStatsFlags flags() { return flags; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java index 0908f34b..00b2c3d8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java @@ -54,6 +54,12 @@ public class IndicesStatsRequestBuilder extends BroadcastOperationRequestBuilder IndicesStatsResponse, IndicesStatsRequestBuilder> { + /** + * Creates a new IndicesStatsRequestBuilder. + * + * @param client the client + * @param action the action + */ public IndicesStatsRequestBuilder(OpenSearchClient client, IndicesStatsAction action) { super(client, action, new IndicesStatsRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsResponse.java index 9e718daf..87d16795 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/IndicesStatsResponse.java @@ -63,11 +63,26 @@ public class IndicesStatsResponse extends BroadcastResponse { private ShardStats[] shards; + /** + * Creates a new IndicesStatsResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IndicesStatsResponse(StreamInput in) throws IOException { super(in); shards = in.readArray(ShardStats::new, (size) -> new ShardStats[size]); } + /** + * Creates a new IndicesStatsResponse. + * + * @param shards the shards + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param failedShards the failed shards + * @param shardFailures the shard failures + */ public IndicesStatsResponse( ShardStats[] shards, int totalShards, @@ -81,6 +96,11 @@ public IndicesStatsResponse( private Map indicesStats; + /** + * Returns the indices. + * + * @return the indices + */ public Map getIndices() { if (indicesStats != null) { return indicesStats; @@ -104,6 +124,11 @@ public Map getIndices() { private CommonStats total = null; + /** + * Returns the total. + * + * @return the total + */ public CommonStats getTotal() { if (total != null) { return total; @@ -118,6 +143,11 @@ public CommonStats getTotal() { private CommonStats primary = null; + /** + * Returns the primaries. + * + * @return the primaries + */ public CommonStats getPrimaries() { if (primary != null) { return primary; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/SearchResponseStatusStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/SearchResponseStatusStats.java index 89d91506..40aeefb9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/SearchResponseStatusStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/SearchResponseStatusStats.java @@ -25,10 +25,19 @@ @PublicApi(since = "3.4.0") public class SearchResponseStatusStats extends AbstractStatusStats { + /** + * Creates a new SearchResponseStatusStats. + */ public SearchResponseStatusStats() { super(); } + /** + * Creates a new SearchResponseStatusStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public SearchResponseStatusStats(StreamInput in) throws IOException { super(in); } @@ -82,6 +91,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * For this function, I just want to retrieve a point in time snapshot of the SearchResponseStatusStats. + * + * @return the snapshot */ public SearchResponseStatusStats getSnapshot() { SearchResponseStatusStats curSnapshot = new SearchResponseStatusStats(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/ShardStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/ShardStats.java index 7d5ac08d..ca060525 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/ShardStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/ShardStats.java @@ -73,6 +73,12 @@ public class ShardStats implements Writeable, ToXContentFragment { private String statePath; private boolean isCustomDataPath; + /** + * Creates a new ShardStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ShardStats(StreamInput in) throws IOException { shardRouting = new ShardRouting(in); commonStats = new CommonStats(in); @@ -89,11 +95,18 @@ public ShardStats(StreamInput in) throws IOException { /** * The shard routing information (cluster wide shard state). + * + * @return the shard routing */ public ShardRouting getShardRouting() { return this.shardRouting; } + /** + * Returns the stats. + * + * @return the stats + */ public CommonStats getStats() { return this.commonStats; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/StatusCounterStats.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/StatusCounterStats.java index 2b38e9a8..7aef7886 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/StatusCounterStats.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/stats/StatusCounterStats.java @@ -33,11 +33,20 @@ public class StatusCounterStats implements Writeable, ToXContentFragment { @Nullable private SearchResponseStatusStats searchResponseStatusStats; + /** + * Creates a new StatusCounterStats. + */ public StatusCounterStats() { docStatusStats = new DocStatusStats(); searchResponseStatusStats = new SearchResponseStatusStats(); } + /** + * Creates a new StatusCounterStats by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public StatusCounterStats(StreamInput in) throws IOException { if (in.getVersion().onOrAfter(Version.V_3_4_0)) { docStatusStats = in.readOptionalWriteable(DocStatusStats::new); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionStateShardFailure.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionStateShardFailure.java index 2403d4a3..5594541b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionStateShardFailure.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionStateShardFailure.java @@ -24,6 +24,9 @@ /** * Indicates ingestion failures at index and shard level. * + * @param index the index + * @param shard the shard + * @param errorMessage the error message * @opensearch.api */ @PublicApi(since = "3.6.0") @@ -32,6 +35,12 @@ public record IngestionStateShardFailure(String index, int shard, String errorMe private static final String SHARD = "shard"; private static final String ERROR = "error"; + /** + * Creates a new IngestionStateShardFailure by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IngestionStateShardFailure(StreamInput in) throws IOException { this(in.readString(), in.readVInt(), in.readString()); } @@ -53,6 +62,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Groups provided shard ingestion state failures by index name. + * + * @param shardFailures the shard failures + * @return the group shard failures by index */ public static Map> groupShardFailuresByIndex(IngestionStateShardFailure[] shardFailures) { Map> shardFailuresByIndex = new HashMap<>(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionUpdateStateResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionUpdateStateResponse.java index 26b623d1..cde1aa9c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionUpdateStateResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/IngestionUpdateStateResponse.java @@ -27,14 +27,38 @@ */ @PublicApi(since = "3.6.0") public class IngestionUpdateStateResponse extends AcknowledgedResponse { + /** + * The SHARD_ACK constant. + */ protected static final String SHARD_ACK = "shards_acknowledged"; + /** + * The ERROR constant. + */ protected static final String ERROR = "error"; + /** + * The FAILURES constant. + */ protected static final String FAILURES = "failures"; + /** + * The shards acknowledged. + */ protected boolean shardsAcknowledged; + /** + * The shard failures list. + */ protected IngestionStateShardFailure[] shardFailuresList; + /** + * The error message. + */ protected String errorMessage; + /** + * Creates a new IngestionUpdateStateResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IngestionUpdateStateResponse(StreamInput in) throws IOException { super(in); shardFailuresList = in.readArray(IngestionStateShardFailure::new, IngestionStateShardFailure[]::new); @@ -42,6 +66,14 @@ public IngestionUpdateStateResponse(StreamInput in) throws IOException { shardsAcknowledged = in.readBoolean(); } + /** + * Creates a new IngestionUpdateStateResponse. + * + * @param acknowledged the acknowledged + * @param shardsAcknowledged the shards acknowledged + * @param shardFailuresList the shard failures list + * @param errorMessage the error message + */ public IngestionUpdateStateResponse( final boolean acknowledged, final boolean shardsAcknowledged, @@ -92,6 +124,11 @@ public String toString() { return Strings.toString(MediaTypeRegistry.JSON, this); } + /** + * Returns the shards acknowledged flag. + * + * @return the shards acknowledged flag + */ public boolean isShardsAcknowledged() { return shardsAcknowledged; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionAction.java index 7d3a54c9..5e2933c1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionAction.java @@ -17,7 +17,13 @@ */ public class PauseIngestionAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final PauseIngestionAction INSTANCE = new PauseIngestionAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/ingestion/pause"; private PauseIngestionAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionRequest.java index 558300b8..add45860 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/pause/PauseIngestionRequest.java @@ -32,6 +32,11 @@ public class PauseIngestionRequest extends AcknowledgedRequest { + /** + * The INSTANCE constant. + */ public static final ResumeIngestionAction INSTANCE = new ResumeIngestionAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/ingestion/resume"; private ResumeIngestionAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/resume/ResumeIngestionRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/resume/ResumeIngestionRequest.java index 7d685e8b..b68da71a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/resume/ResumeIngestionRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/resume/ResumeIngestionRequest.java @@ -39,6 +39,8 @@ public class ResumeIngestionRequest extends AcknowledgedRequest { + /** + * The INSTANCE constant. + */ public static final GetIngestionStateAction INSTANCE = new GetIngestionStateAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/ingestion/state"; private GetIngestionStateAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateRequest.java index e4ba335a..59f8f2ae 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateRequest.java @@ -37,7 +37,13 @@ */ @PublicApi(since = "3.6.0") public class GetIngestionStateRequest extends BroadcastRequest { + /** + * The DEFAULT_PAGE_SIZE constant. + */ public static final int DEFAULT_PAGE_SIZE = 1000; + /** + * The DEFAULT_SORT_VALUE constant. + */ public static final String DEFAULT_SORT_VALUE = PARAM_ASC_SORT_VALUE; private int[] shards; @@ -46,6 +52,11 @@ public class GetIngestionStateRequest extends BroadcastRequest pairs to consider when using pagination private List indexShardPairsList; + /** + * Creates a new GetIngestionStateRequest. + * + * @param indices the indices + */ public GetIngestionStateRequest(String[] indices) { super(); this.indices = indices; @@ -73,6 +84,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeList(indexShardPairsList); } + /** + * Returns the shards. + * + * @return the shards + */ public int[] getShards() { return shards; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateResponse.java index 67c7d033..028958dd 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/GetIngestionStateResponse.java @@ -37,12 +37,28 @@ public class GetIngestionStateResponse extends BroadcastResponse { @Nullable private String nextPageToken; + /** + * Creates a new GetIngestionStateResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetIngestionStateResponse(StreamInput in) throws IOException { super(in); shardStates = in.readArray(ShardIngestionState::new, ShardIngestionState[]::new); nextPageToken = in.readOptionalString(); } + /** + * Creates a new GetIngestionStateResponse. + * + * @param shardStates the shard states + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param failedShards the failed shards + * @param nextPageToken the next page token + * @param shardFailures the shard failures + */ public GetIngestionStateResponse( ShardIngestionState[] shardStates, int totalShards, @@ -85,6 +101,11 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t builder.endObject(); } + /** + * Returns the shard states. + * + * @return the shard states + */ public ShardIngestionState[] getShardStates() { return shardStates; } @@ -94,6 +115,11 @@ public String toString() { return Strings.toString(MediaTypeRegistry.JSON, this, true, false); } + /** + * Returns the next page token. + * + * @return the next page token + */ public String getNextPageToken() { return nextPageToken; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/ShardIngestionState.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/ShardIngestionState.java index 701470ff..1674fe92 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/ShardIngestionState.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/streamingingestion/state/ShardIngestionState.java @@ -49,10 +49,19 @@ public class ShardIngestionState implements Writeable, ToXContentFragment { private boolean isPrimary; private String nodeName; + /** + * Creates a new ShardIngestionState. + */ public ShardIngestionState() { this("", -1, "", "", false, false, "", true, ""); } + /** + * Creates a new ShardIngestionState by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ShardIngestionState(StreamInput in) throws IOException { this.index = in.readString(); this.shardId = in.readVInt(); @@ -72,6 +81,19 @@ public ShardIngestionState(StreamInput in) throws IOException { } } + /** + * Creates a new ShardIngestionState. + * + * @param index the index + * @param shardId the shard identifier + * @param pollerState the poller state + * @param errorPolicy the error policy + * @param isPollerPaused the is poller paused + * @param isWriteBlockEnabled the is write block enabled + * @param batchStartPointer the batch start pointer + * @param isPrimary the is primary + * @param nodeName the node name + */ public ShardIngestionState( String index, int shardId, @@ -128,6 +150,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Groups list of ShardIngestionStates by the index name. + * + * @param shardIngestionStates the shard ingestion states + * @return the group shard state by index */ public static Map> groupShardStateByIndex(ShardIngestionState[] shardIngestionStates) { Map> shardIngestionStatesByIndex = new HashMap<>(); @@ -140,38 +165,83 @@ public static Map> groupShardStateByIndex(Shar return shardIngestionStatesByIndex; } + /** + * Returns the index. + * + * @return the index + */ public String getIndex() { return index; } + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public int getShardId() { return shardId; } + /** + * Returns the poller state. + * + * @return the poller state + */ public String getPollerState() { return pollerState; } + /** + * Returns the error policy. + * + * @return the error policy + */ public String getErrorPolicy() { return errorPolicy; } + /** + * Returns the poller paused flag. + * + * @return the poller paused flag + */ public boolean isPollerPaused() { return isPollerPaused; } + /** + * Returns the write block enabled flag. + * + * @return the write block enabled flag + */ public boolean isWriteBlockEnabled() { return isWriteBlockEnabled; } + /** + * Returns the batch start pointer. + * + * @return the batch start pointer + */ public String getBatchStartPointer() { return batchStartPointer; } + /** + * Returns the primary flag. + * + * @return the primary flag + */ public boolean isPrimary() { return isPrimary; } + /** + * Returns the node name. + * + * @return the node name + */ public String getNodeName() { return nodeName; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java index cf3ffb9e..5a9dde96 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java @@ -42,7 +42,13 @@ */ public class DeleteIndexTemplateAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeleteIndexTemplateAction INSTANCE = new DeleteIndexTemplateAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/template/delete"; private DeleteIndexTemplateAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java index 221762b7..00b5bf0a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java @@ -51,10 +51,15 @@ public class DeleteIndexTemplateRequest extends ClusterManagerNodeRequest { + /** + * Creates a new DeleteIndexTemplateRequestBuilder. + * + * @param client the client + * @param action the action + * @param name the name + */ public DeleteIndexTemplateRequestBuilder(OpenSearchClient client, DeleteIndexTemplateAction action, String name) { super(client, action, new DeleteIndexTemplateRequest(name)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java index 927725f5..371a40d2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java @@ -40,9 +40,18 @@ */ public class GetIndexTemplatesAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetIndexTemplatesAction INSTANCE = new GetIndexTemplatesAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/template/get"; + /** + * Creates a new GetIndexTemplatesAction. + */ protected GetIndexTemplatesAction() { super(NAME, GetIndexTemplatesResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java index e9cc07d9..55fc513f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java @@ -52,8 +52,16 @@ public class GetIndexTemplatesRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new GetIndexTemplatesRequestBuilder. + * + * @param client the client + * @param action the action + * @param names the names + */ public GetIndexTemplatesRequestBuilder(OpenSearchClient client, GetIndexTemplatesAction action, String... names) { super(client, action, new GetIndexTemplatesRequest(names)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java index f684d709..a968e412 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java @@ -57,6 +57,12 @@ public class GetIndexTemplatesResponse extends ActionResponse implements ToXCont private final List indexTemplates; + /** + * Creates a new GetIndexTemplatesResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetIndexTemplatesResponse(StreamInput in) throws IOException { super(in); int size = in.readVInt(); @@ -66,10 +72,20 @@ public GetIndexTemplatesResponse(StreamInput in) throws IOException { } } + /** + * Creates a new GetIndexTemplatesResponse. + * + * @param indexTemplates the index templates + */ public GetIndexTemplatesResponse(List indexTemplates) { this.indexTemplates = indexTemplates; } + /** + * Returns the index templates. + * + * @return the index templates + */ public List getIndexTemplates() { return indexTemplates; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java index 97263329..0e73b7bc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java @@ -42,7 +42,13 @@ */ public class PutIndexTemplateAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final PutIndexTemplateAction INSTANCE = new PutIndexTemplateAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/template/put"; private PutIndexTemplateAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java index 07303d83..fef41d00 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java @@ -108,10 +108,15 @@ public class PutIndexTemplateRequest extends ClusterManagerNodeRequest indexPatterns) { this.indexPatterns = indexPatterns; return this; } + /** + * Returns the order. + * + * @return the order + */ public int order() { return this.order; } + /** + * Creates this instance. + * + * @return the new instance + */ public boolean create() { return create; } /** * The settings to create the index template with. + * + * @param settings the settings + * @return the settings */ public PutIndexTemplateRequest settings(Settings.Builder settings) { this.settings = settings.build(); return this; } + /** + * Returns the cause. + * + * @return the cause + */ public String cause() { return this.cause; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java index fe636a4f..c8c1cd37 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java @@ -56,12 +56,22 @@ public class PutIndexTemplateRequestBuilder extends ClusterManagerNodeOperationR AcknowledgedResponse, PutIndexTemplateRequestBuilder> { + /** + * Creates a new PutIndexTemplateRequestBuilder. + * + * @param client the client + * @param action the action + * @param name the name + */ public PutIndexTemplateRequestBuilder(OpenSearchClient client, PutIndexTemplateAction action, String name) { super(client, action, new PutIndexTemplateRequest(name)); } /** * Sets the match expression that will be used to match on indices created. + * + * @param indexPatterns the index patterns + * @return this instance */ public PutIndexTemplateRequestBuilder setPatterns(List indexPatterns) { request.patterns(indexPatterns); @@ -70,6 +80,9 @@ public PutIndexTemplateRequestBuilder setPatterns(List indexPatterns) { /** * The settings to created the index template with. + * + * @param settings the settings + * @return this instance */ public PutIndexTemplateRequestBuilder setSettings(Settings.Builder settings) { request.settings(settings); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java index 9796660f..d4ac55fd 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java @@ -55,6 +55,11 @@ public class IndexShardUpgradeStatus implements Iterable { this.shards = shards; } + /** + * Returns the shard identifier. + * + * @return the shard identifier + */ public ShardId getShardId() { return this.shardId; } @@ -64,6 +69,11 @@ public Iterator iterator() { return Arrays.stream(shards).iterator(); } + /** + * Returns the total bytes. + * + * @return the total bytes + */ public long getTotalBytes() { long totalBytes = 0; for (ShardUpgradeStatus indexShardUpgradeStatus : shards) { @@ -72,6 +82,11 @@ public long getTotalBytes() { return totalBytes; } + /** + * Returns the to upgrade bytes. + * + * @return the to upgrade bytes + */ public long getToUpgradeBytes() { long upgradeBytes = 0; for (ShardUpgradeStatus indexShardUpgradeStatus : shards) { @@ -80,6 +95,11 @@ public long getToUpgradeBytes() { return upgradeBytes; } + /** + * Returns the to upgrade bytes ancient. + * + * @return the to upgrade bytes ancient + */ public long getToUpgradeBytesAncient() { long upgradeBytesAncient = 0; for (ShardUpgradeStatus indexShardUpgradeStatus : shards) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java index 456cf9bd..500fa6bc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java @@ -76,6 +76,11 @@ public class IndexUpgradeStatus implements Iterable { } } + /** + * Returns the index. + * + * @return the index + */ public String getIndex() { return this.index; } @@ -85,6 +90,11 @@ public Iterator iterator() { return indexShards.values().iterator(); } + /** + * Returns the total bytes. + * + * @return the total bytes + */ public long getTotalBytes() { long totalBytes = 0; for (IndexShardUpgradeStatus indexShardUpgradeStatus : indexShards.values()) { @@ -93,6 +103,11 @@ public long getTotalBytes() { return totalBytes; } + /** + * Returns the to upgrade bytes. + * + * @return the to upgrade bytes + */ public long getToUpgradeBytes() { long upgradeBytes = 0; for (IndexShardUpgradeStatus indexShardUpgradeStatus : indexShards.values()) { @@ -101,6 +116,11 @@ public long getToUpgradeBytes() { return upgradeBytes; } + /** + * Returns the to upgrade bytes ancient. + * + * @return the to upgrade bytes ancient + */ public long getToUpgradeBytesAncient() { long upgradeBytesAncient = 0; for (IndexShardUpgradeStatus indexShardUpgradeStatus : indexShards.values()) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java index 858a5b61..18745954 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java @@ -56,6 +56,12 @@ public class ShardUpgradeStatus extends BroadcastShardResponse { private long toUpgradeBytesAncient; + /** + * Creates a new ShardUpgradeStatus by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ShardUpgradeStatus(StreamInput in) throws IOException { super(in); shardRouting = new ShardRouting(in); @@ -64,18 +70,38 @@ public ShardUpgradeStatus(StreamInput in) throws IOException { toUpgradeBytesAncient = in.readLong(); } + /** + * Returns the shard routing. + * + * @return the shard routing + */ public ShardRouting getShardRouting() { return this.shardRouting; } + /** + * Returns the total bytes. + * + * @return the total bytes + */ public long getTotalBytes() { return totalBytes; } + /** + * Returns the to upgrade bytes. + * + * @return the to upgrade bytes + */ public long getToUpgradeBytes() { return toUpgradeBytes; } + /** + * Returns the to upgrade bytes ancient. + * + * @return the to upgrade bytes ancient + */ public long getToUpgradeBytesAncient() { return toUpgradeBytesAncient; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java index 4c5a7608..33cbdbab 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java @@ -41,7 +41,13 @@ */ public class UpgradeStatusAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final UpgradeStatusAction INSTANCE = new UpgradeStatusAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:monitor/upgrade"; private UpgradeStatusAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java index 6ada8d29..67f7ff34 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java @@ -47,10 +47,18 @@ @PublicApi(since = "1.0.0") public class UpgradeStatusRequest extends BroadcastRequest { + /** + * Creates a new UpgradeStatusRequest. + */ public UpgradeStatusRequest() { this(Strings.EMPTY_ARRAY); } + /** + * Creates a new UpgradeStatusRequest. + * + * @param indices the indices + */ public UpgradeStatusRequest(String... indices) { super(indices); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java index 7f829696..dfde9c10 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java @@ -47,6 +47,12 @@ public class UpgradeStatusRequestBuilder extends BroadcastOperationRequestBuilde UpgradeStatusResponse, UpgradeStatusRequestBuilder> { + /** + * Creates a new UpgradeStatusRequestBuilder. + * + * @param client the client + * @param action the action + */ public UpgradeStatusRequestBuilder(OpenSearchClient client, UpgradeStatusAction action) { super(client, action, new UpgradeStatusRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java index 9a78af68..b1e74b38 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java @@ -67,6 +67,11 @@ public class UpgradeStatusResponse extends BroadcastResponse { } } + /** + * Returns the indices. + * + * @return the indices + */ public Map getIndices() { if (indicesUpgradeStatus != null) { return indicesUpgradeStatus; @@ -100,6 +105,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Returns the total bytes. + * + * @return the total bytes + */ public long getTotalBytes() { long totalBytes = 0; for (IndexUpgradeStatus indexShardUpgradeStatus : getIndices().values()) { @@ -108,6 +118,11 @@ public long getTotalBytes() { return totalBytes; } + /** + * Returns the to upgrade bytes. + * + * @return the to upgrade bytes + */ public long getToUpgradeBytes() { long upgradeBytes = 0; for (IndexUpgradeStatus indexShardUpgradeStatus : getIndices().values()) { @@ -116,6 +131,11 @@ public long getToUpgradeBytes() { return upgradeBytes; } + /** + * Returns the to upgrade bytes ancient. + * + * @return the to upgrade bytes ancient + */ public long getToUpgradeBytesAncient() { long upgradeBytesAncient = 0; for (IndexUpgradeStatus indexShardUpgradeStatus : getIndices().values()) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java index f1bf4146..8535931a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java @@ -41,7 +41,13 @@ */ public class UpgradeAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final UpgradeAction INSTANCE = new UpgradeAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/upgrade"; private UpgradeAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java index 60709b2a..0a401162 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java @@ -57,6 +57,15 @@ public class UpgradeRequest extends BroadcastRequest { * @opensearch.internal */ public static final class Defaults { + /** + * Creates a new Defaults. + */ + public Defaults() { + } + + /** + * The UPGRADE_ONLY_ANCIENT_SEGMENTS constant. + */ public static final boolean UPGRADE_ONLY_ANCIENT_SEGMENTS = false; } @@ -80,6 +89,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Should the upgrade only the ancient (older major version of Lucene) segments? * Defaults to {@code false}. + * + * @return the upgrade only ancient segments */ public boolean upgradeOnlyAncientSegments() { return upgradeOnlyAncientSegments; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java index 0b002054..6ed4b4f3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java @@ -45,6 +45,12 @@ @PublicApi(since = "1.0.0") public class UpgradeRequestBuilder extends BroadcastOperationRequestBuilder { + /** + * Creates a new UpgradeRequestBuilder. + * + * @param client the client + * @param action the action + */ public UpgradeRequestBuilder(OpenSearchClient client, UpgradeAction action) { super(client, action, new UpgradeRequest()); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/QueryExplanation.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/QueryExplanation.java index 267545ba..881dab2e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/QueryExplanation.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/QueryExplanation.java @@ -56,12 +56,30 @@ @PublicApi(since = "1.0.0") public class QueryExplanation implements Writeable, ToXContentFragment { + /** + * The INDEX_FIELD constant. + */ public static final String INDEX_FIELD = "index"; + /** + * The SHARD_FIELD constant. + */ public static final String SHARD_FIELD = "shard"; + /** + * The VALID_FIELD constant. + */ public static final String VALID_FIELD = "valid"; + /** + * The ERROR_FIELD constant. + */ public static final String ERROR_FIELD = "error"; + /** + * The EXPLANATION_FIELD constant. + */ public static final String EXPLANATION_FIELD = "explanation"; + /** + * The RANDOM_SHARD constant. + */ public static final int RANDOM_SHARD = -1; static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>("query_explanation", true, a -> { @@ -89,6 +107,12 @@ public class QueryExplanation implements Writeable, ToXContentFragment { private String error; + /** + * Creates a new QueryExplanation by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public QueryExplanation(StreamInput in) throws IOException { index = in.readOptionalString(); shard = in.readInt(); @@ -97,6 +121,15 @@ public QueryExplanation(StreamInput in) throws IOException { error = in.readOptionalString(); } + /** + * Creates a new QueryExplanation. + * + * @param index the index + * @param shard the shard + * @param valid the valid + * @param explanation the explanation + * @param error the error + */ public QueryExplanation(String index, int shard, boolean valid, String explanation, String error) { this.index = index; this.shard = shard; @@ -105,22 +138,47 @@ public QueryExplanation(String index, int shard, boolean valid, String explanati this.error = error; } + /** + * Returns the index. + * + * @return the index + */ public String getIndex() { return this.index; } + /** + * Returns the shard. + * + * @return the shard + */ public int getShard() { return this.shard; } + /** + * Returns the valid flag. + * + * @return the valid flag + */ public boolean isValid() { return this.valid; } + /** + * Returns the error. + * + * @return the error + */ public String getError() { return this.error; } + /** + * Returns the explanation. + * + * @return the explanation + */ public String getExplanation() { return this.explanation; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java index 23fa8986..b2dec7bc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java @@ -41,7 +41,13 @@ */ public class ValidateQueryAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ValidateQueryAction INSTANCE = new ValidateQueryAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:admin/validate/query"; private ValidateQueryAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java index 9f7433af..09dac8f9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java @@ -65,6 +65,9 @@ public class ValidateQueryRequest extends BroadcastRequest private boolean rewrite; private boolean allShards; + /** + * Creates a new ValidateQueryRequest. + */ public ValidateQueryRequest() { this(Strings.EMPTY_ARRAY); } @@ -72,6 +75,8 @@ public ValidateQueryRequest() { /** * Constructs a new validate request against the provided indices. No indices provided means it will * run against all indices. + * + * @param indices the indices */ public ValidateQueryRequest(String... indices) { super(indices); @@ -89,11 +94,19 @@ public ActionRequestValidationException validate() { /** * The query to validate. + * + * @return this instance */ public QueryBuilder query() { return query; } + /** + * Queries this instance. + * + * @param query the query + * @return this instance + */ public ValidateQueryRequest query(QueryBuilder query) { this.query = query; return this; @@ -101,6 +114,8 @@ public ValidateQueryRequest query(QueryBuilder query) { /** * Indicate if detailed information about query is requested + * + * @param explain the explain */ public void explain(boolean explain) { this.explain = explain; @@ -108,6 +123,8 @@ public void explain(boolean explain) { /** * Indicates if detailed information about query is requested + * + * @return the explain */ public boolean explain() { return explain; @@ -115,6 +132,8 @@ public boolean explain() { /** * Indicates whether the query should be rewritten into primitive queries + * + * @return this instance */ public boolean rewrite() { return rewrite; @@ -122,6 +141,8 @@ public boolean rewrite() { /** * Indicates whether the query should be validated on all shards instead of one random shard + * + * @return the all shards */ public boolean allShards() { return allShards; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java index a003fe85..20f50056 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java @@ -48,6 +48,12 @@ public class ValidateQueryRequestBuilder extends BroadcastOperationRequestBuilde ValidateQueryResponse, ValidateQueryRequestBuilder> { + /** + * Creates a new ValidateQueryRequestBuilder. + * + * @param client the client + * @param action the action + */ public ValidateQueryRequestBuilder(OpenSearchClient client, ValidateQueryAction action) { super(client, action, new ValidateQueryRequest()); } @@ -55,6 +61,8 @@ public ValidateQueryRequestBuilder(OpenSearchClient client, ValidateQueryAction /** * The query to validate. * + * @param queryBuilder the query builder + * @return this instance * @see org.codelibs.fesen.opensearch.index.query.QueryBuilders */ public ValidateQueryRequestBuilder setQuery(QueryBuilder queryBuilder) { @@ -65,6 +73,8 @@ public ValidateQueryRequestBuilder setQuery(QueryBuilder queryBuilder) { /** * Indicates if detailed information about the query should be returned. * + * @param explain the explain + * @return this instance * @see org.codelibs.fesen.opensearch.index.query.QueryBuilders */ public ValidateQueryRequestBuilder setExplain(boolean explain) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java index 3454a9db..c17b6971 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java @@ -58,7 +58,13 @@ @PublicApi(since = "1.0.0") public class ValidateQueryResponse extends BroadcastResponse { + /** + * The VALID_FIELD constant. + */ public static final String VALID_FIELD = "valid"; + /** + * The EXPLANATIONS_FIELD constant. + */ public static final String EXPLANATIONS_FIELD = "explanations"; @SuppressWarnings("unchecked") @@ -108,6 +114,8 @@ public class ValidateQueryResponse extends BroadcastResponse { /** * A boolean denoting whether the query is valid. + * + * @return the valid flag */ public boolean isValid() { return valid; @@ -115,6 +123,8 @@ public boolean isValid() { /** * The list of query explanations. + * + * @return the query explanation */ public List getQueryExplanation() { return queryExplanations; @@ -141,6 +151,12 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t } } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static ValidateQueryResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/CreateViewAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/CreateViewAction.java index 5826e091..e0d653a4 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/CreateViewAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/CreateViewAction.java @@ -38,7 +38,13 @@ public class CreateViewAction extends ActionType { private static final int MAX_TARGET_COUNT = 25; private static final int MAX_TARGET_INDEX_PATTERN_LENGTH = 64; + /** + * The INSTANCE constant. + */ public static final CreateViewAction INSTANCE = new CreateViewAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/views/create"; private CreateViewAction() { @@ -54,12 +60,24 @@ public static class Request extends ClusterManagerNodeRequest { private final String description; private final List targets; + /** + * Creates a new Request. + * + * @param name the name + * @param description the description + * @param targets the targets + */ public Request(final String name, final String description, final List targets) { this.name = name; this.description = Objects.requireNonNullElse(description, ""); this.targets = targets; } + /** + * Returns the name. + * + * @return the name + */ public String getName() { return name; } @@ -68,6 +86,11 @@ public String getDescription() { return description; } + /** + * Returns the targets. + * + * @return the targets + */ public List getTargets() { return new ArrayList<>(targets); } @@ -136,12 +159,25 @@ public void writeTo(final StreamOutput out) throws IOException { /** View target representation for create requests */ @ExperimentalApi public static class Target implements Writeable { + /** + * The index pattern. + */ public final String indexPattern; + /** + * Creates a new Target. + * + * @param indexPattern the index pattern + */ public Target(final String indexPattern) { this.indexPattern = indexPattern; } + /** + * Returns the index pattern. + * + * @return the index pattern + */ public String getIndexPattern() { return indexPattern; } @@ -164,6 +200,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(indexPattern); } + /** + * Validates this instance. + * + * @return this instance + */ public ActionRequestValidationException validate() { ActionRequestValidationException validationException = null; @@ -188,6 +229,13 @@ public ActionRequestValidationException validate() { PARSER.declareString(ConstructingObjectParser.constructorArg(), View.Target.INDEX_PATTERN_FIELD); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static Target fromXContent(final XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/DeleteViewAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/DeleteViewAction.java index 4ae2fdcf..2c16a1d2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/DeleteViewAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/DeleteViewAction.java @@ -29,9 +29,18 @@ @ExperimentalApi public class DeleteViewAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeleteViewAction INSTANCE = new DeleteViewAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/views/delete"; + /** + * Creates a new DeleteViewAction. + */ public DeleteViewAction() { super(NAME, AcknowledgedResponse::new); } @@ -41,10 +50,20 @@ public DeleteViewAction() { public static class Request extends ClusterManagerNodeRequest { private final String name; + /** + * Creates a new Request. + * + * @param name the name + */ public Request(final String name) { this.name = name; } + /** + * Returns the name. + * + * @return the name + */ public String getName() { return name; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/GetViewAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/GetViewAction.java index 37496003..766cee70 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/GetViewAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/GetViewAction.java @@ -32,9 +32,18 @@ @ExperimentalApi public class GetViewAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetViewAction INSTANCE = new GetViewAction(); + /** + * The NAME constant. + */ public static final String NAME = "views:data/read/get"; + /** + * Creates a new GetViewAction. + */ public GetViewAction() { super(NAME, GetViewAction.Response::new); } @@ -44,10 +53,20 @@ public GetViewAction() { public static class Request extends ClusterManagerNodeRequest { private final String name; + /** + * Creates a new Request. + * + * @param name the name + */ public Request(final String name) { this.name = name; } + /** + * Returns the name. + * + * @return the name + */ public String getName() { return name; } @@ -98,15 +117,31 @@ public static class Response extends ActionResponse implements ToXContentObject private final View view; + /** + * Creates a new Response. + * + * @param view the view + */ public Response(final View view) { this.view = view; } + /** + * Creates a new Response. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public Response(final StreamInput in) throws IOException { super(in); this.view = new View(in); } + /** + * Returns the view. + * + * @return the view + */ public View getView() { return view; } @@ -145,6 +180,13 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa PARSER.declareObject(ConstructingObjectParser.constructorArg(), View.PARSER, new ParseField("view")); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static Response fromXContent(final XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/ListViewNamesAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/ListViewNamesAction.java index 990d96c8..a3fd219c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/ListViewNamesAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/ListViewNamesAction.java @@ -26,9 +26,18 @@ @ExperimentalApi public class ListViewNamesAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ListViewNamesAction INSTANCE = new ListViewNamesAction(); + /** + * The NAME constant. + */ public static final String NAME = "views:data/read/list"; + /** + * Creates a new ListViewNamesAction. + */ public ListViewNamesAction() { super(NAME, ListViewNamesAction.Response::new); } @@ -36,6 +45,9 @@ public ListViewNamesAction() { /** Request for list view names */ @ExperimentalApi public static class Request extends ActionRequest { + /** + * Creates a new Request. + */ public Request() {} @Override @@ -63,10 +75,21 @@ public static class Response extends ActionResponse implements ToXContentObject private final List views; + /** + * Creates a new Response. + * + * @param views the views + */ public Response(final List views) { this.views = views; } + /** + * Creates a new Response. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public Response(final StreamInput in) throws IOException { views = in.readStringList(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/SearchViewAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/SearchViewAction.java index 1f0a315a..880a9c07 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/SearchViewAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/SearchViewAction.java @@ -27,7 +27,13 @@ @ExperimentalApi public class SearchViewAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final SearchViewAction INSTANCE = new SearchViewAction(); + /** + * The NAME constant. + */ public static final String NAME = "views:data/read/search"; private SearchViewAction() { @@ -43,11 +49,22 @@ public static class Request extends SearchRequest { private final String view; + /** + * Creates a new Request. + * + * @param view the view + * @param searchRequest the search request + */ public Request(final String view, final SearchRequest searchRequest) { super(searchRequest); this.view = view; } + /** + * Returns the view. + * + * @return the view + */ public String getView() { return view; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/UpdateViewAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/UpdateViewAction.java index 1663f958..ade20bce 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/UpdateViewAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/admin/indices/view/UpdateViewAction.java @@ -21,9 +21,18 @@ @ExperimentalApi public class UpdateViewAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final UpdateViewAction INSTANCE = new UpdateViewAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/views/update"; + /** + * Creates a new UpdateViewAction. + */ public UpdateViewAction() { super(NAME, GetViewAction.Response::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BackoffPolicy.java b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BackoffPolicy.java index 0cbfe1dd..53a48de8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BackoffPolicy.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BackoffPolicy.java @@ -58,6 +58,12 @@ * @opensearch.internal */ public abstract class BackoffPolicy implements Iterable { + /** + * Creates a new BackoffPolicy. + */ + public BackoffPolicy() { + } + private static final BackoffPolicy NO_BACKOFF = new NoBackoff(); /** @@ -132,6 +138,10 @@ public static BackoffPolicy exponentialFullJitterBackoff(long baseDelay) { /** * Wraps the backoff policy in one that calls a method every time a new backoff is taken from the policy. + * + * @param delegate the delegate + * @param onBackoff the on backoff + * @return this instance */ public static BackoffPolicy wrap(BackoffPolicy delegate, Runnable onBackoff) { return new WrappedBackoffPolicy(delegate, onBackoff); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkAction.java index 37a69e7a..733d40dd 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkAction.java @@ -41,7 +41,13 @@ */ public class BulkAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final BulkAction INSTANCE = new BulkAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/write/bulk"; private BulkAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkItemResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkItemResponse.java index 03bfabf4..5bb7f9c9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkItemResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkItemResponse.java @@ -111,9 +111,21 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws */ @PublicApi(since = "1.0.0") public static class Failure implements Writeable, ToXContentFragment { + /** + * The INDEX_FIELD constant. + */ public static final String INDEX_FIELD = "index"; + /** + * The ID_FIELD constant. + */ public static final String ID_FIELD = "id"; + /** + * The CAUSE_FIELD constant. + */ public static final String CAUSE_FIELD = "cause"; + /** + * The STATUS_FIELD constant. + */ public static final String STATUS_FIELD = "status"; private final String index; @@ -130,10 +142,22 @@ public static class Failure implements Writeable, ToXContentFragment { */ @PublicApi(since = "3.0.0") public enum FailureSource { + /** + * The UNKNOWN value. + */ UNKNOWN((byte) 0), // Pipeline execution failure + /** + * The PIPELINE value. + */ PIPELINE((byte) 1), + /** + * The VALIDATION value. + */ VALIDATION((byte) 2), + /** + * The WRITE_PROCESSING value. + */ WRITE_PROCESSING((byte) 3); private final byte sourceType; @@ -142,10 +166,21 @@ public enum FailureSource { this.sourceType = sourceType; } + /** + * Returns the source type. + * + * @return the source type + */ public byte getSourceType() { return sourceType; } + /** + * Creates an instance from source type. + * + * @param sourceType the source type + * @return the new source type + */ public static FailureSource fromSourceType(byte sourceType) { return switch (sourceType) { case 0 -> UNKNOWN; @@ -157,6 +192,9 @@ public static FailureSource fromSourceType(byte sourceType) { } } + /** + * The PARSER constant. + */ public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "bulk_failures", true, @@ -169,6 +207,14 @@ public static FailureSource fromSourceType(byte sourceType) { PARSER.declareInt(constructorArg(), new ParseField(STATUS_FIELD)); } + /** + * Creates a new Failure. + * + * @param index the index + * @param id the identifier + * @param cause the cause + * @param status the status + */ public Failure(String index, String id, Exception cause, RestStatus status) { this( index, @@ -204,6 +250,9 @@ private Failure( /** * Read from a stream. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs */ public Failure(StreamInput in) throws IOException { index = in.readString(); @@ -243,6 +292,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * The index name of the action. + * + * @return the index */ public String getIndex() { return this.index; @@ -250,6 +301,8 @@ public String getIndex() { /** * The id of the action. + * + * @return the identifier */ public String getId() { return id; @@ -257,6 +310,8 @@ public String getId() { /** * The failure message. + * + * @return the message */ public String getMessage() { return this.cause.toString(); @@ -264,6 +319,8 @@ public String getMessage() { /** * The rest status. + * + * @return the status */ public RestStatus getStatus() { return this.status; @@ -271,6 +328,8 @@ public RestStatus getStatus() { /** * The actual cause of the failure. + * + * @return the cause */ public Exception getCause() { return cause; @@ -325,12 +384,26 @@ public String toString() { } } + /** + * Creates a new BulkItemResponse. + * + * @param id the identifier + * @param opType the op type + * @param response the response + */ public BulkItemResponse(int id, OpType opType, DocWriteResponse response) { this.id = id; this.response = response; this.opType = opType; } + /** + * Creates a new BulkItemResponse. + * + * @param id the identifier + * @param opType the op type + * @param failure the failure + */ public BulkItemResponse(int id, OpType opType, Failure failure) { this.id = id; this.opType = opType; @@ -339,6 +412,8 @@ public BulkItemResponse(int id, OpType opType, Failure failure) { /** * The index name of the action. + * + * @return the index */ public String getIndex() { if (failure != null) { @@ -349,6 +424,8 @@ public String getIndex() { /** * The id of the action. + * + * @return the identifier */ public String getId() { if (failure != null) { @@ -359,6 +436,8 @@ public String getId() { /** * Is this a failed execution of an operation. + * + * @return the failed flag */ public boolean isFailed() { return failure != null; @@ -366,6 +445,8 @@ public boolean isFailed() { /** * The failure message, {@code null} if it did not fail. + * + * @return the failure message */ public String getFailureMessage() { if (failure != null) { @@ -376,6 +457,8 @@ public String getFailureMessage() { /** * The actual failure object if there was a failure. + * + * @return the failure */ public Failure getFailure() { return this.failure; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequest.java index 2fd65b47..f3ef49f8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequest.java @@ -104,8 +104,16 @@ public class BulkRequest extends ActionRequest implements CompositeIndicesReques private long sizeInBytes = 0; + /** + * Creates a new BulkRequest. + */ public BulkRequest() {} + /** + * Creates a new BulkRequest. + * + * @param globalIndex the global index + */ public BulkRequest(@Nullable String globalIndex) { this.globalIndex = globalIndex; } @@ -113,6 +121,9 @@ public BulkRequest(@Nullable String globalIndex) { /** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). + * + * @param request the request + * @return this instance */ public BulkRequest add(IndexRequest request) { return internalAdd(request); @@ -131,6 +142,9 @@ BulkRequest internalAdd(IndexRequest request) { /** * Adds an {@link UpdateRequest} to the list of actions to execute. + * + * @param request the request + * @return this instance */ public BulkRequest add(UpdateRequest request) { return internalAdd(request); @@ -156,6 +170,9 @@ BulkRequest internalAdd(UpdateRequest request) { /** * Adds an {@link DeleteRequest} to the list of actions to execute. + * + * @param request the request + * @return this instance */ public BulkRequest add(DeleteRequest request) { Objects.requireNonNull(request, "'request' must not be null"); @@ -169,6 +186,8 @@ public BulkRequest add(DeleteRequest request) { /** * The list of requests in this bulk request. + * + * @return the requests */ public List> requests() { return this.requests; @@ -176,11 +195,18 @@ public List> requests() { /** * The number of actions in the bulk request. + * + * @return the number of actions */ public int numberOfActions() { return requests.size(); } + /** + * Waits the for active shards. + * + * @return this instance + */ public ActiveShardCount waitForActiveShards() { return this.waitForActiveShards; } @@ -230,18 +256,38 @@ public final BulkRequest routing(String globalRouting) { return this; } + /** + * Returns the timeout. + * + * @return the timeout + */ public TimeValue timeout() { return timeout; } + /** + * Returns the pipeline. + * + * @return the pipeline + */ public String pipeline() { return globalPipeline; } + /** + * Returns the routing. + * + * @return the routing + */ public String routing() { return globalRouting; } + /** + * Requires the alias. + * + * @return this instance + */ public Boolean requireAlias() { return globalRequireAlias; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequestBuilder.java index 8a32d9e7..d013da3c 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkRequestBuilder.java @@ -58,10 +58,23 @@ @PublicApi(since = "1.0.0") public class BulkRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { + /** + * Creates a new BulkRequestBuilder. + * + * @param client the client + * @param action the action + * @param globalIndex the global index + */ public BulkRequestBuilder(OpenSearchClient client, BulkAction action, @Nullable String globalIndex) { super(client, action, new BulkRequest(globalIndex)); } + /** + * Creates a new BulkRequestBuilder. + * + * @param client the client + * @param action the action + */ public BulkRequestBuilder(OpenSearchClient client, BulkAction action) { super(client, action, new BulkRequest()); } @@ -69,6 +82,9 @@ public BulkRequestBuilder(OpenSearchClient client, BulkAction action) { /** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). + * + * @param request the request + * @return this instance */ public BulkRequestBuilder add(IndexRequestBuilder request) { super.request.add(request.request()); @@ -77,6 +93,9 @@ public BulkRequestBuilder add(IndexRequestBuilder request) { /** * Adds an {@link DeleteRequest} to the list of actions to execute. + * + * @param request the request + * @return this instance */ public BulkRequestBuilder add(DeleteRequest request) { super.request.add(request); @@ -85,6 +104,9 @@ public BulkRequestBuilder add(DeleteRequest request) { /** * Adds an {@link DeleteRequest} to the list of actions to execute. + * + * @param request the request + * @return this instance */ public BulkRequestBuilder add(DeleteRequestBuilder request) { super.request.add(request.request()); @@ -93,6 +115,9 @@ public BulkRequestBuilder add(DeleteRequestBuilder request) { /** * Adds an {@link UpdateRequest} to the list of actions to execute. + * + * @param request the request + * @return this instance */ public BulkRequestBuilder add(UpdateRequest request) { super.request.add(request); @@ -101,6 +126,9 @@ public BulkRequestBuilder add(UpdateRequest request) { /** * Adds an {@link UpdateRequest} to the list of actions to execute. + * + * @param request the request + * @return this instance */ public BulkRequestBuilder add(UpdateRequestBuilder request) { super.request.add(request.request()); @@ -109,6 +137,8 @@ public BulkRequestBuilder add(UpdateRequestBuilder request) { /** * The number of actions currently in the bulk. + * + * @return the number of actions */ public int numberOfActions() { return request.numberOfActions(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkResponse.java index e5ee5e5d..3a00868d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/bulk/BulkResponse.java @@ -67,12 +67,21 @@ public class BulkResponse extends ActionResponse implements Iterable { + /** + * The INSTANCE constant. + */ public static final DeleteAction INSTANCE = new DeleteAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/write/delete"; private DeleteAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequest.java index 41f42fe6..f458a0ea 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequest.java @@ -85,6 +85,13 @@ public class DeleteRequest extends ReplicatedWriteRequest private long ifSeqNo = UNASSIGNED_SEQ_NO; private long ifPrimaryTerm = UNASSIGNED_PRIMARY_TERM; + /** + * Creates a new DeleteRequest. + * + * @param shardId the shard identifier + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DeleteRequest(@Nullable ShardId shardId, StreamInput in) throws IOException { super(shardId, in); if (in.getVersion().before(Version.V_2_0_0)) { @@ -99,6 +106,9 @@ public DeleteRequest(@Nullable ShardId shardId, StreamInput in) throws IOExcepti ifPrimaryTerm = in.readVLong(); } + /** + * Creates a new DeleteRequest. + */ public DeleteRequest() { super(NO_SHARD_ID); } @@ -106,6 +116,8 @@ public DeleteRequest() { /** * Constructs a new delete request against the specified index. The {@link #id(String)} * must be set. + * + * @param index the index */ public DeleteRequest(String index) { super(NO_SHARD_ID); @@ -146,6 +158,9 @@ public String id() { /** * Sets the id of the document to delete. + * + * @param id the identifier + * @return the identifier */ public DeleteRequest id(String id) { this.id = id; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequestBuilder.java index 6fd16f2d..ddcca08e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteRequestBuilder.java @@ -49,12 +49,22 @@ public class DeleteRequestBuilder extends ReplicationRequestBuilder { + /** + * Creates a new DeleteRequestBuilder. + * + * @param client the client + * @param action the action + * @param index the index + */ public DeleteRequestBuilder(OpenSearchClient client, DeleteAction action, @Nullable String index) { super(client, action, new DeleteRequest(index)); } /** * Sets the id of the document to delete. + * + * @param id the identifier + * @return this instance */ public DeleteRequestBuilder setId(String id) { request.id(id); @@ -67,6 +77,9 @@ public DeleteRequestBuilder setId(String id) { * * If the document last modification was assigned a different sequence number a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @param seqNo the seq no + * @return this instance */ public DeleteRequestBuilder setIfSeqNo(long seqNo) { request.setIfSeqNo(seqNo); @@ -79,6 +92,9 @@ public DeleteRequestBuilder setIfSeqNo(long seqNo) { * * If the document last modification was assigned a different term a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @param term the term + * @return this instance */ public DeleteRequestBuilder setIfPrimaryTerm(long term) { request.setIfPrimaryTerm(term); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteResponse.java index 174f7b27..11e6c935 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/delete/DeleteResponse.java @@ -55,10 +55,23 @@ @PublicApi(since = "1.0.0") public class DeleteResponse extends DocWriteResponse { + /** + * Creates a new DeleteResponse. + * + * @param shardId the shard identifier + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DeleteResponse(ShardId shardId, StreamInput in) throws IOException { super(shardId, in); } + /** + * Creates a new DeleteResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DeleteResponse(StreamInput in) throws IOException { super(in); } @@ -91,6 +104,10 @@ public String toString() { /** * Parse the current token and update the parsing context appropriately. + * + * @param parser the parser + * @param context the context + * @throws IOException if an I/O error occurs */ public static void parseXContentFields(XContentParser parser, Builder context) throws IOException { DocWriteResponse.parseInnerToXContent(parser, context); @@ -105,6 +122,11 @@ public static void parseXContentFields(XContentParser parser, Builder context) t */ @PublicApi(since = "1.0.0") public static class Builder extends DocWriteResponse.Builder { + /** + * Creates a new Builder. + */ + public Builder() { + } @Override public DeleteResponse build() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainAction.java index 3f9322e1..dc0e3a41 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainAction.java @@ -41,7 +41,13 @@ */ public class ExplainAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ExplainAction INSTANCE = new ExplainAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/explain"; private ExplainAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequest.java index a6256b47..dbfb8885 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequest.java @@ -73,34 +73,75 @@ public class ExplainRequest extends SingleShardRequest implement long nowInMillis; + /** + * Creates a new ExplainRequest. + */ public ExplainRequest() {} + /** + * Creates a new ExplainRequest. + * + * @param index the index + * @param id the identifier + */ public ExplainRequest(String index, String id) { this.index = index; this.id = id; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String id() { return id; } + /** + * Returns the identifier. + * + * @param id the identifier + * @return the identifier + */ public ExplainRequest id(String id) { this.id = id; return this; } + /** + * Returns the routing. + * + * @return the routing + */ public String routing() { return routing; } + /** + * Returns the preference. + * + * @return the preference + */ public String preference() { return preference; } + /** + * Queries this instance. + * + * @return this instance + */ public QueryBuilder query() { return query; } + /** + * Queries this instance. + * + * @param query the query + * @return this instance + */ public ExplainRequest query(QueryBuilder query) { this.query = query; return this; @@ -108,16 +149,29 @@ public ExplainRequest query(QueryBuilder query) { /** * Allows setting the {@link FetchSourceContext} for this request, controlling if and how _source should be returned. + * + * @param context the context + * @return this instance */ public ExplainRequest fetchSourceContext(FetchSourceContext context) { this.fetchSourceContext = context; return this; } + /** + * Fetches the source context. + * + * @return this instance + */ public FetchSourceContext fetchSourceContext() { return fetchSourceContext; } + /** + * Returns the stored fields. + * + * @return the stored fields + */ public String[] storedFields() { return storedFields; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequestBuilder.java index 8c707e38..fbc799f1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainRequestBuilder.java @@ -48,12 +48,23 @@ @PublicApi(since = "1.0.0") public class ExplainRequestBuilder extends SingleShardOperationRequestBuilder { + /** + * Creates a new ExplainRequestBuilder. + * + * @param client the client + * @param action the action + * @param index the index + * @param id the identifier + */ public ExplainRequestBuilder(OpenSearchClient client, ExplainAction action, String index, String id) { super(client, action, new ExplainRequest().index(index).id(id)); } /** * Sets the query to get a score explanation for. + * + * @param query the query + * @return this instance */ public ExplainRequestBuilder setQuery(QueryBuilder query) { request.query(query); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainResponse.java index 524b7678..4aad887b 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/explain/ExplainResponse.java @@ -77,22 +77,52 @@ public class ExplainResponse extends ActionResponse implements StatusToXContentO private Explanation explanation; private GetResult getResult; + /** + * Creates a new ExplainResponse. + * + * @param index the index + * @param id the identifier + * @param exists the exists + */ public ExplainResponse(String index, String id, boolean exists) { this.index = index; this.id = id; this.exists = exists; } + /** + * Creates a new ExplainResponse. + * + * @param index the index + * @param id the identifier + * @param exists the exists + * @param explanation the explanation + */ public ExplainResponse(String index, String id, boolean exists, Explanation explanation) { this(index, id, exists); this.explanation = explanation; } + /** + * Creates a new ExplainResponse. + * + * @param index the index + * @param id the identifier + * @param exists the exists + * @param explanation the explanation + * @param getResult the get result + */ public ExplainResponse(String index, String id, boolean exists, Explanation explanation, GetResult getResult) { this(index, id, exists, explanation); this.getResult = getResult; } + /** + * Creates a new ExplainResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ExplainResponse(StreamInput in) throws IOException { super(in); index = in.readString(); @@ -109,10 +139,20 @@ public ExplainResponse(StreamInput in) throws IOException { } } + /** + * Returns the match flag. + * + * @return the match flag + */ public boolean isMatch() { return explanation != null && explanation.isMatch(); } + /** + * Returns the explanation flag. + * + * @return the explanation flag + */ public boolean hasExplanation() { return explanation != null; } @@ -171,6 +211,13 @@ public void writeTo(StreamOutput out) throws IOException { PARSER.declareObject(ConstructingObjectParser.optionalConstructorArg(), (p, c) -> GetResult.fromXContentEmbedded(p), GET); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @param exists the exists + * @return the new XContent + */ public static ExplainResponse fromXContent(XContentParser parser, boolean exists) { return PARSER.apply(parser, exists); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilities.java b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilities.java index 098308dc..c47e3d74 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilities.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilities.java @@ -172,6 +172,14 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param name the name + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static FieldCapabilities fromXContent(String name, XContentParser parser) throws IOException { return PARSER.parse(parser, name); } @@ -208,6 +216,8 @@ public static FieldCapabilities fromXContent(String name, XContentParser parser) /** * The name of the field. + * + * @return the name */ public String getName() { return name; @@ -216,6 +226,8 @@ public String getName() { /** * The list of indices where this field name is defined as {@code type}, * or null if all indices have the same {@code type} for the field. + * + * @return the indices */ public String[] indices() { return indices; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesAction.java index 0aac1e99..c8ef283d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesAction.java @@ -41,7 +41,13 @@ */ public class FieldCapabilitiesAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final FieldCapabilitiesAction INSTANCE = new FieldCapabilitiesAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/field_caps"; private FieldCapabilitiesAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java index e4f638bc..4eb5c7e3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java @@ -58,6 +58,9 @@ */ @PublicApi(since = "1.0.0") public final class FieldCapabilitiesRequest extends ActionRequest implements IndicesRequest.Replaceable, ToXContentObject { + /** + * The NAME constant. + */ public static final String NAME = "field_caps_request"; private String[] indices = Strings.EMPTY_ARRAY; @@ -69,6 +72,9 @@ public final class FieldCapabilitiesRequest extends ActionRequest implements Ind private QueryBuilder indexFilter; private Long nowInMillis; + /** + * Creates a new FieldCapabilitiesRequest. + */ public FieldCapabilitiesRequest() {} @Override @@ -95,6 +101,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * The list of field names to retrieve + * + * @param fields the fields + * @return the fields */ public FieldCapabilitiesRequest fields(String... fields) { if (fields == null || fields.length == 0) { @@ -105,6 +114,11 @@ public FieldCapabilitiesRequest fields(String... fields) { return this; } + /** + * Returns the fields. + * + * @return the fields + */ public String[] fields() { return fields; } @@ -117,6 +131,12 @@ public FieldCapabilitiesRequest indices(String... indices) { return this; } + /** + * Includes the unmapped. + * + * @param includeUnmapped the include unmapped + * @return this instance + */ public FieldCapabilitiesRequest includeUnmapped(boolean includeUnmapped) { this.includeUnmapped = includeUnmapped; return this; @@ -137,10 +157,20 @@ public boolean includeDataStreams() { return true; } + /** + * Includes the unmapped. + * + * @return this instance + */ public boolean includeUnmapped() { return includeUnmapped; } + /** + * Indexes the filter. + * + * @return this instance + */ public QueryBuilder indexFilter() { return indexFilter; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java index d07d9bbf..1d4f0d9f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java @@ -44,12 +44,22 @@ */ @PublicApi(since = "1.0.0") public class FieldCapabilitiesRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new FieldCapabilitiesRequestBuilder. + * + * @param client the client + * @param action the action + * @param indices the indices + */ public FieldCapabilitiesRequestBuilder(OpenSearchClient client, FieldCapabilitiesAction action, String... indices) { super(client, action, new FieldCapabilitiesRequest().indices(indices)); } /** * The list of field names to retrieve. + * + * @param fields the fields + * @return this instance */ public FieldCapabilitiesRequestBuilder setFields(String... fields) { request().fields(fields); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java index 4245d052..15c2d05d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java @@ -70,6 +70,12 @@ public class FieldCapabilitiesResponse extends ActionResponse implements ToXCont private final Map> responseMap; private final List indexResponses; + /** + * Creates a new FieldCapabilitiesResponse. + * + * @param indices the indices + * @param responseMap the response map + */ public FieldCapabilitiesResponse(String[] indices, Map> responseMap) { this(indices, responseMap, Collections.emptyList()); } @@ -84,6 +90,12 @@ private FieldCapabilitiesResponse( this.indices = indices; } + /** + * Creates a new FieldCapabilitiesResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public FieldCapabilitiesResponse(StreamInput in) throws IOException { super(in); indices = in.readStringArray(); @@ -101,6 +113,9 @@ public FieldCapabilitiesResponse(StreamInput in) throws IOException { /** * * Get the field capabilities per type for the provided {@code field}. + * + * @param field the field + * @return the field */ public Map getField(String field) { return responseMap.get(field); @@ -133,6 +148,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static FieldCapabilitiesResponse fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetAction.java index 974ba960..574dc2bc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetAction.java @@ -41,7 +41,13 @@ */ public class GetAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetAction INSTANCE = new GetAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/get"; private GetAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequest.java index 47ffbd7a..30c10f2e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequest.java @@ -83,10 +83,15 @@ public class GetRequest extends SingleShardRequest implements Realti private VersionType versionType = VersionType.INTERNAL; private long version = Versions.MATCH_ANY; + /** + * Creates a new GetRequest. + */ public GetRequest() {} /** * Constructs a new get request against the specified index. The {@link #id(String)} must also be set. + * + * @param index the index */ public GetRequest(String index) { super(index); @@ -120,6 +125,9 @@ public ActionRequestValidationException validate() { /** * Sets the id of the document to fetch. + * + * @param id the identifier + * @return the identifier */ public GetRequest id(String id) { this.id = id; @@ -129,6 +137,9 @@ public GetRequest id(String id) { /** * Controls the shard routing of the request. Using this value to hash the shard * and not the id. + * + * @param routing the routing value + * @return the routing */ public GetRequest routing(String routing) { this.routing = routing; @@ -140,6 +151,9 @@ public GetRequest routing(String routing) { * {@code _local} to prefer local shards, {@code _primary} to execute only on primary shards, * or a custom value, which guarantees that the same order * will be used across different requests. + * + * @param preference the preference + * @return the preference */ public GetRequest preference(String preference) { this.preference = preference; @@ -156,22 +170,40 @@ public String id() { return id; } + /** + * Returns the routing. + * + * @return the routing + */ public String routing() { return this.routing; } + /** + * Returns the preference. + * + * @return the preference + */ public String preference() { return this.preference; } /** * Allows setting the {@link FetchSourceContext} for this request, controlling if and how _source should be returned. + * + * @param context the context + * @return this instance */ public GetRequest fetchSourceContext(FetchSourceContext context) { this.fetchSourceContext = context; return this; } + /** + * Fetches the source context. + * + * @return this instance + */ public FetchSourceContext fetchSourceContext() { return fetchSourceContext; } @@ -179,6 +211,9 @@ public FetchSourceContext fetchSourceContext() { /** * Explicitly specify the stored fields that will be returned. By default, the {@code _source} * field will be returned. + * + * @param fields the fields + * @return the stored fields */ public GetRequest storedFields(String... fields) { this.storedFields = fields; @@ -188,15 +223,27 @@ public GetRequest storedFields(String... fields) { /** * Explicitly specify the stored fields that will be returned. By default, the {@code _source} * field will be returned. + * + * @return the stored fields */ public String[] storedFields() { return this.storedFields; } + /** + * Refreshes this instance. + * + * @return this instance + */ public boolean refresh() { return this.refresh; } + /** + * Returns the realtime. + * + * @return the realtime + */ public boolean realtime() { return this.realtime; } @@ -210,11 +257,18 @@ public GetRequest realtime(boolean realtime) { /** * Sets the version, which will cause the get operation to only be performed if a matching * version exists and no changes happened on the doc since then. + * + * @return the version */ public long version() { return version; } + /** + * Returns the version type. + * + * @return the version type + */ public VersionType versionType() { return this.versionType; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequestBuilder.java index 5230bd68..71e70595 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetRequestBuilder.java @@ -48,12 +48,22 @@ @PublicApi(since = "1.0.0") public class GetRequestBuilder extends SingleShardOperationRequestBuilder { + /** + * Creates a new GetRequestBuilder. + * + * @param client the client + * @param action the action + * @param index the index + */ public GetRequestBuilder(OpenSearchClient client, GetAction action, @Nullable String index) { super(client, action, new GetRequest(index)); } /** * Sets the id of the document to fetch. + * + * @param id the identifier + * @return this instance */ public GetRequestBuilder setId(String id) { request.id(id); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetResponse.java index 4628173d..8af3e1fb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/GetResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/GetResponse.java @@ -72,12 +72,19 @@ public class GetResponse extends ActionResponse implements Iterable getSourceAsMap() throws OpenSearchParseException { return getResult.sourceAsMap(); } + /** + * Returns the source. + * + * @return the source + */ public Map getSource() { return getResult.getSource(); } + /** + * Returns the field. + * + * @param name the name + * @return the field + */ public DocumentField getField(String name) { return getResult.field(name); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetAction.java index a663a728..17a22730 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetAction.java @@ -41,7 +41,13 @@ */ public class MultiGetAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final MultiGetAction INSTANCE = new MultiGetAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/mget"; private MultiGetAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetItemResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetItemResponse.java index f0780bb4..88b3aa7e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetItemResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetItemResponse.java @@ -50,6 +50,12 @@ public class MultiGetItemResponse implements Writeable { private final GetResponse response; private final MultiGetResponse.Failure failure; + /** + * Creates a new MultiGetItemResponse. + * + * @param response the response + * @param failure the failure + */ public MultiGetItemResponse(GetResponse response, MultiGetResponse.Failure failure) { this.response = response; this.failure = failure; @@ -67,6 +73,8 @@ public MultiGetItemResponse(GetResponse response, MultiGetResponse.Failure failu /** * Is this a failed execution? + * + * @return the failed flag */ public boolean isFailed() { return failure != null; @@ -74,6 +82,8 @@ public boolean isFailed() { /** * The actual get response, {@code null} if its a failure. + * + * @return the response */ public GetResponse getResponse() { return this.response; @@ -81,6 +91,8 @@ public GetResponse getResponse() { /** * The failure if relevant. + * + * @return the failure */ public MultiGetResponse.Failure getFailure() { return this.failure; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequest.java index e09f0a5e..cc07d3cf 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequest.java @@ -106,15 +106,29 @@ public static class Item implements Writeable, IndicesRequest, ToXContentObject private VersionType versionType = VersionType.INTERNAL; private FetchSourceContext fetchSourceContext; + /** + * Creates a new Item. + */ public Item() { } + /** + * Creates a new Item. + * + * @param index the index + * @param id the identifier + */ public Item(String index, String id) { this.index = index; this.id = id; } + /** + * Indexes this instance. + * + * @return this instance + */ public String index() { return this.index; } @@ -129,20 +143,38 @@ public IndicesOptions indicesOptions() { return GetRequest.INDICES_OPTIONS; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String id() { return this.id; } + /** + * Returns the routing. + * + * @return the routing + */ public String routing() { return this.routing; } + /** + * Returns the stored fields. + * + * @return the stored fields + */ public String[] storedFields() { return this.storedFields; } /** * Allows setting the {@link FetchSourceContext} for this request, controlling if and how _source should be returned. + * + * @param fetchSourceContext the fetch source context + * @return this instance */ public Item fetchSourceContext(FetchSourceContext fetchSourceContext) { this.fetchSourceContext = fetchSourceContext; @@ -220,8 +252,17 @@ public String toString() { boolean refresh; List items = new ArrayList<>(); + /** + * Creates a new MultiGetRequest. + */ public MultiGetRequest() {} + /** + * Adds this instance. + * + * @param item the item + * @return this instance + */ public MultiGetRequest add(Item item) { items.add(item); return this; @@ -246,10 +287,20 @@ public ActionRequestValidationException validate() { return validationException; } + /** + * Returns the preference. + * + * @return the preference + */ public String preference() { return this.preference; } + /** + * Returns the realtime. + * + * @return the realtime + */ public boolean realtime() { return this.realtime; } @@ -260,6 +311,11 @@ public MultiGetRequest realtime(boolean realtime) { return this; } + /** + * Refreshes this instance. + * + * @return this instance + */ public boolean refresh() { return this.refresh; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequestBuilder.java index fba5f293..4ea69daf 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetRequestBuilder.java @@ -44,10 +44,22 @@ @PublicApi(since = "1.0.0") public class MultiGetRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new MultiGetRequestBuilder. + * + * @param client the client + * @param action the action + */ public MultiGetRequestBuilder(OpenSearchClient client, MultiGetAction action) { super(client, action, new MultiGetRequest()); } + /** + * Adds this instance. + * + * @param item the item + * @return this instance + */ public MultiGetRequestBuilder add(MultiGetRequest.Item item) { request.add(item); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetResponse.java index 61879912..b0abcee1 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/get/MultiGetResponse.java @@ -82,6 +82,13 @@ public static class Failure implements Writeable, ToXContentObject { private final String id; private final Exception exception; + /** + * Creates a new Failure. + * + * @param index the index + * @param id the identifier + * @param exception the exception + */ public Failure(String index, String id, Exception exception) { this.index = index; this.id = id; @@ -120,6 +127,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws private final MultiGetItemResponse[] responses; + /** + * Creates a new MultiGetResponse. + * + * @param responses the responses + */ public MultiGetResponse(MultiGetItemResponse[] responses) { this.responses = responses; } @@ -129,6 +141,11 @@ public MultiGetResponse(MultiGetItemResponse[] responses) { responses = in.readArray(MultiGetItemResponse::new, MultiGetItemResponse[]::new); } + /** + * Returns the responses. + * + * @return the responses + */ public MultiGetItemResponse[] getResponses() { return this.responses; } @@ -156,6 +173,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static MultiGetResponse fromXContent(XContentParser parser) throws IOException { String currentFieldName = null; List items = new ArrayList<>(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexAction.java index 600a761e..625ebd14 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexAction.java @@ -41,7 +41,13 @@ */ public class IndexAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final IndexAction INSTANCE = new IndexAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/write/index"; private IndexAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequest.java index cdd3af10..a43db525 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequest.java @@ -138,6 +138,13 @@ public class IndexRequest extends ReplicatedWriteRequest implement private long ifSeqNo = UNASSIGNED_SEQ_NO; private long ifPrimaryTerm = UNASSIGNED_PRIMARY_TERM; + /** + * Creates a new IndexRequest. + * + * @param shardId the shard identifier + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOException { super(shardId, in); if (in.getVersion().before(Version.V_2_0_0)) { @@ -176,6 +183,9 @@ public IndexRequest(@Nullable ShardId shardId, StreamInput in) throws IOExceptio requireAlias = in.readBoolean(); } + /** + * Creates a new IndexRequest. + */ public IndexRequest() { super(NO_SHARD_ID); } @@ -183,6 +193,8 @@ public IndexRequest() { /** * Constructs a new index request against the specific index. The * {@code #source(byte[], MediaType)} must be set. + * + * @param index the index */ public IndexRequest(String index) { super(NO_SHARD_ID); @@ -256,6 +268,8 @@ public IndicesOptions indicesOptions() { /** * The content type. This will be used when generating a document from user provided objects like Maps and when parsing the * source at index time + * + * @return the content type */ public MediaType getContentType() { return contentType; @@ -271,6 +285,9 @@ public String id() { /** * Sets the id of the indexed document. If not set, will be automatically generated. + * + * @param id the identifier + * @return the identifier */ public IndexRequest id(String id) { this.id = id; @@ -302,6 +319,9 @@ public String routing() { /** * Sets the ingest pipeline to be executed before indexing the document + * + * @param pipeline the pipeline + * @return this instance */ public IndexRequest setPipeline(String pipeline) { this.pipeline = pipeline; @@ -310,6 +330,8 @@ public IndexRequest setPipeline(String pipeline) { /** * Returns the ingest pipeline to be executed before indexing the document + * + * @return the pipeline */ public String getPipeline() { return this.pipeline; @@ -317,6 +339,8 @@ public String getPipeline() { /** * The source of the document to index, recopied to a new array if it is unsafe. + * + * @return the source */ public BytesReference source() { return source; @@ -326,6 +350,7 @@ public BytesReference source() { * Index the Map in {@code Requests#INDEX_CONTENT_TYPE} format * * @param source The map to index + * @return the source */ public IndexRequest source(Map source) throws OpenSearchGenerationException { return source(source, MediaTypeRegistry.JSON); @@ -335,6 +360,8 @@ public IndexRequest source(Map source) throws OpenSearchGenerationExc * Index the Map as the provided content type. * * @param source The map to index + * @param contentType the content type + * @return the source */ public IndexRequest source(Map source, MediaType contentType) throws OpenSearchGenerationException { try { @@ -351,6 +378,10 @@ public IndexRequest source(Map source, MediaType contentType) throws *

* Note, its preferable to either set it using {@link #source(XContentBuilder)} * or using the {@code #source(byte[], MediaType)}. + * + * @param source the source + * @param mediaType the media type + * @return the source */ public IndexRequest source(String source, MediaType mediaType) { return source(new BytesArray(source), mediaType); @@ -358,6 +389,9 @@ public IndexRequest source(String source, MediaType mediaType) { /** * Sets the content source to index. + * + * @param sourceBuilder the source builder + * @return the source */ public IndexRequest source(XContentBuilder sourceBuilder) { return source(BytesReference.bytes(sourceBuilder), sourceBuilder.contentType()); @@ -370,6 +404,9 @@ public IndexRequest source(XContentBuilder sourceBuilder) { * number. Also the first argument in each pair (the field name) must have a * valid String representation. *

+ * + * @param source the source + * @return the source */ public IndexRequest source(Object... source) { return source(MediaTypeRegistry.JSON, source); @@ -382,6 +419,10 @@ public IndexRequest source(Object... source) { * number. Also the first argument in each pair (the field name) must have a * valid String representation. *

+ * + * @param mediaType the media type + * @param source the source + * @return the source */ public IndexRequest source(MediaType mediaType, Object... source) { if (source.length % 2 != 0) { @@ -408,6 +449,10 @@ public IndexRequest source(MediaType mediaType, Object... source) { /** * Sets the document to index in bytes form. + * + * @param source the source + * @param mediaType the media type + * @return the source */ public IndexRequest source(BytesReference source, MediaType mediaType) { this.source = Objects.requireNonNull(source); @@ -417,6 +462,9 @@ public IndexRequest source(BytesReference source, MediaType mediaType) { /** * Sets the type of operation to perform. + * + * @param opType the op type + * @return the op type */ public IndexRequest opType(OpType opType) { if (opType != OpType.CREATE && opType != OpType.INDEX) { @@ -429,6 +477,9 @@ public IndexRequest opType(OpType opType) { /** * Sets a string representation of the {@link #opType(OpType)}. Can * be either "index" or "create". + * + * @param opType the op type + * @return the op type */ public IndexRequest opType(String opType) { String op = opType.toLowerCase(Locale.ROOT); @@ -444,6 +495,9 @@ public IndexRequest opType(String opType) { /** * Set to {@code true} to force this index to use {@link OpType#CREATE}. + * + * @param create the create + * @return the new instance */ public IndexRequest create(boolean create) { if (create) { @@ -630,6 +684,12 @@ public boolean isRequireAlias() { return requireAlias; } + /** + * Sets the require alias. + * + * @param requireAlias the require alias + * @return this instance + */ public IndexRequest setRequireAlias(boolean requireAlias) { this.requireAlias = requireAlias; return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequestBuilder.java index 6fd4e36a..5efee201 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexRequestBuilder.java @@ -55,10 +55,23 @@ public class IndexRequestBuilder extends ReplicationRequestBuilder { + /** + * Creates a new IndexRequestBuilder. + * + * @param client the client + * @param action the action + */ public IndexRequestBuilder(OpenSearchClient client, IndexAction action) { super(client, action, new IndexRequest()); } + /** + * Creates a new IndexRequestBuilder. + * + * @param client the client + * @param action the action + * @param index the index + */ public IndexRequestBuilder(OpenSearchClient client, IndexAction action, @Nullable String index) { super(client, action, new IndexRequest(index)); } @@ -66,6 +79,9 @@ public IndexRequestBuilder(OpenSearchClient client, IndexAction action, @Nullabl /** * Sets the id to index the document under. Optional, and if not set, one will be automatically * generated. + * + * @param id the identifier + * @return this instance */ public IndexRequestBuilder setId(String id) { request.id(id); @@ -76,6 +92,7 @@ public IndexRequestBuilder setId(String id) { * Index the Map as a JSON. * * @param source The map to index + * @return this instance */ public IndexRequestBuilder setSource(Map source) { request.source(source); @@ -86,6 +103,8 @@ public IndexRequestBuilder setSource(Map source) { * Index the Map as the provided content type. * * @param source The map to index + * @param contentType the content type + * @return this instance */ public IndexRequestBuilder setSource(Map source, MediaType contentType) { request.source(source, contentType); @@ -97,6 +116,10 @@ public IndexRequestBuilder setSource(Map source, MediaType contentTyp *

* Note, its preferable to either set it using {@link #setSource(XContentBuilder)} * or using the {@code #setSource(byte[], MediaType)}. + * + * @param source the source + * @param mediaType the media type + * @return this instance */ public IndexRequestBuilder setSource(String source, MediaType mediaType) { request.source(source, mediaType); @@ -105,6 +128,9 @@ public IndexRequestBuilder setSource(String source, MediaType mediaType) { /** * Sets the content source to index. + * + * @param sourceBuilder the source builder + * @return this instance */ public IndexRequestBuilder setSource(XContentBuilder sourceBuilder) { request.source(sourceBuilder); @@ -118,6 +144,9 @@ public IndexRequestBuilder setSource(XContentBuilder sourceBuilder) { * number. Also the first argument in each pair (the field name) must have a * valid String representation. *

+ * + * @param source the source + * @return this instance */ public IndexRequestBuilder setSource(Object... source) { request.source(source); @@ -126,6 +155,9 @@ public IndexRequestBuilder setSource(Object... source) { /** * Sets the type of operation to perform. + * + * @param opType the op type + * @return this instance */ public IndexRequestBuilder setOpType(DocWriteRequest.OpType opType) { request.opType(opType); @@ -134,6 +166,9 @@ public IndexRequestBuilder setOpType(DocWriteRequest.OpType opType) { /** * Set to {@code true} to force this index to use {@link org.codelibs.fesen.opensearch.action.index.IndexRequest.OpType#CREATE}. + * + * @param create the create + * @return this instance */ public IndexRequestBuilder setCreate(boolean create) { request.create(create); @@ -146,6 +181,9 @@ public IndexRequestBuilder setCreate(boolean create) { * * If the document last modification was assigned a different sequence number a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @param seqNo the seq no + * @return this instance */ public IndexRequestBuilder setIfSeqNo(long seqNo) { request.setIfSeqNo(seqNo); @@ -158,6 +196,9 @@ public IndexRequestBuilder setIfSeqNo(long seqNo) { * * If the document last modification was assigned a different term a * {@link org.codelibs.fesen.opensearch.index.engine.VersionConflictEngineException} will be thrown. + * + * @param term the term + * @return this instance */ public IndexRequestBuilder setIfPrimaryTerm(long term) { request.setIfPrimaryTerm(term); @@ -166,6 +207,9 @@ public IndexRequestBuilder setIfPrimaryTerm(long term) { /** * Sets the ingest pipeline to be executed before indexing the document + * + * @param pipeline the pipeline + * @return this instance */ public IndexRequestBuilder setPipeline(String pipeline) { request.setPipeline(pipeline); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexResponse.java index 19843303..41407ce0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/index/IndexResponse.java @@ -57,10 +57,23 @@ @PublicApi(since = "1.0.0") public class IndexResponse extends DocWriteResponse { + /** + * Creates a new IndexResponse. + * + * @param shardId the shard identifier + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IndexResponse(ShardId shardId, StreamInput in) throws IOException { super(shardId, in); } + /** + * Creates a new IndexResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public IndexResponse(StreamInput in) throws IOException { super(in); } @@ -95,6 +108,10 @@ public String toString() { /** * Parse the current token and update the parsing context appropriately. + * + * @param parser the parser + * @param context the context + * @throws IOException if an I/O error occurs */ public static void parseXContentFields(XContentParser parser, Builder context) throws IOException { DocWriteResponse.parseInnerToXContent(parser, context); @@ -109,6 +126,12 @@ public static void parseXContentFields(XContentParser parser, Builder context) t */ @PublicApi(since = "1.0.0") public static class Builder extends DocWriteResponse.Builder { + /** + * Creates a new Builder. + */ + public Builder() { + } + @Override public IndexResponse build() { IndexResponse indexResponse = new IndexResponse(shardId, id, seqNo, primaryTerm, version, result); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineAction.java index 41c0e378..fcd8929d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineAction.java @@ -42,9 +42,18 @@ */ public class DeletePipelineAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeletePipelineAction INSTANCE = new DeletePipelineAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/ingest/pipeline/delete"; + /** + * Creates a new DeletePipelineAction. + */ public DeletePipelineAction() { super(NAME, AcknowledgedResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineRequest.java index e30a5add..7642946e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/DeletePipelineRequest.java @@ -51,6 +51,11 @@ public class DeletePipelineRequest extends AcknowledgedRequest { + /** + * Creates a new DeletePipelineRequestBuilder. + * + * @param client the client + * @param action the action + */ public DeletePipelineRequestBuilder(OpenSearchClient client, DeletePipelineAction action) { super(client, action, new DeletePipelineRequest()); } + /** + * Creates a new DeletePipelineRequestBuilder. + * + * @param client the client + * @param action the action + * @param id the identifier + */ public DeletePipelineRequestBuilder(OpenSearchClient client, DeletePipelineAction action, String id) { super(client, action, new DeletePipelineRequest(id)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineAction.java index 98b4cfcc..346e79cf 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineAction.java @@ -41,9 +41,18 @@ */ public class GetPipelineAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetPipelineAction INSTANCE = new GetPipelineAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/ingest/pipeline/get"; + /** + * Creates a new GetPipelineAction. + */ public GetPipelineAction() { super(NAME, GetPipelineResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineRequest.java index 3075ce80..88759ea2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineRequest.java @@ -51,6 +51,11 @@ public class GetPipelineRequest extends ClusterManagerNodeReadRequest { + /** + * Creates a new GetPipelineRequestBuilder. + * + * @param client the client + * @param action the action + * @param ids the identifiers + */ public GetPipelineRequestBuilder(OpenSearchClient client, GetPipelineAction action, String[] ids) { super(client, action, new GetPipelineRequest(ids)); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineResponse.java index b5548114..375803ea 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/GetPipelineResponse.java @@ -65,6 +65,12 @@ public class GetPipelineResponse extends ActionResponse implements StatusToXCont private List pipelines; + /** + * Creates a new GetPipelineResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetPipelineResponse(StreamInput in) throws IOException { super(in); int size = in.readVInt(); @@ -74,6 +80,11 @@ public GetPipelineResponse(StreamInput in) throws IOException { } } + /** + * Creates a new GetPipelineResponse. + * + * @param pipelines the pipelines + */ public GetPipelineResponse(List pipelines) { this.pipelines = pipelines; } @@ -86,6 +97,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Returns the found flag. + * + * @return the found flag + */ public boolean isFound() { return !pipelines.isEmpty(); } @@ -106,6 +122,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } /** + * Parses an instance from the given parser. * * @param parser the parser for the XContent that contains the serialized GetPipelineResponse. * @return an instance of GetPipelineResponse read from the parser diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineAction.java index dcf86ad7..5db1bf79 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineAction.java @@ -42,9 +42,18 @@ */ public class PutPipelineAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final PutPipelineAction INSTANCE = new PutPipelineAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/ingest/pipeline/put"; + /** + * Creates a new PutPipelineAction. + */ public PutPipelineAction() { super(NAME, AcknowledgedResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequest.java index 4292d3a9..b271b5c3 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequest.java @@ -61,6 +61,10 @@ public class PutPipelineRequest extends AcknowledgedRequest /** * Create a new pipeline request with the id and source along with the content type of the source + * + * @param id the identifier + * @param source the source + * @param mediaType the media type */ public PutPipelineRequest(String id, BytesReference source, MediaType mediaType) { this.id = Objects.requireNonNull(id); @@ -75,14 +79,29 @@ public ActionRequestValidationException validate() { return null; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String getId() { return id; } + /** + * Returns the source. + * + * @return the source + */ public BytesReference getSource() { return source; } + /** + * Returns the media type. + * + * @return the media type + */ public MediaType getMediaType() { return mediaType; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequestBuilder.java index b1c71edd..169bb7e0 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/PutPipelineRequestBuilder.java @@ -47,6 +47,15 @@ @PublicApi(since = "1.0.0") public class PutPipelineRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new PutPipelineRequestBuilder. + * + * @param client the client + * @param action the action + * @param id the identifier + * @param source the source + * @param mediaType the media type + */ public PutPipelineRequestBuilder( OpenSearchClient client, PutPipelineAction action, diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentBaseResult.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentBaseResult.java index 86d6ceda..e8f9b6fb 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentBaseResult.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentBaseResult.java @@ -53,6 +53,9 @@ public final class SimulateDocumentBaseResult implements SimulateDocumentResult private final WriteableIngestDocument ingestDocument; private final Exception failure; + /** + * The PARSER constant. + */ public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "simulate_document_base_result", true, @@ -75,6 +78,11 @@ public final class SimulateDocumentBaseResult implements SimulateDocumentResult PARSER.declareObject(optionalConstructorArg(), (p, c) -> OpenSearchException.fromXContent(p), new ParseField("error")); } + /** + * Creates a new SimulateDocumentBaseResult. + * + * @param ingestDocument the ingest document + */ public SimulateDocumentBaseResult(IngestDocument ingestDocument) { if (ingestDocument != null) { this.ingestDocument = new WriteableIngestDocument(ingestDocument); @@ -84,6 +92,11 @@ public SimulateDocumentBaseResult(IngestDocument ingestDocument) { this.failure = null; } + /** + * Creates a new SimulateDocumentBaseResult. + * + * @param failure the failure + */ public SimulateDocumentBaseResult(Exception failure) { this.ingestDocument = null; this.failure = failure; @@ -91,6 +104,9 @@ public SimulateDocumentBaseResult(Exception failure) { /** * Read from a stream. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs */ public SimulateDocumentBaseResult(StreamInput in) throws IOException { failure = in.readException(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentVerboseResult.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentVerboseResult.java index 6b15e19e..2adc9293 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentVerboseResult.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateDocumentVerboseResult.java @@ -51,9 +51,15 @@ * @opensearch.internal */ public final class SimulateDocumentVerboseResult implements SimulateDocumentResult { + /** + * The PROCESSOR_RESULT_FIELD constant. + */ public static final String PROCESSOR_RESULT_FIELD = "processor_results"; private final List processorResults; + /** + * The PARSER constant. + */ @SuppressWarnings("unchecked") public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "simulate_document_verbose_result", @@ -64,12 +70,20 @@ public final class SimulateDocumentVerboseResult implements SimulateDocumentResu PARSER.declareObjectArray(constructorArg(), SimulateProcessorResult.PARSER, new ParseField(PROCESSOR_RESULT_FIELD)); } + /** + * Creates a new SimulateDocumentVerboseResult. + * + * @param processorResults the processor results + */ public SimulateDocumentVerboseResult(List processorResults) { this.processorResults = processorResults; } /** * Read from a stream. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs */ public SimulateDocumentVerboseResult(StreamInput in) throws IOException { int size = in.readVInt(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineAction.java index 2e73fe4d..53ee4d17 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineAction.java @@ -41,9 +41,18 @@ */ public class SimulatePipelineAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final SimulatePipelineAction INSTANCE = new SimulatePipelineAction(); + /** + * The NAME constant. + */ public static final String NAME = "cluster:admin/ingest/pipeline/simulate"; + /** + * Creates a new SimulatePipelineAction. + */ public SimulatePipelineAction() { super(NAME, SimulatePipelineResponse::new); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequest.java index 24b18c84..338c17d2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequest.java @@ -64,6 +64,9 @@ public class SimulatePipelineRequest extends ActionRequest implements ToXContent /** * Creates a new request with the given source and its content type + * + * @param source the source + * @param mediaType the media type */ public SimulatePipelineRequest(BytesReference source, MediaType mediaType) { this.source = Objects.requireNonNull(source); @@ -77,10 +80,20 @@ public ActionRequestValidationException validate() { return null; } + /** + * Returns the identifier. + * + * @return the identifier + */ public String getId() { return id; } + /** + * Returns the verbose flag. + * + * @return the verbose flag + */ public boolean isVerbose() { return verbose; } @@ -110,6 +123,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws * @opensearch.internal */ public static final class Fields { + /** + * Creates a new Fields. + */ + public Fields() { + } + static final String PIPELINE = "pipeline"; static final String DOCS = "docs"; static final String SOURCE = "_source"; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequestBuilder.java index cc403d5b..0f54f7bc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulatePipelineRequestBuilder.java @@ -48,6 +48,11 @@ public class SimulatePipelineRequestBuilder extends ActionRequestBuilder results; + /** + * The PARSER constant. + */ @SuppressWarnings("unchecked") public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "simulate_pipeline_response", @@ -119,6 +122,12 @@ public class SimulatePipelineResponse extends ActionResponse implements ToXConte }, new ParseField(Fields.DOCUMENTS)); } + /** + * Creates a new SimulatePipelineResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public SimulatePipelineResponse(StreamInput in) throws IOException { super(in); this.pipelineId = in.readOptionalString(); @@ -136,12 +145,24 @@ public SimulatePipelineResponse(StreamInput in) throws IOException { } } + /** + * Creates a new SimulatePipelineResponse. + * + * @param pipelineId the pipeline identifier + * @param verbose the verbose + * @param responses the responses + */ public SimulatePipelineResponse(String pipelineId, boolean verbose, List responses) { this.pipelineId = pipelineId; this.verbose = verbose; this.results = Collections.unmodifiableList(responses); } + /** + * Returns the results. + * + * @return the results + */ public List getResults() { return results; } @@ -168,6 +189,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static SimulatePipelineResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateProcessorResult.java b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateProcessorResult.java index 0ff0ae44..24c0efb5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateProcessorResult.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/ingest/SimulateProcessorResult.java @@ -105,6 +105,9 @@ public String toString() { IF_CONDITION_PARSER.declareBoolean(optionalConstructorArg(), new ParseField(RESULT_FIELD)); } + /** + * The PARSER constant. + */ @SuppressWarnings("unchecked") public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "simulate_processor_result", @@ -139,6 +142,16 @@ public String toString() { PARSER.declareObject(optionalConstructorArg(), (p, c) -> OpenSearchException.fromXContent(p), new ParseField("error")); } + /** + * Creates a new SimulateProcessorResult. + * + * @param type the type + * @param processorTag the processor tag + * @param description the description + * @param ingestDocument the ingest document + * @param failure the failure + * @param conditionalWithResult the conditional with result + */ public SimulateProcessorResult( String type, String processorTag, @@ -227,6 +240,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static SimulateProcessorResult fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/main/MainAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/main/MainAction.java index 666b9000..96c60067 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/main/MainAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/main/MainAction.java @@ -41,7 +41,13 @@ */ public class MainAction extends ActionType { + /** + * The NAME constant. + */ public static final String NAME = "cluster:monitor/main"; + /** + * The INSTANCE constant. + */ public static final MainAction INSTANCE = new MainAction(); private MainAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/main/MainRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/main/MainRequest.java index b99366b8..f55a7b6d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/main/MainRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/main/MainRequest.java @@ -45,6 +45,9 @@ */ public class MainRequest extends ActionRequest { + /** + * Creates a new MainRequest. + */ public MainRequest() {} @Override diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/main/MainResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/main/MainResponse.java index 5bc6f2f7..637aaab5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/main/MainResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/main/MainResponse.java @@ -59,6 +59,9 @@ public class MainResponse extends ActionResponse implements ToXContentObject { private ClusterName clusterName; private String clusterUuid; private Build build; + /** + * The TAGLINE constant. + */ public static final String TAGLINE = "The OpenSearch Project: https://opensearch.org/"; MainResponse() {} @@ -72,6 +75,11 @@ public class MainResponse extends ActionResponse implements ToXContentObject { build = in.readBuild(); } + /** + * Returns the cluster name. + * + * @return the cluster name + */ public ClusterName getClusterName() { return clusterName; } @@ -138,6 +146,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws }, (parser, context) -> parser.map(), new ParseField("version")); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + */ public static MainResponse fromXContent(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/pagination/PageParams.java b/src/main/java/org/codelibs/fesen/opensearch/action/pagination/PageParams.java index 167dd95f..ea1bdf62 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/pagination/PageParams.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/pagination/PageParams.java @@ -23,12 +23,22 @@ @PublicApi(since = "2.18.0") public class PageParams implements Writeable { + /** + * The PARAM_ASC_SORT_VALUE constant. + */ public static final String PARAM_ASC_SORT_VALUE = "asc"; private final String requestedTokenStr; private final String sort; private final int size; + /** + * Creates a new PageParams. + * + * @param requestedToken the requested token + * @param sort the sort + * @param size the size + */ public PageParams(String requestedToken, String sort, int size) { this.requestedTokenStr = requestedToken; this.sort = sort; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollAction.java index 58d9bef2..8322ea58 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollAction.java @@ -41,7 +41,13 @@ */ public class ClearScrollAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final ClearScrollAction INSTANCE = new ClearScrollAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/scroll/clear"; private ClearScrollAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequest.java index ce860ba9..c6975ccc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequest.java @@ -58,12 +58,25 @@ public class ClearScrollRequest extends ActionRequest implements ToXContentObjec private List scrollIds; + /** + * Creates a new ClearScrollRequest. + */ public ClearScrollRequest() {} + /** + * Returns the scroll identifiers. + * + * @return the scroll identifiers + */ public List getScrollIds() { return scrollIds; } + /** + * Adds the scroll identifier. + * + * @param scrollId the scroll identifier + */ public void addScrollId(String scrollId) { if (scrollIds == null) { scrollIds = new ArrayList<>(); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequestBuilder.java index 5aaa357f..8fac6fda 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollRequestBuilder.java @@ -46,10 +46,22 @@ @PublicApi(since = "1.0.0") public class ClearScrollRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new ClearScrollRequestBuilder. + * + * @param client the client + * @param action the action + */ public ClearScrollRequestBuilder(OpenSearchClient client, ClearScrollAction action) { super(client, action, new ClearScrollRequest()); } + /** + * Adds the scroll identifier. + * + * @param cursorId the cursor identifier + * @return this instance + */ public ClearScrollRequestBuilder addScrollId(String cursorId) { request.addScrollId(cursorId); return this; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollResponse.java index e80eec83..95607193 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ClearScrollResponse.java @@ -74,11 +74,23 @@ public class ClearScrollResponse extends ActionResponse implements StatusToXCont private final boolean succeeded; private final int numFreed; + /** + * Creates a new ClearScrollResponse. + * + * @param succeeded the succeeded + * @param numFreed the num freed + */ public ClearScrollResponse(boolean succeeded, int numFreed) { this.succeeded = succeeded; this.numFreed = numFreed; } + /** + * Creates a new ClearScrollResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ClearScrollResponse(StreamInput in) throws IOException { super(in); succeeded = in.readBoolean(); @@ -86,6 +98,8 @@ public ClearScrollResponse(StreamInput in) throws IOException { } /** + * Returns the succeeded flag. + * * @return Whether the attempt to clear a scroll was successful. */ public boolean isSucceeded() { @@ -108,6 +122,10 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Parse the clear scroll response body into a new {@link ClearScrollResponse} object + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs */ public static ClearScrollResponse fromXContent(XContentParser parser) throws IOException { return PARSER.apply(parser, null); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitAction.java index 45a35c92..1757efc5 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitAction.java @@ -14,7 +14,13 @@ * Action type for creating PIT reader context */ public class CreatePitAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final CreatePitAction INSTANCE = new CreatePitAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/point_in_time/create"; private CreatePitAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitRequest.java index ea119c61..19824ed7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitRequest.java @@ -49,6 +49,13 @@ public class CreatePitRequest extends ActionRequest implements IndicesRequest.Re private String[] indices = Strings.EMPTY_ARRAY; private IndicesOptions indicesOptions = SearchRequest.DEFAULT_INDICES_OPTIONS; + /** + * Creates a new CreatePitRequest. + * + * @param keepAlive the keep alive + * @param allowPartialPitCreation the allow partial pit creation + * @param indices the indices + */ public CreatePitRequest(TimeValue keepAlive, Boolean allowPartialPitCreation, String... indices) { this.keepAlive = keepAlive; this.allowPartialPitCreation = allowPartialPitCreation; @@ -66,30 +73,65 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalBoolean(allowPartialPitCreation); } + /** + * Returns the routing. + * + * @return the routing + */ public String getRouting() { return routing; } + /** + * Returns the preference. + * + * @return the preference + */ public String getPreference() { return preference; } + /** + * Returns the indices. + * + * @return the indices + */ public String[] getIndices() { return indices; } + /** + * Returns the keep alive. + * + * @return the keep alive + */ public TimeValue getKeepAlive() { return keepAlive; } + /** + * Returns the allow partial pit creation flag. + * + * @return the allow partial pit creation flag + */ public boolean shouldAllowPartialPitCreation() { return allowPartialPitCreation; } + /** + * Sets the routing. + * + * @param routing the routing value + */ public void setRouting(String routing) { this.routing = routing; } + /** + * Sets the preference. + * + * @param preference the preference + */ public void setPreference(String preference) { this.preference = preference; } @@ -113,6 +155,11 @@ public IndicesOptions indicesOptions() { return indicesOptions; } + /** + * Builds the description. + * + * @return the new description + */ public final String buildDescription() { StringBuilder sb = new StringBuilder(); sb.append("indices["); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitResponse.java index 09041e30..9656fe74 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/CreatePitResponse.java @@ -44,6 +44,12 @@ public class CreatePitResponse extends ActionResponse implements StatusToXConten private final ShardSearchFailure[] shardFailures; private final long creationTime; + /** + * Creates a new CreatePitResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public CreatePitResponse(StreamInput in) throws IOException { super(in); id = in.readString(); @@ -63,6 +69,17 @@ public CreatePitResponse(StreamInput in) throws IOException { } } + /** + * Creates a new CreatePitResponse. + * + * @param id the identifier + * @param creationTime the creation time + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param skippedShards the skipped shards + * @param failedShards the failed shards + * @param shardFailures the shard failures + */ public CreatePitResponse( String id, long creationTime, @@ -101,6 +118,10 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws /** * Parse the create PIT response body into a new {@link CreatePitResponse} object + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs */ public static CreatePitResponse fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.nextToken(), parser); @@ -108,6 +129,13 @@ public static CreatePitResponse fromXContent(XContentParser parser) throws IOExc return innerFromXContent(parser); } + /** + * Returns the inner from XContent. + * + * @param parser the parser + * @return the inner from XContent + * @throws IOException if an I/O error occurs + */ public static CreatePitResponse innerFromXContent(XContentParser parser) throws IOException { ensureExpectedToken(XContentParser.Token.FIELD_NAME, parser.currentToken(), parser); String currentFieldName = parser.currentName(); @@ -175,12 +203,19 @@ public static CreatePitResponse innerFromXContent(XContentParser parser) throws ); } + /** + * Returns the creation time. + * + * @return the creation time + */ public long getCreationTime() { return creationTime; } /** * The failed number of shards the search was executed on. + * + * @return the failed shards */ public int getFailedShards() { return shardFailures.length; @@ -188,6 +223,8 @@ public int getFailedShards() { /** * The failures that occurred during the search. + * + * @return the shard failures */ public ShardSearchFailure[] getShardFailures() { return this.shardFailures; @@ -207,12 +244,19 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Returns the identifier. + * + * @return the identifier + */ public String getId() { return id; } /** * The total number of shards the create pit operation was executed on. + * + * @return the total shards */ public int getTotalShards() { return totalShards; @@ -220,11 +264,18 @@ public int getTotalShards() { /** * The successful number of shards the create pit operation was executed on. + * + * @return the successful shards */ public int getSuccessfulShards() { return successfulShards; } + /** + * Returns the skipped shards. + * + * @return the skipped shards + */ public int getSkippedShards() { return skippedShards; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitAction.java index 15d6cf85..445fc028 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitAction.java @@ -15,7 +15,13 @@ */ public class DeletePitAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final DeletePitAction INSTANCE = new DeletePitAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/point_in_time/delete"; private DeletePitAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitInfo.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitInfo.java index 302c9d26..abe42aa9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitInfo.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitInfo.java @@ -36,21 +36,43 @@ public class DeletePitInfo extends TransportResponse implements Writeable, ToXCo private final String pitId; + /** + * Creates a new DeletePitInfo. + * + * @param successful the successful + * @param pitId the pit identifier + */ public DeletePitInfo(boolean successful, String pitId) { this.successful = successful; this.pitId = pitId; } + /** + * Creates a new DeletePitInfo by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DeletePitInfo(StreamInput in) throws IOException { successful = in.readBoolean(); pitId = in.readString(); } + /** + * Returns the successful flag. + * + * @return the successful flag + */ public boolean isSuccessful() { return successful; } + /** + * Returns the pit identifier. + * + * @return the pit identifier + */ public String getPitId() { return pitId; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitRequest.java index 5b654364..b311bfa9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitRequest.java @@ -39,12 +39,25 @@ public class DeletePitRequest extends ActionRequest implements ToXContentObject */ private final List pitIds = new ArrayList<>(); + /** + * Creates a new DeletePitRequest. + * + * @param pitIds the pit identifiers + */ public DeletePitRequest(String... pitIds) { this.pitIds.addAll(Arrays.asList(pitIds)); } + /** + * Creates a new DeletePitRequest. + */ public DeletePitRequest() {} + /** + * Returns the pit identifiers. + * + * @return the pit identifiers + */ public List getPitIds() { return pitIds; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitResponse.java index 355b2acd..4d8b79e9 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/DeletePitResponse.java @@ -37,10 +37,21 @@ public class DeletePitResponse extends ActionResponse implements StatusToXConten private final List deletePitResults; + /** + * Creates a new DeletePitResponse. + * + * @param deletePitResults the delete pit results + */ public DeletePitResponse(List deletePitResults) { this.deletePitResults = deletePitResults; } + /** + * Creates a new DeletePitResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public DeletePitResponse(StreamInput in) throws IOException { super(in); int size = in.readVInt(); @@ -51,6 +62,11 @@ public DeletePitResponse(StreamInput in) throws IOException { } + /** + * Returns the delete pit results. + * + * @return the delete pit results + */ public List getDeletePitResults() { return deletePitResults; } @@ -96,6 +112,13 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par PARSER.declareObjectArray(constructorArg(), DeletePitInfo.PARSER, new ParseField("pits")); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static DeletePitResponse fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodeResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodeResponse.java index 572721a4..6892a0dc 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodeResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodeResponse.java @@ -34,11 +34,22 @@ public class GetAllPitNodeResponse extends BaseNodeResponse implements ToXConten */ private final List pitInfos; + /** + * Creates a new GetAllPitNodeResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetAllPitNodeResponse(StreamInput in) throws IOException { super(in); this.pitInfos = Collections.unmodifiableList(in.readList(ListPitInfo::new)); } + /** + * Returns the pit infos. + * + * @return the pit infos + */ public List getPitInfos() { return pitInfos; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesRequest.java index fb7b0165..f737f3ca 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesRequest.java @@ -24,6 +24,11 @@ @PublicApi(since = "2.3.0") public class GetAllPitNodesRequest extends BaseNodesRequest { + /** + * Creates a new GetAllPitNodesRequest. + * + * @param concreteNodes the concrete nodes + */ public GetAllPitNodesRequest(DiscoveryNode... concreteNodes) { super(concreteNodes); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesResponse.java index 261e9bf4..2655d5ca 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitNodesResponse.java @@ -43,6 +43,12 @@ public class GetAllPitNodesResponse extends BaseNodesResponse pitInfos = new HashSet<>(); + /** + * Creates a new GetAllPitNodesResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public GetAllPitNodesResponse(StreamInput in) throws IOException { super(in); Set uniquePitIds = new HashSet<>(); @@ -53,6 +59,14 @@ public GetAllPitNodesResponse(StreamInput in) throws IOException { ); } + /** + * Creates a new GetAllPitNodesResponse. + * + * @param listPitInfos the list pit infos + * @param clusterName the cluster name + * @param getAllPitNodeResponseList the get all pit node response list + * @param failures the failures + */ public GetAllPitNodesResponse( List listPitInfos, ClusterName clusterName, @@ -91,6 +105,11 @@ public void writeNodesTo(StreamOutput out, List nodes) th out.writeList(nodes); } + /** + * Returns the pit infos. + * + * @return the pit infos + */ public List getPitInfos() { return Collections.unmodifiableList(new ArrayList<>(pitInfos)); } @@ -115,6 +134,13 @@ public List getPitInfos() { PARSER.declareObjectArray(constructorArg(), ListPitInfo.PARSER, new ParseField("pits")); } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static GetAllPitNodesResponse fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitsAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitsAction.java index 2fbf35f1..0d7199ab 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitsAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/GetAllPitsAction.java @@ -14,7 +14,13 @@ * Action type for retrieving all PIT reader contexts from nodes */ public class GetAllPitsAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final GetAllPitsAction INSTANCE = new GetAllPitsAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/point_in_time/readall"; private GetAllPitsAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ListPitInfo.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ListPitInfo.java index d01bcd4d..b9057fd4 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ListPitInfo.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ListPitInfo.java @@ -33,26 +33,54 @@ public class ListPitInfo implements ToXContentFragment, Writeable { private final long creationTime; private final long keepAlive; + /** + * Creates a new ListPitInfo. + * + * @param pitId the pit identifier + * @param creationTime the creation time + * @param keepAlive the keep alive + */ public ListPitInfo(String pitId, long creationTime, long keepAlive) { this.pitId = pitId; this.creationTime = creationTime; this.keepAlive = keepAlive; } + /** + * Creates a new ListPitInfo by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public ListPitInfo(StreamInput in) throws IOException { this.pitId = in.readString(); this.creationTime = in.readLong(); this.keepAlive = in.readLong(); } + /** + * Returns the pit identifier. + * + * @return the pit identifier + */ public String getPitId() { return pitId; } + /** + * Returns the creation time. + * + * @return the creation time + */ public long getCreationTime() { return creationTime; } + /** + * Returns the keep alive. + * + * @return the keep alive + */ public long getKeepAlive() { return keepAlive; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchAction.java index 4239d264..6e03d575 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchAction.java @@ -41,7 +41,13 @@ */ public class MultiSearchAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final MultiSearchAction INSTANCE = new MultiSearchAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/msearch"; private MultiSearchAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequest.java index 084a3276..216ea5b8 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequest.java @@ -79,11 +79,17 @@ public class MultiSearchRequest extends ActionRequest implements CompositeIndice private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpenAndForbidClosedIgnoreThrottled(); + /** + * Creates a new MultiSearchRequest. + */ public MultiSearchRequest() {} /** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. + * + * @param request the request + * @return this instance */ public MultiSearchRequest add(SearchRequestBuilder request) { requests.add(request.request()); @@ -92,11 +98,18 @@ public MultiSearchRequest add(SearchRequestBuilder request) { /** * Returns the amount of search requests specified in this multi search requests are allowed to be ran concurrently. + * + * @return the max concurrent search requests */ public int maxConcurrentSearchRequests() { return maxConcurrentSearchRequests; } + /** + * Returns the requests. + * + * @return the requests + */ public List requests() { return this.requests; } @@ -120,6 +133,11 @@ public ActionRequestValidationException validate() { return validationException; } + /** + * Returns the indices options. + * + * @return the indices options + */ public IndicesOptions indicesOptions() { return indicesOptions; } @@ -149,6 +167,13 @@ public int hashCode() { return Objects.hash(maxConcurrentSearchRequests, requests, indicesOptions); } + /** + * Writes the search request params. + * + * @param request the request + * @param xContentBuilder the XContent builder + * @throws IOException if an I/O error occurs + */ public static void writeSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder) throws IOException { xContentBuilder.startObject(); if (request.indices() != null) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequestBuilder.java index 3cb58c45..91891841 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchRequestBuilder.java @@ -45,6 +45,12 @@ @PublicApi(since = "1.0.0") public class MultiSearchRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new MultiSearchRequestBuilder. + * + * @param client the client + * @param action the action + */ public MultiSearchRequestBuilder(OpenSearchClient client, MultiSearchAction action) { super(client, action, new MultiSearchRequest()); } @@ -52,6 +58,9 @@ public MultiSearchRequestBuilder(OpenSearchClient client, MultiSearchAction acti /** * Add a search request to execute. Note, the order is important, the search response will be returned in the * same order as the search requests. + * + * @param request the request + * @return this instance */ public MultiSearchRequestBuilder add(SearchRequestBuilder request) { if (request.request().indicesOptions() == SearchRequest.DEFAULT_INDICES_OPTIONS diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchResponse.java index 86dc78cc..8ec6f594 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/MultiSearchResponse.java @@ -87,6 +87,12 @@ public static class Item implements Writeable { private final SearchResponse response; private final Exception exception; + /** + * Creates a new Item. + * + * @param response the response + * @param exception the exception + */ public Item(SearchResponse response, Exception exception) { this.response = response; this.exception = exception; @@ -115,6 +121,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Is it a failed search? + * + * @return the failure flag */ public boolean isFailure() { return exception != null; @@ -122,12 +130,19 @@ public boolean isFailure() { /** * The actual search response, null if its a failure. + * + * @return the response */ @Nullable public SearchResponse getResponse() { return this.response; } + /** + * Returns the failure. + * + * @return the failure + */ public Exception getFailure() { return exception; } @@ -136,6 +151,12 @@ public Exception getFailure() { private final Item[] items; private final long tookInMillis; + /** + * Creates a new MultiSearchResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public MultiSearchResponse(StreamInput in) throws IOException { super(in); items = new Item[in.readVInt()]; @@ -145,6 +166,12 @@ public MultiSearchResponse(StreamInput in) throws IOException { tookInMillis = in.readVLong(); } + /** + * Creates a new MultiSearchResponse. + * + * @param items the items + * @param tookInMillis the took in milliseconds + */ public MultiSearchResponse(Item[] items, long tookInMillis) { this.items = items; this.tookInMillis = tookInMillis; @@ -157,6 +184,8 @@ public Iterator iterator() { /** * The list of responses, the order is the same as the one provided in the request. + * + * @return the responses */ public Item[] getResponses() { return this.items; @@ -192,6 +221,12 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Creates an instance from x context. + * + * @param parser the parser + * @return the new x context + */ public static MultiSearchResponse fromXContext(XContentParser parser) { return PARSER.apply(parser, null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ParsedScrollId.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ParsedScrollId.java index 0d2d81a4..7b290e9a 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ParsedScrollId.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ParsedScrollId.java @@ -44,8 +44,14 @@ @PublicApi(since = "1.0.0") public class ParsedScrollId { + /** + * The QUERY_THEN_FETCH_TYPE constant. + */ public static final String QUERY_THEN_FETCH_TYPE = "queryThenFetch"; + /** + * The QUERY_AND_FETCH_TYPE constant. + */ public static final String QUERY_AND_FETCH_TYPE = "queryAndFetch"; private final String source; @@ -62,22 +68,47 @@ public class ParsedScrollId { this.originalIndices = originalIndices; } + /** + * Returns the source. + * + * @return the source + */ public String getSource() { return source; } + /** + * Returns the type. + * + * @return the type + */ public String getType() { return type; } + /** + * Returns the context. + * + * @return the context + */ public SearchContextIdForNode[] getContext() { return context; } + /** + * Returns the original indices. + * + * @return the original indices + */ public String[] getOriginalIndices() { return originalIndices; } + /** + * Returns the local indices flag. + * + * @return the local indices flag + */ public boolean hasLocalIndices() { return Arrays.stream(context).anyMatch(c -> c.getClusterAlias() == null); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchAction.java index 193a793d..7f4ee266 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchAction.java @@ -41,7 +41,13 @@ */ public class SearchAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final SearchAction INSTANCE = new SearchAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/search"; private SearchAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchContextIdForNode.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchContextIdForNode.java index 0a70f59d..8825f658 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchContextIdForNode.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchContextIdForNode.java @@ -52,6 +52,13 @@ public final class SearchContextIdForNode implements Writeable { private final ShardSearchContextId searchContextId; private final String clusterAlias; + /** + * Creates a new SearchContextIdForNode. + * + * @param clusterAlias the cluster alias + * @param node the node + * @param searchContextId the search context identifier + */ public SearchContextIdForNode(@Nullable String clusterAlias, String node, ShardSearchContextId searchContextId) { this.node = node; this.clusterAlias = clusterAlias; @@ -65,6 +72,11 @@ public void writeTo(StreamOutput out) throws IOException { searchContextId.writeTo(out); } + /** + * Returns the cluster alias. + * + * @return the cluster alias + */ @Nullable public String getClusterAlias() { return clusterAlias; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseExecutionException.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseExecutionException.java index f032b433..6f7426de 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseExecutionException.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseExecutionException.java @@ -52,13 +52,34 @@ * @opensearch.internal */ public class SearchPhaseExecutionException extends OpenSearchException { + /** + * The phase name. + */ private final String phaseName; + /** + * The shard failures. + */ private final ShardSearchFailure[] shardFailures; + /** + * Creates a new SearchPhaseExecutionException. + * + * @param phaseName the phase name + * @param msg the msg + * @param shardFailures the shard failures + */ public SearchPhaseExecutionException(String phaseName, String msg, ShardSearchFailure[] shardFailures) { this(phaseName, msg, null, shardFailures); } + /** + * Creates a new SearchPhaseExecutionException. + * + * @param phaseName the phase name + * @param msg the msg + * @param cause the cause + * @param shardFailures the shard failures + */ public SearchPhaseExecutionException(String phaseName, String msg, Throwable cause, ShardSearchFailure[] shardFailures) { super(msg, getEffectiveCause(cause, shardFailures)); this.phaseName = phaseName; diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseName.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseName.java index 35cff65b..3124295d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseName.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchPhaseName.java @@ -17,11 +17,29 @@ */ @PublicApi(since = "2.9.0") public enum SearchPhaseName { + /** + * The DFS_PRE_QUERY value. + */ DFS_PRE_QUERY("dfs_pre_query"), + /** + * The QUERY value. + */ QUERY("query"), + /** + * The FETCH value. + */ FETCH("fetch"), + /** + * The DFS_QUERY value. + */ DFS_QUERY("dfs_query"), + /** + * The EXPAND value. + */ EXPAND("expand"), + /** + * The CAN_MATCH value. + */ CAN_MATCH("can_match"); private final String name; @@ -30,6 +48,11 @@ public enum SearchPhaseName { this.name = name; } + /** + * Returns the name. + * + * @return the name + */ public String getName() { return name; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequest.java index 8c6c5fc3..792d7643 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequest.java @@ -80,8 +80,14 @@ @PublicApi(since = "1.0.0") public class SearchRequest extends ActionRequest implements IndicesRequest.Replaceable { + /** + * The FORMAT_PARAMS constant. + */ public static final ToXContent.Params FORMAT_PARAMS = new ToXContent.MapParams(Collections.singletonMap("pretty", "false")); + /** + * The DEFAULT_BATCHED_REDUCE_SIZE constant. + */ public static final int DEFAULT_BATCHED_REDUCE_SIZE = 512; private static final long DEFAULT_ABSOLUTE_START_MILLIS = -1; @@ -115,6 +121,9 @@ public class SearchRequest extends ActionRequest implements IndicesRequest.Repla private boolean ccsMinimizeRoundtrips = true; + /** + * The DEFAULT_INDICES_OPTIONS constant. + */ public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpenAndForbidClosedIgnoreThrottled(); private IndicesOptions indicesOptions = DEFAULT_INDICES_OPTIONS; @@ -125,6 +134,9 @@ public class SearchRequest extends ActionRequest implements IndicesRequest.Repla private Boolean phaseTook = null; + /** + * Creates a new SearchRequest. + */ public SearchRequest() { this.localClusterAlias = null; this.absoluteStartMillis = DEFAULT_ABSOLUTE_START_MILLIS; @@ -133,6 +145,8 @@ public SearchRequest() { /** * Constructs a new search request from the provided search request + * + * @param searchRequest the search request */ public SearchRequest(SearchRequest searchRequest) { this( @@ -147,6 +161,8 @@ public SearchRequest(SearchRequest searchRequest) { /** * Constructs a new search request against the indices. No indices provided here means that search * will run against all indices. + * + * @param indices the indices */ public SearchRequest(String... indices) { this(indices, new SearchSourceBuilder()); @@ -154,6 +170,9 @@ public SearchRequest(String... indices) { /** * Constructs a new search request against the provided indices with the given search source. + * + * @param indices the indices + * @param source the source */ public SearchRequest(String[] indices, SearchSourceBuilder source) { this(); @@ -322,6 +341,12 @@ public IndicesOptions indicesOptions() { return indicesOptions; } + /** + * Returns the indices options. + * + * @param indicesOptions the indices options + * @return the indices options + */ public SearchRequest indicesOptions(IndicesOptions indicesOptions) { this.indicesOptions = Objects.requireNonNull(indicesOptions, "indicesOptions must not be null"); return this; @@ -335,6 +360,8 @@ public boolean includeDataStreams() { /** * Returns whether network round-trips should be minimized when executing cross-cluster search requests. * Defaults to true. + * + * @return the ccs minimize roundtrips flag */ public boolean isCcsMinimizeRoundtrips() { return ccsMinimizeRoundtrips; @@ -342,6 +369,8 @@ public boolean isCcsMinimizeRoundtrips() { /** * A comma separated list of routing values to control the shards the search will be executed on. + * + * @return the routing */ public String routing() { return this.routing; @@ -349,6 +378,9 @@ public String routing() { /** * A comma separated list of routing values to control the shards the search will be executed on. + * + * @param routing the routing value + * @return the routing */ public SearchRequest routing(String routing) { this.routing = routing; @@ -360,18 +392,29 @@ public SearchRequest routing(String routing) { * {@code _local} to prefer local shards, {@code _primary} to execute only on primary shards, * or a custom value, which guarantees that the same order * will be used across different requests. + * + * @param preference the preference + * @return the preference */ public SearchRequest preference(String preference) { this.preference = preference; return this; } + /** + * Returns the preference. + * + * @return the preference + */ public String preference() { return this.preference; } /** * The search type to execute, defaults to {@link SearchType#DEFAULT}. + * + * @param searchType the search type + * @return this instance */ public SearchRequest searchType(SearchType searchType) { this.searchType = Objects.requireNonNull(searchType, "searchType must not be null"); @@ -382,6 +425,9 @@ public SearchRequest searchType(SearchType searchType) { * The a string representation search type to execute, defaults to {@link SearchType#DEFAULT}. Can be * one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch", * "query_then_fetch"/"queryThenFetch", and "query_and_fetch"/"queryAndFetch". + * + * @param searchType the search type + * @return this instance */ public SearchRequest searchType(String searchType) { return searchType(SearchType.fromString(searchType)); @@ -389,6 +435,9 @@ public SearchRequest searchType(String searchType) { /** * The source of the search request. + * + * @param sourceBuilder the source builder + * @return the source */ public SearchRequest source(SearchSourceBuilder sourceBuilder) { this.source = Objects.requireNonNull(sourceBuilder, "source must not be null"); @@ -397,11 +446,18 @@ public SearchRequest source(SearchSourceBuilder sourceBuilder) { /** * The search source to execute. + * + * @return the source */ public SearchSourceBuilder source() { return source; } + /** + * Returns the point in time builder. + * + * @return the point in time builder + */ public PointInTimeBuilder pointInTimeBuilder() { if (source != null) { return source.pointInTimeBuilder(); @@ -411,6 +467,8 @@ public PointInTimeBuilder pointInTimeBuilder() { /** * The type of search to execute. + * + * @return this instance */ public SearchType searchType() { return searchType; @@ -426,6 +484,8 @@ public String[] indices() { /** * If set, will enable scrolling of the search request. + * + * @return this instance */ public Scroll scroll() { return scroll; @@ -433,6 +493,9 @@ public Scroll scroll() { /** * If set, will enable scrolling of the search request. + * + * @param scroll the scroll + * @return this instance */ public SearchRequest scroll(Scroll scroll) { this.scroll = scroll; @@ -441,15 +504,28 @@ public SearchRequest scroll(Scroll scroll) { /** * If set, will enable scrolling of the search request for the specified timeout. + * + * @param keepAlive the keep alive + * @return this instance */ public SearchRequest scroll(TimeValue keepAlive) { return scroll(new Scroll(keepAlive)); } + /** + * Returns the request cache. + * + * @return the request cache + */ public Boolean requestCache() { return this.requestCache; } + /** + * Returns the allow partial search results. + * + * @return the allow partial search results + */ public Boolean allowPartialSearchResults() { return this.allowPartialSearchResults; } @@ -457,6 +533,8 @@ public Boolean allowPartialSearchResults() { /** * Returns the number of shard results that should be reduced at once on the coordinating node. This value should be used as a * protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. + * + * @return the batched reduce size */ public int getBatchedReduceSize() { return batchedReduceSize; @@ -466,6 +544,8 @@ public int getBatchedReduceSize() { * Returns the number of shard requests that should be executed concurrently on a single node. This value should be used as a * protection mechanism to reduce the number of shard requests fired per high level search request. Searches that hit the entire * cluster can be throttled with this number to reduce the cluster load. The default is {@code 5} + * + * @return the max concurrent shard requests */ public int getMaxConcurrentShardRequests() { return maxConcurrentShardRequests == 0 ? 5 : maxConcurrentShardRequests; @@ -473,6 +553,8 @@ public int getMaxConcurrentShardRequests() { /** * Returns value of user-provided phase_took query parameter for this search request. + * + * @return the phase took flag */ public Boolean isPhaseTook() { return phaseTook; @@ -491,16 +573,28 @@ public Boolean isPhaseTook() { *
  • The request targets one or more read-only index
  • *
  • The primary sort of the query targets an indexed field
  • * + * + * @return the pre filter shard size */ @Nullable public Integer getPreFilterShardSize() { return preFilterShardSize; } + /** + * Returns the cancel after time interval. + * + * @return the cancel after time interval + */ public TimeValue getCancelAfterTimeInterval() { return cancelAfterTimeInterval; } + /** + * Builds the description. + * + * @return the new description + */ public final String buildDescription() { StringBuilder sb = new StringBuilder(); sb.append("indices["); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequestBuilder.java index 62ae376a..7caa82a7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchRequestBuilder.java @@ -64,12 +64,21 @@ @PublicApi(since = "1.0.0") public class SearchRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new SearchRequestBuilder. + * + * @param client the client + * @param action the action + */ public SearchRequestBuilder(OpenSearchClient client, SearchAction action) { super(client, action, new SearchRequest()); } /** * Sets the indices the search will be executed on. + * + * @param indices the indices + * @return this instance */ public SearchRequestBuilder setIndices(String... indices) { request.indices(indices); @@ -80,6 +89,9 @@ public SearchRequestBuilder setIndices(String... indices) { * The a string representation search type to execute, defaults to {@link SearchType#DEFAULT}. Can be * one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch", * "query_then_fetch"/"queryThenFetch", and "query_and_fetch"/"queryAndFetch". + * + * @param searchType the search type + * @return this instance */ public SearchRequestBuilder setSearchType(String searchType) { request.searchType(searchType); @@ -88,6 +100,9 @@ public SearchRequestBuilder setSearchType(String searchType) { /** * If set, will enable scrolling of the search request for the specified timeout. + * + * @param keepAlive the keep alive + * @return this instance */ public SearchRequestBuilder setScroll(TimeValue keepAlive) { request.scroll(keepAlive); @@ -96,6 +111,9 @@ public SearchRequestBuilder setScroll(TimeValue keepAlive) { /** * An optional timeout to control how long search is allowed to take. + * + * @param timeout the timeout + * @return this instance */ public SearchRequestBuilder setTimeout(TimeValue timeout) { sourceBuilder().timeout(timeout); @@ -105,6 +123,9 @@ public SearchRequestBuilder setTimeout(TimeValue timeout) { /** * An optional document count, upon collecting which the search * query will early terminate + * + * @param terminateAfter the terminate after + * @return this instance */ public SearchRequestBuilder setTerminateAfter(int terminateAfter) { sourceBuilder().terminateAfter(terminateAfter); @@ -113,6 +134,9 @@ public SearchRequestBuilder setTerminateAfter(int terminateAfter) { /** * A comma separated list of routing values to control the shards the search will be executed on. + * + * @param routing the routing value + * @return this instance */ public SearchRequestBuilder setRouting(String routing) { request.routing(routing); @@ -124,6 +148,9 @@ public SearchRequestBuilder setRouting(String routing) { * {@code _local} to prefer local shards, {@code _primary} to execute only on primary shards, * or a custom value, which guarantees that the same order * will be used across different requests. + * + * @param preference the preference + * @return this instance */ public SearchRequestBuilder setPreference(String preference) { request.preference(preference); @@ -133,6 +160,8 @@ public SearchRequestBuilder setPreference(String preference) { /** * Constructs a new search source builder with a search query. * + * @param queryBuilder the query builder + * @return this instance * @see org.codelibs.fesen.opensearch.index.query.QueryBuilders */ public SearchRequestBuilder setQuery(QueryBuilder queryBuilder) { @@ -142,6 +171,9 @@ public SearchRequestBuilder setQuery(QueryBuilder queryBuilder) { /** * Sets the minimum score below which docs will be filtered out. + * + * @param minScore the min score + * @return this instance */ public SearchRequestBuilder setMinScore(float minScore) { sourceBuilder().minScore(minScore); @@ -150,6 +182,9 @@ public SearchRequestBuilder setMinScore(float minScore) { /** * From index to start the search from. Defaults to {@code 0}. + * + * @param from the offset + * @return this instance */ public SearchRequestBuilder setFrom(int from) { sourceBuilder().from(from); @@ -158,6 +193,9 @@ public SearchRequestBuilder setFrom(int from) { /** * The number of search hits to return. Defaults to {@code 10}. + * + * @param size the size + * @return this instance */ public SearchRequestBuilder setSize(int size) { sourceBuilder().size(size); @@ -167,6 +205,9 @@ public SearchRequestBuilder setSize(int size) { /** * Should each {@link org.codelibs.fesen.opensearch.search.SearchHit} be returned with an * explanation of the hit (ranking). + * + * @param explain the explain + * @return this instance */ public SearchRequestBuilder setExplain(boolean explain) { sourceBuilder().explain(explain); @@ -176,6 +217,9 @@ public SearchRequestBuilder setExplain(boolean explain) { /** * Should each {@link org.codelibs.fesen.opensearch.search.SearchHit} be returned with its * version. + * + * @param version the version + * @return this instance */ public SearchRequestBuilder setVersion(boolean version) { sourceBuilder().version(version); @@ -185,6 +229,9 @@ public SearchRequestBuilder setVersion(boolean version) { /** * Should each {@link org.codelibs.fesen.opensearch.search.SearchHit} be returned with the * sequence number and primary term of the last modification of the document. + * + * @param seqNoAndPrimaryTerm the seq no and primary term + * @return the seq no and primary term */ public SearchRequestBuilder seqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm) { sourceBuilder().seqNoAndPrimaryTerm(seqNoAndPrimaryTerm); @@ -193,6 +240,9 @@ public SearchRequestBuilder seqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm) { /** * Indicates whether the response should contain the stored _source for every hit + * + * @param fetch the fetch + * @return this instance */ public SearchRequestBuilder setFetchSource(boolean fetch) { sourceBuilder().fetchSource(fetch); @@ -205,6 +255,7 @@ public SearchRequestBuilder setFetchSource(boolean fetch) { * * @param includes An optional list of include (optionally wildcarded) pattern to filter the returned _source * @param excludes An optional list of exclude (optionally wildcarded) pattern to filter the returned _source + * @return this instance */ public SearchRequestBuilder setFetchSource(@Nullable String[] includes, @Nullable String[] excludes) { sourceBuilder().fetchSource(includes, excludes); @@ -216,6 +267,7 @@ public SearchRequestBuilder setFetchSource(@Nullable String[] includes, @Nullabl * * @param field The name of the field * @param order The sort ordering + * @return this instance */ public SearchRequestBuilder addSort(String field, SortOrder order) { sourceBuilder().sort(field, order); @@ -225,6 +277,8 @@ public SearchRequestBuilder addSort(String field, SortOrder order) { /** * Adds a generic sort builder. * + * @param sort the sort + * @return this instance * @see org.codelibs.fesen.opensearch.search.sort.SortBuilders */ public SearchRequestBuilder addSort(SortBuilder sort) { @@ -235,6 +289,9 @@ public SearchRequestBuilder addSort(SortBuilder sort) { /** * Set the sort values that indicates which docs this request should "search after". * + * @param values the values + * + * @return this instance */ public SearchRequestBuilder searchAfter(Object[] values) { sourceBuilder().searchAfter(values); @@ -245,6 +302,9 @@ public SearchRequestBuilder searchAfter(Object[] values) { * Indicates if the total hit count for the query should be tracked. Requests will count total hit count accurately * up to 10,000 by default, see {@link #setTrackTotalHitsUpTo(int)} to change this value or set to true/false to always/never * count accurately. + * + * @param trackTotalHits the track total hits + * @return this instance */ public SearchRequestBuilder setTrackTotalHits(boolean trackTotalHits) { sourceBuilder().trackTotalHits(trackTotalHits); @@ -253,6 +313,9 @@ public SearchRequestBuilder setTrackTotalHits(boolean trackTotalHits) { /** * Indicates the total hit count that should be tracked accurately or null if the value is unset. Defaults to 10,000. + * + * @param trackTotalHitsUpTo the track total hits up to + * @return this instance */ public SearchRequestBuilder setTrackTotalHitsUpTo(int trackTotalHitsUpTo) { sourceBuilder().trackTotalHitsUpTo(trackTotalHitsUpTo); @@ -261,12 +324,21 @@ public SearchRequestBuilder setTrackTotalHitsUpTo(int trackTotalHitsUpTo) { /** * Adds an aggregation to the search operation. + * + * @param aggregation the aggregation + * @return this instance */ public SearchRequestBuilder addAggregation(AggregationBuilder aggregation) { sourceBuilder().aggregation(aggregation); return this; } + /** + * Returns the highlighter. + * + * @param highlightBuilder the highlight builder + * @return the highlighter + */ public SearchRequestBuilder highlighter(HighlightBuilder highlightBuilder) { sourceBuilder().highlighter(highlightBuilder); return this; @@ -296,6 +368,12 @@ public SearchRequestBuilder addRescorer(RescorerBuilder rescorer) { return this; } + /** + * Sets the collapse. + * + * @param collapse the collapse + * @return this instance + */ public SearchRequestBuilder setCollapse(CollapseBuilder collapse) { sourceBuilder().collapse(collapse); return this; @@ -303,6 +381,9 @@ public SearchRequestBuilder setCollapse(CollapseBuilder collapse) { /** * If specified, OpenSearch will execute this search request using reader contexts from that point in time. + * + * @param pointInTimeBuilder the point in time builder + * @return this instance */ public SearchRequestBuilder setPointInTime(PointInTimeBuilder pointInTimeBuilder) { sourceBuilder().pointInTimeBuilder(pointInTimeBuilder); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponse.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponse.java index 772cead6..d7e4a1a6 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponse.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponse.java @@ -103,6 +103,12 @@ public class SearchResponse extends ActionResponse implements StatusToXContentOb private final long tookInMillis; private final PhaseTook phaseTook; + /** + * Creates a new SearchResponse by reading it from the given input. + * + * @param in the input to read from + * @throws IOException if an I/O error occurs + */ public SearchResponse(StreamInput in) throws IOException { super(in); internalResponse = new InternalSearchResponse(in); @@ -192,6 +198,20 @@ public SearchResponse( ); } + /** + * Creates a new SearchResponse. + * + * @param internalResponse the internal response + * @param scrollId the scroll identifier + * @param totalShards the total shards + * @param successfulShards the successful shards + * @param skippedShards the skipped shards + * @param tookInMillis the took in milliseconds + * @param phaseTook the phase took + * @param shardFailures the shard failures + * @param clusters the clusters + * @param pointInTimeId the point in time identifier + */ public SearchResponse( SearchResponseSections internalResponse, String scrollId, @@ -229,17 +249,26 @@ public RestStatus status() { /** * The search hits. + * + * @return the hits */ public SearchHits getHits() { return internalResponse.hits(); } + /** + * Returns the aggregations. + * + * @return the aggregations + */ public Aggregations getAggregations() { return internalResponse.aggregations(); } /** * Has the search operation timed out. + * + * @return the timed out flag */ public boolean isTimedOut() { return internalResponse.timedOut(); @@ -248,6 +277,8 @@ public boolean isTimedOut() { /** * Has the search operation terminated early due to reaching * terminateAfter + * + * @return the terminated early flag */ public Boolean isTerminatedEarly() { return internalResponse.terminatedEarly(); @@ -255,6 +286,8 @@ public Boolean isTerminatedEarly() { /** * Returns the number of reduce phases applied to obtain this search response + * + * @return the num reduce phases */ public int getNumReducePhases() { return internalResponse.getNumReducePhases(); @@ -262,6 +295,8 @@ public int getNumReducePhases() { /** * How long the search took. + * + * @return the took */ public TimeValue getTook() { return new TimeValue(tookInMillis); @@ -269,6 +304,8 @@ public TimeValue getTook() { /** * The total number of shards the search was executed on. + * + * @return the total shards */ public int getTotalShards() { return totalShards; @@ -276,6 +313,8 @@ public int getTotalShards() { /** * The successful number of shards the search was executed on. + * + * @return the successful shards */ public int getSuccessfulShards() { return successfulShards; @@ -283,6 +322,8 @@ public int getSuccessfulShards() { /** * The number of shards skipped due to pre-filtering + * + * @return the skipped shards */ public int getSkippedShards() { return skippedShards; @@ -290,6 +331,8 @@ public int getSkippedShards() { /** * The failed number of shards the search was executed on. + * + * @return the failed shards */ public int getFailedShards() { // we don't return totalShards - successfulShards, we don't count "no shards available" as a failed shard, just don't @@ -299,6 +342,8 @@ public int getFailedShards() { /** * The failures that occurred during the search. + * + * @return the shard failures */ public ShardSearchFailure[] getShardFailures() { return this.shardFailures; @@ -307,6 +352,8 @@ public ShardSearchFailure[] getShardFailures() { /** * If scrolling was enabled ({@link SearchRequest#scroll(org.codelibs.fesen.opensearch.search.Scroll)}, the * scroll id that can be used to continue scrolling. + * + * @return the scroll identifier */ public String getScrollId() { return scrollId; @@ -320,6 +367,14 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Returns the inner to XContent. + * + * @param builder the content builder + * @param params the serialization parameters + * @return the inner to XContent + * @throws IOException if an I/O error occurs + */ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) throws IOException { if (scrollId != null) { builder.field(SCROLL_ID.getPreferredName(), scrollId); @@ -353,12 +408,26 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static SearchResponse fromXContent(XContentParser parser) throws IOException { ensureExpectedToken(Token.START_OBJECT, parser.nextToken(), parser); parser.nextToken(); return innerFromXContent(parser); } + /** + * Returns the inner from XContent. + * + * @param parser the parser + * @return the inner from XContent + * @throws IOException if an I/O error occurs + */ public static SearchResponse innerFromXContent(XContentParser parser) throws IOException { ensureExpectedToken(Token.FIELD_NAME, parser.currentToken(), parser); String currentFieldName = parser.currentName(); @@ -572,6 +641,9 @@ public String toString() { @PublicApi(since = "1.0.0") public static class Clusters implements ToXContentFragment, Writeable { + /** + * The EMPTY constant. + */ public static final Clusters EMPTY = new Clusters(0, 0, 0); static final ParseField _CLUSTERS_FIELD = new ParseField("_clusters"); @@ -583,6 +655,13 @@ public static class Clusters implements ToXContentFragment, Writeable { private final int successful; private final int skipped; + /** + * Creates a new Clusters. + * + * @param total the total + * @param successful the successful + * @param skipped the skipped + */ public Clusters(int total, int successful, int skipped) { assert total >= 0 && successful >= 0 && skipped >= 0 : "total: " + total @@ -658,6 +737,11 @@ public static class PhaseTook implements ToXContentFragment, Writeable { static final ParseField PHASE_TOOK = new ParseField("phase_took"); private final Map phaseTookMap; + /** + * Creates a new PhaseTook. + * + * @param phaseTookMap the phase took map + */ public PhaseTook(Map phaseTookMap) { this.phaseTookMap = phaseTookMap; } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponseSections.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponseSections.java index 6e2e85ca..60e6446e 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponseSections.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchResponseSections.java @@ -65,18 +65,64 @@ @PublicApi(since = "1.0.0") public class SearchResponseSections implements ToXContentFragment { + /** + * The EXT_FIELD constant. + */ public static final ParseField EXT_FIELD = new ParseField("ext"); + /** + * The PROCESSOR_RESULT_FIELD constant. + */ public static final ParseField PROCESSOR_RESULT_FIELD = new ParseField("processor_results"); + /** + * The hits. + */ protected final SearchHits hits; + /** + * The aggregations. + */ protected final Aggregations aggregations; + /** + * The suggest. + */ protected final Suggest suggest; + /** + * The profile results. + */ protected final SearchProfileShardResults profileResults; + /** + * The timed out. + */ protected final boolean timedOut; + /** + * The terminated early. + */ protected final Boolean terminatedEarly; + /** + * The num reduce phases. + */ protected final int numReducePhases; + /** + * The search ext builders. + */ protected final List searchExtBuilders = new ArrayList<>(); + /** + * The processor result. + */ protected final List processorResult = new ArrayList<>(); + /** + * Creates a new SearchResponseSections. + * + * @param hits the hits + * @param aggregations the aggregations + * @param suggest the suggest + * @param timedOut the timed out + * @param terminatedEarly the terminated early + * @param profileResults the profile results + * @param numReducePhases the num reduce phases + * @param searchExtBuilders the search ext builders + * @param processorResult the processor result + */ public SearchResponseSections( SearchHits hits, Aggregations aggregations, @@ -99,24 +145,46 @@ public SearchResponseSections( this.searchExtBuilders.addAll(Objects.requireNonNull(searchExtBuilders, "searchExtBuilders must not be null")); } + /** + * Returns the timed out. + * + * @return the timed out + */ public final boolean timedOut() { return this.timedOut; } + /** + * Returns the terminated early. + * + * @return the terminated early + */ public final Boolean terminatedEarly() { return this.terminatedEarly; } + /** + * Returns the hits. + * + * @return the hits + */ public final SearchHits hits() { return hits; } + /** + * Returns the aggregations. + * + * @return the aggregations + */ public final Aggregations aggregations() { return aggregations; } /** * Returns the number of reduce phases applied to obtain this search response + * + * @return the num reduce phases */ public final int getNumReducePhases() { return numReducePhases; @@ -148,6 +216,12 @@ public final XContentBuilder toXContent(XContentBuilder builder, Params params) return builder; } + /** + * Writes this instance to the given output. + * + * @param out the output to write to + * @throws IOException if an I/O error occurs + */ protected void writeTo(StreamOutput out) throws IOException { throw new UnsupportedOperationException(); } diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollAction.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollAction.java index 84424bb1..62ab964f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollAction.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollAction.java @@ -41,7 +41,13 @@ */ public class SearchScrollAction extends ActionType { + /** + * The INSTANCE constant. + */ public static final SearchScrollAction INSTANCE = new SearchScrollAction(); + /** + * The NAME constant. + */ public static final String NAME = "indices:data/read/scroll"; private SearchScrollAction() { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequest.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequest.java index ce57c330..32e9d1c7 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequest.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequest.java @@ -60,8 +60,16 @@ public class SearchScrollRequest extends ActionRequest implements ToXContentObje private String scrollId; private Scroll scroll; + /** + * Creates a new SearchScrollRequest. + */ public SearchScrollRequest() {} + /** + * Creates a new SearchScrollRequest. + * + * @param scrollId the scroll identifier + */ public SearchScrollRequest(String scrollId) { this.scrollId = scrollId; } @@ -84,6 +92,8 @@ public ActionRequestValidationException validate() { /** * The scroll id used to scroll the search. + * + * @return this instance */ public String scrollId() { return scrollId; @@ -91,6 +101,8 @@ public String scrollId() { /** * If set, will enable scrolling of the search request. + * + * @return this instance */ public Scroll scroll() { return scroll; @@ -98,6 +110,9 @@ public Scroll scroll() { /** * If set, will enable scrolling of the search request. + * + * @param scroll the scroll + * @return this instance */ public SearchScrollRequest scroll(Scroll scroll) { this.scroll = scroll; @@ -106,6 +121,9 @@ public SearchScrollRequest scroll(Scroll scroll) { /** * If set, will enable scrolling of the search request for the specified timeout. + * + * @param keepAlive the keep alive + * @return this instance */ public SearchScrollRequest scroll(TimeValue keepAlive) { return scroll(new Scroll(keepAlive)); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequestBuilder.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequestBuilder.java index e8edc4a7..93e4a2b2 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequestBuilder.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchScrollRequestBuilder.java @@ -46,12 +46,22 @@ @PublicApi(since = "1.0.0") public class SearchScrollRequestBuilder extends ActionRequestBuilder { + /** + * Creates a new SearchScrollRequestBuilder. + * + * @param client the client + * @param action the action + * @param scrollId the scroll identifier + */ public SearchScrollRequestBuilder(OpenSearchClient client, SearchScrollAction action, String scrollId) { super(client, action, new SearchScrollRequest(scrollId)); } /** * If set, will enable scrolling of the search request for the specified timeout. + * + * @param keepAlive the keep alive + * @return this instance */ public SearchScrollRequestBuilder setScroll(TimeValue keepAlive) { request.scroll(keepAlive); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchType.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchType.java index 404caf80..a587101f 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchType.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/SearchType.java @@ -74,6 +74,8 @@ public enum SearchType { /** * The internal id of the type. + * + * @return the identifier */ public byte id() { return this.id; @@ -81,6 +83,9 @@ public byte id() { /** * Constructs search type based on the internal id. + * + * @param id the identifier + * @return the new identifier */ public static SearchType fromId(byte id) { if (id == 0) { @@ -97,6 +102,9 @@ public static SearchType fromId(byte id) { * The a string representation search type to execute, defaults to {@link SearchType#DEFAULT}. Can be * one of "dfs_query_then_fetch"/"dfsQueryThenFetch", "dfs_query_and_fetch"/"dfsQueryAndFetch", * "query_then_fetch"/"queryThenFetch" and "query_and_fetch"/"queryAndFetch". + * + * @param searchType the search type + * @return the new string */ public static SearchType fromString(String searchType) { if (searchType == null) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/search/ShardSearchFailure.java b/src/main/java/org/codelibs/fesen/opensearch/action/search/ShardSearchFailure.java index 4f37e31e..7667fd27 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/search/ShardSearchFailure.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/search/ShardSearchFailure.java @@ -67,6 +67,9 @@ public class ShardSearchFailure extends ShardOperationFailedException { private static final String INDEX_FIELD = "index"; private static final String SHARD_FIELD = "shard"; + /** + * The EMPTY_ARRAY constant. + */ public static final ShardSearchFailure[] EMPTY_ARRAY = new ShardSearchFailure[0]; private SearchShardTarget shardTarget; @@ -91,6 +94,12 @@ public ShardSearchFailure(Exception e) { this(e, null); } + /** + * Creates a new ShardSearchFailure. + * + * @param e the exception + * @param shardTarget the shard target + */ public ShardSearchFailure(Exception e, @Nullable SearchShardTarget shardTarget) { this(e, ExceptionsHelper.unwrapCause(e), shardTarget); } @@ -113,6 +122,8 @@ private ShardSearchFailure(final Exception e, final Throwable unwrappedCause, @N /** * The search shard target the failure occurred on. + * + * @return the shard */ @Nullable public SearchShardTarget shard() { @@ -130,6 +141,13 @@ public String toString() { + "]"; } + /** + * Reads the shard search failure. + * + * @param in the input to read from + * @return the shard search failure + * @throws IOException if an I/O error occurs + */ public static ShardSearchFailure readShardSearchFailure(StreamInput in) throws IOException { return new ShardSearchFailure(in); @@ -161,6 +179,13 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Parses an instance from the given parser. + * + * @param parser the parser + * @return the new XContent + * @throws IOException if an I/O error occurs + */ public static ShardSearchFailure fromXContent(XContentParser parser) throws IOException { XContentParser.Token token; ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser); diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/support/ActiveShardCount.java b/src/main/java/org/codelibs/fesen/opensearch/action/support/ActiveShardCount.java index ccf83e6d..812e90be 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/support/ActiveShardCount.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/support/ActiveShardCount.java @@ -57,9 +57,21 @@ public final class ActiveShardCount implements Writeable { private static final int ACTIVE_SHARD_COUNT_DEFAULT = -2; private static final int ALL_ACTIVE_SHARDS = -1; + /** + * The DEFAULT constant. + */ public static final ActiveShardCount DEFAULT = new ActiveShardCount(ACTIVE_SHARD_COUNT_DEFAULT); + /** + * The ALL constant. + */ public static final ActiveShardCount ALL = new ActiveShardCount(ALL_ACTIVE_SHARDS); + /** + * The NONE constant. + */ public static final ActiveShardCount NONE = new ActiveShardCount(0); + /** + * The ONE constant. + */ public static final ActiveShardCount ONE = new ActiveShardCount(1); private final int value; @@ -73,6 +85,9 @@ private ActiveShardCount(final int value) { * it is a valid shard count and throws an IllegalArgumentException if validation fails. Valid * values are any non-negative number. Directly use {@link ActiveShardCount#DEFAULT} for the * default value (which is one shard copy) or {@link ActiveShardCount#ALL} to specify all the shards. + * + * @param value the value + * @return the new instance */ public static ActiveShardCount from(final int value) { if (value < 0) { @@ -83,6 +98,9 @@ public static ActiveShardCount from(final int value) { /** * Validates that the instance is valid for the given number of replicas in an index. + * + * @param numberOfReplicas the number of replicas + * @return this instance */ public boolean validate(final int numberOfReplicas) { assert numberOfReplicas >= 0; @@ -110,6 +128,13 @@ public void writeTo(final StreamOutput out) throws IOException { out.writeInt(value); } + /** + * Reads this instance from the given input. + * + * @param in the input to read from + * @return the from + * @throws IOException if an I/O error occurs + */ public static ActiveShardCount readFrom(final StreamInput in) throws IOException { return get(in.readInt()); } @@ -119,6 +144,9 @@ public static ActiveShardCount readFrom(final StreamInput in) throws IOException * all shard copies, null for the default value (which defaults to one shard copy), * or a numeric value greater than or equal to 0. Any other input will throw an * IllegalArgumentException. + * + * @param str the str + * @return this instance */ public static ActiveShardCount parseString(final String str) { if (str == null) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/support/AdapterActionFuture.java b/src/main/java/org/codelibs/fesen/opensearch/action/support/AdapterActionFuture.java index 71638d3e..4e692d2d 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/support/AdapterActionFuture.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/support/AdapterActionFuture.java @@ -45,9 +45,16 @@ /** * Future adapter action * + * @param the element type + * @param the l type * @opensearch.internal */ public abstract class AdapterActionFuture extends BaseFuture implements ActionFuture, ActionListener { + /** + * Creates a new AdapterActionFuture. + */ + public AdapterActionFuture() { + } @Override public T actionGet() { @@ -92,6 +99,12 @@ public void onFailure(Exception e) { setException(e); } + /** + * Converts this instance. + * + * @param listenerResponse the listener response + * @return this instance + */ protected abstract T convert(L listenerResponse); private static RuntimeException unwrapEsException(OpenSearchException esEx) { diff --git a/src/main/java/org/codelibs/fesen/opensearch/action/support/IndicesOptions.java b/src/main/java/org/codelibs/fesen/opensearch/action/support/IndicesOptions.java index 647a0414..8d67f0ff 100644 --- a/src/main/java/org/codelibs/fesen/opensearch/action/support/IndicesOptions.java +++ b/src/main/java/org/codelibs/fesen/opensearch/action/support/IndicesOptions.java @@ -66,12 +66,32 @@ public class IndicesOptions implements ToXContentFragment { */ @PublicApi(since = "1.0.0") public enum WildcardStates { + /** + * The OPEN value. + */ OPEN, + /** + * The CLOSED value. + */ CLOSED, + /** + * The HIDDEN value. + */ HIDDEN; + /** + * The NONE constant. + */ public static final EnumSet NONE = EnumSet.noneOf(WildcardStates.class); + /** + * Writes this instance to the given content builder. + * + * @param states the states + * @param builder the content builder + * @return the XContent + * @throws IOException if an I/O error occurs + */ public static XContentBuilder toXContent(EnumSet states, XContentBuilder builder) throws IOException { if (states.isEmpty()) { builder.field("expand_wildcards", "none"); @@ -93,60 +113,117 @@ public static XContentBuilder toXContent(EnumSet states, XConten * @opensearch.internal */ public enum Option { + /** + * The IGNORE_UNAVAILABLE value. + */ IGNORE_UNAVAILABLE, + /** + * The IGNORE_ALIASES value. + */ IGNORE_ALIASES, + /** + * The ALLOW_NO_INDICES value. + */ ALLOW_NO_INDICES, + /** + * The FORBID_ALIASES_TO_MULTIPLE_INDICES value. + */ FORBID_ALIASES_TO_MULTIPLE_INDICES, + /** + * The FORBID_CLOSED_INDICES value. + */ FORBID_CLOSED_INDICES, + /** + * The IGNORE_THROTTLED value. + */ IGNORE_THROTTLED; + /** + * The NONE constant. + */ public static final EnumSet