Skip to content

Consistency Level

DuyHai DOAN edited this page Mar 19, 2017 · 23 revisions

Static definition

Consistency levels can be defined statically with entity mapping using the @Consistency annotation. Please refer to Achilles Annotations for more details.


Runtime setting

For all the CRUD API and DSL API, Achilles allow you to inject Consistency level:

	manager
		.crud() | .dsl() 
		...
		.withConsistencyLevel(...)
		.execute() | getOne() | getList() ...
		

Settings priority

Consistency levels can be defined at different places. Below is a summary of all type of consistency levels and their respective priority

Priority (in ascending order). Description
0 Hard-coded defaults LOCAL_ONE and LOCAL_SERIAL
1 Default consistency level defined on the com.datastax.driver.core.Cluster object
2 Default consistency level defined in Achilles configuration (if any)
3 Default read/write/serial consistency level map defined in Achilles configuration (if any)
4 Static @Consistency annotation on class
5 Defined at runtime using withConsistency(...) method

Home

Clone this wiki locally