在这里,我试图获取最大值行及其值。代替标准迭代,我想知道是否存在任何功能
Scan s = new Scan();
ResultScanner re = table.getScanner(s);
int maxVal =0;
try{
for (Result rr = re.next(); rr != null; rr = re.next()) {
byte [] row = rr.getRow();
Get g = new Get(row);
Result r = table.get(g);
String rn = Bytes.toString(r.value());
int temp = Integer.parseInt(rn);
if(maxVal < temp)
maxVal = temp;
}
System.out.println(maxVal);
}
finally {
re.close();
}