Add an example controller for hardware switch test
This commit is contained in:
parent
cfc2152b7d
commit
f2297c551a
16 changed files with 501 additions and 50 deletions
|
|
@ -3,7 +3,7 @@
|
|||
-include_lib("stdlib/include/ms_transform.hrl").
|
||||
|
||||
-export([create/0, drop/1]).
|
||||
-export([insert/3, update/3, get/2, delete/2, is_exists/2]).
|
||||
-export([insert/3, update/3, get/2, delete/2, is_exists/2, is_empty/1]).
|
||||
|
||||
-define(TABLE, xact_kv).
|
||||
-define(ENTRY, xact_entry).
|
||||
|
|
@ -44,6 +44,13 @@ is_exists(Tid, Xid) ->
|
|||
[] -> false
|
||||
end.
|
||||
|
||||
-spec is_empty(reference()) -> boolean().
|
||||
is_empty(Tid) ->
|
||||
case ets:info(Tid, size) of
|
||||
0 -> true;
|
||||
_ -> false
|
||||
end.
|
||||
|
||||
%% Private functions
|
||||
|
||||
ms_for_exists(Xid) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue