Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo >> mail # user >> Reset column iterator while using AccumuloRowInputFormat


Copy link to this message
-
Reset column iterator while using AccumuloRowInputFormat
Is there a way to "reset" the column iterator back to the "beginning" when
using the AccumuloRowInputFormat?  We have a case in which we need to
iterate over the columns for a row at least twice and it could be a large
row that may not fit in memory.

I think we can work around this by having a separate scanner used within
the map method for this purpose.  Other than that, is there a way to clone
or copy or reset the column iterator such that we can iterate over it more
than once?

Thanks,

Mike

public void map(Text key, PeekingIterator<Map.Entry<Key, Value>>
columnIterator, Context context) {
    while (columnIterator.hasNext()) {
        Map.Entry<Key, Value> kv = columnIterator.next();
    }

*    // reset column iterator back to the beginning*

    while (columnIterator.hasNext()) {
        Map.Entry<Key, Value> kv = columnIterator.next();
    }

}
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB