[英]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? 你如何使用“范围”在没有先验知识的情况下在accumulo中扫描整个表格?
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
我想从随机搜索: 我正在编写一个Accumulo迭代器来返回一个表的百分位数的随机样本
and scan over (then write to hdfs) a sample. 然后扫描(然后写入hdfs)一个样本。
This requires me to scan the entire table I believe. 这要求我扫描我相信的整个表格。
thanks! 谢谢!
Chris 克里斯
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. 如果你有一个巧妙命名为“scanner”的扫描仪,你可以使用setRange()方法设置扫描仪的范围。 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.
因为默认范围是(-inf,+ inf),所以传递setRange新创建的范围对象将为扫描仪提供扫描整个表的范围(-inf,+ inf)。
The sample code looks like: 示例代码如下所示:
scanner.setRange(new Range());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.