class_docstr: **IMPORTANT** `RocksDBStateBackend` is deprecated in favor of `EmbeddedRocksDBStateBackend`
  and `FileSystemCheckpointStorage`. 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(EmbeddedRocksDBStateBackend())
      >> env.get_checkpoint_config().set_checkpoint_storage("hdfs://checkpoints")
  
  If you are configuring your state backend via the `flink-conf.yaml` no changes are required.
  
  A State Backend that stores its state in ``RocksDB``. This state backend can
  store very large state that exceeds memory and spills to disk.
  
  All key/value state (including windows) is stored in the key/value index of RocksDB.
  For persistence against loss of machines, checkpoints take a snapshot of the
  RocksDB database, and persist that snapshot in a file system (by default) or
  another configurable state backend.
  
  The behavior of the RocksDB instances can be parametrized by setting RocksDB Options
  using the methods :func:`set_predefined_options` and :func:`set_options`.
class_docstr_tok: ["*","*","IMPORTANT","*","*","`","RocksDBStateBackend","`","is","deprecated","in","favor","of","`","EmbeddedRocksDBStateBackend","`","and","`","FileSystemCheckpointStorage","`",".","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","(","EmbeddedRocksDBStateBackend","(",")",")",">",">","env.get_checkpoint_config","(",")",".set_checkpoint_storage","(","``","hdfs",":","\/\/checkpoints","''",")","If","you","are","configuring","your","state","backend","via","the","`","flink-conf.yaml","`","no","changes","are","required",".","A","State","Backend","that","stores","its","state","in","``","RocksDB","``",".","This","state","backend","can","store","very","large","state","that","exceeds","memory","and","spills","to","disk",".","All","key\/value","state","(","including","windows",")","is","stored","in","the","key\/value","index","of","RocksDB",".","For","persistence","against","loss","of","machines",",","checkpoints","take","a","snapshot","of","the","RocksDB","database",",","and","persist","that","snapshot","in","a","file","system","(","by","default",")","or","another","configurable","state","backend",".","The","behavior","of","the","RocksDB","instances","can","be","parametrized","by","setting","RocksDB","Options","using","the","methods",":","func",":","`","set_predefined_options","`","and",":","func",":","`","set_options","`","."]
docstr: Creates a new :class:`RocksDBStateBackend` that stores its checkpoint data in the given
  state backend or the location of given URI.
  
  If using state backend, typically, one would supply a filesystem or database state backend
  here where the snapshots from RocksDB would be stored.
  
  If using URI, a state backend that stores checkpoints in HDFS or S3 must specify the file
  system host and port in the URI, or have the Hadoop configuration that describes the file
  system (host / high-availability group / possibly credentials) either referenced from the
  Flink config, or included in the classpath.
  
  Example:
  ::
  
      >>> state_backend = RocksDBStateBackend("file://var/checkpoints/")
  
  :param checkpoint_data_uri: The URI describing the filesystem and path to the checkpoint
                              data directory.
  :param enable_incremental_checkpointing: True if incremental checkpointing is enabled.
  :param checkpoint_stream_backend: The backend write the checkpoint streams to.
  :param j_rocks_db_state_backend: For internal use, please keep none.
code: def __init__(
      self,
      checkpoint_data_uri=None,
      enable_incremental_checkpointing=None,
      checkpoint_stream_backend=None,
      j_rocks_db_state_backend=None,
  ):
      """
      Creates a new :class:`RocksDBStateBackend` that stores its checkpoint data in the given
      state backend or the location of given URI.
  
      If using state backend, typically, one would supply a filesystem or database state backend
      here where the snapshots from RocksDB would be stored.
  
      If using URI, a state backend that stores checkpoints in HDFS or S3 must specify the file
      system host and port in the URI, or have the Hadoop configuration that describes the file
      system (host / high-availability group / possibly credentials) either referenced from the
      Flink config, or included in the classpath.
  
      Example:
      ::
  
          >>> state_backend = RocksDBStateBackend("file://var/checkpoints/")
  
      :param checkpoint_data_uri: The URI describing the filesystem and path to the checkpoint
                                  data directory.
      :param enable_incremental_checkpointing: True if incremental checkpointing is enabled.
      :param checkpoint_stream_backend: The backend write the checkpoint streams to.
      :param j_rocks_db_state_backend: For internal use, please keep none.
      """
      if j_rocks_db_state_backend is None:
          gateway = get_gateway()
          JTernaryBoolean = (
              gateway.jvm.org.apache.flink.util.TernaryBoolean
          )
          JRocksDBStateBackend = (
              gateway.jvm.org.apache.flink.contrib.streaming.state.RocksDBStateBackend
          )
  
          if enable_incremental_checkpointing not in (
              None,
              True,
              False,
          ):
              raise TypeError(
                  "Unsupported input for 'enable_incremental_checkpointing': %s, "
                  "the value of the parameter should be None or"
                  "True or False."
              )
  
          if checkpoint_data_uri is not None:
              if enable_incremental_checkpointing is None:
                  j_rocks_db_state_backend = JRocksDBStateBackend(
                      checkpoint_data_uri
                  )
              else:
                  j_rocks_db_state_backend = JRocksDBStateBackend(
                      checkpoint_data_uri,
                      enable_incremental_checkpointing,
                  )
          elif isinstance(checkpoint_stream_backend, StateBackend):
              if enable_incremental_checkpointing is None:
                  j_enable_incremental_checkpointing = (
                      JTernaryBoolean.UNDEFINED
                  )
              elif enable_incremental_checkpointing is True:
                  j_enable_incremental_checkpointing = (
                      JTernaryBoolean.TRUE
                  )
              else:
                  j_enable_incremental_checkpointing = (
                      JTernaryBoolean.FALSE
                  )
  
              j_rocks_db_state_backend = JRocksDBStateBackend(
                  checkpoint_stream_backend._j_state_backend,
                  j_enable_incremental_checkpointing,
              )
  
      self._j_rocks_db_state_backend = j_rocks_db_state_backend
      super(RocksDBStateBackend, self).__init__(
          j_rocks_db_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 RocksDBStateBackend object from inherited base classes: StateBackend with example: obj = RocksDBStateBackend(checkpoint_data_uri, enable_incremental_checkpointing, checkpoint_stream_backend, j_rocks_db_state_backend)