Quadcap Embeddable Database

com.quadcap.sql.file.Datafile Class Reference

List of all members.

Detailed Description

This class brings together the various file-level components of the structured (SQL) database.

Author:
Stan Bailes

Definition at line 81 of file Datafile.java.

Public Member Functions

abstract void maybeBackup () throws IOException
abstract void readRoot () throws IOException
abstract void createRoot (String fileName, Properties props) throws IOException
abstract void flushRoot () throws IOException
abstract long getNextTransId () throws IOException
abstract void bootFromRoot (boolean restart) throws IOException
 Datafile ()
 Construct a new Datafile object, from the specified filename and mode.

void init (String url, String fileName, Properties props) throws IOException
void initMemoryDatabase (String url, String fileName, Properties props) throws IOException
void initFileDatabase (String url, String fileName, Properties props) throws IOException
BlockFile getFile ()
 Accessor for my underlying file.

String getURL ()
 Return the JDBC URL used to connect to this database.

LockManager getLockManager ()
 Accessor for the datbase's lock manager.

Object getFileLock ()
 Accessor for file lock.

boolean isReadOnly ()
 Is db read only?

Object getObject (long ref) throws IOException
 Return the specified persistent object from the store.

long putObject (Object obj) throws IOException
 Write a new object to the store and return its reference.

void updateObject (long seg, Object obj) throws IOException
 Write a new version of a persistent object to the store.

void removeObject (long ref) throws IOException
 Remove an object from the store.

BlockFile getTempFile () throws IOException
 The temporary file can be used for storage of non-transactionally-secure data.

BlockFile getTempFile (boolean incr) throws IOException
void releaseTempFile ()
void close ()
 Close the database.

final Transaction makeTransaction (boolean writeLog) throws IOException
 Helper to create a new transaction, and optionally to write the BEGIN_TRANSACTION log entry.

void commitTransaction (Transaction trans) throws IOException
 Commit the transaction.

void rollbackTransaction (Transaction trans) throws IOException
 Rollback the transaction.

void rollbackStatement (Transaction trans, int stmtId) throws IOException
 Rollback the specified statement.

void releaseLocks (Transaction trans)
 Remove the transaction for the given connection from the 'active transactions' table.

Transaction findTransaction (long transId) throws IOException
 Find the specified transaction.

final Log getLog ()
 Return the log for this database.

void finalize () throws Throwable
 If we get finalized, and haven't closed yet, then we should try.

long getSize ()
 Return the total size of the datafile, in bytes.

void checkpoint (boolean truncate, boolean fastSync) throws IOException
 Reset the temp file (on checkpoint).

void checkpointHandler (LongMap activeTransactions) throws IOException
String toString ()
 Return a displayable representation for debugging purposes.

void doStep (Transaction t, LogEntry e) throws IOException, DatafileException
boolean inRecovery () throws IOException

Static Public Attributes

boolean isCaseSensitive

Protected Attributes

boolean inMemory = false
DatafileRoot root
String origFileName
BlockFile file
BlockFile tempFile
boolean readOnly = false
byte[] temp = new byte[256]
Object fileLock = new Object()

Package Functions

File getDbRootDir ()
 Return a File representing the database root directory.

File getScratchDir ()
 Return a File representing the database scratch/temp root directory.

final void makeTempDirectory (Properties props) throws IOException
 Hook which allows the scratch files to be written to a separate directory.

void clearTempFile ()
 When nothing is happening, get rid of this guy.


Static Package Functions

 [static initializer]

Package Attributes

String fileName
File dbRootDir
File tempDir
String url
Log log
LockManager locks = null
Properties props
int blockSize = BLOCK_SIZE
final ConfigNumber cacheSize
int CACHE_SIZE
final ConfigNumber scratchCacheSize
int SCRATCH_CACHE_SIZE
final ConfigString defaultMode = ConfigString.find("qed.defaultMode", "rw")

Static Package Attributes

final int MIN_CACHE = 32
 Minimum cache size: 256K, with 8K blocks.

