John,

Thanks. I went with setting the config property and it works like a charm.

-Ameet Kini

From: John Vines [mailto:[email protected]]
Sent: Friday, May 25, 2012 2:29 PM
To: [email protected]
Subject: Re: setting maxVersions programatically

You can make programmatic changes either by removing the iterator and replacing 
it, or by directly editing the configuration. Both of these can be done through 
the connector object.TableOperations(). For the former, you can use 
removeIterator and attachIterator. For the latter, just use setProperty for 
table.iterator.<scope>.opt.maxVersions and set it to the value you want.

John
On Fri, May 25, 2012 at 2:20 PM, Kini, Ameet M. 
<[email protected]<mailto:[email protected]>> wrote:


The docs (http://accumulo.apache.org/1.4/user_manual/Table_Configuration.html) 
talk about setting maxVersions on the shell

user@myinstance mytable> config -t mytable -s
table.iterator.minc.vers.opt.maxVersions=3

I'm looking for a corresponding API call to do the same?

I tried doing this:

IteratorSetting versionSetting = new IteratorSetting(22, 
VersioningIterator.class);
VersioningIterator.setMaxVersions(3);
Connector.tableOperations.attachIterator(tableName, versionSetting, scopes);

But looks like that adds a second iterator at priority 22 with maxVersions=3 
whereas there is already an existing versioning iterator at a lower priority 
with maxVersions=1, and I end up with only 1 version.

Thanks,
-Ameet Kini


Reply via email to