View Source erlfdb_nif (erlfdb v0.3.1)

The NIF wrapper around all FoundationDB C API function calls.

Tip

Use erlfdb instead.

Summary

Types

-type atomic_mode() ::
          add | bit_and | bit_or | bit_xor | append_if_fits | max | min | byte_min | byte_max |
          set_versionstamped_key | set_versionstamped_value.
-type atomic_operand() :: integer() | binary().
-type conflict_type() :: read | write.
-type database() :: {erlfdb_database, reference()}.
-type database_option() :: location_cache_size | max_watches | machine_id | datacenter_id.
-type error() :: {erlfdb_error, Code :: integer()}.
-type error_predicate() :: retryable | maybe_committed | retryable_not_committed.
-type future() :: {erlfdb_future, reference(), reference()}.
-type future_result() ::
          database() |
          integer() |
          value() |
          {[{key(), value()}], integer(), boolean()} |
          not_found | [] |
          [{key(), value()}] |
          [{{key(), value()}, {key(), key()}, [{key(), value()}]}] |
          ok.
-type key() :: binary().
-type key_selector() ::
          {Key :: binary(), lt | lteq | gt | gteq} |
          {Key :: binary(), OrEqual :: boolean(), Offset :: integer()}.
-type option_value() :: integer() | binary().
-type streaming_mode() ::
          stream_want_all | stream_iterator | stream_exact | stream_small | stream_medium |
          stream_large | stream_serial.
-type tenant() :: {erlfdb_tenant, reference()}.
-type transaction() :: {erlfdb_transaction, reference()}.
-type transaction_option() ::
          causal_write_risky | causal_read_risky | causal_read_disable |
          next_write_no_write_conflict_range | read_your_writes_disable | read_ahead_disable |
          durability_datacenter | durability_risky | durability_dev_null_is_web_scale |
          priority_system_immediate | priority_batch | initialize_new_database | access_system_keys |
          read_system_keys | debug_retry_logging | transaction_logging_enable | timeout | retry_limit |
          max_retry_delay | snapshot_ryw_enable | snapshot_ryw_disable | lock_aware |
          used_during_commit_protection_disable | read_lock_aware | size_limit | allow_writes |
          disallow_writes.
-type value() :: binary().
-type version() :: integer().

Functions

Link to this function

create_database(ClusterFilePath)

View Source
-spec create_database(ClusterFilePath :: binary()) -> database().
Link to this function

database_create_transaction/1

View Source
-spec database_create_transaction(database()) -> transaction().
-spec database_open_tenant(database(), TenantName :: binary()) -> tenant().
Link to this function

database_set_option(Database, Option)

View Source
-spec database_set_option(database(), Option :: database_option()) -> ok.
-spec database_set_option(database(), Option :: database_option(), Value :: option_value()) -> ok.
Link to this function

error_predicate(Predicate, Error)

View Source
-spec error_predicate(Predicate :: error_predicate(), Error :: integer()) -> boolean().
-spec future_cancel(future()) -> ok.
-spec future_get(future()) -> future_result().
-spec future_get_error(future()) -> error().
-spec future_is_ready(future()) -> boolean().
-spec future_silence(future()) -> ok.
-spec get_error(integer()) -> binary().
-spec get_max_api_version() -> {ok, integer()}.
Link to this function

tenant_create_transaction/1

View Source
-spec tenant_create_transaction(tenant()) -> transaction().
Link to this function

transaction_add_conflict_range/4

View Source
-spec transaction_add_conflict_range(transaction(),
                                     StartKey :: binary(),
                                     EndKey :: binary(),
                                     ConflictType :: conflict_type()) ->
                                        ok.
-spec transaction_atomic_op(transaction(),
                            Key :: binary(),
                            Operand :: atomic_operand(),
                            Mode :: atomic_mode()) ->
                               ok.
-spec transaction_cancel(transaction()) -> ok.
-spec transaction_clear(transaction(), Key :: binary()) -> ok.
Link to this function

transaction_clear_range/3

View Source
-spec transaction_clear_range(transaction(), StartKey :: binary(), EndKey :: binary()) -> ok.
-spec transaction_commit(transaction()) -> future().
-spec transaction_get(transaction(), Key :: binary(), Snapshot :: boolean()) -> future().
Link to this function

transaction_get_addresses_for_key/2

View Source
-spec transaction_get_addresses_for_key(transaction(), Key :: binary()) -> future().
Link to this function

transaction_get_approximate_size/1

View Source
-spec transaction_get_approximate_size(transaction()) -> non_neg_integer().
Link to this function

transaction_get_committed_version/1

View Source
-spec transaction_get_committed_version(transaction()) -> integer().
Link to this function

transaction_get_estimated_range_size/3

View Source
-spec transaction_get_estimated_range_size(transaction(), StartKey :: binary(), EndKey :: binary()) ->
                                              future().
-spec transaction_get_key(transaction(), KeySelector :: key_selector(), Snapshot :: boolean()) ->
                             future().
Link to this function

transaction_get_mapped_range/10

View Source
-spec transaction_get_mapped_range(transaction(),
                                   StartKeySelector :: key_selector(),
                                   EndKeySelector :: key_selector(),
                                   Mapper :: binary(),
                                   Limit :: non_neg_integer(),
                                   TargetBytes :: non_neg_integer(),
                                   StreamingMode :: streaming_mode(),
                                   Iteration :: non_neg_integer(),
                                   Snapshot :: boolean(),
                                   Reverse :: integer()) ->
                                      future().
Link to this function

transaction_get_next_tx_id/1

View Source
-spec transaction_get_next_tx_id(transaction()) -> non_neg_integer().
-spec transaction_get_range(transaction(),
                            StartKeySelector :: key_selector(),
                            EndKeySelector :: key_selector(),
                            Limit :: non_neg_integer(),
                            TargetBytes :: non_neg_integer(),
                            StreamingMode :: streaming_mode(),
                            Iteration :: non_neg_integer(),
                            Snapshot :: boolean(),
                            Reverse :: integer()) ->
                               future().
Link to this function

transaction_get_range_split_points/4

View Source
-spec transaction_get_range_split_points(transaction(),
                                         StartKey :: binary(),
                                         EndKey :: binary(),
                                         ChunkSize :: non_neg_integer()) ->
                                            future().
Link to this function

transaction_get_read_version/1

View Source
-spec transaction_get_read_version(transaction()) -> future().
Link to this function

transaction_get_versionstamp/1

View Source
-spec transaction_get_versionstamp(transaction()) -> future().
Link to this function

transaction_get_writes_allowed/1

View Source
-spec transaction_get_writes_allowed(transaction()) -> true | false.
Link to this function

transaction_has_watches/1

View Source
-spec transaction_has_watches(transaction()) -> true | false.
Link to this function

transaction_is_read_only/1

View Source
-spec transaction_is_read_only(transaction()) -> true | false.
-spec transaction_on_error(transaction(), Error :: integer()) -> future().
-spec transaction_reset(transaction()) -> ok.
-spec transaction_set(transaction(), Key :: binary(), Val :: binary()) -> ok.
Link to this function

transaction_set_option(Transaction, Option)

View Source
-spec transaction_set_option(transaction(), Option :: transaction_option()) -> ok.
Link to this function

transaction_set_option/3

View Source
-spec transaction_set_option(transaction(), Option :: transaction_option(), Value :: option_value()) ->
                                ok.
Link to this function

transaction_set_read_version/2

View Source
-spec transaction_set_read_version(transaction(), Version :: integer()) -> ok.
-spec transaction_watch(transaction(), Key :: binary()) -> future().