Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8D9E648E for ; Thu, 30 Jun 2011 03:16:58 +0000 (UTC) Received: (qmail 63125 invoked by uid 500); 30 Jun 2011 03:16:55 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 62469 invoked by uid 500); 30 Jun 2011 03:16:47 -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 62453 invoked by uid 99); 30 Jun 2011 03:16:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 03:16:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a57.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jun 2011 03:16:38 +0000 Received: from homiemail-a57.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a57.g.dreamhost.com (Postfix) with ESMTP id 2293120805B for ; Wed, 29 Jun 2011 20:16:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=content-type :mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; q=dns; s= thelastpickle.com; b=cPwU0GauwgfFKJksGL1zYM9Np56UG2QpdmhfQBUT8ZV M28XP8yV7NUtMImLCYo4vg2tB1STtR5aR8d0PcBroJZBOMzOaGc5/yqodLdNoiNh HIAzD62PByE+edVuNM3JqzLBRbWOUAvAj2yRk54sAteqAWnK9/+a73uqivhJZqTs = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h= content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; s= thelastpickle.com; bh=iPKp3Nt3MbDAjtzYoa/iJrjHNgA=; b=4AekzRSnZP iYRREBW8Y9dARaYHcEQR0ruZHbtFI/jmAnzBHi1HVTVWn40PccxuAHyxpwW4BV9V Dsca3oDiJq22RQNs1X7SJA3wcUtClRWXzlr8hyfqUITnAQFD4W/5n3bj/A/A/Hi/ uEAZRXPvh55hqqn8PqrFpuBng2/w/Z6Qc= Received: from [10.0.1.151] (121-73-157-230.cable.telstraclear.net [121.73.157.230]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a57.g.dreamhost.com (Postfix) with ESMTPSA id 9E3AD208049 for ; Wed, 29 Jun 2011 20:16:11 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: hadoop results From: aaron morton In-Reply-To: Date: Thu, 30 Jun 2011 15:16:09 +1200 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: user@cassandra.apache.org X-Mailer: Apple Mail (2.1084) X-Virus-Checked: Checked by ClamAV on apache.org How about get_slice() with reversed =3D=3D true and count =3D 1 to get = the highest time UUID ?=20 Or you can also store a column with a magic name that have the value of = the timeuuid that is the current metric to use.=20 Cheers ----------------- Aaron Morton Freelance Cassandra Developer @aaronmorton http://www.thelastpickle.com On 30 Jun 2011, at 06:35, William Oberman wrote: > I'll start with my question: given a CF with comparator TimeUUIDType, = what is the most efficient way to get the greatest column's value? >=20 > Context: I've been running cassandra for a couple of months now, so = obviously it's time to start layering more on top :-) In my test = environment, I managed to get pig/hadoop running, and developed a few = scripts to collect metrics I've been missing since I switched from MySQL = to cassandra (including the ever useful "select count(*) from table" = equivalent). =20 >=20 > I was hoping to dump the results of this processing back into = cassandra for use in other tools/processes. My initial thought was: new = CF called "stats" with comparator TimeUUIDType. The basic idea being = I'd store: > stat_name -> time stat was computed (as UUID) -> value > That way I can also see a historical perspective of any given stat for = auditing (and for cumulative stats to see trends). The stat_name itself = is a URI that is composed of "what" and any constraints on the "what" = (including an optional time range, if the stat supports it). E.g. = ClassOfSomething/ID/MetricName/OptionalTimeRange (or something, still = deciding on the format of the URI). But, right now, the only way I know = to get the "current" stat value would be to iterate over all columns = (the TimeUUIDs) and then return the last one. >=20 > Thanks for any tips, >=20 > will