public class LogUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LogUtils.HeaderAndEntry |
static class |
LogUtils.XidImpl |
Modifier and Type | Field and Description |
---|---|
static int |
INT_BYTES |
static int |
LONG_BYTES |
static int |
SHORT_BYTES |
static int |
UNSIGNED_INT_BYTES |
static byte[] |
ZERO_LENGTH_BYTE_ARRAY |
Constructor and Description |
---|
LogUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
dumpBoolean(java.nio.ByteBuffer itemBuffer,
java.lang.StringBuffer sb,
java.lang.String tag) |
static int |
getBooleanLogSize() |
static int |
getByteArrayLogSize(byte[] b) |
static int |
getIntLogSize() |
static int |
getLongLogSize() |
static int |
getPackedIntLogSize(int i) |
static int |
getPackedLongLogSize(long l) |
static int |
getStringLogSize(java.lang.String s) |
static int |
getTimestampLogSize(java.sql.Timestamp time) |
static int |
getXidSize(javax.transaction.xa.Xid xid)
The byte[]'s in Xid's are known to be 255 or less in length.
|
static boolean |
readBoolean(java.nio.ByteBuffer logBuf)
Read a boolean from the log.
|
static byte[] |
readByteArray(java.nio.ByteBuffer logBuf,
boolean unpacked)
Read a byte array from the log.
|
static byte[] |
readBytesNoLength(java.nio.ByteBuffer logBuf,
int size)
Read a byte array from the log.
|
static LogUtils.HeaderAndEntry |
readHeaderAndEntry(java.nio.ByteBuffer bytesFromLog,
EnvironmentImpl envImpl,
boolean anticipateChecksumErrors,
boolean readFullItem)
Convenience method for marshalling a header and log entry
out of a byte buffer read directly out of the log.
|
static int |
readInt(java.nio.ByteBuffer logBuf)
Read a int from the log.
|
static int |
readInt(java.nio.ByteBuffer logBuf,
boolean unpacked)
Read an int from the log in either packed or unpacked format.
|
static int |
readIntMSB(java.nio.ByteBuffer logBuf)
Read a int from the log in MSB order.
|
static long |
readLong(java.nio.ByteBuffer logBuf)
Read a long from the log.
|
static long |
readLong(java.nio.ByteBuffer logBuf,
boolean unpacked)
Read an int from the log in either packed or unpacked format.
|
static int |
readPackedInt(java.nio.ByteBuffer logBuf)
Read a packed int from the log.
|
static long |
readPackedLong(java.nio.ByteBuffer logBuf)
Read a packed long from the log.
|
static short |
readShort(java.nio.ByteBuffer logBuf)
Read a short from the log.
|
static java.lang.String |
readString(java.nio.ByteBuffer logBuf,
boolean unpacked)
Read a string from the log.
|
static java.sql.Timestamp |
readTimestamp(java.nio.ByteBuffer logBuf,
boolean unpacked)
Read a timestamp from the log.
|
static long |
readUnsignedInt(java.nio.ByteBuffer buf)
Unmarshall the next four bytes which hold an unsigned int into a long.
|
static javax.transaction.xa.Xid |
readXid(java.nio.ByteBuffer logBuf) |
static void |
writeBoolean(java.nio.ByteBuffer logBuf,
boolean bool)
Write a boolean into the log.
|
static void |
writeByteArray(java.nio.ByteBuffer logBuf,
byte[] b)
Write a byte array into the log.
|
static void |
writeBytesNoLength(java.nio.ByteBuffer logBuf,
byte[] b)
Write a byte array into the log.
|
static void |
writeInt(java.nio.ByteBuffer logBuf,
int i)
Write an int into the log.
|
static void |
writeIntMSB(java.nio.ByteBuffer logBuf,
int i)
Write an int into the log in MSB order.
|
static void |
writeLong(java.nio.ByteBuffer logBuf,
long l)
Write a long into the log.
|
static void |
writePackedInt(java.nio.ByteBuffer logBuf,
int i)
Write a packed int into the log.
|
static void |
writePackedLong(java.nio.ByteBuffer logBuf,
long l)
Write a packed long into the log.
|
static void |
writeShort(java.nio.ByteBuffer logBuf,
short i)
Write a short into the log.
|
static void |
writeString(java.nio.ByteBuffer logBuf,
java.lang.String stringVal)
Write a string into the log.
|
static void |
writeTimestamp(java.nio.ByteBuffer logBuf,
java.sql.Timestamp time)
Write a timestamp into the log.
|
static void |
writeUnsignedInt(java.nio.ByteBuffer buf,
long value)
Marshall a long into the next 4 bytes in this buffer.
|
static void |
writeXid(java.nio.ByteBuffer logBuf,
javax.transaction.xa.Xid xid) |
public static final int SHORT_BYTES
public static final int INT_BYTES
public static final int LONG_BYTES
public static final int UNSIGNED_INT_BYTES
public static final byte[] ZERO_LENGTH_BYTE_ARRAY
public static void writeUnsignedInt(java.nio.ByteBuffer buf, long value)
public static long readUnsignedInt(java.nio.ByteBuffer buf)
public static void writeShort(java.nio.ByteBuffer logBuf, short i)
public static short readShort(java.nio.ByteBuffer logBuf)
public static int readInt(java.nio.ByteBuffer logBuf, boolean unpacked)
public static void writeInt(java.nio.ByteBuffer logBuf, int i)
public static int readInt(java.nio.ByteBuffer logBuf)
public static int getIntLogSize()
public static void writePackedInt(java.nio.ByteBuffer logBuf, int i)
public static int readPackedInt(java.nio.ByteBuffer logBuf)
public static int getPackedIntLogSize(int i)
public static void writeIntMSB(java.nio.ByteBuffer logBuf, int i)
public static int readIntMSB(java.nio.ByteBuffer logBuf)
public static void writeLong(java.nio.ByteBuffer logBuf, long l)
public static long readLong(java.nio.ByteBuffer logBuf, boolean unpacked)
public static long readLong(java.nio.ByteBuffer logBuf)
public static int getLongLogSize()
public static void writePackedLong(java.nio.ByteBuffer logBuf, long l)
public static long readPackedLong(java.nio.ByteBuffer logBuf)
public static int getPackedLongLogSize(long l)
public static void writeByteArray(java.nio.ByteBuffer logBuf, byte[] b)
public static byte[] readByteArray(java.nio.ByteBuffer logBuf, boolean unpacked)
public static int getByteArrayLogSize(byte[] b)
public static void writeBytesNoLength(java.nio.ByteBuffer logBuf, byte[] b)
public static byte[] readBytesNoLength(java.nio.ByteBuffer logBuf, int size)
public static void writeString(java.nio.ByteBuffer logBuf, java.lang.String stringVal)
public static java.lang.String readString(java.nio.ByteBuffer logBuf, boolean unpacked)
public static int getStringLogSize(java.lang.String s)
public static void writeTimestamp(java.nio.ByteBuffer logBuf, java.sql.Timestamp time)
public static java.sql.Timestamp readTimestamp(java.nio.ByteBuffer logBuf, boolean unpacked)
public static int getTimestampLogSize(java.sql.Timestamp time)
public static void writeBoolean(java.nio.ByteBuffer logBuf, boolean bool)
public static boolean readBoolean(java.nio.ByteBuffer logBuf)
public static int getBooleanLogSize()
public static boolean dumpBoolean(java.nio.ByteBuffer itemBuffer, java.lang.StringBuffer sb, java.lang.String tag)
public static int getXidSize(javax.transaction.xa.Xid xid)
public static void writeXid(java.nio.ByteBuffer logBuf, javax.transaction.xa.Xid xid)
public static javax.transaction.xa.Xid readXid(java.nio.ByteBuffer logBuf)
public static LogUtils.HeaderAndEntry readHeaderAndEntry(java.nio.ByteBuffer bytesFromLog, EnvironmentImpl envImpl, boolean anticipateChecksumErrors, boolean readFullItem) throws DatabaseException
DatabaseException