Cassandra 数据类型

Cassandra 数据类型

Column:是Cassandra中最基本的存储单元 (一行信息)
struct Column {
 1 : binary name
        2 : binary value
        3 : i64 timestamp
}

SuperColumn 其实是在Super类型的ColumnFamily中存储数据的单元 包含多个Column

struct SuperColumn{
 1 binary name
        2 list<Column> columns
}

ColumnOrSuperColumn 即可以为一个Column也可以为SuperColumn,两个只能有一个有值

struct ColumnOrSuperColumn {
 1 opt Column column
   2 opt SuperColumn superColumn
}

ColumnParent 相当于文件系统中的一个目录

struct ColumnParent{
 1 string column_family
        2 binary superColumn
}

ColumnPath 相当于文件系统中一个具体的文件

struct ColumnPath {
 1 string column_family
 2 binary super_column
 3 binary column
}

SliceRange 当我们查询某一个Key下面的Value的时候,可以通过SliceRange来指定需要返回的Column规则

struct SliceRange{
 1 binary start 开始的Column名称
 2 binary finish 最后一个Column名称
 3 bool reversed=0
 4 i32 count=0
}

SlicePredicate 查询某一个Key下面的Value 的时候,通过SlicePredicate来指定需要返回哪些Column

struct SlicePredicate {
 1 list<binary> column_names
 2 SliceRange slice_range
}


Deletion 删除某一个key中的Column 或者Key中的SuperColumn下的Column

struct Deletion{
 1 i64 timestamp;
 2 binary super_column
 3 SlicePredicate predicate
}

Mutation 修改(更新,插入) 和 删除。

struct Mutation{
 1 ColumnOrSuperColumn column
 2 Deletion deletion
}

struct KeyRange{
 1 string start_token
 2 stringend_token
 3 i32 count
}

struct KeySlice{
 1 string key
 2 list<ColumnOrSuperColumn> columns
}

struct TokenRange{
 1 string start_token
 2 end_token
 3 list<string> endpoints;
}

猜你喜欢

转载自mojianpo.iteye.com/blog/2038032