public final class StoredFieldHeader
extends java.lang.Object
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 | | | | +--------+-------------------+-----------------+--------------+
Modifier and Type | Field and Description |
---|---|
static int |
FIELD_EXTENSIBLE |
protected static int |
FIELD_FIXED |
private static int |
FIELD_INITIAL
Constants of the class
|
static int |
FIELD_NONEXISTENT |
private static int |
FIELD_NOT_NULLABLE |
static int |
FIELD_NULL |
static int |
FIELD_OVERFLOW |
static int |
FIELD_TAGGED |
static int |
STORED_FIELD_HEADER_STATUS_SIZE |
Constructor and Description |
---|
StoredFieldHeader() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isExtensible(int status) |
static boolean |
isFixed(int status) |
static boolean |
isNonexistent(int status) |
static boolean |
isNull(int status)
Get the status of the field
MT - single thread required |
static boolean |
isNullable(int status) |
static boolean |
isNullorNonExistent(int status) |
static boolean |
isOverflow(int status) |
static boolean |
isTagged(int status) |
static int |
readFieldDataLength(java.io.ObjectInput in,
int status,
int fieldDataSize)
read the field data length
|
static int |
readFieldLengthAndSetStreamPosition(byte[] data,
int offset,
int status,
int fieldDataSize,
ArrayInputStream ais) |
static int |
readStatus(byte[] page,
int offset) |
static int |
readStatus(java.io.ObjectInput in)
read the field status
|
static int |
readTotalFieldLength(byte[] data,
int offset)
read the length of the field and hdr.
|
static int |
setExtensible(int status,
boolean isExtensible) |
static int |
setFixed(int status,
boolean isFixed) |
static int |
setInitial()
Set accessors for setting bits in the status field.
|
static int |
setNonexistent(int status) |
static int |
setNull(int status,
boolean isNull) |
static int |
setOverflow(int status,
boolean isOverflow) |
static int |
setTagged(int status,
boolean isTagged) |
static int |
size(int status,
int fieldDataLength,
int fieldDataSize) |
static java.lang.String |
toDebugString(int status) |
static int |
write(java.io.OutputStream out,
int status,
int fieldDataLength,
int fieldDataSize)
write out the field status and field data Length
|
private static final int FIELD_INITIAL
public static final int FIELD_NULL
public static final int FIELD_OVERFLOW
private static final int FIELD_NOT_NULLABLE
public static final int FIELD_EXTENSIBLE
public static final int FIELD_TAGGED
protected static final int FIELD_FIXED
public static final int FIELD_NONEXISTENT
public static final int STORED_FIELD_HEADER_STATUS_SIZE
public static final boolean isNull(int status)
public static final boolean isOverflow(int status)
public static final boolean isNonexistent(int status)
public static final boolean isExtensible(int status)
public static final boolean isNullorNonExistent(int status)
public static final boolean isTagged(int status)
public static final boolean isFixed(int status)
public static final boolean isNullable(int status)
public static final int size(int status, int fieldDataLength, int fieldDataSize)
public static final int setInitial()
public static final int setNull(int status, boolean isNull)
public static final int setOverflow(int status, boolean isOverflow)
public static final int setNonexistent(int status)
public static final int setExtensible(int status, boolean isExtensible)
public static final int setTagged(int status, boolean isTagged)
public static final int setFixed(int status, boolean isFixed)
public static final int write(java.io.OutputStream out, int status, int fieldDataLength, int fieldDataSize) throws java.io.IOException
java.io.IOException
- Thrown by potential I/O errors while writing
field header.public static final int readStatus(java.io.ObjectInput in) throws java.io.IOException
java.io.IOException
- Thrown by potential I/O errors while reading
field header.public static final int readStatus(byte[] page, int offset)
public static final int readTotalFieldLength(byte[] data, int offset) throws java.io.IOException
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.
data
- the array where the field is.offset
- the offset in the array where the field begin, ie.
the status byte is at data[offset].java.io.IOException
- if an I/O error occurspublic static final int readFieldLengthAndSetStreamPosition(byte[] data, int offset, int status, int fieldDataSize, ArrayInputStream ais) throws java.io.IOException
java.io.IOException
public static final int readFieldDataLength(java.io.ObjectInput in, int status, int fieldDataSize) throws java.io.IOException
java.io.IOException
- Thrown by potential I/O errors while reading
field header.public static java.lang.String toDebugString(int status)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.