Java Doc for DataFileCache.java in  » Database-DBMS » hsql » org » hsqldb » persist » 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 » hsql » org.hsqldb.persist 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.persist.DataFileCache

All known Subclasses:   org.hsqldb.persist.TextCache,
DataFileCache
public class DataFileCache (Code)
Acts as a manager for CACHED table persistence.

This contains the top level functionality. Provides file management services and access.

Rewritten for 1.8.0 together with Cache.
author:
   fredt@users
version:
   1.8.0
since:
   1.7.2



Field Summary
final static  intFLAGS_POS
    
final public static  intFLAG_ISSAVED
    
final public static  intFLAG_ROWINFO
    
final static  intINITIAL_FREE_POS
    
final static  intLONG_EMPTY_INDEX_POS
    
final static  intLONG_EMPTY_SIZE
    
final static  intLONG_FREE_POS_POS
    
protected  StringbackupFileName
    
protected  Cachecache
    
protected  intcacheFileScale
    
protected  booleancacheReadonly
    
protected  intcachedRowPadding
    
protected  StoragedataFile
    
protected  Databasedatabase
    
protected  FileAccessfa
    
protected  longfileFreePosition
    
protected  booleanfileModified
    
protected  StringfileName
    
 DataFileBlockManagerfreeBlocks
    
protected  booleanhasRowInfo
    
protected  longmaxCacheBytes
    
protected  intmaxCacheSize
    
public  longmaxDataFileSize
    
protected  intmaxFreeBlocks
    
protected  RowInputInterfacerowIn
    
protected  RowOutputInterfacerowOut
    
protected  booleanstoreOnInsert
    

Constructor Summary
public  DataFileCache(Database db, String baseFileName)
    

Method Summary
public synchronized  voidadd(CachedObject object)
    
 voidbackupFile()
     Saves the *.data file as compressed *.backup.
public  longbytesCapacity()
    
public  intcapacity()
    
public  voidclose(boolean write)
     Parameter write indicates either an orderly close, or a fast close without backup.
public  voiddefrag()
     Writes out all the rows to a new file without fragmentation.
 voiddeleteBackup()
    
 voiddeleteFile(boolean wasNio)
    
static  voiddeleteOrResetFreePos(Database database, String filename)
     This method deletes a data file or resets its free position.
public synchronized  CachedObjectget(int i, PersistentStore store, boolean keep)
    
public  intgetCachedObjectCount()
    
public  longgetFileFreePos()
    
public  StringgetFileName()
    
public  intgetFreeBlockCount()
    
synchronized  RowInputInterfacegetRaw(int i)
    
public synchronized  intgetStorageSize(int i)
    
public  longgetTotalCachedBlockSize()
    
public  intgetTotalFreeBlockSize()
    
public  booleanhasRowInfo()
    
protected  voidinitBuffers()
    
protected  voidinitParams(Database database, String baseFileName)
     initial external parameters are set here.
public  booleanisFileModified()
    
public  voidopen(boolean readonly)
     Opens the *.data file for this cache, setting the variables that allow access to the particular database version of the *.data file.
protected synchronized  RowInputInterfacereadObject(int pos)
    
protected synchronized  intreadSize(int pos)
    
public synchronized  CachedObjectrelease(int i)
    
public synchronized  voidremove(int i, PersistentStore store)
     Used when a row is deleted as a result of some DML or DDL command.
public synchronized  voidremovePersistence(int i, PersistentStore store)
    
 voidrenameBackupFile()
    
 voidrenameDataFile()
     Renames the *.data.new file.
public synchronized  voidrestore(CachedObject object)
     For a CacheObject that had been previously released from the cache.
public synchronized  voidsaveRow(CachedObject row)
     Writes out the specified Row.
protected synchronized  voidsaveRows(CachedObject[] rows, int offset, int count)
    
protected synchronized  voidsetFileModified()
    

Field Detail
FLAGS_POS
final static int FLAGS_POS(Code)



FLAG_ISSAVED
final public static int FLAG_ISSAVED(Code)



FLAG_ROWINFO
final public static int FLAG_ROWINFO(Code)



INITIAL_FREE_POS
final static int INITIAL_FREE_POS(Code)



LONG_EMPTY_INDEX_POS
final static int LONG_EMPTY_INDEX_POS(Code)



LONG_EMPTY_SIZE
final static int LONG_EMPTY_SIZE(Code)



LONG_FREE_POS_POS
final static int LONG_FREE_POS_POS(Code)



