You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@accumulo.apache.org by Sami Omer <so...@eoir.com> on 2012/10/18 19:25:28 UTC

making Scanner iterate through different version of cell

Hello everyone,

Is there a way to programmatically iterate through the different version of a cell (cells that have identical row id, column family, and column qualifier but different timestamps) in Accumulo 1.3.6?

I was looking over the documentation and saw that those settings can be applied per table through the command line, but is it doable via the API?

Thank you.

Re: making Scanner iterate through different version of cell

Posted by John Stoneham <ly...@lyrically.net>.
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 <bi...@apache.org> wrote:

> On Thu, Oct 18, 2012 at 11:28 AM, John Stoneham <ly...@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

Re: making Scanner iterate through different version of cell

Posted by Billie Rinaldi <bi...@apache.org>.
On Thu, Oct 18, 2012 at 11:28 AM, John Stoneham <ly...@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

Re: making Scanner iterate through different version of cell

Posted by John Stoneham <ly...@lyrically.net>.
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;
                }
            }
        }
    }


On Thu, Oct 18, 2012 at 1:43 PM, William Slacum <
wilhelm.von.cloud@accumulo.net> wrote:

> I think you'll probably have to have modify the table configuration since
> the VersioningIterator is applied by default at level 20.
>
>
> On Thu, Oct 18, 2012 at 10:35 AM, <Bo...@l-3com.com> wrote:
>
>> You can use the VersioningIterator within your scanner  and specify the
>> number of versions (i.e. timestamps) you want.  Or you can use the
>> TimeStampFilter and specify the time range for the rows you want.   Or use
>> no iterators at all and let the scanner give you ALL rows.  ****
>>
>> ** **
>>
>> *From:* Sami Omer [mailto:somer@eoir.com]
>> *Sent:* Thursday, October 18, 2012 12:25
>> *To:* user@accumulo.apache.org
>> *Subject:* making Scanner iterate through different version of cell****
>>
>> ** **
>>
>> Hello everyone,****
>>
>> ** **
>>
>> Is there a way to programmatically iterate through the different version
>> of a cell (cells that have identical row id, column family, and column
>> qualifier but different timestamps) in Accumulo 1.3.6?****
>>
>> ** **
>>
>> I was looking over the documentation and saw that those settings can be
>> applied per table through the command line, but is it doable via the API?
>> ****
>>
>> ** **
>>
>> Thank you.****
>>
>
>


-- 
John Stoneham
lyric@lyrically.net

Re: making Scanner iterate through different version of cell

Posted by William Slacum <wi...@accumulo.net>.
I think you'll probably have to have modify the table configuration since
the VersioningIterator is applied by default at level 20.

On Thu, Oct 18, 2012 at 10:35 AM, <Bo...@l-3com.com> wrote:

> You can use the VersioningIterator within your scanner  and specify the
> number of versions (i.e. timestamps) you want.  Or you can use the
> TimeStampFilter and specify the time range for the rows you want.   Or use
> no iterators at all and let the scanner give you ALL rows.  ****
>
> ** **
>
> *From:* Sami Omer [mailto:somer@eoir.com]
> *Sent:* Thursday, October 18, 2012 12:25
> *To:* user@accumulo.apache.org
> *Subject:* making Scanner iterate through different version of cell****
>
> ** **
>
> Hello everyone,****
>
> ** **
>
> Is there a way to programmatically iterate through the different version
> of a cell (cells that have identical row id, column family, and column
> qualifier but different timestamps) in Accumulo 1.3.6?****
>
> ** **
>
> I was looking over the documentation and saw that those settings can be
> applied per table through the command line, but is it doable via the API?*
> ***
>
> ** **
>
> Thank you.****
>

RE: making Scanner iterate through different version of cell

Posted by Bo...@l-3com.com.
You can use the VersioningIterator within your scanner  and specify the
number of versions (i.e. timestamps) you want.  Or you can use the
TimeStampFilter and specify the time range for the rows you want.   Or
use no iterators at all and let the scanner give you ALL rows.  

 

From: Sami Omer [mailto:somer@eoir.com] 
Sent: Thursday, October 18, 2012 12:25
To: user@accumulo.apache.org
Subject: making Scanner iterate through different version of cell

 

Hello everyone,

 

Is there a way to programmatically iterate through the different version
of a cell (cells that have identical row id, column family, and column
qualifier but different timestamps) in Accumulo 1.3.6?

 

I was looking over the documentation and saw that those settings can be
applied per table through the command line, but is it doable via the
API?

 

Thank you.


Re: making Scanner iterate through different version of cell

Posted by Eric Newton <er...@gmail.com>.
You just need to remove the Versioning iterator that is put on the table by
default:

$ ./bin/accumulo shell --fake
Enter current password for 'ecn'@'mock-instance':

Shell - Apache Accumulo Interactive Shell
-
- version: 1.4.3-SNAPSHOT
- instance name: mock-instance
- instance id: mock-instance-id
-
- type 'help' for a list of available commands
-
ecn@mock-instance> createtable test
ecn@mock-instance test> deleteiter -scan -majc -minc -n vers
ecn@mock-instance test> insert a b c d
ecn@mock-instance test> insert a b c e
ecn@mock-instance test> insert a b c f
ecn@mock-instance test> scan -st
a b:c [] 1350581608126    f
a b:c [] 1350581607086    e
a b:c [] 1350581605986    d
ecn@mock-instance test>


On Thu, Oct 18, 2012 at 1:25 PM, Sami Omer <so...@eoir.com> wrote:
> Hello everyone,
>
>
>
> Is there a way to programmatically iterate through the different version
of
> a cell (cells that have identical row id, column family, and column
> qualifier but different timestamps) in Accumulo 1.3.6?
>
>
>
> I was looking over the documentation and saw that those settings can be
> applied per table through the command line, but is it doable via the API?
>
>
>
> Thank you.