@@ -114,6 +114,7 @@ public void testNodeCounts() {
114
114
NodeRoleSettings .NODE_ROLES_SETTING .getKey (),
115
115
roles .stream ().map (DiscoveryNodeRole ::roleName ).collect (Collectors .toList ())
116
116
)
117
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
117
118
.build ();
118
119
internalCluster ().startNode (settings );
119
120
total ++;
@@ -146,6 +147,7 @@ public void testNodeCountsWithDeprecatedMasterRole() throws ExecutionException,
146
147
int total = 1 ;
147
148
Settings settings = Settings .builder ()
148
149
.putList (NodeRoleSettings .NODE_ROLES_SETTING .getKey (), Collections .singletonList (DiscoveryNodeRole .MASTER_ROLE .roleName ()))
150
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
149
151
.build ();
150
152
internalCluster ().startNode (settings );
151
153
waitForNodes (total );
@@ -177,7 +179,8 @@ private void assertShardStats(ClusterStatsIndices.ShardStats stats, int indices,
177
179
}
178
180
179
181
public void testIndicesShardStats () throws ExecutionException , InterruptedException {
180
- internalCluster ().startNode ();
182
+ Settings settings = Settings .builder ().put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ()).build ();
183
+ internalCluster ().startNode (settings );
181
184
ensureGreen ();
182
185
ClusterStatsResponse response = client ().admin ().cluster ().prepareClusterStats ().get ();
183
186
assertThat (response .getStatus (), Matchers .equalTo (ClusterHealthStatus .GREEN ));
@@ -222,7 +225,8 @@ public void testIndicesShardStats() throws ExecutionException, InterruptedExcept
222
225
}
223
226
224
227
public void testValuesSmokeScreen () throws IOException , ExecutionException , InterruptedException {
225
- internalCluster ().startNodes (randomIntBetween (1 , 3 ));
228
+ Settings settings = Settings .builder ().put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ()).build ();
229
+ internalCluster ().startNodes (randomIntBetween (1 , 3 ), settings );
226
230
index ("test1" , "type" , "1" , "f" , "f" );
227
231
228
232
ClusterStatsResponse response = client ().admin ().cluster ().prepareClusterStats ().get ();
@@ -262,15 +266,25 @@ public void testValuesSmokeScreen() throws IOException, ExecutionException, Inte
262
266
263
267
public void testAllocatedProcessors () throws Exception {
264
268
// start one node with 7 processors.
265
- internalCluster ().startNode (Settings .builder ().put (OpenSearchExecutors .NODE_PROCESSORS_SETTING .getKey (), 7 ).build ());
269
+ internalCluster ().startNode (
270
+ Settings .builder ()
271
+ .put (OpenSearchExecutors .NODE_PROCESSORS_SETTING .getKey (), 7 )
272
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
273
+ .build ()
274
+ );
266
275
waitForNodes (1 );
267
276
268
277
ClusterStatsResponse response = client ().admin ().cluster ().prepareClusterStats ().get ();
269
278
assertThat (response .getNodesStats ().getOs ().getAllocatedProcessors (), equalTo (7 ));
270
279
}
271
280
272
281
public void testClusterStatusWhenStateNotRecovered () throws Exception {
273
- internalCluster ().startClusterManagerOnlyNode (Settings .builder ().put ("gateway.recover_after_nodes" , 2 ).build ());
282
+ internalCluster ().startClusterManagerOnlyNode (
283
+ Settings .builder ()
284
+ .put ("gateway.recover_after_nodes" , 2 )
285
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
286
+ .build ()
287
+ );
274
288
ClusterStatsResponse response = client ().admin ().cluster ().prepareClusterStats ().get ();
275
289
assertThat (response .getStatus (), equalTo (ClusterHealthStatus .RED ));
276
290
@@ -286,7 +300,8 @@ public void testClusterStatusWhenStateNotRecovered() throws Exception {
286
300
}
287
301
288
302
public void testFieldTypes () {
289
- internalCluster ().startNode ();
303
+ Settings settings = Settings .builder ().put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ()).build ();
304
+ internalCluster ().startNode (settings );
290
305
ensureGreen ();
291
306
ClusterStatsResponse response = client ().admin ().cluster ().prepareClusterStats ().get ();
292
307
assertThat (response .getStatus (), Matchers .equalTo (ClusterHealthStatus .GREEN ));
@@ -321,6 +336,7 @@ public void testNodeRolesWithMasterLegacySettings() throws ExecutionException, I
321
336
.put ("node.master" , true )
322
337
.put ("node.data" , false )
323
338
.put ("node.ingest" , false )
339
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
324
340
.build ();
325
341
326
342
internalCluster ().startNodes (legacyMasterSettings );
@@ -351,6 +367,7 @@ public void testNodeRolesWithClusterManagerRole() throws ExecutionException, Int
351
367
DiscoveryNodeRole .REMOTE_CLUSTER_CLIENT_ROLE .roleName ()
352
368
)
353
369
)
370
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
354
371
.build ();
355
372
356
373
internalCluster ().startNodes (clusterManagerNodeRoleSettings );
@@ -375,6 +392,7 @@ public void testNodeRolesWithSeedDataNodeLegacySettings() throws ExecutionExcept
375
392
.put ("node.master" , true )
376
393
.put ("node.data" , true )
377
394
.put ("node.ingest" , false )
395
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
378
396
.build ();
379
397
380
398
internalCluster ().startNodes (legacySeedDataNodeSettings );
@@ -400,6 +418,7 @@ public void testNodeRolesWithDataNodeLegacySettings() throws ExecutionException,
400
418
.put ("node.master" , false )
401
419
.put ("node.data" , true )
402
420
.put ("node.ingest" , false )
421
+ .put (TransportClusterStatsAction .OPTIMIZED_CLUSTER_STATS , randomBoolean ())
403
422
.build ();
404
423
405
424
// can't start data-only node without assigning cluster-manager
0 commit comments