class_docstr: Wraps ray's internal_kv with a namespace to avoid collisions.
  
  Supports string keys and bytes values, caller must handle serialization.
class_docstr_tok: ["Wraps","ray","'s","internal_kv","with","a","namespace","to","avoid","collisions",".","Supports","string","keys","and","bytes","values",",","caller","must","handle","serialization","."]
code: def __init__(
      self,
      namespace: Optional[str] = None,
      gcs_client: Optional[GcsClient] = None,
  ):
      if namespace is not None and not isinstance(namespace, str):
          raise TypeError(
              "namespace must a string, got: {}.".format(
                  type(namespace)
              )
          )
      if gcs_client is not None:
          self.gcs_client = gcs_client
      else:
          self.gcs_client = GcsClient(
              address=ray.get_runtime_context().gcs_address
          )
      self.timeout = RAY_SERVE_KV_TIMEOUT_S
      self.namespace = namespace or ""
  
file_path: ray/python/ray/serve/_private/storage/kv_store.py
imports: import logging
  from typing import Optional
  import ray
  from ray._private import ray_constants
  from ray._raylet import GcsClient
  from ray.serve._private.constants import RAY_SERVE_KV_TIMEOUT_S, SERVE_LOGGER_NAME
  from ray.serve._private.storage.kv_store_base import KVStoreBase
label_desc: Use image node_id 1 to create a new RayInternalKVStore object from inherited base classes: KVStoreBase with example: obj = RayInternalKVStore(namespace, gcs_client)