public interface VDatabase
Represents a database using Multiversion Concurrency Control (MVCC). A MVCC database consists of a tree which can be split up into several branches. Each branch consists of several commits which contain references to database objects. The MVCC database provides quick access to single objects. How this is achieved, is implementation-specific.
The following abbreviations are used throughout the framework:
Thread-safety: this class is thread-safe.
Modifier and Type | Method and Description |
---|---|
VBranch |
checkout(long cid)
Checks out an unnamed branch from the database
|
VBranch |
checkout(java.lang.String name)
Checks out a named branch from the database
|
void |
connect(java.lang.String name)
Connect to a database
|
void |
connect(java.lang.String name,
int port)
Connect to a database
|
void |
connect(java.lang.String name,
java.lang.String host,
int port)
Connect to a database running on a given host and port
|
VBranch |
createBranch(java.lang.String name,
long headCID)
Creates a new named branch whose head is set to the given CID
|
void |
drop()
Deletes the whole database.
|
VCounter |
getCounter() |
VHistory |
getHistory() |
VMaintenance |
getMaintenance() |
void connect(java.lang.String name)
name
- the database nameVException
- if connection failedvoid connect(java.lang.String name, int port)
name
- the database nameport
- the port the database listens toVException
- if connection failedvoid connect(java.lang.String name, java.lang.String host, int port)
name
- the database namehost
- the host the database is running onport
- the port the database listens toVException
- if connection failedVBranch checkout(java.lang.String name)
name
- the branch's nameVException
- if the branch does not exist yetVBranch checkout(long cid)
cid
- the CID of the commit which should be the branch's rootVException
- if there is not commit with the given CIDVBranch createBranch(java.lang.String name, long headCID)
name
- the branch's nameheadCID
- the branch's head CIDVException
- if there already is a branch with the given name or
if the given head CID could not be resolved to an existing commitvoid drop()
VCounter getCounter()
VHistory getHistory()
VMaintenance getMaintenance()