Class StateMetadata

java.lang.Object
org.apache.flink.table.planner.plan.nodes.exec.StateMetadata

@Internal public class StateMetadata extends Object
It is used to describe the state metadata of a stateful operator, which is serialized/deserialized into/from those StreamExecNodes that can generate stateful operators. For ExecNodes that generates TwoInputStreamOperator or MultipleInputStreamOperator, there will be multiple metadata describing information about each input's state.

The metadata describes the following attributes.

  • stateIndex: annotates the state is from the i-th input, index based on zero
  • ttl: annotates the state retention time for the i-th input's state, the time unit is ms.
  • name: annotates the state description, such as deduplicate-state, join-left-state.
  • Field Details

  • Constructor Details

    • StateMetadata

      public StateMetadata(int stateIndex, String stateTtl, String stateName)
    • StateMetadata

      public StateMetadata(int stateIndex, Duration stateTtl, String stateName)
  • Method Details

    • getStateIndex

      public int getStateIndex()
    • getStateTtl

      public String getStateTtl()
    • getOneInputOperatorDefaultMeta

      public static List<StateMetadata> getOneInputOperatorDefaultMeta(org.apache.flink.configuration.ReadableConfig tableConfig, String stateName)
    • getOneInputOperatorDefaultMeta

      public static List<StateMetadata> getOneInputOperatorDefaultMeta(@Nullable Long stateTtlFromHint, org.apache.flink.configuration.ReadableConfig tableConfig, String stateName)
    • getMultiInputOperatorDefaultMeta

      public static List<StateMetadata> getMultiInputOperatorDefaultMeta(Map<Integer,Long> stateTtlFromHint, org.apache.flink.configuration.ReadableConfig tableConfig, String... stateNameList)
    • getStateTtlForOneInputOperator

      public static long getStateTtlForOneInputOperator(ExecNodeConfig config, @Nullable List<StateMetadata> stateMetadataList)
    • getStateTtlForMultiInputOperator

      public static List<Long> getStateTtlForMultiInputOperator(ExecNodeConfig config, int inputNumOfOperator, @Nullable List<StateMetadata> stateMetadataList)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object