| java.lang.Object com.quadcap.sql.file.Datafile
All known Subclasses: com.quadcap.sql.Database,
Datafile | abstract public class Datafile (Code) | | This class brings together the various file-level components of the
structured (SQL) database.
author: Stan Bailes |
Constructor Summary | |
public | Datafile() Construct a new Datafile object, from the specified filename and mode. |
Method Summary | |
abstract public void | bootFromRoot(boolean restart) | public void | checkpoint(boolean truncate, boolean fastSync) | public void | checkpointHandler(LongMap activeTransactions) | void | clearTempFile() When nothing is happening, get rid of this guy. | public void | close() Close the database. | public void | commitTransaction(Transaction trans) | abstract public void | createRoot(String fileName, Properties props) | public void | doStep(Transaction t, LogEntry e) | public void | finalize() If we get finalized, and haven't closed yet, then we should try. | public Transaction | findTransaction(long transId) | abstract public void | flushRoot() | File | getDbRootDir() | public BlockFile | getFile() | public Object | getFileLock() | public LockManager | getLockManager() | final public Log | getLog() | abstract public long | getNextTransId() | public Object | getObject(long ref) | File | getScratchDir() | public long | getSize() | public BlockFile | getTempFile() | public BlockFile | getTempFile(boolean incr) | public String | getURL() Return the JDBC URL used to connect to this database. | public boolean | inRecovery() | public void | init(String url, String fileName, Properties props) | public void | initFileDatabase(String url, String fileName, Properties props) | public void | initMemoryDatabase(String url, String fileName, Properties props) | public boolean | isReadOnly() | final void | makeTempDirectory(Properties props) Hook which allows the scratch files to be written to a separate
directory. | final public Transaction | makeTransaction(boolean writeLog) Helper to create a new transaction, and optionally to write the
BEGIN_TRANSACTION log entry. | abstract public void | maybeBackup() | public long | putObject(Object obj) | abstract public void | readRoot() | public void | releaseLocks(Transaction trans) Remove the transaction for the given connection from the
'active transactions' table. | public void | releaseTempFile() | public void | removeObject(long ref) | public void | rollbackStatement(Transaction trans, int stmtId) Rollback the specified statement. | public void | rollbackTransaction(Transaction trans) | public String | toString() | public void | updateObject(long seg, Object obj) Write a new version of a persistent object to the store. |
BLOCK_SIZE | final static int BLOCK_SIZE(Code) | | |
CACHE_SIZE | int CACHE_SIZE(Code) | | |
GOOD_CACHE | final static int GOOD_CACHE(Code) | | Reasonable cache size: 4MB (8K blocks). This cache size should
support a moderate load; 8-10 busy threads...
|
MIN_CACHE | final static int MIN_CACHE(Code) | | Minimum cache size: 256K, with 8K blocks. The minimum is
dependent on various factors, including query type (joins
need more cache, for example) and concurrency level.
Simple applications which are primarily single threaded will
be able to get by with 32 blocks or so.
|
SCRATCH_CACHE_DEFAULT | final static int SCRATCH_CACHE_DEFAULT(Code) | | Reasonable scratch cache default
|
SCRATCH_CACHE_SIZE | int SCRATCH_CACHE_SIZE(Code) | | |
inMemory | protected boolean inMemory(Code) | | |
isCaseSensitive | public static boolean isCaseSensitive(Code) | | |
readOnly | protected boolean readOnly(Code) | | |
temp | protected byte[] temp(Code) | | |
Datafile | public Datafile()(Code) | | Construct a new Datafile object, from the specified filename and mode.
|
bootFromRoot | abstract public void bootFromRoot(boolean restart) throws IOException(Code) | | |
checkpoint | public void checkpoint(boolean truncate, boolean fastSync) throws IOException(Code) | | Reset the temp file (on checkpoint)
|
clearTempFile | void clearTempFile()(Code) | | When nothing is happening, get rid of this guy. Who needs him, eh?
|
close | public void close()(Code) | | Close the database. Sync and close the physical file(s),
delete the tempfile(s) and lockfile. Kill the database
reference monitor thread.
|
finalize | public void finalize() throws Throwable(Code) | | If we get finalized, and haven't closed yet, then we should try.
|
getDbRootDir | File getDbRootDir()(Code) | | Return a File representing the database root directory
|
getFileLock | public Object getFileLock()(Code) | | Accessor for file lock
|
getLockManager | public LockManager getLockManager()(Code) | | Accessor for the datbase's lock manager
|
getLog | final public Log getLog()(Code) | | Return the log for this database
|
getObject | public Object getObject(long ref) throws IOException(Code) | | Return the specified persistent object from the store
Parameters: ref - the block number of the object's root the object exception: IOException - may be thrown |
getScratchDir | File getScratchDir()(Code) | | Return a File representing the database scratch/temp root directory
|
getSize | public long getSize()(Code) | | Return the total size of the datafile, in bytes
|
getTempFile | public BlockFile getTempFile() throws IOException(Code) | | The temporary file can be used for storage of non-transactionally-secure
data
|
getURL | public String getURL()(Code) | | Return the JDBC URL used to connect to this database.
|
isReadOnly | public boolean isReadOnly()(Code) | | Is db read only?
|
makeTempDirectory | final void makeTempDirectory(Properties props) throws IOException(Code) | | Hook which allows the scratch files to be written to a separate
directory. Useful when you want to mount the data files read only
|
makeTransaction | final public Transaction makeTransaction(boolean writeLog) throws IOException(Code) | | Helper to create a new transaction, and optionally to write the
BEGIN_TRANSACTION log entry.
|
putObject | public long putObject(Object obj) throws IOException(Code) | | Write a new object to the store and return its reference
Parameters: obj - the object the block number of the object's root exception: IOException - may be thrown |
releaseLocks | public void releaseLocks(Transaction trans)(Code) | | Remove the transaction for the given connection from the
'active transactions' table. Flush the log?
|
releaseTempFile | public void releaseTempFile()(Code) | | |
removeObject | public void removeObject(long ref) throws IOException(Code) | | Remove an object from the store
Parameters: ref - the block number of the object's root exception: IOException - may be thrown |
toString | public String toString()(Code) | | Return a displayable representation for debugging purposes
|
updateObject | public void updateObject(long seg, Object obj) throws IOException(Code) | | Write a new version of a persistent object to the store.
Parameters: blockNum - the address of the object's root page in the store Parameters: obj - the new object value exception: IOException - may be thrown |
|
|