Skip to content

Commit

Permalink
Update to SVN r809718.
Browse files Browse the repository at this point in the history
  • Loading branch information
ieure committed Aug 31, 2009
1 parent 5cb00b9 commit c13f202
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
68 changes: 37 additions & 31 deletions cassandra.thrift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#!/usr/local/bin/thrift --java --php --py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
Expand Down Expand Up @@ -36,14 +37,14 @@ namespace rb CassandraThrift
#

struct Column {
1: binary name,
2: binary value,
3: i64 timestamp,
1: required binary name,
2: required binary value,
3: required i64 timestamp,
}

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

struct ColumnOrSuperColumn {
Expand All @@ -62,7 +63,7 @@ exception NotFoundException {

# invalid request (keyspace / CF does not exist, etc.)
exception InvalidRequestException {
1: string why
1: required string why
}

# not all the replicas required could be created / read
Expand All @@ -84,72 +85,77 @@ enum ConsistencyLevel {
}

struct ColumnParent {
3: string column_family,
3: required string column_family,
4: optional binary super_column,
}

struct ColumnPath {
3: string column_family,
3: required string column_family,
4: optional binary super_column,
5: optional binary column,
}

struct SliceRange {
1: binary start,
2: binary finish,
3: bool reversed=0,
4: i32 count=100,
1: required binary start,
2: required binary finish,
3: required bool reversed=0,
4: required i32 count=100,
}

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

typedef map<string, list<ColumnOrSuperColumn>> column_family_map

struct BatchMutation {
1: string key,
2: column_family_map cfmap,
1: required string key,
2: required map<string, list<ColumnOrSuperColumn>> cfmap,
}


service Cassandra {
list<ColumnOrSuperColumn> get_slice(1:string keyspace, 2:string key, 3:ColumnParent column_parent, 4:SlicePredicate predicate, 5:ConsistencyLevel consistency_level=1)
# retrieval methods
ColumnOrSuperColumn get(1:string keyspace, 2:string key, 3:ColumnPath column_path, 4:ConsistencyLevel consistency_level=1)
throws (1: InvalidRequestException ire, 2: NotFoundException nfe),

ColumnOrSuperColumn get(1:string keyspace, 2:string key, 3:ColumnPath column_path, 4:ConsistencyLevel consistency_level=1)
list<ColumnOrSuperColumn> get_slice(1:string keyspace, 2:string key, 3:ColumnParent column_parent, 4:SlicePredicate predicate, 5:ConsistencyLevel consistency_level=1)
throws (1: InvalidRequestException ire, 2: NotFoundException nfe),

map<string,ColumnOrSuperColumn> multiget(1:string keyspace, 2:list<string> keys, 3:ColumnPath column_path, 4:ConsistencyLevel consistency_level=1)
throws (1: InvalidRequestException ire),

map<string,list<ColumnOrSuperColumn>> multiget_slice(1:string keyspace, 2:list<string> keys, 3:ColumnParent column_parent, 4:SlicePredicate predicate, 5:ConsistencyLevel consistency_level=1)
throws (1: InvalidRequestException ire),

i32 get_count(1:string keyspace, 2:string key, 3:ColumnParent column_parent, 5:ConsistencyLevel consistency_level=1)
throws (1: InvalidRequestException ire),

void insert(1:string keyspace, 2:string key, 3:ColumnPath column_path, 4:binary value, 5:i64 timestamp, 6:ConsistencyLevel consistency_level=0)
# range query: returns matching keys
list<string> get_key_range(1:string keyspace, 2:string column_family, 3:string start="", 4:string finish="", 5:i32 count=100, 6:ConsistencyLevel consistency_level=1)
throws (1: InvalidRequestException ire),

# modification methods
void insert(1:string keyspace, 2:string key, 3:ColumnPath column_path, 4:binary value, 5:i64 timestamp, 6:ConsistencyLevel consistency_level=0)
throws (1: InvalidRequestException ire, 2: UnavailableException ue),

void batch_insert(1:string keyspace, 2:BatchMutation batch_mutation, 3:ConsistencyLevel consistency_level=0)
void batch_insert(1:string keyspace, 2:BatchMutation batch_mutation, 3:ConsistencyLevel consistency_level=0)
throws (1: InvalidRequestException ire, 2: UnavailableException ue),

void remove(1:string keyspace, 2:string key, 3:ColumnPath column_path, 4:i64 timestamp, 5:ConsistencyLevel consistency_level=0)
void remove(1:string keyspace, 2:string key, 3:ColumnPath column_path, 4:i64 timestamp, 5:ConsistencyLevel consistency_level=0)
throws (1: InvalidRequestException ire, 2: UnavailableException ue),

# range query: returns matching keys
list<string> get_key_range(1:string keyspace, 2:string column_family, 3:string start="", 4:string finish="", 5:i32 count=100)
throws (1: InvalidRequestException ire),

/////////////////////////////////////////////////////////////////////////////////////
// The following are beta APIs being introduced for CLI and/or CQL support. //
// These are still experimental, and subject to change. //
/////////////////////////////////////////////////////////////////////////////////////
// Meta-APIs -- APIs to get information about the node or cluster,
// rather than user data. The nodeprobe program provides usage examples.

// get property whose value is of type "string"
string get_string_property(1:string property),
string get_string_property(1:string property),

// get property whose value is list of "strings"
list<string> get_string_list_property(1:string property),
list<string> get_string_list_property(1:string property),

// describe specified keyspace
map<string, map<string, string>> describe_keyspace(1:string keyspace)
map<string, map<string, string>> describe_keyspace(1:string keyspace)
throws (1: NotFoundException nfe),
}

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from setuptools import setup, find_packages

setup(name="Cassandra",
version='svn808045',
version='svn809718',
description="Thrift client for Cassandra",
url="http://incubator.apache.org/cassandra/",
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
Expand Down

0 comments on commit c13f202

Please sign in to comment.