final int GOOD_CACHE = 256
 Reasonable cache size: 4MB (8K blocks).

final int SCRATCH_CACHE_DEFAULT = 64
 Reasonable scratch cache default.

final int BLOCK_SIZE = ConfigNumber.find("qed.blockSize", Integer.toString(8192)).intValue()
final ConfigString caseSensitive = ConfigString.find("qed.isCaseSensitive", "true")

Private Member Functions

final void deleteHalfBakedDir ()

Private Attributes

FileChannel lockChannel = null
 True if we've locked the lockfile.

FileLock lockLock = null
int tempFileRefCount = 0


Constructor & Destructor Documentation

com.quadcap.sql.file.Datafile.Datafile  ) 
 

Construct a new Datafile object, from the specified filename and mode.

Definition at line 239 of file Datafile.java.


Member Function Documentation

com.quadcap.sql.file.Datafile.[static initializer]  )  [static, package]
 

abstract void com.quadcap.sql.file.Datafile.bootFromRoot boolean  restart  )  throws IOException [pure virtual]
 

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

void com.quadcap.sql.file.Datafile.checkpoint boolean  truncate,
boolean  fastSync
throws IOException
 

Reset the temp file (on checkpoint).

Definition at line 845 of file Datafile.java.

References com.quadcap.sql.file.Datafile.checkpoint(), com.quadcap.sql.file.Datafile.fileLock, com.quadcap.sql.file.BlockFile.flush(), and com.quadcap.sql.file.Datafile.tempFile.

Referenced by com.quadcap.sql.file.Datafile.checkpoint(), and com.quadcap.sql.file.Log1.reallyCheckpoint().

void com.quadcap.sql.file.Datafile.checkpointHandler LongMap  activeTransactions  )  throws IOException
 

Definition at line 855 of file Datafile.java.

References com.quadcap.sql.file.Datafile.checkpointHandler().

Referenced by com.quadcap.sql.file.Datafile.checkpointHandler(), and com.quadcap.sql.file.Log1.reallyCheckpoint().

void com.quadcap.sql.file.Datafile.clearTempFile  )  [package]
 

When nothing is happening, get rid of this guy.

Who needs him, eh?

Definition at line 686 of file Datafile.java.

References com.quadcap.sql.file.BlockFile.close(), com.quadcap.sql.file.Datafile.dbRootDir, com.quadcap.sql.file.Datafile.inMemory, and com.quadcap.sql.file.Datafile.tempFile.

Referenced by com.quadcap.sql.file.Datafile.close(), and com.quadcap.sql.file.Datafile.releaseTempFile().

void com.quadcap.sql.file.Datafile.close  ) 
 

Close the database.

Sync and close the physical file(s), delete the tempfile(s) and lockfile. Kill the database reference monitor thread.

Definition at line 711 of file Datafile.java.

References com.quadcap.sql.file.Log.checkpoint(), com.quadcap.sql.file.Datafile.clearTempFile(), com.quadcap.sql.file.BlockFile.close(), com.quadcap.sql.file.Log.close(), com.quadcap.sql.file.Datafile.dbRootDir, com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.Datafile.lockChannel, com.quadcap.sql.file.Datafile.lockLock, com.quadcap.sql.file.Datafile.log, com.quadcap.sql.file.Log.remove(), and com.quadcap.sql.file.Log.sync().

Referenced by com.quadcap.sql.file.Datafile.finalize().

void com.quadcap.sql.file.Datafile.commitTransaction Transaction  trans  )  throws IOException
 

Commit the transaction.

Definition at line 780 of file Datafile.java.

References com.quadcap.sql.file.Log.addEntry(), com.quadcap.sql.file.Datafile.commitTransaction(), com.quadcap.sql.file.Log.flushLog(), com.quadcap.sql.lock.Transaction.getTransactionId(), com.quadcap.sql.file.Datafile.log, and com.quadcap.sql.file.Datafile.releaseLocks().

Referenced by com.quadcap.sql.file.Datafile.commitTransaction().

