The policy module defines policies and policy values that
define the behavior of database commands. Most Client methods,
including scans and queries, accept a policy object, that affects how the
database command is executed, by specifying timeouts, transactional
behavior, etc. Global defaults for specific types of database commands can
also be set through the client config, when a new Client instance is
created.
Different policies apply to different types of database commands:
Base policy BasePolicy class which defines common policy
values that apply to all database commands
(except InfoPolicy, AdminPolicy, MapPolicy and ListPolicy).
This module also defines global values for the following policy settings:
commitLevel - Specifies the
number of replicas required to be successfully committed before returning
success in a write operation to provide the desired consistency guarantee.
exists - Specifies the behavior for
writing the record depending whether or not it exists.
gen - Specifies the behavior of record
modifications with regard to the generation value.
key - Specifies the behavior for
whether keys or digests should be sent to the cluster.
readModeAP - How duplicates
should be consulted in a read operation.
The policy module defines policies and policy values that define the behavior of database commands. Most Client methods, including scans and queries, accept a policy object, that affects how the database command is executed, by specifying timeouts, transactional behavior, etc. Global defaults for specific types of database commands can also be set through the client config, when a new Client instance is created.
Different policies apply to different types of database commands:
Base policy BasePolicy class which defines common policy values that apply to all database commands (except
InfoPolicy
,AdminPolicy
,MapPolicy
andListPolicy
).This module also defines global values for the following policy settings:
Example