Details
-
Sub-task
-
Status: In Progress
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Some logic of KubernetesAutoScalerStateStore and JDBCAutoScalerStateStore are similar, we can share some common code.
- ConfigMapStore and JDBCStore can be abstracted to StringStateStore interface
-
- They support put, get and remove
- The parameters of ConfigMapStore are the (JobContext, String key, String value).
- The parameters of JDBCStore are the (String jobKey, StateType stateType, String value).
- We can define a interface StringStateStore, and the parameters are (JobContext, StateType stateType, String value).
- KubernetesAutoScalerStateStore and JDBCAutoScalerStateStore can be abstracted to AbstractAutoscalerStateStore
-
- They support serialize and compress Original State to String.
- AbstractAutoscalerStateStore can reuse the serialize and compress logic
- KubernetesAutoScalerStateStore support the limitation of stateValue
- We can define a parameter for AbstractAutoscalerStateStore, the limitation is disabled by default, and KubernetesAutoScalerStateStore can enable it.