return mResultScanner.next();
} catch (LeaseException le) {
if (!mReopenScannerOnTimeout) {
LOG.debug("HBase scanner timed out and user disabled automatic scanner reopening.");
throw new KijiIOException(
"HBase scanner timed out and user disabled automatic scanner reopening.", le);
} else {
// The HBase scanner timed out, re-open a new one:
LOG.debug("HBase scanner timed out: closing and reopening a new scanner.");
mResultScanner.close();
mResultScanner = openResultScanner();
continue;
}
} catch (ScannerTimeoutException ste) {
if (!mReopenScannerOnTimeout) {
LOG.debug("HBase scanner timed out and user disabled automatic scanner reopening.");
throw new KijiIOException(
"HBase scanner timed out and user disabled automatic scanner reopening.", ste);
} else {
// The HBase scanner timed out, re-open a new one:
LOG.debug("HBase scanner timed out: closing and reopening a new scanner.");
mResultScanner.close();
mResultScanner = openResultScanner();
continue;
}
} catch (IOException ioe) {
throw new KijiIOException(ioe);
}
}
throw new KijiIOException("Unable to retrieve HBase result from scanner.");
}