Java Doc for StoredFieldHeader.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » raw » data » 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 » db derby 10.2 » org.apache.derby.impl.store.raw.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.store.raw.data.StoredFieldHeader

StoredFieldHeader
final public class StoredFieldHeader (Code)
A class to provide static methods to manipulate fields in the field header. A class StoredPage uses to read/write field status and field data length. No attributes exist in this class, this class provides a set of static methods for writing field status and field data length, and for reading field status and field data length.

Stored Field Header Format
The field header is broken into two sections. Only the Status byte is required to be there.

 Field header format:
 +--------+-------------------+
 | status |  |
 +--------+-------------------+
 Overflow page and overflow id are stored as field data.
 If the overflow bit in status is set, the field data is the overflow 
 information.  When the overflow bit is not set in status, then,
 fieldData is the actually user data for the field.
 That means, field header consists only field status, and field data length.
 A non-overflow field:
 +--------+-------------------+-------------+
 | status |  |  |
 +--------+-------------------+-------------+
 An overflow field:
 +--------+-------------------+-----------------+--------------+
 | status |  |  |  |
 +--------+-------------------+-----------------+--------------+
 

status
The status is 1 byte, it indicates the state of the field. A FieldHeader can be in the following states: NULL - if the field is NULL, no field data length is stored OVERFLOW - indicates the field has been overflowed to another page. overflow page and overflow ID is stored at the end of the user data. field data length must be a number greater or equal to 0, indicating the length of the field that is stored on the current page. The format looks like this: +--------+-----------------+---------------+------------+ ||||| +--------+-----------------+---------------+------------+ overflowPage will be written as compressed long, overflowId will be written as compressed Int NONEXISTENT - the field no longer exists, e.g. column has been dropped during an alter table EXTENSIBLE - the field is of user defined data type. The field may be tagged. TAGGED - the field is TAGGED if and only if it is EXTENSIBLE. FIXED - the field is FIXED if and only if it is used in the log records for version 1.2 and higher.
fieldDataLength
The fieldDataLength is only set if the field is not NULL. It is the length of the field that is stored on the current page. The fieldDataLength is a variable length CompressedInt.
overflowPage and overflowID
The overflowPage is a variable length CompressedLong, overflowID is a variable Length CompressedInt. They are only stored when the field state is OVERFLOW. And they are not stored in the field header. Instead, they are stored at the end of the field data. The reason we do that is to save a copy if the field has to overflow.
MT - Mutable - Immutable identity - Thread Aware


Field Summary
final public static  intFIELD_EXTENSIBLE
    
final protected static  intFIELD_FIXED
    
final public static  intFIELD_NONEXISTENT
    
final public static  intFIELD_NULL
    
final public static  intFIELD_OVERFLOW
    
final public static  intFIELD_TAGGED
    
final public static  intSTORED_FIELD_HEADER_STATUS_SIZE
    


Method Summary
final public static  booleanisExtensible(int status)
    
final public static  booleanisFixed(int status)
    
final public static  booleanisNonexistent(int status)
    
final public static  booleanisNull(int status)
    
final public static  booleanisNullable(int status)
    
final public static  booleanisNullorNonExistent(int status)
    
final public static  booleanisOverflow(int status)
    
final public static  booleanisTagged(int status)
    
final public static  intreadFieldDataLength(ObjectInput in, int status, int fieldDataSize)
    
final public static  intreadFieldLengthAndSetStreamPosition(byte[] data, int offset, int status, int fieldDataSize, ArrayInputStream ais)
    
final public static  intreadStatus(ObjectInput in)
    
final public static  intreadStatus(byte[] page, int offset)
    
final public static  intreadTotalFieldLength(byte[] data, int offset)
     read the length of the field and hdr.

Optimized routine used to skip a field on a page.

final public static  intsetExtensible(int status, boolean isExtensible)
    
final public static  intsetFixed(int status, boolean isFixed)
    
final public static  intsetInitial()
     Set accessors for setting bits in the status field.
