Bedrock.DataPlane.Materializer.Olivine.CompactionWriter.SplitFile (bedrock v0.5.2)

View Source

CompactionWriter implementation that writes to two separate files.

This is the current behavior used for local storage: data goes to a .data file and index goes to a separate .idx file.

Summary

Functions

Create a new SplitFile writer for the given paths.

Types

result()

@type result() :: %{
  data_fd: :file.fd(),
  idx_fd: :file.fd(),
  data_path: charlist(),
  idx_path: charlist(),
  data_offset: non_neg_integer(),
  idx_offset: non_neg_integer()
}

t()

@type t() :: %Bedrock.DataPlane.Materializer.Olivine.CompactionWriter.SplitFile{
  data_fd: :file.fd(),
  data_offset: non_neg_integer(),
  data_path: charlist(),
  idx_fd: :file.fd(),
  idx_path: charlist()
}

Functions

new(data_path, idx_path)

@spec new(data_path :: charlist(), idx_path :: charlist()) ::
  {:ok, t()} | {:error, term()}

Create a new SplitFile writer for the given paths.