class LogBufferElement
extends java.lang.Object
The format of each log record in the LogBufferElement is the same
as is written to log file in LogAccessFile:
(int) total_length (data[].length + optionaldata[].length)
(long) instant
(byte[]) data+optionaldata
(int) total_length
Modifier and Type | Field and Description |
---|---|
private byte[] |
bufferdata |
private long |
greatestInstant |
private int |
position |
private boolean |
recycleMe |
Modifier | Constructor and Description |
---|---|
protected |
LogBufferElement(int bufferSize) |
Modifier and Type | Method and Description |
---|---|
private int |
appendBytes(byte[] b,
int offset,
int pos,
int length)
Append a byte[] to this LogBufferElement.
|
protected void |
appendLog(long greatestInstant,
byte[] log,
int logOffset,
int logLength)
Append a chunk of log records to this LogBufferElement.
|
protected int |
freeSize() |
protected byte[] |
getData() |
protected long |
getLastInstant() |
protected void |
init()
Resets all variables to default values.
|
protected boolean |
isRecyclable() |
protected void |
setRecyclable(boolean r) |
protected int |
size() |
private final byte[] bufferdata
private int position
private long greatestInstant
private boolean recycleMe
protected void init()
protected void appendLog(long greatestInstant, byte[] log, int logOffset, int logLength)
greatestInstant
- the instant of the log record that was
added last to this chunk of loglog
- the chunk of log recordslogOffset
- offset in log to start copy fromlogLength
- number of bytes to copy, starting
from logOffsetprotected byte[] getData()
protected long getLastInstant()
protected int freeSize()
protected int size()
protected boolean isRecyclable()
protected void setRecyclable(boolean r)
private int appendBytes(byte[] b, int offset, int pos, int length)
b
- where the bytes are copied fromoffset
- offset in b to start copying frompos
- the position in this LogBufferElement to start copying tolength
- number of bytes to copy from b, starting from offsetApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.