|
@@ -9,35 +9,25 @@
|
|
|
package org.elasticsearch.action.admin.indices.close;
|
|
|
|
|
|
import org.elasticsearch.action.support.ActiveShardCount;
|
|
|
-import org.elasticsearch.cluster.ack.IndicesClusterStateUpdateRequest;
|
|
|
+import org.elasticsearch.core.TimeValue;
|
|
|
+import org.elasticsearch.index.Index;
|
|
|
+
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* Cluster state update request that allows to close one or more indices
|
|
|
*/
|
|
|
-public class CloseIndexClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest<CloseIndexClusterStateUpdateRequest> {
|
|
|
-
|
|
|
- private long taskId;
|
|
|
- private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
|
|
|
-
|
|
|
- public CloseIndexClusterStateUpdateRequest(final long taskId) {
|
|
|
- this.taskId = taskId;
|
|
|
- }
|
|
|
-
|
|
|
- public long taskId() {
|
|
|
- return taskId;
|
|
|
- }
|
|
|
-
|
|
|
- public CloseIndexClusterStateUpdateRequest taskId(final long taskId) {
|
|
|
- this.taskId = taskId;
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
- public ActiveShardCount waitForActiveShards() {
|
|
|
- return waitForActiveShards;
|
|
|
- }
|
|
|
-
|
|
|
- public CloseIndexClusterStateUpdateRequest waitForActiveShards(final ActiveShardCount waitForActiveShards) {
|
|
|
- this.waitForActiveShards = waitForActiveShards;
|
|
|
- return this;
|
|
|
+public record CloseIndexClusterStateUpdateRequest(
|
|
|
+ TimeValue masterNodeTimeout,
|
|
|
+ TimeValue ackTimeout,
|
|
|
+ long taskId,
|
|
|
+ ActiveShardCount waitForActiveShards,
|
|
|
+ Index[] indices
|
|
|
+) {
|
|
|
+ public CloseIndexClusterStateUpdateRequest {
|
|
|
+ Objects.requireNonNull(masterNodeTimeout);
|
|
|
+ Objects.requireNonNull(ackTimeout);
|
|
|
+ Objects.requireNonNull(waitForActiveShards);
|
|
|
+ Objects.requireNonNull(indices);
|
|
|
}
|
|
|
}
|