accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Stoneham <ly...@lyrically.net>
Subject Re: making Scanner iterate through different version of cell
Date Thu, 18 Oct 2012 19:32:11 GMT
Thanks, Billie - I'm working on a 1.4 upgrade right now so that will be
helpful to include. (Obviously my code was written against 1.3.)

On Thu, Oct 18, 2012 at 3:03 PM, Billie Rinaldi <billie@apache.org> wrote:

> On Thu, Oct 18, 2012 at 11:28 AM, John Stoneham <lyric@lyrically.net>wrote:
>
>> Here's some Java code to do just that:
>>
>>     public void removeVersioningIterator(String tableName) throws
>>             TableNotFoundException, CBSecurityException, CBException {
>>         Iterable<Map.Entry<String, String>> properties =
>> connector.tableOperations().getProperties(tableName);
>>         List<String> versioningIteratorPropertyNames = Arrays.asList(
>>                 "table.iterator.majc.vers",
>>                 "table.iterator.majc.vers.opt.maxVersions",
>>                 "table.iterator.minc.vers",
>>                 "table.iterator.minc.vers.opt.maxVersions",
>>                 "table.iterator.scan.vers",
>>                 "table.iterator.scan.vers.opt.maxVersions"
>>         );
>>         for (String propertyName : versioningIteratorPropertyNames) {
>>             for (Map.Entry<String, String> tableProperty : properties) {
>>                 if (tableProperty.getKey().equals(propertyName)) {
>>                     connector.tableOperations().removeProperty(tableName,
>> propertyName);
>>                     break;
>>                 }
>>             }
>>         }
>>     }
>>
>
> You should be able to accomplish the same thing with this in 1.4:
>     conn.tableOperations().removeIterator(tableName, "vers",
> EnumSet.allOf(IteratorScope.class));
>
> Billie
>



-- 
John Stoneham
lyric@lyrically.net

Mime
View raw message