19
19
20
20
package org .elasticsearch .client ;
21
21
22
+ import org .apache .http .util .EntityUtils ;
22
23
import org .elasticsearch .ElasticsearchException ;
23
24
import org .elasticsearch .action .admin .cluster .health .ClusterHealthRequest ;
24
25
import org .elasticsearch .action .admin .cluster .health .ClusterHealthResponse ;
34
35
import org .elasticsearch .common .unit .ByteSizeUnit ;
35
36
import org .elasticsearch .common .xcontent .XContentType ;
36
37
import org .elasticsearch .common .xcontent .support .XContentMapValues ;
38
+ import org .elasticsearch .client .Request ;
37
39
import org .elasticsearch .indices .recovery .RecoverySettings ;
38
40
import org .elasticsearch .rest .RestStatus ;
39
41
@@ -178,6 +180,8 @@ public void testClusterHealthYellowClusterLevel() throws IOException {
178
180
request .level (ClusterHealthRequest .Level .CLUSTER );
179
181
ClusterHealthResponse response = execute (request , highLevelClient ().cluster ()::health , highLevelClient ().cluster ()::healthAsync );
180
182
183
+ logger .info ("Shard stats\n {}" , EntityUtils .toString (
184
+ client ().performRequest (new Request ("GET" , "/_cat/shards" )).getEntity ()));
181
185
assertYellowShards (response );
182
186
assertThat (response .getIndices ().size (), equalTo (0 ));
183
187
}
@@ -190,6 +194,8 @@ public void testClusterHealthYellowIndicesLevel() throws IOException {
190
194
request .level (ClusterHealthRequest .Level .INDICES );
191
195
ClusterHealthResponse response = execute (request , highLevelClient ().cluster ()::health , highLevelClient ().cluster ()::healthAsync );
192
196
197
+ logger .info ("Shard stats\n {}" , EntityUtils .toString (
198
+ client ().performRequest (new Request ("GET" , "/_cat/shards" )).getEntity ()));
193
199
assertYellowShards (response );
194
200
assertThat (response .getIndices ().size (), equalTo (2 ));
195
201
for (Map .Entry <String , ClusterIndexHealth > entry : response .getIndices ().entrySet ()) {
0 commit comments