while (result != null && result.length > 0) { for (int i = 0; i < result.length; ++i) { Result r = MVCC.handleResult(this, metaTable, result[i], startId, null); if (r == null || r.isEmpty()) {
@Override public boolean hasNext() { if (next != null && !next.isEmpty()) return true; while (it.hasNext()) { try { trx.checkIfReadyToContinue(); next = MVCC.handleResult(DResultScanner.this, metaTable, it.next(), startId, null); if (next == null || next.isEmpty()) continue; break; } catch (TransactionOutOfDateException e) { trx.disable(); throw new RuntimeException(e); } catch (InvalidRowStatusException e) { trx.disable(); throw new RuntimeException(e); } catch (IOException e) { trx.disable(); throw new RuntimeException(e); } } return next != null && !next.isEmpty(); }
@Override public Result next() throws IOException { trx.checkIfReadyToContinue(); try { while (true) { Result result = scanner.next(); if (result == null || result.isEmpty()) return result; result = MVCC.handleResult(this, metaTable, result, startId, null); if (result.isEmpty()) continue; return result; } } catch (TransactionOutOfDateException e) { trx.disable(); throw new IOException(e); } catch (InvalidRowStatusException e) { trx.disable(); throw new IOException(e); } catch (IOException e) { trx.disable(); throw e; } }
@SuppressWarnings("deprecation") @Override public DResult get(Get get, long startId) throws IOException { if (get.hasFamilies()) get.addFamily(DominoConst.INNER_FAMILY); get.setTimeRange(0, startId + 1); // [x, y) get.setMaxVersions(); Result preRead = region.get(get); List<KeyValue> status = preRead.getColumn(DominoConst.INNER_FAMILY, DominoConst.STATUS_COL); if (status == null || status.size() == 0) { Result ret = MVCC.handleResult(this, getTrxMetaTable(), preRead, startId, null); return new DResult(ret, null); } Integer lockId = region.getLock(null, get.getRow(), true); try { Result r = MVCC.handleResult(this, getTrxMetaTable(), region.get(get, lockId), startId, lockId); return new DResult(r, null); } catch (TransactionOutOfDateException oode) { return new DResult(null, oode.getMessage()); } catch (InvalidRowStatusException e) { return new DResult(null, e.getMessage()); } finally { region.releaseRowLock(lockId); } }