|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimpledb.file.FileMgr
public class FileMgr
The SimpleDB file manager.
The database system stores its data as files within a specified directory.
The file manager provides methods for reading the contents of
a file block to a Java byte buffer,
writing the contents of a byte buffer to a file block,
and appending the contents of a byte buffer to the end of a file.
These methods are called exclusively by the class Page
,
and are thus package-private.
The class also contains two public methods:
Method isNew
is called during system initialization by SimpleDB.init(java.lang.String)
.
Method size
is called by the log manager and transaction manager to
determine the end of the file.
Constructor Summary | |
---|---|
FileMgr(String dbname)
Creates a file manager for the specified database. |
Method Summary | |
---|---|
boolean |
isNew()
Returns a boolean indicating whether the file manager had to create a new database directory. |
int |
size(String filename)
Returns the number of blocks in the specified file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileMgr(String dbname)
dbname
- the name of the directory that holds the databaseMethod Detail |
---|
public int size(String filename)
filename
- the name of the file
public boolean isNew()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |