accumulo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Craig <ben.cra...@gmail.com>
Subject Querying Accumulo Data Using Java
Date Thu, 28 Apr 2016 15:30:41 GMT
Hey Guys I'm new to Accumulo and trying to learn how to query data.  I
think I've got the basics down like:

//create a scanner
Scanner scan = connector.createScanner( "table", auths );

//create a filter
IteratorSetting itr1 = new IteratorSetting( 1, "TimeFilter",
AgeOffFilter.class );
itr1.addOption( TTL, Long.toString( DEFAULT_QUERY_TIME ) );
scan.addScanIterator( itr1 );

//iterate over the resulting rows
RowIterator rowIterator = new RowIterator( scan );
while ( rowIterator.hasNext() )
{
}

I've been playing around with some of the built in filters and have been
able to apply multiple filters on top of each other.  Some of the filters
I'm having issues with where they take a complex java object and not just
option<String,String>

For example ColumnQualifierFilter.java
<https://github.com/apache/accumulo/blob/master/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java>

When we use Iterator Settings the class is implicitly created but if I want
to use the ColumnQualifierFilter I need to create one and pass it a set of
columns.  I've been playing around with it for a while and havn't been able
to learn how to use it properly.

The constructor takes a sorted key value iterator.  How do I get this
sorted key value iterator?  Do I start with a scanner or do you start with
another type of scanner?  Do I just make one?
new ArrayList<SortedKeyValueIterator<Key,Value>>(); ? And the data goes
into it?

I've read through this Accumulo
<http://shop.oreilly.com/product/0636920032304.do> book but it just shows
how you can use the Scanner/Iterator Settings to query.

If anyone has any suggestions / documentation / examples it be much
appreciated.

Thanks,

Ben

Mime
View raw message