abstract void com.quadcap.sql.file.Datafile.createRoot String  fileName,
Properties  props
throws IOException [pure virtual]
 

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

final void com.quadcap.sql.file.Datafile.deleteHalfBakedDir  )  [private]
 

Definition at line 528 of file Datafile.java.

References com.quadcap.sql.file.Datafile.dbRootDir.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase().

void com.quadcap.sql.file.Datafile.doStep Transaction  t,
LogEntry  e
throws IOException, DatafileException
 

Definition at line 873 of file Datafile.java.

References com.quadcap.sql.file.Log.addEntry(), com.quadcap.sql.file.Datafile.doStep(), and com.quadcap.sql.file.Datafile.log.

Referenced by com.quadcap.sql.file.Datafile.doStep().

void com.quadcap.sql.file.Datafile.finalize  )  throws Throwable
 

If we get finalized, and haven't closed yet, then we should try.

Definition at line 830 of file Datafile.java.

References com.quadcap.sql.file.Datafile.close().

Transaction com.quadcap.sql.file.Datafile.findTransaction long  transId  )  throws IOException
 

Find the specified transaction.

Definition at line 817 of file Datafile.java.

References com.quadcap.sql.file.Datafile.findTransaction(), and com.quadcap.sql.file.Datafile.locks.

Referenced by com.quadcap.sql.file.Log1.abortOldestTransaction(), and com.quadcap.sql.file.Datafile.findTransaction().

abstract void com.quadcap.sql.file.Datafile.flushRoot  )  throws IOException [pure virtual]
 

Referenced by com.quadcap.sql.file.Log1.reallyCheckpoint().

File com.quadcap.sql.file.Datafile.getDbRootDir  )  [package]
 

Return a File representing the database root directory.

Definition at line 546 of file Datafile.java.

References com.quadcap.sql.file.Datafile.dbRootDir.

Referenced by com.quadcap.sql.file.Log0.getDbRootDir(), and com.quadcap.sql.file.Logger1.init().

BlockFile com.quadcap.sql.file.Datafile.getFile  ) 
 

Accessor for my underlying file.

Definition at line 536 of file Datafile.java.

References com.quadcap.sql.file.Datafile.file.

Referenced by com.quadcap.sql.types.ValueBlob.getRandomAccess(), com.quadcap.sql.types.ValueBlob.init(), and com.quadcap.sql.types.ValueBlob.passivate().

Object com.quadcap.sql.file.Datafile.getFileLock  ) 
 

Accessor for file lock.

Definition at line 561 of file Datafile.java.

References com.quadcap.sql.file.Datafile.fileLock.

Referenced by com.quadcap.sql.types.ValueBlob.init(), com.quadcap.sql.file.Log1.init(), and com.quadcap.sql.types.ValueBlob.passivate().

LockManager com.quadcap.sql.file.Datafile.getLockManager  ) 
 

Accessor for the datbase's lock manager.

Definition at line 556 of file Datafile.java.

References com.quadcap.sql.file.Datafile.locks.

final Log com.quadcap.sql.file.Datafile.getLog  ) 
 

Return the log for this database.

Definition at line 825 of file Datafile.java.

References com.quadcap.sql.file.Datafile.log.

abstract long com.quadcap.sql.file.Datafile.getNextTransId  )  throws IOException [pure virtual]
 

Referenced by com.quadcap.sql.file.Datafile.makeTransaction().

Object com.quadcap.sql.file.Datafile.getObject long  ref  )  throws IOException
 

Return the specified persistent object from the store.

Parameters:
ref the block number of the object's root
Returns:
the object
Exceptions:
IOException may be thrown

Definition at line 574 of file Datafile.java.

References com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.BlockFile.getObject(), and com.quadcap.sql.file.Datafile.getObject().

Referenced by com.quadcap.sql.file.Datafile.getObject().

File com.quadcap.sql.file.Datafile.getScratchDir  )  [package]
 

Return a File representing the database scratch/temp root directory.

Definition at line 551 of file Datafile.java.

References com.quadcap.sql.file.Datafile.tempDir.

