LogRecordHeaderpublic class LogRecordHeader extends Object implements SerializableA class containing header information for a log record. |
Fields Summary |
---|
static final int | SIZEOFThis constant holds the size of the LogRecordHeader object. | int | recordType | LogLSN | currentLSN | LogLSN | previousLSN | LogLSN | nextLSN | int | recordLength |
Constructors Summary |
---|
LogRecordHeader()
currentLSN = new LogLSN();
previousLSN = new LogLSN();
nextLSN = new LogLSN();
| LogRecordHeader(byte[] bytes, int index)Constructs a LogRecordHeader from the given byte array.
recordType = (bytes[index++]&255) +
((bytes[index++]&255) << 8) +
((bytes[index++]&255) << 16) +
((bytes[index++]&255) << 24);
currentLSN = new LogLSN(bytes,index); index += LogLSN.SIZEOF;
previousLSN = new LogLSN(bytes,index); index += LogLSN.SIZEOF;
nextLSN = new LogLSN(bytes,index); index += LogLSN.SIZEOF;
recordLength = (bytes[index++]&255) +
((bytes[index++]&255) << 8) +
((bytes[index++]&255) << 16) +
((bytes[index++]&255) << 24);
|
Methods Summary |
---|
void | copy(com.sun.jts.CosTransactions.LogRecordHeader other)Makes the target object a copy of the parameter.
recordType = other.recordType;
currentLSN.copy(other.currentLSN);
previousLSN.copy(other.previousLSN);
nextLSN.copy(other.nextLSN);
recordLength = other.recordLength;
| final int | toBytes(byte[] bytes, int index)Makes a byte representation of the LogRecordHeader.
bytes[index++] = (byte) recordType;
bytes[index++] = (byte)(recordType >> 8);
bytes[index++] = (byte)(recordType >> 16);
bytes[index++] = (byte)(recordType >> 24);
index += currentLSN.toBytes(bytes,index);
index += previousLSN.toBytes(bytes,index);
index += nextLSN.toBytes(bytes,index);
bytes[index++] = (byte) recordLength;
bytes[index++] = (byte)(recordLength >> 8);
bytes[index++] = (byte)(recordLength >> 16);
bytes[index++] = (byte)(recordLength >> 24);
return SIZEOF;
| public final java.lang.String | toString()This method is called to direct the object to format its state
to a String.
return "LRH(type="/*#Frozen*/ + recordType + ",curr="/*#Frozen*/ + currentLSN +
",prev="/*#Frozen*/ + previousLSN + ",next="/*#Frozen*/ + nextLSN +
",len="/*#Frozen*/ + recordLength + ")"/*#Frozen*/;
|
|