phasedb v0.0.2 PhaseDB.Series
Provies an interface for creating, dropping and querying Series'.
Currently only supports ETS-based cursors, but DETS will be added later on.
Summary
Functions
Creates a series for a given Database
and series_name
Retrieve cursor to a given series' storage. Mostly used by PhaseDB.Queryable
implementations
Drops a Series if it exists
Test whether a series actually exists
Force the series to run a GC flush
Get an existing series
Insert a sample into the series. Used by Insertable
Subscribe to events from this series. The calling process will receive events about this series
Unsubscribe the calling process to updates about this series
Functions
Specs
create({:error, any}, any) :: {:error, any}
create(db :: %PhaseDB.Database{name: term}, series_name :: binary) :: %PhaseDB.Series{database: term, name: term, options: term}
Creates a series for a given Database
and series_name
.
Returns %Series{}
or {:error, reason}
Specs
create({:error, any}, any, any) :: {:error, any}
create(db :: %PhaseDB.Database{name: term}, series_name :: binary, opts :: [...]) :: %PhaseDB.Series{database: term, name: term, options: term}
Specs
cursor({:error, any}) :: {:error, any}
cursor(series :: %PhaseDB.Series{database: term, name: term, options: term}) ::
struct |
{:error, binary}
Retrieve cursor to a given series' storage. Mostly used by PhaseDB.Queryable
implementations.
Specs
drop({:error, any}) :: {:error, any}
drop(series :: %PhaseDB.Series{database: term, name: term, options: term}) ::
:ok |
{:error, binary}
Drops a Series if it exists.
Returns :ok
or {:error, reason}
Specs
exists?(series :: %PhaseDB.Series{database: term, name: term, options: term}) ::
true |
false
Test whether a series actually exists.
Returns true
or false
Specs
gc(series :: %PhaseDB.Series{database: term, name: term, options: term}) ::
{:ok, integer} |
{:error, binary}
Force the series to run a GC flush.
Specs
get({:error, any}, any) :: {:error, any}
get(db :: %PhaseDB.Database{name: term}, series_name :: binary) :: %PhaseDB.Series{database: term, name: term, options: term}
Get an existing series.
Returns %Series{}
or `{:error, reason}
Specs
insert(series :: %PhaseDB.Series{database: term, name: term, options: term}, sample :: %PhaseDB.Sample{actual: term, received_at: term, recorded_at: term, tags: term, value: term}) ::
{:ok, integer} |
{:error, binary}
Insert a sample into the series. Used by Insertable.
Specs
subscribe(series :: %PhaseDB.Series{database: term, name: term, options: term}) ::
:ok |
{:error, binary}
Subscribe to events from this series. The calling process will receive events about this series..