Referenced by com.quadcap.sql.file.Log1.resetBlocks(), and com.quadcap.sql.file.Log1.restoreBlocks().

long com.quadcap.sql.file.Datafile.getSize  ) 
 

Return the total size of the datafile, in bytes.

Definition at line 838 of file Datafile.java.

References com.quadcap.sql.file.Datafile.file, and com.quadcap.sql.file.BlockFile.getSize().

BlockFile com.quadcap.sql.file.Datafile.getTempFile boolean  incr  )  throws IOException
 

Definition at line 649 of file Datafile.java.

References com.quadcap.sql.file.Datafile.blockSize, com.quadcap.sql.file.Datafile.fileLock, com.quadcap.sql.file.Datafile.fileName, com.quadcap.sql.file.Datafile.inMemory, com.quadcap.sql.file.Datafile.props, com.quadcap.sql.file.Datafile.SCRATCH_CACHE_SIZE, com.quadcap.sql.file.Datafile.tempDir, com.quadcap.sql.file.Datafile.tempFile, and com.quadcap.sql.file.Datafile.tempFileRefCount.

BlockFile com.quadcap.sql.file.Datafile.getTempFile  )  throws IOException
 

The temporary file can be used for storage of non-transactionally-secure data.

Definition at line 645 of file Datafile.java.

Referenced by com.quadcap.sql.types.ValueBlob.init(), com.quadcap.sql.types.ValueBlob.passivate(), and com.quadcap.sql.file.Log1.reallyRestart().

String com.quadcap.sql.file.Datafile.getURL  ) 
 

Return the JDBC URL used to connect to this database.

Definition at line 541 of file Datafile.java.

References com.quadcap.sql.file.Datafile.url.

void com.quadcap.sql.file.Datafile.init String  url,
String  fileName,
Properties  props
throws IOException
 

Definition at line 242 of file Datafile.java.

References com.quadcap.sql.file.Datafile.fileName, com.quadcap.sql.file.Datafile.init(), com.quadcap.sql.file.Datafile.initFileDatabase(), com.quadcap.sql.file.Datafile.initMemoryDatabase(), com.quadcap.sql.file.Datafile.inMemory, com.quadcap.sql.file.Datafile.props, and com.quadcap.sql.file.Datafile.url.

Referenced by com.quadcap.sql.file.Datafile.init().

void com.quadcap.sql.file.Datafile.initFileDatabase String  url,
String  fileName,
Properties  props
throws IOException
 

Definition at line 296 of file Datafile.java.

References com.quadcap.sql.file.Datafile.blockSize, com.quadcap.sql.file.Datafile.bootFromRoot(), com.quadcap.sql.file.Datafile.CACHE_SIZE, com.quadcap.sql.file.Datafile.caseSensitive, com.quadcap.sql.file.Log.checkpoint(), com.quadcap.sql.file.Datafile.createRoot(), com.quadcap.sql.file.Datafile.dbRootDir, com.quadcap.sql.file.Datafile.defaultMode, com.quadcap.sql.file.Datafile.deleteHalfBakedDir(), com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.Datafile.fileName, com.quadcap.sql.file.Log.init(), com.quadcap.sql.file.Datafile.initFileDatabase(), com.quadcap.sql.file.Datafile.isCaseSensitive, com.quadcap.sql.file.Datafile.lockChannel, com.quadcap.sql.file.Datafile.lockLock, com.quadcap.sql.file.Datafile.log, com.quadcap.sql.file.Datafile.makeTempDirectory(), com.quadcap.sql.file.Datafile.props, com.quadcap.sql.file.Datafile.readOnly, com.quadcap.sql.file.Datafile.readRoot(), com.quadcap.sql.file.Log.restart(), com.quadcap.sql.file.Log.restoreBlocks(), com.quadcap.sql.file.BlockFile.revert(), com.quadcap.sql.file.Datafile.SCRATCH_CACHE_SIZE, com.quadcap.sql.file.BlockFile.setLog(), com.quadcap.sql.file.Log.start(), and com.quadcap.sql.file.Datafile.url.

