Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 带asyc HBase扫描仪的复杂正则表达式_Java_Regex_Asynchronous_Hbase_Bigdata - Fatal编程技术网

Java 带asyc HBase扫描仪的复杂正则表达式

Java 带asyc HBase扫描仪的复杂正则表达式,java,regex,asynchronous,hbase,bigdata,Java,Regex,Asynchronous,Hbase,Bigdata,我已经开始使用异步HBase库。我正在尝试使用TableInputFormat。我不需要Map Reduce作业的所有行,因此我通过在TableRecordReader中指定scanner对象的正则表达式来修改代码 String regEx=getRegEx(conf); //my function to calculate the regular expression based on the input given in the conf object System.out.println(

我已经开始使用异步HBase库。我正在尝试使用TableInputFormat。我不需要Map Reduce作业的所有行,因此我通过在TableRecordReader中指定scanner对象的正则表达式来修改代码

String regEx=getRegEx(conf); //my function to calculate the regular expression based on the input given in the conf object
System.out.println("RegEx = "+regEx);
scanner.setKeyRegexp(regEx);
基本上,我只是在正则表达式中添加一个OR(
|
)作为必需行的键。当我想获取几百行时,这个方法就起作用了。在某些情况下,当我想要获取更多行时,我的正则表达式非常长(大约600000行)。但在这种情况下,扫描仪停止工作

我知道基于正则表达式的行键过滤是在服务器端完成的,复杂正则表达式可能无法工作

  • 那么,如何使扫描仪只获取所需的行呢
  • 使用多个扫描器是否有效,这样每个扫描器都可以得到正则表达式的一部分
  • 或者使用一个扫描器获取所有行,然后对它们进行迭代以获得所需的行是否有效

仅供参考:我的表中的行总数将在数千万之间

这取决于行的长度。您很可能遇到了最大字符串legnth,理论上是2147483647,但实际上它仅限于Java获得的虚拟内存

仅用于说明:
2147483647
字符需要4GB专用内存才能保存字符串。您可能需要考虑将字符串拆分,每1000行左右生成一个字符串,然后使用所有这些结果来查找您要查找的结果