Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 95288 invoked from network); 7 Sep 2010 19:55:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Sep 2010 19:55:24 -0000 Received: (qmail 97197 invoked by uid 500); 7 Sep 2010 19:55:22 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 97156 invoked by uid 500); 7 Sep 2010 19:55:22 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 97148 invoked by uid 99); 7 Sep 2010 19:55:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 19:55:22 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 19:55:17 +0000 Received: by vws10 with SMTP id 10so4951306vws.31 for ; Tue, 07 Sep 2010 12:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=bJBn8VWe5XNwzceYMyJ5PKHvYPxEcqK4CFNUft8O2YA=; b=marcIt5vtTVAqSl/BRo6RwtlXY5udfJRKiaHpbNdmG3gmnxKo74iAqmnrPENWnMOtA 7QLqkwtiiEWohaNVSmoHV95EWm9EgBqUBXiHiDSfxo4C+QXzQHbaFMZjH+TdB8CEZLUf tg6c3VZ6yyefSPBmfQJM7lJ+TjFJe05aO4pUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=wuTcgR3Xn5VvFTDZr9vxgNqgBCiWvueBGXH5Kz1uH4q8JiYTet0wI1rzf6U/1030vu lNkA/BYZYZ4rUBUpoU5QkNECRGq84wpR+Mup6n4/qe2ATaa8H8Nf3xIv8c0jHuykkpuY GnynfoN4BDm17DuY4A4w/qhc1FX1YY2Imlll8= Received: by 10.220.161.201 with SMTP id s9mr110903vcx.277.1283889296274; Tue, 07 Sep 2010 12:54:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.182.193 with HTTP; Tue, 7 Sep 2010 12:54:36 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Tue, 7 Sep 2010 14:54:36 -0500 Message-ID: Subject: Re: batch_mutate silently failing in Cassandra To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I would try to get a single hard-coded column to insert, before doing something more complex. You can also enable debug logging on the server and see if that matches what you want the client to be doing. On Tue, Sep 7, 2010 at 9:11 AM, Lucas Nodine wrote: > Hello all, > > I have=A0posted the following to Stackoverflow, but thought that I would = also > try the list.=A0 If you have any suggestions, please let me know > > I am working with Cassandra 0.6.5 using the thrift interface. I am trying= to > use the batch_mutate method call, however, when I execute it, I receive n= o > error message. This leads me to believe it worked. When I check using the > CLI, there is nothing there. Is there something wrong with my code or for= mat > of the mutation_map that anyone can see? Any ideas? > > Thanks in advance, > > LN > > public void Update(string keyspace, Common.NetworkPackage.MetaAsset ma) > { > =A0 Dictionary>> package; > =A0 Dictionary> packageEntry; > =A0 Dictionary.Enumerator en; > =A0 List mutList; > =A0 Mutation mut; > =A0 DateTime now =3D DateTime.Now; > > =A0 if(!ma.Fields.ContainsKey("$guid")) > =A0 =A0 throw new ArgumentException("The field $guid is not present"); > > =A0 mutList =3D new List(); > =A0 en =3D ma.Fields.GetEnumerator(); > > =A0 while(en.MoveNext()) > =A0 { > =A0 =A0 if (en.Current.Value =3D=3D null) > =A0 =A0 =A0 continue; > =A0 =A0 mut =3D new Mutation(); > =A0 =A0 mut.Column_or_supercolumn =3D new ColumnOrSuperColumn(); > =A0 =A0 mut.Column_or_supercolumn.Column =3D new Column(); > =A0 =A0 mut.Column_or_supercolumn.Column.Name =3D _utf8.GetBytes(en.Curre= nt.Key); > > =A0 =A0 if (en.Current.Value =3D=3D null) > =A0 =A0 =A0 mut.Column_or_supercolumn.Column.Value =3D null; > =A0 =A0 else > =A0 =A0 =A0 mut.Column_or_supercolumn.Column.Value =3D ToBytes(en.Current= .Value); > > =A0 =A0 mut.Column_or_supercolumn.Column.Timestamp =3D Utilities.Timestam= p(now); > > =A0 =A0 mutList.Add(mut); > =A0 } > > =A0 packageEntry =3D new Dictionary>(); > =A0 packageEntry.Add("MetaAsset", mutList); > > =A0 package =3D new Dictionary>= >(); > =A0 package.Add((string)ma.Fields["$guid"], packageEntry); > > =A0 Console.WriteLine(Utilities.ExportBulkMutate("LawOffice", package)); > > =A0 _client.batch_mutate(keyspace, package, ConsistencyLevel.QUORUM); > } > > The above code produces (columns are name:value @ timestamp, value consis= ts > of a type:and a representation of the actual value): > > LawOffice : { > =A0Row=3D08469fba50f448be8943614abd059d10 : { > =A0 =A0CF=3DMetaAsset : { > =A0 =A0 $guid : String:08469fba50f448be8943614abd059d10 @ 93 > =A0 =A0 $creator : String:Lucas @ 93 > =A0 =A0 $previousversion : String:00000000000000000000000000000000 @ 93 > =A0 =A0 $nextversion : String:00000000000000000000000000000000 @ 93 > =A0 =A0 $etag : String:0 @ 93 > =A0 =A0 $length : Int32:123456789 @ 93 > =A0 =A0 $extension : String:.odt @ 93 > =A0 =A0 $created : DateTime:90 @ 93 > =A0 =A0 $modified : DateTime:90 @ 93 > =A0 =A0 $lastaccess : DateTime:90 @ 93 > =A0 =A0 $title : String:Title @ 93 > =A0 =A0 $tags : List`1:tag1,tag2,tag3 @ 93 > =A0 =A0} > =A0} > } > > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com