|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimpledb.log.LogMgr
public class LogMgr
The low-level log manager.
This log manager is responsible for writing log records
into a log file.
A log record can be any sequence of integer and string values.
The log manager does not understand the meaning of these
values, which are written and read by the
recovery manager
.
Field Summary | |
---|---|
static int |
LAST_POS
The location where the pointer to the last integer in the page is. |
Constructor Summary | |
---|---|
LogMgr(String logfile)
Creates the manager for the specified log file. |
Method Summary | |
---|---|
int |
append(Object[] rec)
Appends a log record to the file. |
void |
flush(int lsn)
Ensures that the log records corresponding to the specified LSN has been written to disk. |
Iterator<BasicLogRecord> |
iterator()
Returns an iterator for the log records, which will be returned in reverse order starting with the most recent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LAST_POS
Constructor Detail |
---|
public LogMgr(String logfile)
FileMgr
object
that it gets from the method
SimpleDB.fileMgr()
.
That object is created during system initialization.
Thus this constructor cannot be called until
SimpleDB.initFileMgr(String)
is called first.
logfile
- the name of the log fileMethod Detail |
---|
public void flush(int lsn)
lsn
- the LSN of a log recordpublic Iterator<BasicLogRecord> iterator()
iterator
in interface Iterable<BasicLogRecord>
Iterable.iterator()
public int append(Object[] rec)
rec
- the list of values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |