Java Doc for DiskFile.java in  » Database-DBMS » h2database » org » h2 » store » 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 » h2database » org.h2.store 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.h2.store.DiskFile

DiskFile
public class DiskFile implements CacheWriter(Code)
This class represents a file that is usually written to disk. The two main files are .data.db and .index.db. For each such file, a number of Storage objects exists. The disk file is responsible for caching; each object contains a Cache object. Changes in the file are logged in a LogSystem object. Reading and writing to the file is delegated to the FileStore class.

There are 'blocks' of 128 bytes (DiskFile.BLOCK_SIZE). Each objects own one or more pages; each page size is 64 blocks (DiskFile.BLOCKS_PER_PAGE). That is 8 KB page size. However pages are not read or written as one unit; only individual objects (multiple blocks at a time) are read or written.

Currently there are no in-place updates. Each row occupies one or multiple blocks. Row can occupy multiple pages. Rows are always contiguous (except LOBs, they are stored in their own files).



Field Summary
final public static  intBLOCKS_PER_PAGE
    
final static  intBLOCK_PAGE_PAGE_SHIFT
     The size of a page in blocks.
final public static  intBLOCK_SIZE
     The size of a block in bytes.
final static  intFREE_PAGE
    
final public static  intOFFSET
    

Constructor Summary
public  DiskFile(Database database, String fileName, String mode, boolean dataFile, boolean logChanges, int cacheSize)
    

Method Summary
 voidaddRecord(Session session, Record record)
    
public  voidaddRedoLog(Storage storage, int recordId, int blockCount, DataPage rec)
     Add a redo-log entry to the redo buffer.
 intallocate(Storage storage, int blockCount)
    
public  voidclose()
    
public  intcopyDirect(int pos, OutputStream out)
    
public  voiddelete()
    
public  voidflush()
    
public  voidflushLog()
    
public  voidflushRedoLog()
    
 voidfree(int pos, int blockCount)
    
 voidfreePage(int page)
    
 intgetBlockCount()
    
public  CachegetCache()
    
 intgetPage(int pos)
    
 intgetPageOwner(int page)
    
public  intgetReadCount()
    
 RecordgetRecord(Session session, int pos, RecordReader reader, int storageId)
    
 RecordgetRecordIfStored(Session session, int pos, RecordReader reader, int storageId)
    
public  intgetRecordOverhead()
    
public  byte[]getSummary()
    
 BitFieldgetUsed()
    
public  intgetWriteCount()
    
public  voidinit()
    
public  voidinitFromSummary(byte[] summary)
    
public  booleanisDataFile()
    
 booleanisPageFree(int page)
    
 voidremoveRecord(Session session, int pos, Record record, int blockCount)
    
 voidreuseSpace()
    
public  voidsetLogChanges(boolean b)
    
public  voidsetPageOwner(int page, int storageId)
    
 voidsetUsed(int pos, int blockCount)
    
public  voidsync()
    
public  StringtoString()
    
public  voidtruncateStorage(Session session, Storage storage, IntArray pages)
    
 voiduncommittedDelete(Session session)
    
 voidupdateRecord(Session session, Record record)
    
public  voidwriteBack(CacheObject obj)
    
 voidwriteDirect(Storage storage, int pos, byte[] data, int offset)
    
 voidwriteDirectDeleted(int recordId, int blockCount)
    

Field Detail
BLOCKS_PER_PAGE
final public static int BLOCKS_PER_PAGE(Code)



BLOCK_PAGE_PAGE_SHIFT
final static int BLOCK_PAGE_PAGE_SHIFT(Code)
The size of a page in blocks. Each page contains blocks from the same storage.



BLOCK_SIZE
final public static int BLOCK_SIZE(Code)
The size of a block in bytes. A block is the minimum row size.



FREE_PAGE
final static int FREE_PAGE(Code)



OFFSET
final public static int OFFSET(Code)




Constructor Detail
DiskFile
public DiskFile(Database database, String fileName, String mode, boolean dataFile, boolean logChanges, int cacheSize) throws SQLException(Code)




Method Detail
addRecord
void addRecord(Session session, Record record) throws SQLException(Code)



addRedoLog
public void addRedoLog(Storage storage, int recordId, int blockCount, DataPage rec) throws SQLException(Code)
Add a redo-log entry to the redo buffer.
Parameters:
  storage - the storage
Parameters:
  recordId - the record id of the entry
Parameters:
  blockCount - the number of blocks
Parameters:
  rec - the record



allocate
int allocate(Storage storage, int blockCount) throws SQLException(Code)



close
public void close() throws SQLException(Code)



copyDirect
public int copyDirect(int pos, OutputStream out) throws SQLException(Code)



delete
public void delete() throws SQLException(Code)



flush
public void flush() throws SQLException(Code)



flushLog
public void flushLog() throws SQLException(Code)



flushRedoLog
public void flushRedoLog() throws SQLException(Code)



free
void free(int pos, int blockCount)(Code)



freePage
void freePage(int page) throws SQLException(Code)



getBlockCount
int getBlockCount()(Code)



getCache
public Cache getCache()(Code)



getPage
int getPage(int pos)(Code)



getPageOwner
int getPageOwner(int page)(Code)



getReadCount
public int getReadCount()(Code)



getRecord
Record getRecord(Session session, int pos, RecordReader reader, int storageId) throws SQLException(Code)



getRecordIfStored
Record getRecordIfStored(Session session, int pos, RecordReader reader, int storageId) throws SQLException(Code)



getRecordOverhead
public int getRecordOverhead()(Code)



getSummary
public byte[] getSummary() throws SQLException(Code)



getUsed
BitField getUsed()(Code)



getWriteCount
public int getWriteCount()(Code)



init
public void init() throws SQLException(Code)



initFromSummary
public void initFromSummary(byte[] summary)(Code)



isDataFile
public boolean isDataFile()(Code)



isPageFree
boolean isPageFree(int page)(Code)



removeRecord
void removeRecord(Session session, int pos, Record record, int blockCount) throws SQLException(Code)



reuseSpace
void reuseSpace() throws SQLException(Code)



setLogChanges
public void setLogChanges(boolean b)(Code)



setPageOwner
public void setPageOwner(int page, int storageId) throws SQLException(Code)



setUsed
void setUsed(int pos, int blockCount)(Code)



sync
public void sync()(Code)



toString
public String toString()(Code)



truncateStorage
public void truncateStorage(Session session, Storage storage, IntArray pages) throws SQLException(Code)



uncommittedDelete
void uncommittedDelete(Session session) throws SQLException(Code)



updateRecord
void updateRecord(Session session, Record record) throws SQLException(Code)



writeBack
public void writeBack(CacheObject obj) throws SQLException(Code)



writeDirect
void writeDirect(Storage storage, int pos, byte[] data, int offset) throws SQLException(Code)



writeDirectDeleted
void writeDirectDeleted(int recordId, int blockCount) throws SQLException(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.