class_docstr: **IMPORTANT** `MemoryStateBackend` is deprecated in favor of `HashMapStateBackend` and
  `JobManagerCheckpointStorage`. This change does not affect the runtime characteristics of your
  Jobs and is simply an API change to help better communicate the ways Flink separates local state
  storage from fault tolerance. Jobs can be upgraded without loss of state. If configuring
  your state backend via the `StreamExecutionEnvironment` please make the following changes.
  
  ::
  
      >> env.set_state_backend(HashMapStateBackend())
      >> env.get_checkpoint_config().set_checkpoint_storage(JobManagerCheckpointStorage())
  
  If you are configuring your state backend via the `flink-conf.yaml` please make the following
  changes.
  
  ```
  state.backend.type: hashmap
  state.checkpoint-storage: jobmanager
  ```
  
  This state backend holds the working state in the memory (JVM heap) of the TaskManagers.
  The state backend checkpoints state directly to the JobManager's memory (hence the backend's
  name), but the checkpoints will be persisted to a file system for high-availability setups and
  savepoints. The MemoryStateBackend is consequently a FileSystem-based backend that can work
  without a file system dependency in simple setups.
  
  This state backend should be used only for experimentation, quick local setups,
  or for streaming applications that have very small state: Because it requires checkpoints to
  go through the JobManager's memory, larger state will occupy larger portions of the
  JobManager's main memory, reducing operational stability.
  For any other setup, the :class:`FsStateBackend` should be used. The :class:`FsStateBackend`
  holds the working state on the TaskManagers in the same way, but checkpoints state directly to
  files rather then to the JobManager's memory, thus supporting large state sizes.
  
  **State Size Considerations**
  
  State checkpointing with this state backend is subject to the following conditions:
  
  - Each individual state must not exceed the configured maximum state size
    (see :func:`get_max_state_size`.
  
  - All state from one task (i.e., the sum of all operator states and keyed states from all
    chained operators of the task) must not exceed what the RPC system supports, which is
    be default < 10 MB. That limit can be configured up, but that is typically not advised.
  
  - The sum of all states in the application times all retained checkpoints must comfortably
    fit into the JobManager's JVM heap space.
  
  **Persistence Guarantees**
  
  For the use cases where the state sizes can be handled by this backend, the backend does
  guarantee persistence for savepoints, externalized checkpoints (of configured), and checkpoints
  (when high-availability is configured).
  
  **Configuration**
  
  As for all state backends, this backend can either be configured within the application (by
  creating the backend with the respective constructor parameters and setting it on the execution
  environment) or by specifying it in the Flink configuration.
  
  If the state backend was specified in the application, it may pick up additional configuration
  parameters from the Flink configuration. For example, if the backend if configured in the
  application without a default savepoint directory, it will pick up a default savepoint
  directory specified in the Flink configuration of the running job/cluster. That behavior is
  implemented via the :func:`configure` method.
class_docstr_tok: ["*","*","IMPORTANT","*","*","`","MemoryStateBackend","`","is","deprecated","in","favor","of","`","HashMapStateBackend","`","and","`","JobManagerCheckpointStorage","`",".","This","change","does","not","affect","the","runtime","characteristics","of","your","Jobs","and","is","simply","an","API","change","to","help","better","communicate","the","ways","Flink","separates","local","state","storage","from","fault","tolerance",".","Jobs","can","be","upgraded","without","loss","of","state",".","If","configuring","your","state","backend","via","the","`","StreamExecutionEnvironment","`","please","make","the","following","changes",".",":",":",">",">","env.set_state_backend","(","HashMapStateBackend","(",")",")",">",">","env.get_checkpoint_config","(",")",".set_checkpoint_storage","(","JobManagerCheckpointStorage","(",")",")","If","you","are","configuring","your","state","backend","via","the","`","flink-conf.yaml","`","please","make","the","following","changes",".","``","`","state.backend.type",":","hashmap","state.checkpoint-storage",":","jobmanager","``","`","This","state","backend","holds","the","working","state","in","the","memory","(","JVM","heap",")","of","the","TaskManagers",".","The","state","backend","checkpoints","state","directly","to","the","JobManager","'s","memory","(","hence","the","backend's","name",")",",","but","the","checkpoints","will","be","persisted","to","a","file","system","for","high-availability","setups","and","savepoints",".","The","MemoryStateBackend","is","consequently","a","FileSystem-based","backend","that","can","work","without","a","file","system","dependency","in","simple","setups",".","This","state","backend","should","be","used","only","for","experimentation",",","quick","local","setups",",","or","for","streaming","applications","that","have","very","small","state",":","Because","it","requires","checkpoints","to","go","through","the","JobManager","'s","memory",",","larger","state","will","occupy","larger","portions","of","the","JobManager","'s","main","memory",",","reducing","operational","stability",".","For","any","other","setup",",","the",":","class",":","`","FsStateBackend","`","should","be","used",".","The",":","class",":","`","FsStateBackend","`","holds","the","working","state","on","the","TaskManagers","in","the","same","way",",","but","checkpoints","state","directly","to","files","rather","then","to","the","JobManager","'s","memory",",","thus","supporting","large","state","sizes",".","*","*","State","Size","Considerations","*","*","State","checkpointing","with","this","state","backend","is","subject","to","the","following","conditions",":","-","Each","individual","state","must","not","exceed","the","configured","maximum","state","size","(","see",":","func",":","`","get_max_state_size","`",".","-","All","state","from","one","task","(","i.e.",",","the","sum","of","all","operator","states","and","keyed","states","from","all","chained","operators","of","the","task",")","must","not","exceed","what","the","RPC","system","supports",",","which","is","be","default","<","10","MB",".","That","limit","can","be","configured","up",",","but","that","is","typically","not","advised",".","-","The","sum","of","all","states","in","the","application","times","all","retained","checkpoints","must","comfortably","fit","into","the","JobManager","'s","JVM","heap","space",".","*","*","Persistence","Guarantees","*","*","For","the","use","cases","where","the","state","sizes","can","be","handled","by","this","backend",",","the","backend","does","guarantee","persistence","for","savepoints",",","externalized","checkpoints","(","of","configured",")",",","and","checkpoints","(","when","high-availability","is","configured",")",".","*","*","Configuration","*","*","As","for","all","state","backends",",","this","backend","can","either","be","configured","within","the","application","(","by","creating","the","backend","with","the","respective","constructor","parameters","and","setting","it","on","the","execution","environment",")","or","by","specifying","it","in","the","Flink","configuration",".","If","the","state","backend","was","specified","in","the","application",",","it","may","pick","up","additional","configuration","parameters","from","the","Flink","configuration",".","For","example",",","if","the","backend","if","configured","in","the","application","without","a","default","savepoint","directory",",","it","will","pick","up","a","default","savepoint","directory","specified","in","the","Flink","configuration","of","the","running","job\/cluster",".","That","behavior","is","implemented","via","the",":","func",":","`","configure","`","method","."]
docstr: Creates a new MemoryStateBackend, setting optionally the paths to persist checkpoint
  metadata and savepoints to, as well as configuring state thresholds and asynchronous
  operations.
  
  WARNING: Increasing the size of this value beyond the default value
  (:data:`DEFAULT_MAX_STATE_SIZE`) should be done with care.
  The checkpointed state needs to be send to the JobManager via limited size RPC messages,
  and there and the JobManager needs to be able to hold all aggregated state in its memory.
  
  Example:
  ::
      >>> state_backend = MemoryStateBackend()
  
  :param checkpoint_path: The path to write checkpoint metadata to. If none, the value from
                          the runtime configuration will be used.
  :param savepoint_path: The path to write savepoints to. If none, the value from
                         the runtime configuration will be used.
  :param max_state_size: The maximal size of the serialized state. If none, the
                         :data:`DEFAULT_MAX_STATE_SIZE` will be used.
  :param using_asynchronous_snapshots: Snapshots are now always asynchronous. This flag
                                       has no effect anymore in this version.
  :param j_memory_state_backend: For internal use, please keep none.
code: def __init__(
      self,
      checkpoint_path=None,
      savepoint_path=None,
      max_state_size=None,
      using_asynchronous_snapshots=None,
      j_memory_state_backend=None,
  ):
      """
      Creates a new MemoryStateBackend, setting optionally the paths to persist checkpoint
      metadata and savepoints to, as well as configuring state thresholds and asynchronous
      operations.
  
      WARNING: Increasing the size of this value beyond the default value
      (:data:`DEFAULT_MAX_STATE_SIZE`) should be done with care.
      The checkpointed state needs to be send to the JobManager via limited size RPC messages,
      and there and the JobManager needs to be able to hold all aggregated state in its memory.
  
      Example:
      ::
          >>> state_backend = MemoryStateBackend()
  
      :param checkpoint_path: The path to write checkpoint metadata to. If none, the value from
                              the runtime configuration will be used.
      :param savepoint_path: The path to write savepoints to. If none, the value from
                             the runtime configuration will be used.
      :param max_state_size: The maximal size of the serialized state. If none, the
                             :data:`DEFAULT_MAX_STATE_SIZE` will be used.
      :param using_asynchronous_snapshots: Snapshots are now always asynchronous. This flag
                                           has no effect anymore in this version.
      :param j_memory_state_backend: For internal use, please keep none.
      """
      if j_memory_state_backend is None:
          gateway = get_gateway()
          JTernaryBoolean = (
              gateway.jvm.org.apache.flink.util.TernaryBoolean
          )
          JMemoryStateBackend = (
              gateway.jvm.org.apache.flink.runtime.state.memory.MemoryStateBackend
          )
          if using_asynchronous_snapshots is None:
              j_asynchronous_snapshots = JTernaryBoolean.UNDEFINED
          elif using_asynchronous_snapshots is True:
              j_asynchronous_snapshots = JTernaryBoolean.TRUE
          elif using_asynchronous_snapshots is False:
              j_asynchronous_snapshots = JTernaryBoolean.FALSE
          else:
              raise TypeError(
                  "Unsupported input for 'using_asynchronous_snapshots': %s, "
                  "the value of the parameter should be None or"
                  "True or False."
              )
          if max_state_size is None:
              max_state_size = (
                  JMemoryStateBackend.DEFAULT_MAX_STATE_SIZE
              )
          j_memory_state_backend = JMemoryStateBackend(
              checkpoint_path,
              savepoint_path,
              max_state_size,
              j_asynchronous_snapshots,
          )
  
      self._j_memory_state_backend = j_memory_state_backend
      super(MemoryStateBackend, self).__init__(j_memory_state_backend)
  
imports: from abc import ABCMeta
  from enum import Enum
  from py4j.java_gateway import get_java_class
  from typing import List, Optional
  from pyflink.java_gateway import get_gateway
  from pyflink.util.java_utils import load_java_class
label_desc: Use image node_id 1 to create a new MemoryStateBackend object from inherited base classes: StateBackend with example: obj = MemoryStateBackend(checkpoint_path, savepoint_path, max_state_size, using_asynchronous_snapshots, j_memory_state_backend)