Class InMemoryAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
- java.lang.Object
-
- org.apache.flink.autoscaler.state.InMemoryAutoScalerStateStore<KEY,Context>
-
- Type Parameters:
KEY
- The job key.Context
- The job autoscaler context.
- All Implemented Interfaces:
AutoScalerStateStore<KEY,Context>
public class InMemoryAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>> extends java.lang.Object implements AutoScalerStateStore<KEY,Context>
State store based on the Java Heap, the state will be discarded after process restarts.
-
-
Constructor Summary
Constructors Constructor Description InMemoryAutoScalerStateStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAll(Context jobContext)
Removes all data from this context.void
flush(Context jobContext)
Flushing is needed because we do not persist data for all store methods until this method is called.java.util.SortedMap<java.time.Instant,CollectedMetrics>
getCollectedMetrics(Context jobContext)
ConfigChanges
getConfigChanges(Context jobContext)
java.util.Map<java.lang.String,java.lang.String>
getParallelismOverrides(Context jobContext)
java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,java.util.SortedMap<java.time.Instant,ScalingSummary>>
getScalingHistory(Context jobContext)
ScalingTracking
getScalingTracking(Context jobContext)
void
removeCollectedMetrics(Context jobContext)
void
removeConfigChanges(Context jobContext)
void
removeInfoFromCache(KEY jobKey)
Clean up all information related to the current job.void
removeParallelismOverrides(Context jobContext)
void
removeScalingHistory(Context jobContext)
void
storeCollectedMetrics(Context jobContext, java.util.SortedMap<java.time.Instant,CollectedMetrics> metrics)
void
storeConfigChanges(Context jobContext, ConfigChanges configChanges)
void
storeParallelismOverrides(Context jobContext, java.util.Map<java.lang.String,java.lang.String> parallelismOverrides)
void
storeScalingHistory(Context jobContext, java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,java.util.SortedMap<java.time.Instant,ScalingSummary>> scalingHistory)
void
storeScalingTracking(Context jobContext, ScalingTracking scalingTracking)
-
-
-
Method Detail
-
storeScalingHistory
public void storeScalingHistory(Context jobContext, java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,java.util.SortedMap<java.time.Instant,ScalingSummary>> scalingHistory)
- Specified by:
storeScalingHistory
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
getScalingHistory
public java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,java.util.SortedMap<java.time.Instant,ScalingSummary>> getScalingHistory(Context jobContext)
- Specified by:
getScalingHistory
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
storeScalingTracking
public void storeScalingTracking(Context jobContext, ScalingTracking scalingTracking)
- Specified by:
storeScalingTracking
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
getScalingTracking
public ScalingTracking getScalingTracking(Context jobContext)
- Specified by:
getScalingTracking
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
removeScalingHistory
public void removeScalingHistory(Context jobContext)
- Specified by:
removeScalingHistory
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
storeCollectedMetrics
public void storeCollectedMetrics(Context jobContext, java.util.SortedMap<java.time.Instant,CollectedMetrics> metrics)
- Specified by:
storeCollectedMetrics
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
getCollectedMetrics
public java.util.SortedMap<java.time.Instant,CollectedMetrics> getCollectedMetrics(Context jobContext)
- Specified by:
getCollectedMetrics
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
removeCollectedMetrics
public void removeCollectedMetrics(Context jobContext)
- Specified by:
removeCollectedMetrics
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
storeParallelismOverrides
public void storeParallelismOverrides(Context jobContext, java.util.Map<java.lang.String,java.lang.String> parallelismOverrides)
- Specified by:
storeParallelismOverrides
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
getParallelismOverrides
public java.util.Map<java.lang.String,java.lang.String> getParallelismOverrides(Context jobContext)
- Specified by:
getParallelismOverrides
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
storeConfigChanges
public void storeConfigChanges(Context jobContext, ConfigChanges configChanges)
- Specified by:
storeConfigChanges
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
getConfigChanges
@Nonnull public ConfigChanges getConfigChanges(Context jobContext)
- Specified by:
getConfigChanges
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
removeConfigChanges
public void removeConfigChanges(Context jobContext)
- Specified by:
removeConfigChanges
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
removeParallelismOverrides
public void removeParallelismOverrides(Context jobContext)
- Specified by:
removeParallelismOverrides
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
clearAll
public void clearAll(Context jobContext)
Description copied from interface:AutoScalerStateStore
Removes all data from this context. Flush stil needs to be called.- Specified by:
clearAll
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
flush
public void flush(Context jobContext)
Description copied from interface:AutoScalerStateStore
Flushing is needed because we do not persist data for all store methods until this method is called. Note: The state store implementation should try to avoid write operations unless data was changed through this interface.- Specified by:
flush
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
removeInfoFromCache
public void removeInfoFromCache(KEY jobKey)
Description copied from interface:AutoScalerStateStore
Clean up all information related to the current job.- Specified by:
removeInfoFromCache
in interfaceAutoScalerStateStore<KEY,Context extends JobAutoScalerContext<KEY>>
-
-