Referenced by com.quadcap.sql.file.Datafile.init(), and com.quadcap.sql.file.Datafile.initFileDatabase().

void com.quadcap.sql.file.Datafile.initMemoryDatabase String  url,
String  fileName,
Properties  props
throws IOException
 

Definition at line 257 of file Datafile.java.

References com.quadcap.sql.file.Datafile.blockSize, com.quadcap.sql.file.Datafile.bootFromRoot(), com.quadcap.sql.file.Datafile.CACHE_SIZE, com.quadcap.sql.file.Datafile.caseSensitive, com.quadcap.sql.file.Datafile.createRoot(), com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.Datafile.fileName, com.quadcap.sql.file.Log.init(), com.quadcap.sql.file.Datafile.initMemoryDatabase(), com.quadcap.sql.file.Datafile.isCaseSensitive, com.quadcap.sql.file.Datafile.log, com.quadcap.sql.file.Datafile.props, com.quadcap.sql.file.BlockFile.setLog(), and com.quadcap.sql.file.Datafile.url.

Referenced by com.quadcap.sql.file.Datafile.init(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

boolean com.quadcap.sql.file.Datafile.inRecovery  )  throws IOException
 

Definition at line 880 of file Datafile.java.

References com.quadcap.sql.file.Log.inRecovery(), and com.quadcap.sql.file.Datafile.log.

boolean com.quadcap.sql.file.Datafile.isReadOnly  ) 
 

Is db read only?

Definition at line 566 of file Datafile.java.

References com.quadcap.sql.file.Datafile.readOnly.

final void com.quadcap.sql.file.Datafile.makeTempDirectory Properties  props  )  throws IOException [package]
 

Hook which allows the scratch files to be written to a separate directory.

Useful when you want to mount the data files read only

Definition at line 615 of file Datafile.java.

References com.quadcap.sql.file.Datafile.dbRootDir, com.quadcap.sql.file.Datafile.inMemory, com.quadcap.sql.file.Datafile.makeTempDirectory(), com.quadcap.sql.file.Datafile.props, and com.quadcap.sql.file.Datafile.tempDir.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.makeTempDirectory().

final Transaction com.quadcap.sql.file.Datafile.makeTransaction boolean  writeLog  )  throws IOException
 

Helper to create a new transaction, and optionally to write the BEGIN_TRANSACTION log entry.

Definition at line 761 of file Datafile.java.

References com.quadcap.sql.file.Log.addEntry(), com.quadcap.sql.file.Datafile.fileLock, com.quadcap.sql.file.Datafile.getNextTransId(), com.quadcap.sql.file.Datafile.locks, com.quadcap.sql.file.Datafile.log, and com.quadcap.sql.file.Datafile.makeTransaction().

Referenced by com.quadcap.sql.file.Datafile.makeTransaction(), and com.quadcap.sql.file.Log1.reallyRestart().

abstract void com.quadcap.sql.file.Datafile.maybeBackup  )  throws IOException [pure virtual]
 

long com.quadcap.sql.file.Datafile.putObject Object  obj  )  throws IOException
 

Write a new object to the store and return its reference.

Parameters:
obj the object
Returns:
the block number of the object's root
Exceptions:
IOException may be thrown

Definition at line 585 of file Datafile.java.

References com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.BlockFile.putObject(), and com.quadcap.sql.file.Datafile.putObject().

Referenced by com.quadcap.sql.file.Datafile.putObject().

abstract void com.quadcap.sql.file.Datafile.readRoot  )  throws IOException [pure virtual]
 

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase().

void com.quadcap.sql.file.Datafile.releaseLocks Transaction  trans  ) 
 

Remove the transaction for the given connection from the 'active transactions' table.

Flush the log?

Definition at line 810 of file Datafile.java.

References com.quadcap.sql.file.Datafile.locks, and com.quadcap.sql.file.Datafile.releaseLocks().

Referenced by com.quadcap.sql.file.Datafile.commitTransaction(), and com.quadcap.sql.file.Datafile.releaseLocks().

