| java.lang.Object com.quadcap.sql.file.LogBuffer
LogBuffer | public class LogBuffer (Code) | | A bounded buffer based on an underlying RandomAccess
author: Stan Bailes |
Method Summary | |
public int | addPos(int pos, int amt) | public void | checkpoint() | public void | close() | public int | getBegin() | public int | getCheckpoint() | public int | getEnd() | public InputStream | getInputStream(int pos) | public OutputStream | getOutputStream() | public void | init(RandomAccess ra, Properties props) | public void | init(RandomAccess ra, int m) | public static void | main(String[] args) | static void | makeBuf(byte[] buf, int x, int siz) | public int | read(int pos, byte[] buf, int off, int cnt) | public int | readByte(int pos) | public void | reset() | public void | setBegin(int b) Move the begin pointer past some bytes. | public int | size() | public void | sync() Flush any changes to disk. | static void | test1() | public String | toString() | public void | truncate() | public void | write(byte[] buf, int off, int cnt) Write a range of bytes to the end of the buffer, updating 'eX' to
point to the new end of the buffer. | public void | writeByte(int pos, int b) Write a single byte to the buffer. |
bX | int bX(Code) | | "Begin" pointer.
|
cX | int cX(Code) | | "Checkpoint" pointer
|
headerSize | final static int headerSize(Code) | | Total header bytes
|
maxSize | int maxSize(Code) | | Size Limit, in octets.
|
LogBuffer | public LogBuffer()(Code) | | Default constructor (for factory)
|
addPos | public int addPos(int pos, int amt)(Code) | | Perform buffer-wrapping address incrementing math
|
checkpoint | public void checkpoint()(Code) | | Set the checkpoint value
|
getBegin | public int getBegin()(Code) | | Return the current begin position (the position of the first byte
written
|
getCheckpoint | public int getCheckpoint()(Code) | | Return the value marking the end of the last checkpoint
|
getEnd | public int getEnd()(Code) | | Return the current end position (the position of the next byte to
be written)
|
getInputStream | public InputStream getInputStream(int pos)(Code) | | Return an InputStream which will supply a subset of the buffer starting
at 'pos' and ending at the current buffer end
|
getOutputStream | public OutputStream getOutputStream()(Code) | | Return an OutputStream which can be used to write to the end of
the buffer
|
init | public void init(RandomAccess ra, int m) throws IOException(Code) | | Create a new one
Parameters: ra - the underlying random access interface to the store Parameters: m - the maximum size of this buffer. |
makeBuf | static void makeBuf(byte[] buf, int x, int siz)(Code) | | |
read | public int read(int pos, byte[] buf, int off, int cnt) throws IOException(Code) | | Read a range of bytes from the buffer
|
reset | public void reset()(Code) | | Reset the buffer to its empty state
|
setBegin | public void setBegin(int b)(Code) | | Move the begin pointer past some bytes.
|
size | public int size()(Code) | | Return the size of the active area
|
truncate | public void truncate() throws IOException(Code) | | Truncate the underlying region to the current actual size of the
buffer
|
write | public void write(byte[] buf, int off, int cnt) throws IOException(Code) | | Write a range of bytes to the end of the buffer, updating 'eX' to
point to the new end of the buffer.
|
writeByte | public void writeByte(int pos, int b) throws IOException(Code) | | Write a single byte to the buffer. Do not modify eX.
|
|
|