Return-Path: X-Original-To: apmail-accumulo-user-archive@www.apache.org Delivered-To: apmail-accumulo-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 46ED1C0E3 for ; Tue, 29 May 2012 14:33:51 +0000 (UTC) Received: (qmail 52264 invoked by uid 500); 29 May 2012 14:33:51 -0000 Delivered-To: apmail-accumulo-user-archive@accumulo.apache.org Received: (qmail 52235 invoked by uid 500); 29 May 2012 14:33:51 -0000 Mailing-List: contact user-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@accumulo.apache.org Delivered-To: mailing list user@accumulo.apache.org Received: (qmail 52226 invoked by uid 99); 29 May 2012 14:33:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2012 14:33:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [206.112.75.239] (HELO iron-e-outbound.osis.gov) (206.112.75.239) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2012 14:33:46 +0000 X-IronPort-AV: E=Sophos;i="4.75,678,1330923600"; d="scan'208";a="99386431" Received: from netmgmt.ext.intelink.gov (HELO ww4.ugov.gov) ([172.16.11.235]) by iron-e-outbound.osis.gov with ESMTP; 29 May 2012 10:30:22 -0400 Date: Tue, 29 May 2012 14:33:22 +0000 (GMT+00:00) From: Billie J Rinaldi To: user@accumulo.apache.org Message-ID: <2038955452.240233.1338302002108.JavaMail.root@linzimmb04o.imo.intelink.gov> In-Reply-To: <97EB0FF1279CC5428640A3FB61B10BD602B9E5AA@mx1.Comcept.L-3Com.com> Subject: Re: VersioningIterator - Latest version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.2.188.66] X-Mailer: Zimbra 6.0.7_GA_2476.RHEL4 (ZimbraWebClient - SAF3 (Mac)/6.0.7_GA_2473.RHEL5_64) X-Virus-Checked: Checked by ClamAV on apache.org On Tuesday, May 29, 2012 10:02:53 AM, "Bob Thorman" wrote: > So my table has maxversions set to 99999 for the table so that rows > are kept for every instance of a KVP update. And during some scan > operations (not all) the user would like to see the latest version of > each row. So the answer to your question, "Are you trying to keep more > than one version stored, but only see one version when scanning?" is > yes. Are you suggesting that in the case where I want a scanner to > return only one instance of each RowID I can set that scanner to > maxVersion=1 and get that result? > > An example rowset of a table that has maxVersion=99999: > > BOB person:father [public] 1234567892 Hello world! > BOB person:father [public] 1234567891 Hello world! > BOB person:father [public] 1234567890 Hello world! > BOB person:uncle [public] 1234567892 Hello world! > BOB person:uncle [public] 1234567891 Hello world! > BOB person:uncle [public] 1234567890 Hello world! > BOB person:brother [public] 1234567892 Hello world! > BOB person:brother [public] 1234567891 Hello world! > BOB person:brother [public] 1234567890 Hello world! > > Scanner with maxVersion=1 results in: > > BOB person:father [public] 1234567892 Hello world! > BOB person:uncle [public] 1234567892 Hello world! > BOB person:brother [public] 1234567892 Hello world! > > Is it possible to set a scanner with a VersioningIterator that has > maxVersions=1? If you're looking to keep all versions, I would just remove the versioning iterator from the table: connector.tableOperations().removeIterator(tableName, "vers", EnumSet.allOf(IteratorScope.class)); or in the shell: deleteiter -t tableName -n vers -minc -majc -scan Then you can add the versioning iterator back in for a particular scan: IteratorSetting setting = new IteratorSetting(20, "vers", VersioningIterator.class); VersioningIterator.setMaxVersions(setting, 1); scanner.addScanIterator(setting); Billie > -----Original Message----- > From: Billie J Rinaldi [mailto:billie.j.rinaldi@ugov.gov] > Sent: Tuesday, May 29, 2012 08:49 > To: user@accumulo.apache.org > Subject: Re: VersioningIterator - Latest version > > On Tuesday, May 29, 2012 9:38:54 AM, "Bob Thorman" > wrote: > > Has anyone developed an iterator that returns the latest version of > > each RowID when the maxVersions is greater than one? > > Could you give me an example of what you'd like to do? The versioning > iterator gives you the latest version of each key when maxVersions is > set to 1. Are you trying to keep more than one version stored, but > only see one version when scanning? If that's the case, you could set > maxVersions to 1 for the scan scope but set it higher for the other > scopes. > > Billie