@@ -41,22 +41,22 @@ public Result rotateSalts(
4141 }
4242
4343 // Salts that can be rotated based on their refreshFrom being at target date
44- var rotatableSalts = findRotatableSalts (preRotationSalts , targetDate );
44+ var refreshableSalts = findRefreshableSalts (preRotationSalts , targetDate );
4545
4646 var saltsToRotate = pickSaltsToRotate (
47- rotatableSalts ,
47+ refreshableSalts ,
4848 targetDate ,
4949 minAges ,
5050 getNumSaltsToRotate (preRotationSalts , fraction )
5151 );
5252
5353 if (saltsToRotate .isEmpty ()) {
54- return Result .noSnapshot ("all rotatable salts are below min rotation age" );
54+ return Result .noSnapshot ("all refreshable salts are below min rotation age" );
5555 }
5656
5757 var postRotationSalts = rotateSalts (preRotationSalts , saltsToRotate , targetDate );
5858
59- logSaltAges ("rotatable -salts" , targetDate , rotatableSalts );
59+ logSaltAges ("refreshable -salts" , targetDate , refreshableSalts );
6060 logSaltAges ("rotated-salts" , targetDate , saltsToRotate );
6161 logSaltAges ("total-salts" , targetDate , Arrays .asList (postRotationSalts ));
6262
@@ -72,11 +72,11 @@ private static int getNumSaltsToRotate(SaltEntry[] preRotationSalts, double frac
7272 return (int ) Math .ceil (preRotationSalts .length * fraction );
7373 }
7474
75- private Set <SaltEntry > findRotatableSalts (SaltEntry [] preRotationSalts , TargetDate targetDate ) {
76- return Arrays .stream (preRotationSalts ).filter (s -> isRotatable (targetDate , s )).collect (Collectors .toSet ());
75+ private Set <SaltEntry > findRefreshableSalts (SaltEntry [] preRotationSalts , TargetDate targetDate ) {
76+ return Arrays .stream (preRotationSalts ).filter (s -> isRefreshable (targetDate , s )).collect (Collectors .toSet ());
7777 }
7878
79- private boolean isRotatable (TargetDate targetDate , SaltEntry salt ) {
79+ private boolean isRefreshable (TargetDate targetDate , SaltEntry salt ) {
8080 if (this .isRefreshFromEnabled ) {
8181 return salt .refreshFrom ().equals (targetDate .asEpochMs ());
8282 }
@@ -129,7 +129,7 @@ private String calculatePreviousSalt(SaltEntry salt, boolean shouldRotate, Targe
129129 }
130130
131131 private List <SaltEntry > pickSaltsToRotate (
132- Set <SaltEntry > rotatableSalts ,
132+ Set <SaltEntry > refreshableSalts ,
133133 TargetDate targetDate ,
134134 Duration [] minAges ,
135135 int numSaltsToRotate
@@ -146,7 +146,7 @@ private List<SaltEntry> pickSaltsToRotate(
146146
147147 var maxIndexes = numSaltsToRotate - indexesToRotate .size ();
148148 var saltsToRotate = pickSaltsToRotateInTimeWindow (
149- rotatableSalts ,
149+ refreshableSalts ,
150150 maxIndexes ,
151151 minLastUpdated .toEpochMilli (),
152152 maxLastUpdated .toEpochMilli ()
@@ -158,12 +158,12 @@ private List<SaltEntry> pickSaltsToRotate(
158158 }
159159
160160 private List <SaltEntry > pickSaltsToRotateInTimeWindow (
161- Set <SaltEntry > rotatableSalts ,
161+ Set <SaltEntry > refreshableSalts ,
162162 int maxIndexes ,
163163 long minLastUpdated ,
164164 long maxLastUpdated
165165 ) {
166- ArrayList <SaltEntry > candidateSalts = rotatableSalts .stream ()
166+ ArrayList <SaltEntry > candidateSalts = refreshableSalts .stream ()
167167 .filter (salt -> minLastUpdated <= salt .lastUpdated () && salt .lastUpdated () < maxLastUpdated )
168168 .collect (Collectors .toCollection (ArrayList ::new ));
169169
0 commit comments