consistency

consistency [[ABSOLUTE(default) | NONE_REQUIRED] [-time -permissible-lag <time_ms> -timeout <time_ms>]]

Configures the read consistency used for this session.

The read operations are serviced either on a master or a replica node depending on the configured value. For more details on consistency, see Consistency Guarantees. The following policies are supported. They are defined in the Consistency class of Java APIs.

If you do not specify this value, the default value ABSOLUTE is applied for this session.

For more details on the policies, see Consistency in the Java Direct Driver API Reference Guide.

Other non-mandatory parameter includes:

-time: Indicates the use of time-based options for tuning the consistency. The following parameters are supported:

For example, you can define the consistency as follows:

sql-> consistency ABSOLUTE -time -permissible-lag 1000 -timeout 5000;

The following sample output confirms the applied read policy:

Read consistency policy: Consistency.Time[permissibleLag_ms=1000, timeout_ms=5000]