Sylvain Lebresne resolved CASSANDRA-13350.
I'm pretty sure this is a request for the [DataStax Java
driver|https://github.com/datastax/java-driver] which is a separate. Please
inquire about this with said project.
> getByPk() utility methods in Datastax session object
> Key: CASSANDRA-13350
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13350
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Sachin Goyal
> Data modeling in Cassandra is the key to querying.
> Best way to query is to have tables where you always query by primary-key or
> by partition-key.
> And yet there is no method in the datastax's session object that simplifies
> this process.
> It would be great to have methods like:
> # session.getByPrimaryKey (String tableName, Object primaryKeys)
> # session.getByPartitionKey (String tableName, Object partitionKeys)
> # session.getByPartitionKeys (String tableName, Object partitionKeys) //
> Like an in-query
> # session.getByPrimaryKeys (String tableName, Object primaryKeys)
> The last is an unsupported feature yet in Cassandra but it would be really
> awesome to have the same. It would be like a read equivalent of the
> batch-statements in write.
> # Ease-of-use: User does not have to create a string query or a prepared
> # User does not have to worry about [using prepared statements with select *
> I am not yet sure how the driver would handle it but if it can, wow!
> # If murmur-3 hashing in the client is same as the cluster, clients can query
> just the right node (Better token-aware?)
> Such methods are present in several other software. Examples:
> # Hibernate:
> # JPA: [find()|http://www.java2s.com/Code/Java/JPA/GetEntitybyID.htm].
> # Solr:
> and several flavors of the same.
> (Please note that these links are just an example, not meant to provide
> implementation details or the behavior).
> As a feature, *session.getByPrimaryKeys (String tableName, Object
> primaryKeys)* should help get a performance boost to the users because
> it allows running queries for different partitions in parallel and also
> allows getting results from the same partition in one query. We can put this
> in a separate JIRA task if it is seen as a useful feature by all.
This message was sent by Atlassian JIRA