Search code examples
javaaccumulo

How do you use "Range" to Scan an entire table in accumulo


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


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());