Java Doc for Datafile.java in  » Database-DBMS » Quadcap-Embeddable-Database » com » quadcap » sql » file » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » Quadcap Embeddable Database » com.quadcap.sql.file 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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


Field Summary
final static  intBLOCK_SIZE
    
 intCACHE_SIZE
    
final static  intGOOD_CACHE
     Reasonable cache size: 4MB (8K blocks).
final static  intMIN_CACHE
     Minimum cache size: 256K, with 8K blocks.
final static  intSCRATCH_CACHE_DEFAULT
    
 intSCRATCH_CACHE_SIZE
    
 intblockSize
    
final  ConfigNumbercacheSize
    
final static  ConfigStringcaseSensitive
    
 FiledbRootDir
    
final  ConfigStringdefaultMode
    
protected  BlockFilefile
    
protected  ObjectfileLock
    
 StringfileName
    
protected  booleaninMemory
    
public static  booleanisCaseSensitive
    
 LockManagerlocks
    
 Loglog
    
protected  StringorigFileName
    
 Propertiesprops
    
protected  booleanreadOnly
    
protected  DatafileRootroot
    
final  ConfigNumberscratchCacheSize
    
protected  byte[]temp
    
 FiletempDir
    
protected  BlockFiletempFile
    
 Stringurl
    

Constructor Summary
public  Datafile()
     Construct a new Datafile object, from the specified filename and mode.

Method Summary
abstract public  voidbootFromRoot(boolean restart)
    
public  voidcheckpoint(boolean truncate, boolean fastSync)
    
public  voidcheckpointHandler(LongMap activeTransactions)
    
 voidclearTempFile()
     When nothing is happening, get rid of this guy.
public  voidclose()
     Close the database.
public  voidcommitTransaction(Transaction trans)
    
abstract public  voidcreateRoot(String fileName, Properties props)
    
public  voiddoStep(Transaction t, LogEntry e)
    
public  voidfinalize()
     If we get finalized, and haven't closed yet, then we should try.
public  TransactionfindTransaction(long transId)
    
abstract public  voidflushRoot()
    
 FilegetDbRootDir()
    
public  BlockFilegetFile()
    
public  ObjectgetFileLock()
    
public  LockManagergetLockManager()
    
final public  LoggetLog()
    
abstract public  longgetNextTransId()
    
public  ObjectgetObject(long ref)
    
 FilegetScratchDir()
    
public  longgetSize()
    
public  BlockFilegetTempFile()
    
public  BlockFilegetTempFile(boolean incr)
    
public  StringgetURL()
     Return the JDBC URL used to connect to this database.
public  booleaninRecovery()
    
public  voidinit(String url, String fileName, Properties props)
    
public  voidinitFileDatabase(String url, String fileName, Properties props)
    
public  voidinitMemoryDatabase(String url, String fileName, Properties props)
    
public  booleanisReadOnly()
    
final  voidmakeTempDirectory(Properties props)
     Hook which allows the scratch files to be written to a separate directory.
final public  TransactionmakeTransaction(boolean writeLog)
     Helper to create a new transaction, and optionally to write the BEGIN_TRANSACTION log entry.
abstract public  voidmaybeBackup()
    
public  longputObject(Object obj)
    
abstract public  voidreadRoot()
    
public  voidreleaseLocks(Transaction trans)
     Remove the transaction for the given connection from the 'active transactions' table.
public  voidreleaseTempFile()
    
public  voidremoveObject(long ref)
    
public  voidrollbackStatement(Transaction trans, int stmtId)
     Rollback the specified statement.
public  voidrollbackTransaction(Transaction trans)
    
public  StringtoString()
    
public  voidupdateObject(long seg, Object obj)
     Write a new version of a persistent object to the store.

Field Detail
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)



blockSize
int blockSize(Code)



cacheSize
final ConfigNumber cacheSize(Code)



caseSensitive
final static ConfigString caseSensitive(Code)



dbRootDir
File dbRootDir(Code)



defaultMode
final ConfigString defaultMode(Code)



file
protected BlockFile file(Code)



fileLock
protected Object fileLock(Code)



fileName
String fileName(Code)



inMemory
protected boolean inMemory(Code)



isCaseSensitive
public static boolean isCaseSensitive(Code)



locks
LockManager locks(Code)



log
Log log(Code)



origFileName
protected String origFileName(Code)



props
Properties props(Code)



readOnly
protected boolean readOnly(Code)



root
protected DatafileRoot root(Code)



scratchCacheSize
final ConfigNumber scratchCacheSize(Code)



temp
protected byte[] temp(Code)



tempDir
File tempDir(Code)



tempFile
protected BlockFile tempFile(Code)



url
String url(Code)




Constructor Detail
Datafile
public Datafile()(Code)
Construct a new Datafile object, from the specified filename and mode.




Method Detail
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)



checkpointHandler
public void checkpointHandler(LongMap activeTransactions) throws IOException(Code)



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.



commitTransaction
public void commitTransaction(Transaction trans) throws IOException(Code)
Commit the transaction



createRoot
abstract public void createRoot(String fileName, Properties props) throws IOException(Code)



doStep
public void doStep(Transaction t, LogEntry e) throws IOException, DatafileException(Code)



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



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



flushRoot
abstract public void flushRoot() throws IOException(Code)



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



getFile
public BlockFile getFile()(Code)
Accessor for my underlying file



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



getNextTransId
abstract public long getNextTransId() throws IOException(Code)



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



getTempFile
public BlockFile getTempFile(boolean incr) throws IOException(Code)



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



inRecovery
public boolean inRecovery() throws IOException(Code)



init
public void init(String url, String fileName, Properties props) throws IOException(Code)



initFileDatabase
public void initFileDatabase(String url, String fileName, Properties props) throws IOException(Code)



initMemoryDatabase
public void initMemoryDatabase(String url, String fileName, Properties props) throws IOException(Code)



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.



maybeBackup
abstract public void maybeBackup() throws IOException(Code)



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



readRoot
abstract public void readRoot() throws IOException(Code)



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



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



rollbackTransaction
public void rollbackTransaction(Transaction trans) throws IOException(Code)
Rollback the transaction



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.