|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.logical.log.LogicalLog
A class implementing a classical linked list of log elements. It is serializable so that it can be sent through a outputstream and cloneable because of the need to avoid race conditions. The Logical Log Records are encased in LogElements to add the support of nextElement needed in the linked list. The logical log has a fixed maximum size and functions as a circular buffer
Constructor Summary | |
LogicalLog()
Standard constructor, creates an empty LogicalLog with no elements. |
|
LogicalLog(LogicalLogRecord lr)
Constructor with a logical log record as a parameter. |
Method Summary | |
void |
add(LogicalLogRecord lr)
Adds a Logical Log Record to the Logical Log. |
void |
addElements(org.apache.derby.iapi.store.raw.log.LogicalLog log)
Adds an entire logical log to this log, used in LogReceiver when an entire log is received and then added to the current log. |
java.util.ArrayList |
divide()
Divide the log into an ArrayList with logs with a maximum size of 3000. |
LogicalLog |
flush()
flush() is a method added to remove race conditions between the add() method and the need to empty the Logical Log after it has been sent using the LogShipper. |
void |
flushLogToDisk()
Flushes the logical log to disk. |
LogicalLogRecord |
getFirst()
Get the first log element of the Logical Log |
LogicalLogRecord |
getLast()
Get the last log element of the Logical Log |
LogicalLogRecord |
getNext()
Get the next (if any) log element of the Logical Log |
boolean |
hasMoreElements()
Checks if this Logical Log has more elements |
static LogicalLog |
readFromDisk()
Read the log from disk. |
void |
reset()
Reset pointers in the log, moving the currentElement-pointer to firstElement |
LogicalLogRecord |
rewind(int lsn)
Rewind the log to a selected lsn and returns this log record. |
int |
size()
Gets the size of this Logical Log |
LogicalLog |
split(int lsn)
Split the log around a chosen lsn. |
java.lang.String |
toString()
Writes the log to screen, written for debug purposes |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LogicalLog()
public LogicalLog(LogicalLogRecord lr)
LogicalLog log = new LogicalLog();
log.add(lr);
lr
- The Logical Log Record to be added to the new Logical LogMethod Detail |
public LogicalLog flush()
LogShipper
public void add(LogicalLogRecord lr)
add
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
lr
- The Logical Log Record to be added.public void addElements(org.apache.derby.iapi.store.raw.log.LogicalLog log)
addElements
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
log
- The logical log to be added to this logical logLogReceiver
public LogicalLogRecord getFirst()
getFirst
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
public LogicalLogRecord getLast()
getLast
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
public LogicalLogRecord getNext()
getNext
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
public LogicalLogRecord rewind(int lsn)
lsn
- The lsn of the log to be found
public boolean hasMoreElements()
hasMoreElements
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
public int size()
size
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
public java.lang.String toString()
public void flushLogToDisk()
public void reset()
reset
in interface org.apache.derby.iapi.store.raw.log.LogicalLog
public LogicalLog split(int lsn)
lsn
- The lsn to split the log on
public java.util.ArrayList divide()
public static LogicalLog readFromDisk()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |