@@ -73,92 +73,92 @@ protected ClusterHealthResponse newResponse() {
73
73
@ Override
74
74
protected ClusterHealthResponse masterOperation (ClusterHealthRequest request , ClusterState unusedState ) throws ElasticSearchException {
75
75
int waitFor = 5 ;
76
- if (request .getWaitForStatus () == null ) {
76
+ if (request .waitForStatus () == null ) {
77
77
waitFor --;
78
78
}
79
- if (request .getWaitForRelocatingShards () == -1 ) {
79
+ if (request .waitForRelocatingShards () == -1 ) {
80
80
waitFor --;
81
81
}
82
- if (request .getWaitForActiveShards () == -1 ) {
82
+ if (request .waitForActiveShards () == -1 ) {
83
83
waitFor --;
84
84
}
85
- if (request .getWaitForNodes ().isEmpty ()) {
85
+ if (request .waitForNodes ().isEmpty ()) {
86
86
waitFor --;
87
87
}
88
- if (request .getIndices ().length == 0 ) { // check that they actually exists in the meta data
88
+ if (request .indices ().length == 0 ) { // check that they actually exists in the meta data
89
89
waitFor --;
90
90
}
91
91
if (waitFor == 0 ) {
92
92
// no need to wait for anything
93
93
ClusterState clusterState = clusterService .state ();
94
94
return clusterHealth (request , clusterState );
95
95
}
96
- long endTime = System .currentTimeMillis () + request .getTimeout ().millis ();
96
+ long endTime = System .currentTimeMillis () + request .timeout ().millis ();
97
97
while (true ) {
98
98
int waitForCounter = 0 ;
99
99
ClusterState clusterState = clusterService .state ();
100
100
ClusterHealthResponse response = clusterHealth (request , clusterState );
101
- if (request .getWaitForStatus () != null && response .getStatus ().value () <= request .getWaitForStatus ().value ()) {
101
+ if (request .waitForStatus () != null && response .getStatus ().value () <= request .waitForStatus ().value ()) {
102
102
waitForCounter ++;
103
103
}
104
- if (request .getWaitForRelocatingShards () != -1 && response .getRelocatingShards () <= request .getWaitForRelocatingShards ()) {
104
+ if (request .waitForRelocatingShards () != -1 && response .getRelocatingShards () <= request .waitForRelocatingShards ()) {
105
105
waitForCounter ++;
106
106
}
107
- if (request .getWaitForActiveShards () != -1 && response .getActiveShards () >= request .getWaitForActiveShards ()) {
107
+ if (request .waitForActiveShards () != -1 && response .getActiveShards () >= request .waitForActiveShards ()) {
108
108
waitForCounter ++;
109
109
}
110
- if (request .getIndices ().length > 0 ) {
110
+ if (request .indices ().length > 0 ) {
111
111
try {
112
- clusterState .metaData ().concreteIndices (request .getIndices ());
112
+ clusterState .metaData ().concreteIndices (request .indices ());
113
113
waitForCounter ++;
114
114
} catch (IndexMissingException e ) {
115
115
response .status = ClusterHealthStatus .RED ; // no indices, make sure its RED
116
116
// missing indices, wait a bit more...
117
117
}
118
118
}
119
- if (!request .getWaitForNodes ().isEmpty ()) {
120
- if (request .getWaitForNodes ().startsWith (">=" )) {
121
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (2 ));
119
+ if (!request .waitForNodes ().isEmpty ()) {
120
+ if (request .waitForNodes ().startsWith (">=" )) {
121
+ int expected = Integer .parseInt (request .waitForNodes ().substring (2 ));
122
122
if (response .getNumberOfNodes () >= expected ) {
123
123
waitForCounter ++;
124
124
}
125
- } else if (request .getWaitForNodes ().startsWith ("ge(" )) {
126
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (3 , request .getWaitForNodes ().length () - 1 ));
125
+ } else if (request .waitForNodes ().startsWith ("ge(" )) {
126
+ int expected = Integer .parseInt (request .waitForNodes ().substring (3 , request .waitForNodes ().length () - 1 ));
127
127
if (response .getNumberOfNodes () >= expected ) {
128
128
waitForCounter ++;
129
129
}
130
- } else if (request .getWaitForNodes ().startsWith ("<=" )) {
131
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (2 ));
130
+ } else if (request .waitForNodes ().startsWith ("<=" )) {
131
+ int expected = Integer .parseInt (request .waitForNodes ().substring (2 ));
132
132
if (response .getNumberOfNodes () <= expected ) {
133
133
waitForCounter ++;
134
134
}
135
- } else if (request .getWaitForNodes ().startsWith ("le(" )) {
136
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (3 , request .getWaitForNodes ().length () - 1 ));
135
+ } else if (request .waitForNodes ().startsWith ("le(" )) {
136
+ int expected = Integer .parseInt (request .waitForNodes ().substring (3 , request .waitForNodes ().length () - 1 ));
137
137
if (response .getNumberOfNodes () <= expected ) {
138
138
waitForCounter ++;
139
139
}
140
- } else if (request .getWaitForNodes ().startsWith (">" )) {
141
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (1 ));
140
+ } else if (request .waitForNodes ().startsWith (">" )) {
141
+ int expected = Integer .parseInt (request .waitForNodes ().substring (1 ));
142
142
if (response .getNumberOfNodes () > expected ) {
143
143
waitForCounter ++;
144
144
}
145
- } else if (request .getWaitForNodes ().startsWith ("gt(" )) {
146
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (3 , request .getWaitForNodes ().length () - 1 ));
145
+ } else if (request .waitForNodes ().startsWith ("gt(" )) {
146
+ int expected = Integer .parseInt (request .waitForNodes ().substring (3 , request .waitForNodes ().length () - 1 ));
147
147
if (response .getNumberOfNodes () > expected ) {
148
148
waitForCounter ++;
149
149
}
150
- } else if (request .getWaitForNodes ().startsWith ("<" )) {
151
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (1 ));
150
+ } else if (request .waitForNodes ().startsWith ("<" )) {
151
+ int expected = Integer .parseInt (request .waitForNodes ().substring (1 ));
152
152
if (response .getNumberOfNodes () < expected ) {
153
153
waitForCounter ++;
154
154
}
155
- } else if (request .getWaitForNodes ().startsWith ("lt(" )) {
156
- int expected = Integer .parseInt (request .getWaitForNodes ().substring (3 , request .getWaitForNodes ().length () - 1 ));
155
+ } else if (request .waitForNodes ().startsWith ("lt(" )) {
156
+ int expected = Integer .parseInt (request .waitForNodes ().substring (3 , request .waitForNodes ().length () - 1 ));
157
157
if (response .getNumberOfNodes () < expected ) {
158
158
waitForCounter ++;
159
159
}
160
160
} else {
161
- int expected = Integer .parseInt (request .getWaitForNodes ());
161
+ int expected = Integer .parseInt (request .waitForNodes ());
162
162
if (response .getNumberOfNodes () == expected ) {
163
163
waitForCounter ++;
164
164
}
@@ -190,7 +190,7 @@ private ClusterHealthResponse clusterHealth(ClusterHealthRequest request, Cluste
190
190
response .numberOfNodes = clusterState .nodes ().size ();
191
191
response .numberOfDataNodes = clusterState .nodes ().dataNodes ().size ();
192
192
193
- for (String index : clusterState .metaData ().concreteIndicesIgnoreMissing (request .getIndices ())) {
193
+ for (String index : clusterState .metaData ().concreteIndicesIgnoreMissing (request .indices ())) {
194
194
IndexRoutingTable indexRoutingTable = clusterState .routingTable ().index (index );
195
195
IndexMetaData indexMetaData = clusterState .metaData ().index (index );
196
196
if (indexRoutingTable == null ) {
0 commit comments