| java.lang.Object org.h2.store.DiskFile
DiskFile | public class DiskFile implements CacheWriter(Code) | | This class represents a file that is usually written to disk. The two main
files are .data.db and .index.db. For each such file, a number of
Storage objects exists. The disk file is responsible for caching;
each object contains a
Cache object. Changes in the file are logged
in a
LogSystem object. Reading and writing to the file is delegated
to the
FileStore class.
There are 'blocks' of 128 bytes (DiskFile.BLOCK_SIZE). Each objects own one
or more pages; each page size is 64 blocks (DiskFile.BLOCKS_PER_PAGE). That
is 8 KB page size. However pages are not read or written as one unit; only
individual objects (multiple blocks at a time) are read or written.
Currently there are no in-place updates. Each row occupies one or multiple
blocks. Row can occupy multiple pages. Rows are always contiguous (except
LOBs, they are stored in their own files).
|
Method Summary | |
void | addRecord(Session session, Record record) | public void | addRedoLog(Storage storage, int recordId, int blockCount, DataPage rec) Add a redo-log entry to the redo buffer. | int | allocate(Storage storage, int blockCount) | public void | close() | public int | copyDirect(int pos, OutputStream out) | public void | delete() | public void | flush() | public void | flushLog() | public void | flushRedoLog() | void | free(int pos, int blockCount) | void | freePage(int page) | int | getBlockCount() | public Cache | getCache() | int | getPage(int pos) | int | getPageOwner(int page) | public int | getReadCount() | Record | getRecord(Session session, int pos, RecordReader reader, int storageId) | Record | getRecordIfStored(Session session, int pos, RecordReader reader, int storageId) | public int | getRecordOverhead() | public byte[] | getSummary() | BitField | getUsed() | public int | getWriteCount() | public void | init() | public void | initFromSummary(byte[] summary) | public boolean | isDataFile() | boolean | isPageFree(int page) | void | removeRecord(Session session, int pos, Record record, int blockCount) | void | reuseSpace() | public void | setLogChanges(boolean b) | public void | setPageOwner(int page, int storageId) | void | setUsed(int pos, int blockCount) | public void | sync() | public String | toString() | public void | truncateStorage(Session session, Storage storage, IntArray pages) | void | uncommittedDelete(Session session) | void | updateRecord(Session session, Record record) | public void | writeBack(CacheObject obj) | void | writeDirect(Storage storage, int pos, byte[] data, int offset) | void | writeDirectDeleted(int recordId, int blockCount) |
BLOCKS_PER_PAGE | final public static int BLOCKS_PER_PAGE(Code) | | |
BLOCK_PAGE_PAGE_SHIFT | final static int BLOCK_PAGE_PAGE_SHIFT(Code) | | The size of a page in blocks.
Each page contains blocks from the same storage.
|
BLOCK_SIZE | final public static int BLOCK_SIZE(Code) | | The size of a block in bytes.
A block is the minimum row size.
|
FREE_PAGE | final static int FREE_PAGE(Code) | | |
OFFSET | final public static int OFFSET(Code) | | |
addRedoLog | public void addRedoLog(Storage storage, int recordId, int blockCount, DataPage rec) throws SQLException(Code) | | Add a redo-log entry to the redo buffer.
Parameters: storage - the storage Parameters: recordId - the record id of the entry Parameters: blockCount - the number of blocks Parameters: rec - the record |
free | void free(int pos, int blockCount)(Code) | | |
getBlockCount | int getBlockCount()(Code) | | |
getPage | int getPage(int pos)(Code) | | |
getPageOwner | int getPageOwner(int page)(Code) | | |
getReadCount | public int getReadCount()(Code) | | |
getRecordOverhead | public int getRecordOverhead()(Code) | | |
getWriteCount | public int getWriteCount()(Code) | | |
initFromSummary | public void initFromSummary(byte[] summary)(Code) | | |
isDataFile | public boolean isDataFile()(Code) | | |
isPageFree | boolean isPageFree(int page)(Code) | | |
setLogChanges | public void setLogChanges(boolean b)(Code) | | |
setUsed | void setUsed(int pos, int blockCount)(Code) | | |
writeDirectDeleted | void writeDirectDeleted(int recordId, int blockCount) throws SQLException(Code) | | |
|
|