Question

How do you use "Range" to Scan an entire table in accumulo without apriori knowledge?

How do folks currently do that. I want to take the random search from:I am looking at writing an Accumulo iterator to return a random sample of a percentile of a table

and scan over (then write to hdfs) a sample.

This requires me to scan the entire table I believe.

thanks!

Chris

Was it helpful?

Solution

This is the same thing that the previous answer is saying, but I thought it might help to show a line of code.

If you have a scanner, cleverly named 'scanner', you can use the setRange() method to set the range on the scanner. Because the default range is (-inf, +inf), passing setRange a newly created range object will give your scanner, with a range of (-inf, +inf), the ability to scan the entire table.

The sample code looks like:

scanner.setRange(new Range());

OTHER TIPS

You can scan the entire table by using the no-arg constructor. Per the docs on Range():

Creates a range that goes from negative to positive infinity.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top