public class Database
extends java.lang.Object
implements java.io.Closeable
All the data of the Database is stored into a persistent file which just can be created or open through a Sparksee instance.
Also, all the manipulation of a Database must be done by means of a Session which can be initiated from a Database instance.
Multiple Databases do not share the memory, that is there is no negotiation among them. In those cases, memory must be prefixed for each Database. To do that, use the SPARKSEEConfig.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the Database instance.
|
void |
disableRollback()
Disables the rollback mechanism.
|
void |
dumpSchema(java.lang.String filePath)
Dump the database schema to the given file using the Sparksee scripting format.
|
void |
enableRollback()
Enables the rollback mechanism.
|
void |
fixCurrentCacheMaxSize()
Sets the cache maximum size to the current cache size in use.
|
java.lang.String |
getAlias()
Gets the alias of the Database.
|
int |
getCacheMaxSize()
Gets the cache maximum size (in MB).
|
java.lang.String |
getPath()
Gets the path of the Database.
|
void |
getStatistics(DatabaseStatistics stats)
Gets Database statistics.
|
boolean |
isClosed()
Gets if Database instance has been closed or not.
|
Session |
newSession()
Creates a new Session.
|
void |
redoPrecommitted(long txId)
Redo a pending precommitted transaction recovered.
|
void |
setCacheMaxSize(int megaBytes)
Sets the cache maximum size (in MB).
|
public void dumpSchema(java.lang.String filePath)
filePath
- nullpublic Session newSession()
public java.lang.String getPath()
public void enableRollback()
public void fixCurrentCacheMaxSize()
public boolean isClosed()
close()
public void redoPrecommitted(long txId)
YOU SHOULD NOT USE THIS METHOD. This method only exists for a specific service.
txId
- nullpublic void getStatistics(DatabaseStatistics stats)
stats
- [out] The DatabaseStatistics instance.public void setCacheMaxSize(int megaBytes)
0 means unlimited which is all the physical memory of the computer minus a small margin.
megaBytes
- [in] The new cache max size.public void disableRollback()
public void close()
It must be called to ensure the integrity of all data.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public java.lang.String getAlias()
public int getCacheMaxSize()