| java.lang.Object com.caucho.db.store.Inode
Inode | public class Inode (Code) | | Represents the indexes for a BLOB or CLOB.
The inode contains 16 long values
0) length of the saved file
1-14) direct fragment addresses (to 112k)
15) pointer to the indirect block
Inline storage (120)
If the length of the blob is less than 120, the blob is stored directly
in the inode.
mini fragment storage (3840)
If the length of the blob is less than 3840, the blob is stored
in mini-fragments of size 256 pointed by the inode's addresses.
The maximum wasted space for mini-fragment storage is 255 bytes.
indirect storage
The indirect block (an 8k fragment) itself is divided into sections:
0-511) single indirect fragment addresses (4M, 2^12)
512-767) double indirect block addresses (128G, 2^37)
768-1023) triple indirect fragment addresses (to 1P, 2^50)
|
Method Summary | |
static void | append(byte[] inode, int inodeOffset, Store store, StoreTransaction xa, byte[] buffer, int offset, int length) Updates the buffer. | static void | append(byte[] inode, int inodeOffset, Store store, StoreTransaction xa, char[] buffer, int offset, int length) Updates the buffer. | static void | clear(byte[] inode, int inodeOffset) Clears the inode. | void | closeOutputStream() Closes the output stream. | public byte[] | getBuffer() Returns the buffer. | public long | getLength() Returns the length. | public Store | getStore() Returns the backing store. | public void | init(Store store, StoreTransaction xa, byte[] buffer, int offset) | public InputStream | openInputStream() Opens a read stream to the inode. | public OutputStream | openOutputStream() Opens a byte output stream to the inode. | public Reader | openReader() Opens a char reader to the inode. | public Writer | openWriter() Opens a char writer to the inode. | static int | read(byte[] inode, int inodeOffset, Store store, long fileOffset, byte[] buffer, int bufferOffset, int bufferLength) Reads into a buffer. | static int | read(byte[] inode, int inodeOffset, Store store, long fileOffset, char[] buffer, int bufferOffset, int bufferLength) Reads into a buffer. | static long | readBlockAddr(byte[] inode, int inodeOffset, Store store, long fileOffset) Returns the fragment id for the given offset. | static long | readFragmentAddr(byte[] inode, int inodeOffset, Store store, long fileOffset) Returns the fragment id for the given offset. | public static long | readLong(byte[] buffer, int offset) Reads the long. | static long | readMiniFragAddr(byte[] inode, int inodeOffset, Store store, long fileOffset) Returns the fragment id for the given offset. | public void | remove() | public static void | writeLong(byte[] buffer, int offset, long v) Writes the long. | public void | writeToStream(OutputStreamWithBuffer os) Writes the inode value to a stream. | public void | writeToStream(OutputStreamWithBuffer os, long offset, long length) Writes the inode value to a stream. | public void | writeToWriter(Writer writer) Writes the inode value to a stream. |
BLOCK_SIZE | final public static int BLOCK_SIZE(Code) | | |
DIRECT_BLOCKS | final public static int DIRECT_BLOCKS(Code) | | |
DIRECT_MAX | final public static long DIRECT_MAX(Code) | | |
DOUBLE_INDIRECT_BLOCKS | final public static int DOUBLE_INDIRECT_BLOCKS(Code) | | |
DOUBLE_INDIRECT_MAX | final public static long DOUBLE_INDIRECT_MAX(Code) | | |
FRAGMENT_MAX | final public static long FRAGMENT_MAX(Code) | | |
FRAGMENT_SIZE | final public static int FRAGMENT_SIZE(Code) | | |
INDIRECT_BLOCKS | final public static int INDIRECT_BLOCKS(Code) | | |
INLINE_BLOB_SIZE | final public static int INLINE_BLOB_SIZE(Code) | | |
INLINE_MAX | final public static long INLINE_MAX(Code) | | |
INODE_BLOCK_SIZE | final public static int INODE_BLOCK_SIZE(Code) | | |
INODE_SIZE | final public static int INODE_SIZE(Code) | | |
MINI_FRAG_BLOB_SIZE | final public static int MINI_FRAG_BLOB_SIZE(Code) | | |
MINI_FRAG_MAX | final public static int MINI_FRAG_MAX(Code) | | |
MINI_FRAG_SIZE | final public static int MINI_FRAG_SIZE(Code) | | |
SINGLE_INDIRECT_BLOCKS | final public static int SINGLE_INDIRECT_BLOCKS(Code) | | |
SINGLE_INDIRECT_MAX | final public static long SINGLE_INDIRECT_MAX(Code) | | |
TRIPLE_INDIRECT_BLOCKS | final public static int TRIPLE_INDIRECT_BLOCKS(Code) | | |
append | static void append(byte[] inode, int inodeOffset, Store store, StoreTransaction xa, byte[] buffer, int offset, int length) throws IOException(Code) | | Updates the buffer. Called only from the blob classes.
|
append | static void append(byte[] inode, int inodeOffset, Store store, StoreTransaction xa, char[] buffer, int offset, int length) throws IOException(Code) | | Updates the buffer. Called only from the clob classes.
|
clear | static void clear(byte[] inode, int inodeOffset)(Code) | | Clears the inode.
|
closeOutputStream | void closeOutputStream()(Code) | | Closes the output stream.
|
getBuffer | public byte[] getBuffer()(Code) | | Returns the buffer.
|
getLength | public long getLength()(Code) | | Returns the length.
|
getStore | public Store getStore()(Code) | | Returns the backing store.
|
openInputStream | public InputStream openInputStream()(Code) | | Opens a read stream to the inode.
|
openOutputStream | public OutputStream openOutputStream()(Code) | | Opens a byte output stream to the inode.
|
openReader | public Reader openReader()(Code) | | Opens a char reader to the inode.
|
openWriter | public Writer openWriter()(Code) | | Opens a char writer to the inode.
|
read | static int read(byte[] inode, int inodeOffset, Store store, long fileOffset, byte[] buffer, int bufferOffset, int bufferLength) throws IOException(Code) | | Reads into a buffer.
Parameters: inode - the inode buffer Parameters: inodeOffset - the offset of the inode data in the buffer Parameters: store - the owning store Parameters: fileOffset - the offset into the file to read Parameters: buffer - the buffer receiving the data Parameters: bufferOffset - the offset into the receiving buffer Parameters: bufferLength - the maximum number of bytes to read the number of bytes read |
read | static int read(byte[] inode, int inodeOffset, Store store, long fileOffset, char[] buffer, int bufferOffset, int bufferLength) throws IOException(Code) | | Reads into a buffer.
Parameters: inode - the inode buffer Parameters: inodeOffset - the offset of the inode data in the buffer Parameters: store - the owning store Parameters: fileOffset - the offset into the file to read Parameters: buffer - the buffer receiving the data Parameters: bufferOffset - the offset into the receiving buffer Parameters: bufferLength - the maximum number of chars to read the number of characters read |
readBlockAddr | static long readBlockAddr(byte[] inode, int inodeOffset, Store store, long fileOffset) throws IOException(Code) | | Returns the fragment id for the given offset.
|
readFragmentAddr | static long readFragmentAddr(byte[] inode, int inodeOffset, Store store, long fileOffset) throws IOException(Code) | | Returns the fragment id for the given offset.
|
readLong | public static long readLong(byte[] buffer, int offset)(Code) | | Reads the long.
|
readMiniFragAddr | static long readMiniFragAddr(byte[] inode, int inodeOffset, Store store, long fileOffset) throws IOException(Code) | | Returns the fragment id for the given offset.
|
remove | public void remove()(Code) | | Deletes the inode
|
writeLong | public static void writeLong(byte[] buffer, int offset, long v)(Code) | | Writes the long.
|
writeToStream | public void writeToStream(OutputStreamWithBuffer os) throws IOException(Code) | | Writes the inode value to a stream.
|
writeToStream | public void writeToStream(OutputStreamWithBuffer os, long offset, long length) throws IOException(Code) | | Writes the inode value to a stream.
|
|
|