Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo, mail # user - How to remove entire row at the server side?


Copy link to this message
-
Re: How to remove entire row at the server side?
Terry P. 2013-11-12, 17:36
Keith, you are my hero!  From tests using various column family configs to
test various configs, it appears to be working like a charm.  Now I'm
working on the IteratorOptions part so the expirationTimestamp column
family name and datetime format can be set at the installation time of the
Iterator.

Many, many thanks Keith, your example really helps me understand row-based
iterators much better.

Thanks again to everyone else for your assistance as well.  Accumulo has
such a great community!

Kind regards,
Terry
On Fri, Nov 8, 2013 at 8:49 AM, Keith Turner <[EMAIL PROTECTED]> wrote:

>
>
>
> On Fri, Nov 8, 2013 at 12:26 AM, Terry P. <[EMAIL PROTECTED]> wrote:
>
>> Hi Keith,
>> Given that what I need to filter on is only the expTs column family,
>> would it be faster to seek?  I don't know how to seek, but I also can't
>> figure out how to iterate inside the acceptRow method -- there's no scanner
>> as I normally use when reading and iterating over key/values.
>>
>
> I think in your case you should iterate,  because you are only advancing a
> few keys.   Some of the iterators in Accumulo try to iterator for a few
> keys, and if something is not found in 10 keys then seek.
>
> Could do something like the following.
>
>
>   ByteSequence expTsColFam = new ArrayByteSequence("expTs");
>
> @Override
>   public boolean acceptRow(SortedKeyValueIterator<Key, Value>
> rowIterator)  throws IOException {
>        while(rowIterator.hasTop()){
>             //this is faster becaue it compares against byte arrays in key
> directly w/o converting to string
>             int cmp
> = rowIterator.getTopKey().getColumnFamilyData().compareTo(expTsColFam);
>             if (cmp == 0) {
>                  ....
>             }else if(cmp > 0){
>                  //went past column family
>                  //can only do this w/ col fam since it next field in sort
> order after row
>                  break;
>             }
>             rowIterator.next();
>        }
>
>        return true;
>   }
>
>
>>
>>