Skip to content
This repository
tree: 46ebecdaec
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 39 lines (30 sloc) 1.316 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

-record(bitcask_entry, { key :: binary(),
                         file_id :: integer(),
                         total_sz :: integer(),
                         offset :: integer() | binary(),
                         tstamp :: integer() }).


%% @type filestate().
-record(filestate, {mode, % File mode: read_only, read_write
                    filename, % Filename
                    tstamp, % Tstamp portion of filename
                    fd, % File handle
                    hintfd, % File handle for hints
                    hintcrc=0,% CRC-32 of current hint
                    ofs }). % Current offset for writing

-record(file_status, { filename,
                       fragmented,
                       dead_bytes,
                       total_bytes,
                       oldest_tstamp }).


-define(FMT(Str, Args), lists:flatten(io_lib:format(Str, Args))).

-define(TOMBSTONE, <<"bitcask_tombstone">>).

-define(OFFSETFIELD, 64).
-define(TSTAMPFIELD, 32).
-define(KEYSIZEFIELD, 16).
-define(TOTALSIZEFIELD, 32).
-define(VALSIZEFIELD, 32).
-define(CRCSIZEFIELD, 32).
-define(HEADER_SIZE, 14). % 4 + 4 + 2 + 4 bytes
-define(MAXKEYSIZE, 2#1111111111111111).
-define(MAXVALSIZE, 2#11111111111111111111111111111111).
-define(MAXOFFSET, 16#ffffffffffffffff). % max 64-bit unsigned
Something went wrong with that request. Please try again.