Java Doc for SubPageManager.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.SubPageManager

SubPageManager
public class SubPageManager implements PageManager(Code)
This class implements a sub-page manager which operates by allocating pages as needed from the main file and chopping them up into smaller pages of the appropriate size.
author:
   Stan Bailes


Field Summary
static  int[]BLOCK_NUM
    
final static  longPAGE_FREE
    
static  int[]PAGE_NUM
    
static  int[]PAGE_SHIFT
     Sub-page numbers are encoded as follows:

 sub_page {
 pageShift		bit4
 pageNum		bit16
 blockNum		bit44
 }
 

This has the desirable property of being backward compatible with the pre-sub-page block numbers, which will have pageShift and pageNum equal to zero.

 BlockFilefile
    
 intoffset
    
 intpageShift
    
 intpageSize
    
 intpagesPerBlock
    
 longrootBlock
     rootBlock is the root block of the entire block file, and will always be zero in this implementation.

Constructor Summary
public  SubPageManager(BlockFile file, int pageShift, long rootBlock)
    

Method Summary
final static  longfEnd(int[] f)
    
final static  longfExt(long v, int[] f)
    
final static  longfIns(long v, int[] f)
    
final static  longfMask(int[] f)
    
public  voidfreePage(long block)
     Free a block.
public  voidfreeStream(long page)
     Destroy the stream with the specified root page and free up the storage it was using.
public  RandomAccessInputStreamgetInputStream(long block)
     Return a new input stream, reading from the region with the specified root block.
public  ObjectgetLock()
    
public  RandomAccessOutputStreamgetOutputStream(long block)
     Return a new output stream, writing to the region with the specified root block.
public  PagegetPage(long block)
    
final public  intgetPageSize()
    
public  RandomAccessgetStream(long blockRef)
    
final  longmakePageNo(long blk, long page)
    
public  longnewPage()
     Allocate a new block.
final public static  longpageBlock(long page)
     Return the number of the block that contains this page.
final public  intpageOffset(long page)
     Return the byte offset of this page in the base block.
final static  intpageShift(long page)
     Return the page shift for this page.
public  StringtoString()
     Return a displayable representation for this object.
public static  StringtoString(long page)
    

Field Detail
BLOCK_NUM
static int[] BLOCK_NUM(Code)



PAGE_FREE
final static long PAGE_FREE(Code)



PAGE_NUM
static int[] PAGE_NUM(Code)



PAGE_SHIFT
static int[] PAGE_SHIFT(Code)
Sub-page numbers are encoded as follows:

 sub_page {
 pageShift		bit4
 pageNum		bit16
 blockNum		bit44
 }
 

This has the desirable property of being backward compatible with the pre-sub-page block numbers, which will have pageShift and pageNum equal to zero.




file
BlockFile file(Code)



offset
int offset(Code)
The offset into the root block of our freelist head



pageShift
int pageShift(Code)
The page shift (file.pageSize >> pageShift == pageSize)



pageSize
int pageSize(Code)
The size of a subpage



pagesPerBlock
int pagesPerBlock(Code)
(1 << pageShift)



rootBlock
long rootBlock(Code)
rootBlock is the root block of the entire block file, and will always be zero in this implementation.




Constructor Detail
SubPageManager
public SubPageManager(BlockFile file, int pageShift, long rootBlock) throws IOException(Code)
Construct a new sub-page manager bound to the specified block file




Method Detail
fEnd
final static long fEnd(int[] f)(Code)



fExt
final static long fExt(long v, int[] f)(Code)



fIns
final static long fIns(long v, int[] f)(Code)



fMask
final static long fMask(int[] f)(Code)



freePage
public void freePage(long block) throws IOException(Code)
Free a block.
Parameters:
  block - a previously allocated block



freeStream
public void freeStream(long page) throws IOException(Code)
Destroy the stream with the specified root page and free up the storage it was using.
Parameters:
  page - the root page of the region
exception:
  IOException - if the page number isn't valid, or if anothererror is detected trying to access the region.



getInputStream
public RandomAccessInputStream getInputStream(long block) throws IOException(Code)
Return a new input stream, reading from the region with the specified root block.
Parameters:
  block - the root block of the region an InputStream bound to the region.
exception:
  IOException - if the block number isn't valid, or if anothererror is detected trying to access the region.



getLock
public Object getLock()(Code)
Return the (file) lock



getOutputStream
public RandomAccessOutputStream getOutputStream(long block) throws IOException(Code)
Return a new output stream, writing to the region with the specified root block.
Parameters:
  block - the root block of the region an OutputStream bound to the region.
exception:
  IOException - if the block number isn't valid, or if anothererror is detected trying to access the region.



getPage
public Page getPage(long block) throws IOException(Code)
Return the specified page



getPageSize
final public int getPageSize()(Code)
Return this manager's block size



getStream
public RandomAccess getStream(long blockRef) throws IOException(Code)



makePageNo
final long makePageNo(long blk, long page)(Code)



newPage
public long newPage() throws IOException(Code)
Allocate a new block.



pageBlock
final public static long pageBlock(long page)(Code)
Return the number of the block that contains this page.



pageOffset
final public int pageOffset(long page)(Code)
Return the byte offset of this page in the base block.



pageShift
final static int pageShift(long page)(Code)
Return the page shift for this page.



toString
public String toString()(Code)
Return a displayable representation for this object.



toString
public static String toString(long page)(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.