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 extends OpenSearchException>,
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 extends OpenSearchException> 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 extends Throwable> 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 extends Throwable> 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