Skip to content

Commit

Permalink
Less Invasive MultiGet_MultiSlice Implementation (#8)
Browse files Browse the repository at this point in the history
* new iface

* Thrift

* More Thrift

* Cassandra server changes

* update tests

* no withOutAnderr

* CR - depend on abstraction

* Tighten the contract of MGMS

* Ban different-types and update tests

* fail sooner on invalid query (#12)

* fail sooner on invalid query

* iterate entry set instead of key set with lookups
  • Loading branch information
jeremyk-91 authored and tpetracca committed Mar 11, 2019
1 parent 8d244e7 commit 09d98da
Show file tree
Hide file tree
Showing 7 changed files with 1,573 additions and 637 deletions.
3 changes: 3 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
<dependency groupId="org.jboss.byteman" artifactId="byteman" version="${byteman.version}" scope="test"/>
<dependency groupId="org.jboss.byteman" artifactId="byteman-submit" version="${byteman.version}" scope="test"/>
<dependency groupId="org.jboss.byteman" artifactId="byteman-bmunit" version="${byteman.version}" scope="test"/>
<dependency groupId="org.assertj" artifactId="assertj-core" version="3.12.0" scope="test"/>


<dependency groupId="org.openjdk.jmh" artifactId="jmh-core" version="1.1.1"/>
Expand Down Expand Up @@ -479,6 +480,7 @@
artifactId="cassandra-parent"
version="${version}"/>
<dependency groupId="junit" artifactId="junit"/>
<dependency groupId="org.assertj" artifactId="assertj-core"/>
<dependency groupId="org.apache.rat" artifactId="apache-rat"/>
<dependency groupId="org.apache.hadoop" artifactId="hadoop-core"/>
<dependency groupId="org.apache.hadoop" artifactId="hadoop-minicluster"/>
Expand All @@ -503,6 +505,7 @@
artifactId="cassandra-parent"
version="${version}"/>
<dependency groupId="junit" artifactId="junit"/>
<dependency groupId="org.assertj" artifactId="assertj-core"/>
<dependency groupId="org.apache.pig" artifactId="pig">
<exclusion groupId="xmlenc" artifactId="xmlenc"/>
<exclusion groupId="tomcat" artifactId="jasper-runtime"/>
Expand Down
29 changes: 24 additions & 5 deletions interface/cassandra.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace rb CassandraThrift
# An effort should be made not to break forward-client-compatibility either
# (e.g. one should avoid removing obsolete fields from the IDL), but no
# guarantees in this respect are made by the Cassandra project.
const string VERSION = "20.1.0-pt1"
const string VERSION = "20.1.0-pt2"


#
Expand Down Expand Up @@ -600,6 +600,15 @@ struct MultiSliceRequest {
6: optional ConsistencyLevel consistency_level=ConsistencyLevel.ONE
}

/**
* A pair of a row (key) and selection of columns, used in calls to multiget_multislice() specifying which rows should
* be queried and which columns within said rows.
*/
struct KeyPredicate {
1: optional binary key,
2: optional SlicePredicate predicate,
}

service Cassandra {
# auth methods
void login(1: required AuthenticationRequest auth_request) throws (1:AuthenticationException authnx, 2:AuthorizationException authzx),
Expand Down Expand Up @@ -649,11 +658,21 @@ service Cassandra {

/**
Performs multiple get_slice commands in parallel for the given column_parent. Differently from multiget_slice,
users may specify a distinct <code>SlicePredicate</code> for each key in the <code>request</code>.
users may specify more than one <code>KeyPredicate</code> for each distinct key in the <code>request</code>.
Each list of <code>ColumnOrSuperColumn</code> present in the list associated with a specific key in the result
map corresponds to the result of a get_slice for one of the <code>KeyPredicate</code>s provided that matches
that key.
If there is more than one <code>KeyPredicate</code> associated with a specific key, we require that the types
of associated <code>SlicePredicate</code>s are of the same type (where type is defined as named columns,
slice range or reversed slice range).
We also do not make guarantees on the ordering of the lists for each key.
*/
map<binary,list<ColumnOrSuperColumn>> multiget_multislice(1:required map<binary, SlicePredicate> request,
2:required ColumnParent column_parent,
3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE)
map<binary,list<list<ColumnOrSuperColumn>>> multiget_multislice(1:required list<KeyPredicate> request,
2:required ColumnParent column_parent,
3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE)
throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te),

/**
Expand Down
Loading

0 comments on commit 09d98da

Please sign in to comment.