backupFileName
protected String backupFileName(Code)



cache
protected Cache cache(Code)



cacheFileScale
protected int cacheFileScale(Code)



cacheReadonly
protected boolean cacheReadonly(Code)



cachedRowPadding
protected int cachedRowPadding(Code)



dataFile
protected Storage dataFile(Code)



database
protected Database database(Code)



fa
protected FileAccess fa(Code)



fileFreePosition
protected long fileFreePosition(Code)



fileModified
protected boolean fileModified(Code)



fileName
protected String fileName(Code)



freeBlocks
DataFileBlockManager freeBlocks(Code)



hasRowInfo
protected boolean hasRowInfo(Code)



maxCacheBytes
protected long maxCacheBytes(Code)



maxCacheSize
protected int maxCacheSize(Code)



maxDataFileSize
public long maxDataFileSize(Code)



maxFreeBlocks
protected int maxFreeBlocks(Code)



rowIn
protected RowInputInterface rowIn(Code)



rowOut
protected RowOutputInterface rowOut(Code)



storeOnInsert
protected boolean storeOnInsert(Code)




Constructor Detail
DataFileCache
public DataFileCache(Database db, String baseFileName) throws HsqlException(Code)




Method Detail
add
public synchronized void add(CachedObject object) throws IOException(Code)



backupFile
void backupFile() throws IOException(Code)
Saves the *.data file as compressed *.backup.
throws:
  HsqlException -



bytesCapacity
public long bytesCapacity()(Code)



capacity
public int capacity()(Code)



close
public void close(boolean write) throws HsqlException(Code)
Parameter write indicates either an orderly close, or a fast close without backup. When false, just closes the file. When true, writes out all cached rows that have been modified and the free position pointer for the *.data file and then closes the file.



defrag
public void defrag() throws HsqlException(Code)
Writes out all the rows to a new file without fragmentation.



deleteBackup
void deleteBackup()(Code)



deleteFile
void deleteFile(boolean wasNio)(Code)



deleteOrResetFreePos
static void deleteOrResetFreePos(Database database, String filename)(Code)
This method deletes a data file or resets its free position. this is used only for nio files - not OOo files



get
public synchronized CachedObject get(int i, PersistentStore store, boolean keep) throws HsqlException(Code)



getCachedObjectCount
public int getCachedObjectCount()(Code)



getFileFreePos
public long getFileFreePos()(Code)



getFileName
public String getFileName()(Code)



getFreeBlockCount
public int getFreeBlockCount()(Code)



getRaw
synchronized RowInputInterface getRaw(int i) throws IOException(Code)



getStorageSize
public synchronized int getStorageSize(int i) throws IOException(Code)



getTotalCachedBlockSize
public long getTotalCachedBlockSize()(Code)



getTotalFreeBlockSize
public int getTotalFreeBlockSize()(Code)



hasRowInfo
public boolean hasRowInfo()(Code)



initBuffers
protected void initBuffers()(Code)



initParams
protected void initParams(Database database, String baseFileName) throws HsqlException(Code)
initial external parameters are set here.



isFileModified
public boolean isFileModified()(Code)



open
public void open(boolean readonly) throws HsqlException(Code)
Opens the *.data file for this cache, setting the variables that allow access to the particular database version of the *.data file.



readObject
protected synchronized RowInputInterface readObject(int pos) throws IOException(Code)



readSize
protected synchronized int readSize(int pos) throws IOException(Code)



release
public synchronized CachedObject release(int i)(Code)



remove
public synchronized void remove(int i, PersistentStore store) throws IOException(Code)
Used when a row is deleted as a result of some DML or DDL command. Removes the row from the cache data structures. Adds the file space for the row to the list of free positions.



removePersistence
public synchronized void removePersistence(int i, PersistentStore store) throws IOException(Code)



renameBackupFile
void renameBackupFile()(Code)



renameDataFile
void renameDataFile()(Code)
Renames the *.data.new file.
throws:
  HsqlException -



restore
public synchronized void restore(CachedObject object) throws IOException(Code)
For a CacheObject that had been previously released from the cache. A new version is introduced, using the preallocated space for the object.



saveRow
public synchronized void saveRow(CachedObject row) throws IOException(Code)
Writes out the specified Row. Will write only the Nodes or both Nodes and table row data depending on what is not already persisted to disk.



saveRows
protected synchronized void saveRows(CachedObject[] rows, int offset, int count) throws IOException(Code)



setFileModified
protected synchronized void setFileModified() throws IOException(Code)



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.