void com.quadcap.sql.file.Datafile.releaseTempFile  ) 
 

Definition at line 672 of file Datafile.java.

References com.quadcap.sql.file.Datafile.clearTempFile(), com.quadcap.sql.file.Datafile.fileLock, and com.quadcap.sql.file.Datafile.tempFileRefCount.

void com.quadcap.sql.file.Datafile.removeObject long  ref  )  throws IOException
 

Remove an object from the store.

Parameters:
ref the block number of the object's root
Exceptions:
IOException may be thrown

Definition at line 606 of file Datafile.java.

References com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.BlockFile.removeObject(), and com.quadcap.sql.file.Datafile.removeObject().

Referenced by com.quadcap.sql.file.Datafile.removeObject().

void com.quadcap.sql.file.Datafile.rollbackStatement Transaction  trans,
int  stmtId
throws IOException
 

Rollback the specified statement.

Definition at line 800 of file Datafile.java.

References com.quadcap.sql.file.Datafile.log, com.quadcap.sql.file.Log.rollbackStatement(), and com.quadcap.sql.file.Datafile.rollbackStatement().

Referenced by com.quadcap.sql.file.Datafile.rollbackStatement().

void com.quadcap.sql.file.Datafile.rollbackTransaction Transaction  trans  )  throws IOException
 

Rollback the transaction.

Definition at line 790 of file Datafile.java.

References com.quadcap.sql.file.Datafile.log, com.quadcap.sql.file.Log.rollbackTransaction(), and com.quadcap.sql.file.Datafile.rollbackTransaction().

Referenced by com.quadcap.sql.file.Datafile.rollbackTransaction().

String com.quadcap.sql.file.Datafile.toString  ) 
 

Return a displayable representation for debugging purposes.

Definition at line 864 of file Datafile.java.

References com.quadcap.sql.file.Datafile.url.

Referenced by com.quadcap.sql.file.Log1.resetBlocks(), and com.quadcap.sql.file.Log1.restoreBlocks().

void com.quadcap.sql.file.Datafile.updateObject long  seg,
Object  obj
throws IOException
 

Write a new version of a persistent object to the store.

Parameters:
blockNum the address of the object's root page in the store
obj the new object value
Exceptions:
IOException may be thrown

Definition at line 596 of file Datafile.java.

References com.quadcap.sql.file.Datafile.file, com.quadcap.sql.file.BlockFile.updateObject(), and com.quadcap.sql.file.Datafile.updateObject().

Referenced by com.quadcap.sql.file.Datafile.updateObject().


Member Data Documentation

final int com.quadcap.sql.file.Datafile.BLOCK_SIZE = ConfigNumber.find("qed.blockSize", Integer.toString(8192)).intValue() [static, package]
 

Definition at line 161 of file Datafile.java.

int com.quadcap.sql.file.Datafile.blockSize = BLOCK_SIZE [package]
 

Definition at line 162 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.getTempFile(), com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

int com.quadcap.sql.file.Datafile.CACHE_SIZE [package]
 

Initial value:

Math.max(MIN_CACHE, cacheSize.intValue() / BLOCK_SIZE)

Definition at line 178 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

final ConfigNumber com.quadcap.sql.file.Datafile.cacheSize [package]
 

Initial value:

ConfigNumber.find("qed.cacheSize", Integer.toString(GOOD_CACHE * BLOCK_SIZE))

Definition at line 176 of file Datafile.java.

final ConfigString com.quadcap.sql.file.Datafile.caseSensitive = ConfigString.find("qed.isCaseSensitive", "true") [static, package]
 

Definition at line 219 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

File com.quadcap.sql.file.Datafile.dbRootDir [package]
 

Definition at line 86 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.clearTempFile(), com.quadcap.sql.file.Datafile.close(), com.quadcap.sql.file.Datafile.deleteHalfBakedDir(), com.quadcap.sql.file.Datafile.getDbRootDir(), com.quadcap.sql.file.Log1.init(), com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.makeTempDirectory().

