public class Database
extends java.lang.Object
| Constructor and Description |
|---|
Database()
Creates the database.
|
Database(Path dir)
Creates the database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTable(Table table)
Adds a table.
|
void |
close()
Closes the database.
|
TableFactory |
createTableFactory()
Creates a table factory.
|
void |
dropTable(java.lang.String name)
Drops a table.
|
void |
ensureMemoryCapacity(long minCapacity)
Ensure a minimum memory size.
|
BlockManager |
getBlockManager()
Returns the block manager.
|
java.util.concurrent.locks.ReadWriteLock |
getDatabaseLock()
Returns the database lock.
|
Path |
getPath()
Returns the path.
|
Table |
getTable(java.lang.String name)
Gets a table.
|
void |
init()
Initializes the database.
|
boolean |
isFlushDirtyBlocksOnCommit() |
Query |
parseQuery(java.lang.String sql)
Parses a query.
|
void |
setFlushDirtyBlocksOnCommit(boolean isFlush) |
void |
setPath(Path dir)
Sets the directory.
|
void |
setRemoveOnError(boolean remove)
Set if error tables should be removed.
|
java.lang.String |
toString() |
public Database()
public Database(Path dir)
public void setPath(Path dir)
public void setRemoveOnError(boolean remove)
public void setFlushDirtyBlocksOnCommit(boolean isFlush)
public boolean isFlushDirtyBlocksOnCommit()
public void ensureMemoryCapacity(long minCapacity)
minCapacity - the minimum capacity in bytes@PostConstruct public void init() throws java.sql.SQLException
java.sql.SQLExceptionpublic Path getPath()
public BlockManager getBlockManager()
public java.util.concurrent.locks.ReadWriteLock getDatabaseLock()
public TableFactory createTableFactory()
public void addTable(Table table) throws java.io.IOException
java.io.IOExceptionpublic Table getTable(java.lang.String name)
public void dropTable(java.lang.String name)
throws java.sql.SQLException
java.sql.SQLExceptionpublic Query parseQuery(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLExceptionpublic void close()
public java.lang.String toString()
toString in class java.lang.Object