3

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

4

2 回答 2

3

这与上一个答案所说的相同,但我认为显示一行代码可能会有所帮助。

如果你有一个扫描仪,巧妙地命名为“扫描仪”,你可以使用 setRange() 方法来设置扫描仪的范围。因为默认范围是 (-inf, +inf),所以传递 setRange 一个新创建的范围对象将使您的扫描仪能够扫描整个表,范围为 (-inf, +inf)。

示例代码如下所示:

scanner.setRange(new Range());
于 2014-04-16T00:51:02.877 回答
2

您可以使用无参数构造函数扫描整个表。根据以下文档Range()

Creates a range that goes from negative to positive infinity.

于 2014-04-15T22:03:56.280 回答