UndoLogRecord

An entry in a undo log.

Methods
static UndoLogRecord loadFromBuffer(Data buff, UndoLog log)
Load an undo log record row using a buffer.
static UndoLogRecord loadFromBuffer(Data buff, UndoLog log)
Load an undo log record row using a buffer.
Parameters:
buff - the buffer
log - the log
Returns:
the undo log record
UndoLogRecord(Table table, short op, Row row)
Create a new undo log record
UndoLogRecord(Table table, short op, Row row)
Create a new undo log record
Parameters:
table - the table
op - the operation type
row - the row that was deleted or inserted
void append(Data buff, UndoLog log)
Append the row to the buffer.
void append(Data buff, UndoLog log)
Append the row to the buffer.
Parameters:
buff - the buffer
log - the undo log
boolean canStore()
Check if this undo log record can be store.
boolean canStore()
Check if this undo log record can be store. Only record can be stored if the table has a unique index.
Returns:
if it can be stored
void commit()
This method is called after the operation was committed.
void commit()
This method is called after the operation was committed. It commits the change to the indexes.
long getFilePos()
Get the position in the file.
long getFilePos()
Get the position in the file.
Returns:
the file position
Row getRow()
Get the row that was deleted or inserted.
Row getRow()
Get the row that was deleted or inserted.
Returns:
the row
Table getTable()
Get the table.
Table getTable()
Get the table.
Returns:
the table
void invalidatePos()
Change the state from IN_MEMORY to IN_MEMORY_INVALID.
void invalidatePos()
Change the state from IN_MEMORY to IN_MEMORY_INVALID. This method is called if a later record was read from the temporary file, and therefore the position could have changed.
boolean isStored()
Check if the log record is stored in the file.
boolean isStored()
Check if the log record is stored in the file.
Returns:
true if it is
void load(Data buff, FileStore file, UndoLog log)
Load an undo log record row using a buffer.
void load(Data buff, FileStore file, UndoLog log)
Load an undo log record row using a buffer.
Parameters:
buff - the buffer
file - the source file
log - the log
void save(Data buff, FileStore file, UndoLog log)
Save the row in the file using a buffer.
void save(Data buff, FileStore file, UndoLog log)
Save the row in the file using a buffer.
Parameters:
buff - the buffer
file - the file
log - the undo log
void undo(Session session)
Un-do the operation.
void undo(Session session)
Un-do the operation. If the row was inserted before, it is deleted now, and vice versa.
Parameters:
session - the session

Fields
static short DELETE = 1
static short INSERT = 0

INSERT = 0

Operation type meaning the row was inserted.

DELETE = 1

Operation type meaning the row was deleted.