final public static  intsetNonexistent(int status)
    
final public static  intsetNull(int status, boolean isNull)
    
final public static  intsetOverflow(int status, boolean isOverflow)
    
final public static  intsetTagged(int status, boolean isTagged)
    
final public static  intsize(int status, int fieldDataLength, int fieldDataSize)
    
public static  StringtoDebugString(int status)
    
final public static  intwrite(OutputStream out, int status, int fieldDataLength, int fieldDataSize)
    

Field Detail
FIELD_EXTENSIBLE
final public static int FIELD_EXTENSIBLE(Code)



FIELD_FIXED
final protected static int FIELD_FIXED(Code)



FIELD_NONEXISTENT
final public static int FIELD_NONEXISTENT(Code)



FIELD_NULL
final public static int FIELD_NULL(Code)



FIELD_OVERFLOW
final public static int FIELD_OVERFLOW(Code)



FIELD_TAGGED
final public static int FIELD_TAGGED(Code)



STORED_FIELD_HEADER_STATUS_SIZE
final public static int STORED_FIELD_HEADER_STATUS_SIZE(Code)





Method Detail
isExtensible
final public static boolean isExtensible(int status)(Code)



isFixed
final public static boolean isFixed(int status)(Code)



isNonexistent
final public static boolean isNonexistent(int status)(Code)



isNull
final public static boolean isNull(int status)(Code)
Get the status of the field
MT - single thread required



isNullable
final public static boolean isNullable(int status)(Code)



isNullorNonExistent
final public static boolean isNullorNonExistent(int status)(Code)



isOverflow
final public static boolean isOverflow(int status)(Code)



isTagged
final public static boolean isTagged(int status)(Code)



readFieldDataLength
final public static int readFieldDataLength(ObjectInput in, int status, int fieldDataSize) throws IOException(Code)
read the field data length
exception:
  IOException - Thrown by potential I/O errors while reading field header.



readFieldLengthAndSetStreamPosition
final public static int readFieldLengthAndSetStreamPosition(byte[] data, int offset, int status, int fieldDataSize, ArrayInputStream ais) throws IOException(Code)



readStatus
final public static int readStatus(ObjectInput in) throws IOException(Code)
read the field status
exception:
  IOException - Thrown by potential I/O errors while reading field header.



readStatus
final public static int readStatus(byte[] page, int offset)(Code)



readTotalFieldLength
final public static int readTotalFieldLength(byte[] data, int offset) throws IOException(Code)
read the length of the field and hdr.

Optimized routine used to skip a field on a page. It returns the total length of the field including the header portion. It operates directly on the array and does no checking of it's own for limits on the array length, so an array out of bounds exception may be thrown - the routine is meant to be used to read a field from a page so this should not happen.

The length of the field on the page, including it's header.
Parameters:
  data - the array where the field is.
Parameters:
  offset - the offset in the array where the field begin, ie. the status byte is at data[offset].
exception:
  StandardException - Standard exception policy.




setExtensible
final public static int setExtensible(int status, boolean isExtensible)(Code)



setFixed
final public static int setFixed(int status, boolean isFixed)(Code)



setInitial
final public static int setInitial()(Code)
Set accessors for setting bits in the status field.



setNonexistent
final public static int setNonexistent(int status)(Code)



setNull
final public static int setNull(int status, boolean isNull)(Code)



setOverflow
final public static int setOverflow(int status, boolean isOverflow)(Code)



setTagged
final public static int setTagged(int status, boolean isTagged)(Code)



size
final public static int size(int status, int fieldDataLength, int fieldDataSize)(Code)



toDebugString
public static String toDebugString(int status)(Code)



write
final public static int write(OutputStream out, int status, int fieldDataLength, int fieldDataSize) throws IOException(Code)
write out the field status and field data Length
exception:
  IOException - Thrown by potential I/O errors while writing field header.



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)

w___w___w_.___j__av_a_2_s_.c___om__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.