Electric.ShapeCache.PureFileStorage.KeyIndex (electric v1.1.0)

View Source

Summary

Functions

copy_adjusting_positions(source, target, starting_pos, adjustment)

expected_position(pos, arg)

make_entry(arg, log_file_entry_start_pos, label \\ 0)

@spec make_entry(
  Electric.ShapeCache.PureFileStorage.LogFile.log_item_with_sizes(),
  non_neg_integer(),
  non_neg_integer()
) :: {iodata(), iodata_size :: non_neg_integer()}

read_key_file(path)

sort(inputs, output)

stream_for_actions(path, starting_pos \\ 0)

trim(path, log_file_path, search_start_pos)

write_from_stream(stream, path, label)

This is a "side-write" function when log file is being written start-to-end.

"Live" keyfile appends shouldn't be done using this function because we're not controlling flush points.