@Override public boolean next() { if (multiVersion) { while (true) { if (delta != null) { if (!delta.hasNext()) { delta = null; row = null; continue; } row = delta.next(); if (!row.isDeleted() || row.getSessionId() == session.getId()) { continue; } } else { row = scan.getNextRow(row); if (row != null && row.getSessionId() != 0 && row.getSessionId() != session.getId()) { continue; } } break; } return row != null; } row = scan.getNextRow(row); return row != null; }
@Override public boolean next() { if (!multiVersion) { nextRow(); return checkMax(); } while (true) { if (delta != null) { if (!delta.hasNext()) { delta = null; row = null; continue; } row = delta.next(); if (!row.isDeleted() || row.getSessionId() == session.getId()) { continue; } } else { nextRow(); if (row != null && row.getSessionId() != 0 && row.getSessionId() != session.getId()) { continue; } } break; } return checkMax(); }
@Override public void removeRow(Session session, Row row) { if (database.isMultiVersion()) { if (row.isDeleted()) { throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, getName());
boolean isDeleted = deltaRow.isDeleted(); if (isThisSession && isDeleted) { needNewDelta = true;
if (row.isDeleted()) {
buff.writeLong(r.getKey()); buff.writeInt(r.getVersion()); buff.writeInt(r.isDeleted() ? 1 : 0); buff.writeInt(r.getSessionId()); for (int i = 0; i < columnCount; i++) {
/** * Append the row to the buffer. * * @param buff the buffer * @param log the undo log */ void append(Data buff, UndoLog log) { int p = buff.length(); buff.writeInt(0); buff.writeInt(operation); buff.writeByte(row.isDeleted() ? (byte) 1 : (byte) 0); buff.writeInt(log.getTableId(table)); buff.writeLong(row.getKey()); buff.writeInt(row.getSessionId()); int count = row.getColumnCount(); buff.writeInt(count); for (int i = 0; i < count; i++) { Value v = row.getValue(i); buff.checkCapacity(buff.getValueLen(v)); buff.writeValue(v); } buff.fillAligned(); buff.setInt(p, (buff.length() - p) / Constants.FILE_BLOCK_SIZE); }
@Override public boolean next() { if (multiVersion) { while (true) { if (delta != null) { if (!delta.hasNext()) { delta = null; row = null; continue; } row = delta.next(); if (!row.isDeleted() || row.getSessionId() == session.getId()) { continue; } } else { row = scan.getNextRow(row); if (row != null && row.getSessionId() != 0 && row.getSessionId() != session.getId()) { continue; } } break; } return row != null; } row = scan.getNextRow(row); return row != null; }
@Override public boolean next() { if (multiVersion) { while (true) { if (delta != null) { if (!delta.hasNext()) { delta = null; row = null; continue; } row = delta.next(); if (!row.isDeleted() || row.getSessionId() == session.getId()) { continue; } } else { row = scan.getNextRow(row); if (row != null && row.getSessionId() != 0 && row.getSessionId() != session.getId()) { continue; } } break; } return row != null; } row = scan.getNextRow(row); return row != null; }
@Override public boolean next() { if (!multiVersion) { nextRow(); return checkMax(); } while (true) { if (delta != null) { if (!delta.hasNext()) { delta = null; row = null; continue; } row = delta.next(); if (!row.isDeleted() || row.getSessionId() == session.getId()) { continue; } } else { nextRow(); if (row != null && row.getSessionId() != 0 && row.getSessionId() != session.getId()) { continue; } } break; } return checkMax(); }
@Override public boolean next() { if (!multiVersion) { nextRow(); return checkMax(); } while (true) { if (delta != null) { if (!delta.hasNext()) { delta = null; row = null; continue; } row = delta.next(); if (!row.isDeleted() || row.getSessionId() == session.getId()) { continue; } } else { nextRow(); if (row != null && row.getSessionId() != 0 && row.getSessionId() != session.getId()) { continue; } } break; } return checkMax(); }
@Override public void removeRow(Session session, Row row) { if (database.isMultiVersion()) { if (row.isDeleted()) { throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, getName());
@Override public void removeRow(Session session, Row row) { if (database.isMultiVersion()) { if (row.isDeleted()) { throw DbException.get(ErrorCode.CONCURRENT_UPDATE_1, getName());
if (row.isDeleted()) {
if (row.isDeleted()) {
boolean isDeleted = deltaRow.isDeleted(); if (isThisSession && isDeleted) { needNewDelta = true;
/** * Append the row to the buffer. * * @param buff the buffer * @param log the undo log */ void append(Data buff, UndoLog log) { int p = buff.length(); buff.writeInt(0); buff.writeInt(operation); buff.writeByte(row.isDeleted() ? (byte) 1 : (byte) 0); buff.writeInt(log.getTableId(table)); buff.writeLong(row.getKey()); buff.writeInt(row.getSessionId()); int count = row.getColumnCount(); buff.writeInt(count); for (int i = 0; i < count; i++) { Value v = row.getValue(i); buff.checkCapacity(buff.getValueLen(v)); buff.writeValue(v); } buff.fillAligned(); buff.setInt(p, (buff.length() - p) / Constants.FILE_BLOCK_SIZE); }
/** * Append the row to the buffer. * * @param buff the buffer * @param log the undo log */ void append(Data buff, UndoLog log) { int p = buff.length(); buff.writeInt(0); buff.writeInt(operation); buff.writeByte(row.isDeleted() ? (byte) 1 : (byte) 0); buff.writeInt(log.getTableId(table)); buff.writeLong(row.getKey()); buff.writeInt(row.getSessionId()); int count = row.getColumnCount(); buff.writeInt(count); for (int i = 0; i < count; i++) { Value v = row.getValue(i); buff.checkCapacity(buff.getValueLen(v)); buff.writeValue(v); } buff.fillAligned(); buff.setInt(p, (buff.length() - p) / Constants.FILE_BLOCK_SIZE); }
buff.writeLong(r.getKey()); buff.writeInt(r.getVersion()); buff.writeInt(r.isDeleted() ? 1 : 0); buff.writeInt(r.getSessionId()); for (int i = 0; i < columnCount; i++) {
buff.writeLong(r.getKey()); buff.writeInt(r.getVersion()); buff.writeInt(r.isDeleted() ? 1 : 0); buff.writeInt(r.getSessionId()); for (int i = 0; i < columnCount; i++) {