@@ -34,25 +34,30 @@ public class TimeseriesLifecycleType implements LifecycleType {
3434 static final String HOT_PHASE = "hot" ;
3535 static final String WARM_PHASE = "warm" ;
3636 static final String COLD_PHASE = "cold" ;
37+ static final String FROZEN_PHASE = "frozen" ;
3738 static final String DELETE_PHASE = "delete" ;
38- static final List <String > VALID_PHASES = Arrays .asList (HOT_PHASE , WARM_PHASE , COLD_PHASE , DELETE_PHASE );
39+ static final List <String > VALID_PHASES = Arrays .asList (HOT_PHASE , WARM_PHASE , COLD_PHASE , FROZEN_PHASE , DELETE_PHASE );
3940 static final List <String > ORDERED_VALID_HOT_ACTIONS = Arrays .asList (SetPriorityAction .NAME , UnfollowAction .NAME , RolloverAction .NAME ,
4041 ForceMergeAction .NAME );
4142 static final List <String > ORDERED_VALID_WARM_ACTIONS = Arrays .asList (SetPriorityAction .NAME , UnfollowAction .NAME , ReadOnlyAction .NAME ,
4243 AllocateAction .NAME , ShrinkAction .NAME , ForceMergeAction .NAME );
4344 static final List <String > ORDERED_VALID_COLD_ACTIONS = Arrays .asList (SetPriorityAction .NAME , UnfollowAction .NAME , AllocateAction .NAME ,
4445 FreezeAction .NAME , SearchableSnapshotAction .NAME );
46+ static final List <String > ORDERED_VALID_FROZEN_ACTIONS = Arrays .asList (SetPriorityAction .NAME , UnfollowAction .NAME , AllocateAction .NAME ,
47+ FreezeAction .NAME , SearchableSnapshotAction .NAME );
4548 static final List <String > ORDERED_VALID_DELETE_ACTIONS = Arrays .asList (WaitForSnapshotAction .NAME , DeleteAction .NAME );
4649 static final Set <String > VALID_HOT_ACTIONS = Sets .newHashSet (ORDERED_VALID_HOT_ACTIONS );
4750 static final Set <String > VALID_WARM_ACTIONS = Sets .newHashSet (ORDERED_VALID_WARM_ACTIONS );
4851 static final Set <String > VALID_COLD_ACTIONS = Sets .newHashSet (ORDERED_VALID_COLD_ACTIONS );
52+ static final Set <String > VALID_FROZEN_ACTIONS = Sets .newHashSet (ORDERED_VALID_FROZEN_ACTIONS );
4953 static final Set <String > VALID_DELETE_ACTIONS = Sets .newHashSet (ORDERED_VALID_DELETE_ACTIONS );
5054 private static Map <String , Set <String >> ALLOWED_ACTIONS = new HashMap <>();
5155
5256 static {
5357 ALLOWED_ACTIONS .put (HOT_PHASE , VALID_HOT_ACTIONS );
5458 ALLOWED_ACTIONS .put (WARM_PHASE , VALID_WARM_ACTIONS );
5559 ALLOWED_ACTIONS .put (COLD_PHASE , VALID_COLD_ACTIONS );
60+ ALLOWED_ACTIONS .put (FROZEN_PHASE , VALID_FROZEN_ACTIONS );
5661 ALLOWED_ACTIONS .put (DELETE_PHASE , VALID_DELETE_ACTIONS );
5762 }
5863
@@ -141,6 +146,9 @@ public List<LifecycleAction> getOrderedActions(Phase phase) {
141146 case COLD_PHASE :
142147 return ORDERED_VALID_COLD_ACTIONS .stream ().map (a -> actions .getOrDefault (a , null ))
143148 .filter (Objects ::nonNull ).collect (Collectors .toList ());
149+ case FROZEN_PHASE :
150+ return ORDERED_VALID_FROZEN_ACTIONS .stream ().map (a -> actions .getOrDefault (a , null ))
151+ .filter (Objects ::nonNull ).collect (Collectors .toList ());
144152 case DELETE_PHASE :
145153 return ORDERED_VALID_DELETE_ACTIONS .stream ().map (a -> actions .getOrDefault (a , null ))
146154 .filter (Objects ::nonNull ).collect (Collectors .toList ());
@@ -162,6 +170,9 @@ public String getNextActionName(String currentActionName, Phase phase) {
162170 case COLD_PHASE :
163171 orderedActionNames = ORDERED_VALID_COLD_ACTIONS ;
164172 break ;
173+ case FROZEN_PHASE :
174+ orderedActionNames = ORDERED_VALID_FROZEN_ACTIONS ;
175+ break ;
165176 case DELETE_PHASE :
166177 orderedActionNames = ORDERED_VALID_DELETE_ACTIONS ;
167178 break ;
0 commit comments