simpledb
Class Database

java.lang.Object
  extended by simpledb.Database

public class Database
extends java.lang.Object

Database is a class that initializes several static variables used by the database system (the catalog, the buffer pool, and the log files, in particular.)

Provides a set of methods that can be used to access these variables from anywhere.


Field Summary
private  BufferPool _bufferpool
           
private  Catalog _catalog
           
private static Database _instance
           
private  LogFile _logfile
           
private static java.lang.String LOGFILENAME
           
 
Constructor Summary
private Database()
           
 
Method Summary
static BufferPool getBufferPool()
          Return the buffer pool of the static Database instance
static Catalog getCatalog()
          Return the catalog of the static Database instance
static LogFile getLogFile()
          Return the log file of the static Database instance
static void reset()
           
static BufferPool resetBufferPool(int pages)
          Method used for testing -- create a new instance of the buffer pool and return it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_instance

private static Database _instance

_catalog

private final Catalog _catalog

_bufferpool

private BufferPool _bufferpool

LOGFILENAME

private static final java.lang.String LOGFILENAME
See Also:
Constant Field Values

_logfile

private LogFile _logfile
Constructor Detail

Database

private Database()
Method Detail

getLogFile

public static LogFile getLogFile()
Return the log file of the static Database instance


getBufferPool

public static BufferPool getBufferPool()
Return the buffer pool of the static Database instance


getCatalog

public static Catalog getCatalog()
Return the catalog of the static Database instance


resetBufferPool

public static BufferPool resetBufferPool(int pages)
Method used for testing -- create a new instance of the buffer pool and return it


reset

public static void reset()