Merge pull request #150 from martinsumner/mas-i29-linkall
Mas i29 linkall
This commit is contained in:
commit
461779b739
7 changed files with 34 additions and 18 deletions
|
@ -315,7 +315,7 @@ book_start(RootPath, LedgerCacheSize, JournalSize, SyncStrategy) ->
|
|||
%% comments on the open_options() type
|
||||
|
||||
book_start(Opts) ->
|
||||
gen_server:start(?MODULE, [set_defaults(Opts)], []).
|
||||
gen_server:start_link(?MODULE, [set_defaults(Opts)], []).
|
||||
|
||||
|
||||
-spec book_tempput(pid(), any(), any(), any(),
|
||||
|
@ -916,12 +916,12 @@ snapshot_store(LedgerCache, Penciller, Inker, SnapType, Query, LongRunning) ->
|
|||
snapshot_query = Query,
|
||||
snapshot_longrunning = LongRunning,
|
||||
bookies_mem = BookiesMem},
|
||||
{ok, LedgerSnapshot} = leveled_penciller:pcl_start(PCLopts),
|
||||
{ok, LedgerSnapshot} = leveled_penciller:pcl_snapstart(PCLopts),
|
||||
case SnapType of
|
||||
store ->
|
||||
InkerOpts = #inker_options{start_snapshot=true,
|
||||
source_inker=Inker},
|
||||
{ok, JournalSnapshot} = leveled_inker:ink_start(InkerOpts),
|
||||
{ok, JournalSnapshot} = leveled_inker:ink_snapstart(InkerOpts),
|
||||
{ok, LedgerSnapshot, JournalSnapshot};
|
||||
ledger ->
|
||||
{ok, LedgerSnapshot, null}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
-ifdef(fsm_deprecated).
|
||||
-compile({nowarn_deprecated_function,
|
||||
[{gen_fsm, start, 3},
|
||||
[{gen_fsm, start_link, 3},
|
||||
{gen_fsm, sync_send_event, 3},
|
||||
{gen_fsm, sync_send_event, 2},
|
||||
{gen_fsm, send_event, 2},
|
||||
|
@ -162,7 +162,7 @@ cdb_open_writer(Filename) ->
|
|||
%% hashtree cached in memory (the file will need to be scanned to build the
|
||||
%% hashtree)
|
||||
cdb_open_writer(Filename, Opts) ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [Opts], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [Opts], []),
|
||||
ok = gen_fsm:sync_send_event(Pid, {open_writer, Filename}, infinity),
|
||||
{ok, Pid}.
|
||||
|
||||
|
@ -177,7 +177,9 @@ cdb_open_writer(Filename, Opts) ->
|
|||
%% determine when scans over a file have completed.
|
||||
cdb_reopen_reader(Filename, LastKey, CDBopts) ->
|
||||
{ok, Pid} =
|
||||
gen_fsm:start(?MODULE, [CDBopts#cdb_options{binary_mode=true}], []),
|
||||
gen_fsm:start_link(?MODULE,
|
||||
[CDBopts#cdb_options{binary_mode=true}],
|
||||
[]),
|
||||
ok = gen_fsm:sync_send_event(Pid,
|
||||
{open_reader, Filename, LastKey},
|
||||
infinity),
|
||||
|
@ -198,7 +200,7 @@ cdb_open_reader(Filename) ->
|
|||
%% to discover the LastKey.
|
||||
%% Allows non-default cdb_options to be passed
|
||||
cdb_open_reader(Filename, Opts) ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [Opts], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [Opts], []),
|
||||
ok = gen_fsm:sync_send_event(Pid, {open_reader, Filename}, infinity),
|
||||
{ok, Pid}.
|
||||
|
||||
|
@ -2459,7 +2461,7 @@ safe_read_test() ->
|
|||
|
||||
|
||||
nonsense_coverage_test() ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [#cdb_options{}], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [#cdb_options{}], []),
|
||||
ok = gen_fsm:send_all_state_event(Pid, nonsense),
|
||||
?assertMatch({next_state, reader, #state{}}, handle_info(nonsense,
|
||||
reader,
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
%% @doc
|
||||
%% Generate a new clerk
|
||||
clerk_new(InkerClerkOpts) ->
|
||||
gen_server:start(?MODULE, [InkerClerkOpts], []).
|
||||
gen_server:start_link(?MODULE, [InkerClerkOpts], []).
|
||||
|
||||
-spec clerk_compact(pid(), pid(),
|
||||
fun(), fun(), fun(),
|
||||
|
|
|
@ -94,6 +94,7 @@
|
|||
terminate/2,
|
||||
code_change/3,
|
||||
ink_start/1,
|
||||
ink_snapstart/1,
|
||||
ink_put/4,
|
||||
ink_mput/3,
|
||||
ink_get/3,
|
||||
|
@ -169,6 +170,12 @@
|
|||
%% The inker will need to know what the reload strategy is, to inform the
|
||||
%% clerk about the rules to enforce during compaction.
|
||||
ink_start(InkerOpts) ->
|
||||
gen_server:start_link(?MODULE, [InkerOpts], []).
|
||||
|
||||
-spec ink_snapstart(inker_options()) -> {ok, pid()}.
|
||||
%% @doc
|
||||
%% Don't link on startup as snapshot
|
||||
ink_snapstart(InkerOpts) ->
|
||||
gen_server:start(?MODULE, [InkerOpts], []).
|
||||
|
||||
-spec ink_put(pid(),
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
clerk_new(Owner, Manifest, CompressionMethod) ->
|
||||
{ok, Pid} =
|
||||
gen_server:start(?MODULE,
|
||||
gen_server:start_link(?MODULE,
|
||||
[{compression_method, CompressionMethod}],
|
||||
[]),
|
||||
ok = gen_server:call(Pid, {load, Owner, Manifest}, infinity),
|
||||
|
|
|
@ -170,6 +170,7 @@
|
|||
code_change/3]).
|
||||
|
||||
-export([
|
||||
pcl_snapstart/1,
|
||||
pcl_start/1,
|
||||
pcl_pushmem/2,
|
||||
pcl_fetchlevelzero/2,
|
||||
|
@ -308,6 +309,12 @@
|
|||
%% query is run against the level zero space and just the query results are
|
||||
%5 copied into the clone.
|
||||
pcl_start(PCLopts) ->
|
||||
gen_server:start_link(?MODULE, [PCLopts], []).
|
||||
|
||||
-spec pcl_snapstart(penciller_options()) -> {ok, pid()}.
|
||||
%% @doc
|
||||
%% Don't link to the bookie - this is a snpashot
|
||||
pcl_snapstart(PCLopts) ->
|
||||
gen_server:start(?MODULE, [PCLopts], []).
|
||||
|
||||
-spec pcl_pushmem(pid(), bookies_memory()) -> ok|returned.
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
|
||||
-ifdef(fsm_deprecated).
|
||||
-compile({nowarn_deprecated_function,
|
||||
[{gen_fsm, start, 3},
|
||||
[{gen_fsm, start_link, 3},
|
||||
{gen_fsm, sync_send_event, 3},
|
||||
{gen_fsm, send_event, 2},
|
||||
{gen_fsm, send_all_state_event, 2}]}).
|
||||
|
@ -209,7 +209,7 @@
|
|||
%%
|
||||
%% The filename should include the file extension.
|
||||
sst_open(RootPath, Filename) ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [], []),
|
||||
case gen_fsm:sync_send_event(Pid,
|
||||
{sst_open, RootPath, Filename},
|
||||
infinity) of
|
||||
|
@ -228,7 +228,7 @@ sst_open(RootPath, Filename) ->
|
|||
%% pairs. This should not be used for basement levels or unexpanded Key/Value
|
||||
%% lists as merge_lists will not be called.
|
||||
sst_new(RootPath, Filename, Level, KVList, MaxSQN, PressMethod) ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [], []),
|
||||
PressMethod0 = compress_level(Level, PressMethod),
|
||||
{[], [], SlotList, FK} = merge_lists(KVList, PressMethod0),
|
||||
case gen_fsm:sync_send_event(Pid,
|
||||
|
@ -276,7 +276,7 @@ sst_new(RootPath, Filename,
|
|||
[] ->
|
||||
empty;
|
||||
_ ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [], []),
|
||||
case gen_fsm:sync_send_event(Pid,
|
||||
{sst_new,
|
||||
RootPath,
|
||||
|
@ -303,7 +303,7 @@ sst_newlevelzero(RootPath, Filename,
|
|||
Slots, FetchFun, Penciller,
|
||||
MaxSQN, PressMethod) ->
|
||||
PressMethod0 = compress_level(0, PressMethod),
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [], []),
|
||||
gen_fsm:send_event(Pid,
|
||||
{sst_newlevelzero,
|
||||
RootPath,
|
||||
|
@ -2802,7 +2802,7 @@ key_dominates_test() ->
|
|||
key_dominates([KV7|KL2], [KV2], {true, 1})).
|
||||
|
||||
nonsense_coverage_test() ->
|
||||
{ok, Pid} = gen_fsm:start(?MODULE, [], []),
|
||||
{ok, Pid} = gen_fsm:start_link(?MODULE, [], []),
|
||||
ok = gen_fsm:send_all_state_event(Pid, nonsense),
|
||||
?assertMatch({next_state, reader, #state{}}, handle_info(nonsense,
|
||||
reader,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue