42
42
import java .util .Iterator ;
43
43
import java .util .List ;
44
44
import java .util .Map ;
45
+ import java .util .Objects ;
45
46
46
47
public class VerifyRepositoryIntegrityAction extends ActionType <VerifyRepositoryIntegrityAction .Response > {
47
48
@@ -55,6 +56,7 @@ private VerifyRepositoryIntegrityAction() {
55
56
public static class Request extends MasterNodeReadRequest <Request > {
56
57
57
58
private final String repository ;
59
+ private final String [] indices ;
58
60
private final int threadpoolConcurrency ;
59
61
private final int snapshotVerificationConcurrency ;
60
62
private final int indexVerificationConcurrency ;
@@ -64,6 +66,7 @@ public static class Request extends MasterNodeReadRequest<Request> {
64
66
65
67
public Request (
66
68
String repository ,
69
+ String [] indices ,
67
70
int threadpoolConcurrency ,
68
71
int snapshotVerificationConcurrency ,
69
72
int indexVerificationConcurrency ,
@@ -72,6 +75,7 @@ public Request(
72
75
boolean permitMissingSnapshotDetails
73
76
) {
74
77
this .repository = repository ;
78
+ this .indices = Objects .requireNonNull (indices , "indices" );
75
79
this .threadpoolConcurrency = requireMin ("threadpoolConcurrency" , 0 , threadpoolConcurrency );
76
80
this .snapshotVerificationConcurrency = requireMin ("snapshotVerificationConcurrency" , 1 , snapshotVerificationConcurrency );
77
81
this .indexVerificationConcurrency = requireMin ("indexVerificationConcurrency" , 1 , indexVerificationConcurrency );
@@ -94,6 +98,7 @@ private static int requireMin(String name, int min, int value) {
94
98
public Request (StreamInput in ) throws IOException {
95
99
super (in );
96
100
this .repository = in .readString ();
101
+ this .indices = in .readStringArray ();
97
102
this .threadpoolConcurrency = in .readVInt ();
98
103
this .snapshotVerificationConcurrency = in .readVInt ();
99
104
this .indexVerificationConcurrency = in .readVInt ();
@@ -106,6 +111,7 @@ public Request(StreamInput in) throws IOException {
106
111
public void writeTo (StreamOutput out ) throws IOException {
107
112
super .writeTo (out );
108
113
out .writeString (repository );
114
+ out .writeStringArray (indices );
109
115
out .writeVInt (threadpoolConcurrency );
110
116
out .writeVInt (snapshotVerificationConcurrency );
111
117
out .writeVInt (indexVerificationConcurrency );
@@ -124,6 +130,14 @@ public Task createTask(long id, String type, String action, TaskId parentTaskId,
124
130
return new CancellableTask (id , type , action , getDescription (), parentTaskId , headers );
125
131
}
126
132
133
+ public String getRepository () {
134
+ return repository ;
135
+ }
136
+
137
+ public String [] getIndices () {
138
+ return indices ;
139
+ }
140
+
127
141
public int getThreadpoolConcurrency () {
128
142
return threadpoolConcurrency ;
129
143
}
@@ -152,6 +166,7 @@ public Request withDefaultThreadpoolConcurrency(Settings settings) {
152
166
if (threadpoolConcurrency == 0 ) {
153
167
final var request = new Request (
154
168
repository ,
169
+ indices ,
155
170
Math .max (1 , EsExecutors .allocatedProcessors (settings ) / 2 ),
156
171
snapshotVerificationConcurrency ,
157
172
indexVerificationConcurrency ,
@@ -249,7 +264,7 @@ protected ClusterBlockException checkBlock(Request request, ClusterState state)
249
264
protected void masterOperation (Task task , Request request , ClusterState state , ActionListener <Response > listener ) throws Exception {
250
265
// TODO add mechanism to block blob deletions while this is running
251
266
final var cancellableTask = (CancellableTask ) task ;
252
- repositoriesService .repository (request .repository )
267
+ repositoriesService .repository (request .getRepository () )
253
268
.verifyMetadataIntegrity (
254
269
request .withDefaultThreadpoolConcurrency (clusterService .getSettings ()),
255
270
listener .map (Response ::new ),
0 commit comments