一、下载安装
二、集群搭建
三、调优
四、客户端选择
五、Java Driver 1.0 for Apache Cassandra
Java classes to CQL3 data types
CQL3 data type | Java type |
---|---|
ascii | java.lang.String |
bigint | long |
blob | java.nio.ByteBuffer |
boolean | boolean |
counter | long |
decimal | java.math.BigDecimal |
double | double |
float | float |
inet | java.net.InetAddress |
int | int |
list | java.util.List<T> |
map | java.util.Map<K, V> |
set | java.util.Set<T> |
text | java.lang.String |
timestamp | java.util.Date |
timeuuid | java.util.UUID |
uuid | java.util.UUID |
varchar | java.lang.String |
varint | java.math.BigInteger |
CQL
CQL Data Types
CQL Type | Constants | Description |
---|---|---|
ascii | strings | US-ASCII character string |
bigint | integers | 64-bit signed long |
blob | blobs | Arbitrary bytes (no validation), expressed as hexadecimal |
boolean | booleans | true or false |
counter | integers | Distributed counter value (64-bit long) |
decimal | integers, floats | Variable-precision decimal |
double | integers | 64-bit IEEE-754 floating point |
float | integers, floats | 32-bit IEEE-754 floating point |
inet | strings | IP address string in IPv4 or IPv6 format* |
int | integers | 32-bit signed integer |
list | n/a | A collection of one or more ordered elements |
map | n/a | A JSON-style array of literals: { literal : literal, literal : literal ... } |
set | n/a | A collection of one or more elements |
text | strings | UTF-8 encoded string |
timestamp | integers, strings | Date plus time, encoded as 8 bytes since epoch |
uuid | uuids | A UUID in format |
timeuuid | uuids | Type 1 UUID only (CQL 3) |
varchar | strings | UTF-8 encoded string |
varint | integers | Arbitrary-precision integer |
*Used by python-cql driver and binary protocols.
六、异常
com.datastax.driver.core.exceptions.UnavailableException: Not enough replica available for query at consistency ONE (1 required but only 0 alive)
解决:
Bad Request: ORDER BY is only supported when the partition key is restricted by an EQ or an IN.
七、keyspace的两种类型与snitch集群解疑
八、cql语法