cassandra java driver
java driver version: com.datastax.cassandra:cassandra-driver-core:3.1.2
概念
cassandra driver 与 cassandra cluster server 通过TCP协议进行异步通信。
首先,driver与cassandra建立连接创建Cluster对象,它代表这个cassandra集群,通过Cluster对象可以拿到一些元数据信息,例如keyspace,table,host等。其次,由Cluster对象创建Session对象,通过它就可以进行sql操作了。
Mapper
objects are thread-safe. The manager caches them internally, so calling manager#mapper
more than once for the same class will return the previously generated mapper.
The MappingManager
can then process this interface and automatically generate an implementation for it:
Like mappers, accessors are cached at the manager level and thus, are thread-safe/sharable.