View Source FDBC.Network (fdbc v0.1.4)

A module used to start and stop the network thread which is responsible for running most of the clients tasks.

Summary

Functions

Starts the networking thread used for communication with FoundationDB.

Stops the network threat.

Functions

start(opts \\ [])

@spec start(keyword()) :: :ok

Starts the networking thread used for communication with FoundationDB.

Options

  • :callbacks_on_external_threats - (true) If set, callbacks from external client libraries can be called from threads created by the FoundationDB client library. Otherwise, callbacks will be called from either the thread used to add the callback or the network thread. Setting this option can improve performance when connected using an external client, but may not be safe to use in all environments. Must be set before setting up the network. WARNING: This feature is considered experimental at this time.

  • :client_threads_per_version - (integer) Spawns multiple worker threads for each version of the client that is loaded. Setting this to a number greater than one implies :disable_local_client.

  • :client_tmp_dir - (binary) Sets the directory for storing temporary files created by FDBC client, such as temporary copies of client libraries. Defaults to /tmp.

  • :disable_client_bypass - (true) Prevents the multi-version client API from being disabled, even if no external clients are configured. This option is required to use GRV caching.

  • :disable_client_statistics_logging - (true) Disables logging of client statistics, such as sampled transaction activity.

  • :disable_local_client - (true) Prevents connections through the local client, allowing only connections through externally loaded client libraries.

  • :disable_multi_version_client_api - (true) Disables the multi-version client API and instead uses the local client directly.

  • :distributed_client_tracer - (atom) Set a tracer to run on the client. Should be set to the same value as the tracer set on the server. Valid values are nil, :log_file or :network_lossy.

  • :enable_run_loop_profiling - (true) Enables debugging feature to perform run loop profiling. Requires trace logging to be enabled. WARNING: this feature is not recommended for use in production.

  • :external_client_directory - (binary) Searches the specified path for dynamic libraries and adds them to the list of client libraries for use by the multi-version client API.

  • :external_client_library - (binary) Adds an external client library for use by the multi-version client API.

  • :fail_incompatible_client - (true) Fail with an error if there is no client matching the server version the client is connecting to.

  • :ignore_external_client_failures - (true) Ignore the failure to initialize some of the external clients.

  • :knob - (binary) Set internal tuning or debugging knobs.

  • :retain_client_library_copies - (true) Retain temporary external client library copies that are created for enabling multi-threading.

  • :tls_ca_bytes - (binary) Set the certificate authority bundle.

  • :tls_ca_path - (binary) Set the file from which to load the certificate authority bundle.

  • :tls_cert_bytes - (binary) Set the certificate chain.

  • :tls_cert_path - (binary) Set the file from which to load the certificate chain.

  • :tls_disable_plaintext_connection - (true) Prevent client from connecting to a non-TLS endpoint by throwing network connection failed error.

  • :tls_key_bytes - (binary) Set the private key corresponding to your own certificate.

  • :tls_key_path - (binary) Set the file from which to load the private key corresponding to your own certificate.

  • :tls_password - (binary) Set the passphrase for encrypted private key.

  • :tls_verify_peers - (true) Set the peer certificate field verification criteria.

  • :trace_clock_source - (atom) Select clock source for trace files. Valid values are :now or realtime. Defaults to :now.

  • :trace_enable - (true) Enables trace output to a file in a directory of the clients choosing.

  • :trace_file_identifier - (binary) Once provided, this string will be used to replace the port/PID in the log file names.

  • :trace_format - (atom) Select the format of the log files. Valid values are :xml and :json. Defaults to :xml.

  • :trace_initialize_on_setup - (true) Initialize trace files on network setup, determine the local IP later. Otherwise tracing is initialized when opening the first database.

  • :trace_log_group - (binary) Sets the 'LogGroup' attribute with the specified value for all events in the trace output files. The default log group is 'default'.

  • :trace_max_logs_size - (integer) Sets the maximum size of all the trace output files put together. If the value is set to 0, there is no limit on the total size of the files. The default is a maximum size of 104,857,600 bytes. If the de fault roll size is used, this means that a maximum of 10 trace files will be written at a time.

  • :trace_partial_file_suffix - (binary) Set file suffix for partially written log files.

  • :trace_roll_size - (integer) Sets the maximum size in bytes of a single trace output file. If the value is set to 0, there is no limit on individual file size. The default is a maximum size of 10,485,760 bytes.

  • :trace_share_among_client_threads - (true) Use the same base trace file name for all client threads as it did before version 7.2. The current default behavior is to use distinct trace file names for client threads by including their version and thread index.

stop()

@spec stop() :: :ok

Stops the network threat.

Warning

Once the network is stopped it cannot be restarted during the lifetime of the running program.