final ConfigString com.quadcap.sql.file.Datafile.defaultMode = ConfigString.find("qed.defaultMode", "rw") [package]
 

Definition at line 207 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase().

BlockFile com.quadcap.sql.file.Datafile.file [protected]
 

Definition at line 92 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.close(), com.quadcap.sql.file.Datafile.getFile(), com.quadcap.sql.file.Datafile.getObject(), com.quadcap.sql.file.Datafile.getSize(), com.quadcap.sql.file.Log1.init(), com.quadcap.sql.file.Datafile.initFileDatabase(), com.quadcap.sql.file.Datafile.initMemoryDatabase(), com.quadcap.sql.file.Datafile.putObject(), com.quadcap.sql.file.Datafile.removeObject(), com.quadcap.sql.types.ValueBlob.setDatafile(), and com.quadcap.sql.file.Datafile.updateObject().

Object com.quadcap.sql.file.Datafile.fileLock = new Object() [protected]
 

Definition at line 120 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.checkpoint(), com.quadcap.sql.file.Datafile.getFileLock(), com.quadcap.sql.file.Datafile.getTempFile(), com.quadcap.sql.file.Datafile.makeTransaction(), and com.quadcap.sql.file.Datafile.releaseTempFile().

String com.quadcap.sql.file.Datafile.fileName [package]
 

Definition at line 83 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.getTempFile(), com.quadcap.sql.file.Datafile.init(), com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

final int com.quadcap.sql.file.Datafile.GOOD_CACHE = 256 [static, package]
 

Reasonable cache size: 4MB (8K blocks).

This cache size should support a moderate load; 8-10 busy threads...

Definition at line 146 of file Datafile.java.

boolean com.quadcap.sql.file.Datafile.inMemory = false [protected]
 

Definition at line 82 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.clearTempFile(), com.quadcap.sql.file.Datafile.getTempFile(), com.quadcap.sql.file.Datafile.init(), and com.quadcap.sql.file.Datafile.makeTempDirectory().

boolean com.quadcap.sql.file.Datafile.isCaseSensitive [static]
 

Initial value:

caseSensitive.toString().equalsIgnoreCase("true")

Definition at line 222 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.initFileDatabase(), and com.quadcap.sql.file.Datafile.initMemoryDatabase().

FileChannel com.quadcap.sql.file.Datafile.lockChannel = null [private]
 

True if we've locked the lockfile.

Definition at line 114 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.close(), and com.quadcap.sql.file.Datafile.initFileDatabase().

FileLock com.quadcap.sql.file.Datafile.lockLock = null [private]
 

Definition at line 115 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.close(), and com.quadcap.sql.file.Datafile.initFileDatabase().

LockManager com.quadcap.sql.file.Datafile.locks = null [package]
 

Definition at line 102 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.findTransaction(), com.quadcap.sql.file.Datafile.getLockManager(), com.quadcap.sql.file.Datafile.makeTransaction(), and com.quadcap.sql.file.Datafile.releaseLocks().

Log com.quadcap.sql.file.Datafile.log [package]
 

Definition at line 99 of file Datafile.java.

Referenced by com.quadcap.sql.file.Datafile.close(), com.quadcap.sql.file.Datafile.commitTransaction(), com.quadcap.sql.file.Datafile.doStep(), com.quadcap.sql.file.Datafile.getLog(), com.quadcap.sql.file.Datafile.initFileDatabase(), com.quadcap.sql.file.Datafile.initMemoryDatabase(), com.quadcap.sql.file.Datafile.inRecovery(), com.quadcap.sql.file.Datafile.makeTransaction(), com.quadcap.sql.file.Datafile.rollbackStatement(), and com.quadcap.sql.file.Datafile.rollbackTransaction().

final int com.quadcap.sql.file.Datafile.MIN_CACHE = 32 [static, package]
 

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.

Definition at line 140 of file Datafile.java.

String com.quadcap.sql.file.Datafile.origFileName [protected]
 

Definition at line 89 of file Datafile.java.

Properties com.quadcap.sql.file.Datafile.