Configuration module
Author(s): Arsen Kostenko.
This is the initial system-wide configuration storage module. All the configurations stored here are represented by command-line arguments or corresponding terms, depending on the server launching style.
Usage and interface
- Library usage:
:- use_module(library(dht_config)). - Exports:
- Predicates:
hash_power/1, dht_set_hash_power/1, dht_s2c_port/1, dht_set_s2c_port/1, dht_s2c_threads/1, dht_set_s2c_threads/1, dht_s2s_port/1, dht_set_s2s_port/1, dht_s2s_threads/1, dht_set_s2s_threads/1, dht_join_host/1, dht_set_join_host/1, dht_server_id/1, dht_set_server_id/1, dht_server_host/1, dht_set_server_host/1.
- Predicates:
- Imports:
- Packages:
prelude, nonpure, assertions, regtypes, isomodes.
- Packages:
Documentation on exports
PREDICATE
Get/check power of currently running DHT. Hash function has (2**m) values, therefore hash_power/1 returns/checks m.
Usage 1:hash_power(Power)
Bound Power to value of currently running DHT power.
- The following properties should hold at call time:
(term_typing:var/1)Power is a free variable. - The following properties should hold upon exit:
(basic_props:int/1)Power is an integer.
Usage 2:hash_power(Power)
Check whether Power is equal to power of the currently running DHT.
- The following properties should hold at call time:
(basic_props:int/1)Power is an integer.
PREDICATE
Set initial power of hash function.
Usage:dht_set_hash_power(Power)
Set m for (2**m) formula.
- The following properties should hold at call time:
(basic_props:int/1)Power is an integer.
PREDICATE
Get/check server to client communication port.
Usage 1:dht_s2c_port(Port)
Set value of Port to currently used port number for server-to-client communication.
- The following properties should hold at call time:
(term_typing:var/1)Port is a free variable. - The following properties should hold upon exit:
(basic_props:int/1)Port is an integer.
Usage 2:dht_s2c_port(Port)
Check whether value of Port is equal to currently used port number for server-to-client communication.
- The following properties should hold at call time:
(basic_props:int/1)Port is an integer.