class_docstr: Writer object that saves experiences in JSON file chunks.
docstr: Initializes a JsonWriter instance.
  
  Args:
      path: a path/URI of the output directory to save files in.
      ioctx: current IO context object.
      max_file_size: max size of single files before rolling over.
      compress_columns: list of sample batch columns to compress.
docstr_tok: ["Initializes","a","JsonWriter","instance",".","Args",":","path",":","a","path\/URI","of","the","output","directory","to","save","files","in",".","ioctx",":","current","IO","context","object",".","max_file_size",":","max","size","of","single","files","before","rolling","over",".","compress_columns",":","list","of","sample","batch","columns","to","compress","."]
code: def __init__(
      self,
      path: str,
      ioctx: IOContext = None,
      max_file_size: int = 64 * 1024 * 1024,
      compress_columns: List[str] = frozenset(["obs", "new_obs"]),
  ):
      """Initializes a JsonWriter instance.
  
      Args:
          path: a path/URI of the output directory to save files in.
          ioctx: current IO context object.
          max_file_size: max size of single files before rolling over.
          compress_columns: list of sample batch columns to compress.
      """
      logger.info(
          "You are using JSONWriter. It is recommended to use "
          + "DatasetWriter instead."
      )
  
      self.ioctx = ioctx or IOContext()
      self.max_file_size = max_file_size
      self.compress_columns = compress_columns
      if urlparse(path).scheme not in [""] + WINDOWS_DRIVES:
          self.path_is_uri = True
      else:
          path = os.path.abspath(os.path.expanduser(path))
          # Try to create local dirs if they don't exist
          os.makedirs(path, exist_ok=True)
          assert os.path.exists(path), "Failed to create {}".format(
              path
          )
          self.path_is_uri = False
      self.path = path
      self.file_index = 0
      self.bytes_written = 0
      self.cur_file = None
  
imports: from datetime import datetime
  import json
  import logging
  import numpy
  import os
  from urllib.parse import urlparse
  import time
  from ray.air._internal.json import SafeFallbackEncoder
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.offline.io_context import IOContext
  from ray.rllib.offline.output_writer import OutputWriter
  from ray.rllib.utils.annotations import override, PublicAPI
  from ray.rllib.utils.compression import pack, compression_supported
  from ray.rllib.utils.typing import FileType, SampleBatchType
  from typing import Any, Dict, List
label_desc: Use image node_id 1 to create a new JsonWriter object from inherited base classes: OutputWriter with example: obj = JsonWriter(path, ioctx, max_file_size, compress_columns)