if (lockId == null && statusList != null && statusList.size() > 0) { if (isSelfDelete(statusList.get(0), startId)) { return new Result(); return tableWrapper.get(getQuery(result)); committedList = handleStatus(tableWrapper, metaTable, statusList, result.getRow(), startId, lockId); List<KeyValue> mergedList = mergeVersionedList(committedList, versionList); List<KeyValue> retKV = new ArrayList<KeyValue>(); if (isDeletedRow(statusList, mergedList, startId)) { return new Result(); for (byte[] column : familyMap.keySet()) { NavigableMap<Long, byte[]> values = familyMap.get(column); if (isSelfWrite(values, startId)) { retKV .add(new KeyValue(result.getRow(), family, column, checkIfTransactionOutOfDate(result.getRow(), tableWrapper, startId, mergedList, lockId);
continue; Result tStatus = getTransactionStatus(metaTable, transactionId); if (tStatus == null) { rollbackRow(tableWrapper, row, transactionId, lockId); break; case DominoConst.TRX_COMMITTED: long commitId = DominoConst.commitId(tStatus); if (commitId > startId) continue; // Ignore the "future" value. committed.add(commitRow(tableWrapper, kv, transactionId, commitId, lockId)); break;
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()) {
handleStatus(tableWrapper, metaTable, status, row, startId, lockId); continue; if (locking && conflicted(status, startId)) { if (retried) { throw new InvalidRowStatusException(String.format( handleStatus(tableWrapper, metaTable, status, row, startId, lockId); continue; try { while (it.hasNext()) { if (conflicted(it.next(), startId)) { throw new InvalidRowStatusException(String.format( "[%s][%s] Row is in a stateful update status.", new String( handleStatus(tableWrapper, metaTable, status, row, startId, lockId); continue;
private static boolean isDeletedRow(List<KeyValue> statusList, List<KeyValue> versionList, long startId) { if (statusList != null && statusList.size() > 0) { if (isSelfDelete(statusList.get(0), startId)) { return true; } } if (versionList != null && versionList.size() > 0) { KeyValue version = versionList.get(0); if (DominoConst.isDeleteVersion(version.getValue())) { return true; } } return false; }
@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); } }