Ferricstore.Store.ListOps (ferricstore v0.4.1)

Copy Markdown View Source

Pure-logic module for list data structure operations.

Storage format (compound key / float-position)

Each list element is stored as an individual compound key entry: L:redis_key\0{encoded_position} -> element_value

A metadata key stores length and position boundaries: LM:redis_key -> :erlang.term_to_binary({length, next_left_pos, next_right_pos})

Summary

Functions

execute(key, store, operation)

@spec execute(binary(), map(), term()) :: term()

execute_lmove(src_key, dst_key, store, from_dir, to_dir)

@spec execute_lmove(binary(), binary(), map(), :left | :right, :left | :right) ::
  binary() | nil | {:error, term()}