cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonid Ilyevsky <lilyev...@mooncapital.com>
Subject batch_mutate
Date Thu, 05 Jul 2012 14:38:50 GMT
My current way of inserting rows one by one is too slow (I use cql3 prepared statements) ,
so I want to try batch_mutate.

Could anybody give me more details about the interface? In the javadoc it says:

public void batch_mutate(java.util.Map<java.nio.ByteBuffer,java.util.Map<java.lang.String,java.util.List<Mutation<file:///C:\Tools\apache-cassandra-1.1.1\javadoc\org\apache\cassandra\thrift\Mutation.html>>>>
mutation_map,
                         ConsistencyLevel<file:///C:\Tools\apache-cassandra-1.1.1\javadoc\org\apache\cassandra\thrift\ConsistencyLevel.html>
consistency_level)
                  throws InvalidRequestException<file:///C:\Tools\apache-cassandra-1.1.1\javadoc\org\apache\cassandra\thrift\InvalidRequestException.html>,
                         UnavailableException<file:///C:\Tools\apache-cassandra-1.1.1\javadoc\org\apache\cassandra\thrift\UnavailableException.html>,
                         TimedOutException<file:///C:\Tools\apache-cassandra-1.1.1\javadoc\org\apache\cassandra\thrift\TimedOutException.html>,
                         org.apache.thrift.TException
Description copied from interface: Cassandra.Iface<file:///C:\Tools\apache-cassandra-1.1.1\javadoc\org\apache\cassandra\thrift\Cassandra.Iface.html#batch_mutate%28java.util.Map,%20org.apache.cassandra.thrift.ConsistencyLevel%29>
Mutate many columns or super columns for many row keys. See also: Mutation. mutation_map maps
key to column family to a list of Mutation objects to take place at that scope. *


I need to understand the meaning of the elements of mutation_map parameter.
My guess is, the key in the outer map is columnfamily name, is this correct?
The key in the inner map is, probably, a key to the columnfamily (it is somewhat confusing
that it is String while the outer key is ByteBuffer, I wonder what is the rational). If this
is correct, how should I do it if my key is a composite one. Does anybody have an example?

Thanks,

Leonid

________________________________
This email, along with any attachments, is confidential and may be legally privileged or otherwise
protected from disclosure. Any unauthorized dissemination, copying or use of the contents
of this email is strictly prohibited and may be in violation of law. If you are not the intended
recipient, any disclosure, copying, forwarding or distribution of this email is strictly prohibited
and this email and any attachments should be deleted immediately. This email and any attachments
do not constitute an offer to sell or a solicitation of an offer to purchase any interest
in any investment vehicle sponsored by Moon Capital Management LP ("Moon Capital"). Moon Capital
does not provide legal, accounting or tax advice. Any statement regarding legal, accounting
or tax matters was not intended or written to be relied upon by any person as advice. Moon
Capital does not waive confidentiality or privilege as a result of this email.

Mime
View raw message