@@ -307,14 +307,16 @@ public void createClusterWithAutoscalingTest() {
307307 ClusterAutoscalingConfig .of (newInstanceId , clusterId )
308308 .setMaxNodes (4 )
309309 .setMinNodes (1 )
310- .setCpuUtilizationTargetPercent (20 ));
310+ .setCpuUtilizationTargetPercent (20 )
311+ .setStorageUtilizationGibPerNode (9200 ));
311312
312313 Cluster cluster = client .createCluster (createClusterRequest );
313314 assertThat (cluster .getId ()).contains (clusterId );
314315 assertThat (cluster .getServeNodes ()).isEqualTo (0 );
315316 assertThat (cluster .getAutoscalingMinServeNodes ()).isEqualTo (1 );
316317 assertThat (cluster .getAutoscalingMaxServeNodes ()).isEqualTo (4 );
317318 assertThat (cluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
319+ assertThat (cluster .getStorageUtilizationGibPerNode ()).isEqualTo (9200 );
318320 } catch (Exception e ) {
319321 Assert .fail ("error in the test" + e .getMessage ());
320322 } finally {
@@ -343,6 +345,7 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() {
343345 ClusterAutoscalingConfig .of ("ignored" , clusterId )
344346 .setMaxNodes (4 )
345347 .setMinNodes (1 )
348+ .setStorageUtilizationGibPerNode (2561 )
346349 .setCpuUtilizationTargetPercent (20 ));
347350
348351 Cluster cluster = client .createCluster (createClusterRequest );
@@ -351,20 +354,42 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() {
351354 assertThat (cluster .getAutoscalingMinServeNodes ()).isEqualTo (1 );
352355 assertThat (cluster .getAutoscalingMaxServeNodes ()).isEqualTo (4 );
353356 assertThat (cluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
357+ assertThat (cluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
358+
359+ Cluster retrievedCluster = client .getCluster (newInstanceId , clusterId );
360+ assertThat (retrievedCluster .getId ()).contains (clusterId );
361+ assertThat (retrievedCluster .getAutoscalingMinServeNodes ()).isEqualTo (1 );
362+ assertThat (retrievedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (4 );
363+ assertThat (retrievedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
364+ assertThat (retrievedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
354365
355366 Cluster updatedCluster =
356367 client .updateClusterAutoscalingConfig (
357368 ClusterAutoscalingConfig .of (newInstanceId , clusterId ).setMaxNodes (3 ));
358369 assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (1 );
359370 assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (3 );
360371 assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
372+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
373+
374+ Cluster retrievedUpdatedCluster = client .getCluster (newInstanceId , clusterId );
375+ assertThat (retrievedUpdatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (1 );
376+ assertThat (retrievedUpdatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (3 );
377+ assertThat (retrievedUpdatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
378+ assertThat (retrievedUpdatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
361379
362380 updatedCluster =
363381 client .updateClusterAutoscalingConfig (
364382 ClusterAutoscalingConfig .of (newInstanceId , clusterId ).setMinNodes (2 ));
365383 assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
366384 assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (3 );
367385 assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
386+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
387+
388+ retrievedUpdatedCluster = client .getCluster (newInstanceId , clusterId );
389+ assertThat (retrievedUpdatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
390+ assertThat (retrievedUpdatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (3 );
391+ assertThat (retrievedUpdatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (20 );
392+ assertThat (retrievedUpdatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
368393
369394 updatedCluster =
370395 client .updateClusterAutoscalingConfig (
@@ -373,6 +398,13 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() {
373398 assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
374399 assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (3 );
375400 assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (40 );
401+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
402+
403+ retrievedUpdatedCluster = client .getCluster (newInstanceId , clusterId );
404+ assertThat (retrievedUpdatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
405+ assertThat (retrievedUpdatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (3 );
406+ assertThat (retrievedUpdatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (40 );
407+ assertThat (retrievedUpdatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
376408
377409 updatedCluster =
378410 client .updateClusterAutoscalingConfig (
@@ -382,6 +414,44 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() {
382414 assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
383415 assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (5 );
384416 assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (45 );
417+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
418+
419+ retrievedUpdatedCluster = client .getCluster (newInstanceId , clusterId );
420+ assertThat (retrievedUpdatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
421+ assertThat (retrievedUpdatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (5 );
422+ assertThat (retrievedUpdatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (45 );
423+ assertThat (retrievedUpdatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2561 );
424+
425+ updatedCluster =
426+ client .updateClusterAutoscalingConfig (
427+ ClusterAutoscalingConfig .of (newInstanceId , clusterId )
428+ .setStorageUtilizationGibPerNode (2777 ));
429+ assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
430+ assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (5 );
431+ assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (45 );
432+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2777 );
433+
434+ retrievedUpdatedCluster = client .getCluster (newInstanceId , clusterId );
435+ assertThat (retrievedUpdatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
436+ assertThat (retrievedUpdatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (5 );
437+ assertThat (retrievedUpdatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (45 );
438+ assertThat (retrievedUpdatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2777 );
439+
440+ updatedCluster =
441+ client .updateClusterAutoscalingConfig (
442+ ClusterAutoscalingConfig .of (newInstanceId , clusterId )
443+ // testing default case
444+ .setStorageUtilizationGibPerNode (0 ));
445+ assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
446+ assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (5 );
447+ assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (45 );
448+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2560 );
449+
450+ retrievedUpdatedCluster = client .getCluster (newInstanceId , clusterId );
451+ assertThat (retrievedUpdatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (2 );
452+ assertThat (retrievedUpdatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (5 );
453+ assertThat (retrievedUpdatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (45 );
454+ assertThat (retrievedUpdatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (2560 );
385455 } catch (Exception e ) {
386456 Assert .fail ("error in the test: " + e .getMessage ());
387457 } finally {
@@ -414,6 +484,7 @@ public void createClusterWithManualScalingTest() {
414484 assertThat (cluster .getAutoscalingMaxServeNodes ()).isEqualTo (0 );
415485 assertThat (cluster .getAutoscalingMinServeNodes ()).isEqualTo (0 );
416486 assertThat (cluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (0 );
487+ assertThat (cluster .getStorageUtilizationGibPerNode ()).isEqualTo (0 );
417488 } catch (Exception e ) {
418489 Assert .fail ("error in the test: " + e .getMessage ());
419490 } finally {
@@ -447,16 +518,19 @@ private void basicClusterOperationTestHelper(String targetInstanceId, String tar
447518 ClusterAutoscalingConfig .of (targetInstanceId , targetClusterId )
448519 .setMinNodes (1 )
449520 .setMaxNodes (4 )
521+ .setStorageUtilizationGibPerNode (2877 )
450522 .setCpuUtilizationTargetPercent (40 );
451523 Cluster cluster = client .updateClusterAutoscalingConfig (autoscalingConfig );
452524 assertThat (cluster .getAutoscalingMaxServeNodes ()).isEqualTo (4 );
453525 assertThat (cluster .getAutoscalingMinServeNodes ()).isEqualTo (1 );
454526 assertThat (cluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (40 );
527+ assertThat (cluster .getStorageUtilizationGibPerNode ()).isEqualTo (2877 );
455528
456529 Cluster updatedCluster = client .disableClusterAutoscaling (targetInstanceId , targetClusterId , 3 );
457530 assertThat (updatedCluster .getServeNodes ()).isEqualTo (3 );
458531 assertThat (updatedCluster .getAutoscalingMaxServeNodes ()).isEqualTo (0 );
459532 assertThat (updatedCluster .getAutoscalingMinServeNodes ()).isEqualTo (0 );
460533 assertThat (updatedCluster .getAutoscalingCpuPercentageTarget ()).isEqualTo (0 );
534+ assertThat (updatedCluster .getStorageUtilizationGibPerNode ()).isEqualTo (0 );
461535 }
462536}
0 commit comments