|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbxml.core.filer.Paged
org.dbxml.core.filer.BTree
org.exist.storage.store.DOMFile
DOMFile represents the central storage file for DOM nodes. Nodes are stored in sequential order to allow fast access when serializing a document or fragment. Pages have previous-page/next-page links. Each node has a virtual address, which consists of a page-number/tid pair. The tid is a virtual offset into the page. A node may be moved to a new page on node insertions. However, the tid will always remain the same.
Nested Class Summary | |
protected class |
DOMFile.ClockPageBuffer
Cache for data pages. |
protected class |
DOMFile.DOMFilePageHeader
Description of the Class |
protected class |
DOMFile.DOMPage
Description of the Class |
protected class |
DOMFile.OverflowDOMPage
|
protected static class |
DOMFile.RecordPos
|
Nested classes inherited from class org.dbxml.core.filer.BTree |
org.dbxml.core.filer.BTree.BTreeFileHeader, org.dbxml.core.filer.BTree.BTreeNode, org.dbxml.core.filer.BTree.BTreePageHeader, org.dbxml.core.filer.BTree.ClockNodeBuffer |
Nested classes inherited from class org.dbxml.core.filer.Paged |
org.dbxml.core.filer.Paged.FileHeader, org.dbxml.core.filer.Paged.Page, org.dbxml.core.filer.Paged.PageHeader |
Field Summary | |
static byte |
FREE_LIST
|
static byte |
LOB
|
protected static short |
OVERFLOW
|
static byte |
RECORD
|
Fields inherited from class org.dbxml.core.filer.BTree |
BRANCH, KEY_NOT_FOUND, LEAF, STREAM |
Fields inherited from class org.dbxml.core.filer.Paged |
DELETED, PAGE_SIZE, UNUSED |
Constructor Summary | |
DOMFile(java.io.File file)
Constructor for the DOMFile object |
|
DOMFile(java.io.File file,
int buffers)
Constructor for the DOMFile object |
|
DOMFile(java.io.File file,
int buffers,
int dataBuffers)
Constructor for the DOMFile object |
|
DOMFile(java.io.File file,
int buffers,
short keyLen)
Constructor for the DOMFile object. |
|
DOMFile(int buffers,
int dataBuffers)
Constructor for the DOMFile object |
Method Summary | |
long |
add(byte[] value)
Append a value to the current page |
void |
addToBuffer(DOMFile.DOMPage page)
|
boolean |
close()
Description of the Method |
void |
closeDocument()
|
boolean |
create()
Description of the Method |
org.dbxml.core.filer.Paged.FileHeader |
createFileHeader()
Description of the Method |
org.dbxml.core.filer.Paged.FileHeader |
createFileHeader(boolean read)
Description of the Method |
org.dbxml.core.filer.Paged.FileHeader |
createFileHeader(long pageCount)
Description of the Method |
org.dbxml.core.filer.Paged.FileHeader |
createFileHeader(long pageCount,
int pageSize)
Description of the Method |
protected org.dbxml.core.filer.Paged.Page |
createNewPage()
Description of the Method |
org.dbxml.core.filer.Paged.PageHeader |
createPageHeader()
Description of the Method |
java.util.ArrayList |
findKeys(org.dbxml.core.indexer.IndexQuery query)
Description of the Method |
java.util.ArrayList |
findRange(org.dbxml.core.data.Value first,
org.dbxml.core.data.Value last)
Retrieve a range of nodes, starting at first and including last. |
protected long |
findValue(java.lang.Object lock,
NodeProxy node)
Find a node by searching for a known ancestor in the index. |
protected DOMFile.RecordPos |
findValuePosition(long p)
|
java.util.ArrayList |
findValues(org.dbxml.core.indexer.IndexQuery query)
Find matching nodes for the given query. |
boolean |
flush()
Flush all buffers to disk. |
org.dbxml.core.data.Value |
get(long p)
Retrieve node at virtual address p. |
org.dbxml.core.data.Value |
get(NodeProxy node)
Retrieve a node described by the given NodeProxy. |
org.dbxml.core.data.Value |
get(org.dbxml.core.data.Value key)
Retrieve a node by key |
protected DOMFile.DOMPage |
getCurrentPage(long p)
Retrieve the page with page number p |
BufferStats |
getDataBufferStats()
|
Lock |
getLock()
Get the active Lock object for this file. |
java.lang.String |
getNodeValue(NodeProxy proxy)
|
protected byte[] |
getOverflowValue(long pnum)
|
protected DOMFile.ClockPageBuffer |
getPageBuffer()
|
long |
insertAfter(DocumentImpl doc,
long address,
byte[] value)
Insert a new node after the node located at the specified address. |
long |
insertAfter(DocumentImpl doc,
org.dbxml.core.data.Value key,
byte[] value)
Insert a new node after the specified node. |
boolean |
open()
Open the file. |
void |
printStatistics()
|
long |
put(org.dbxml.core.data.Value key,
byte[] value)
Put a new key/value pair. |
void |
releaseOwner(java.lang.Object obj)
|
void |
remove(long p)
|
void |
remove(org.dbxml.core.data.Value key)
Remove a key/value pair. |
void |
remove(org.dbxml.core.data.Value key,
long p)
Remove the value at address p. |
protected void |
removeOverflowValue(long pnum)
|
protected void |
reportSplit(DocumentImpl doc,
DOMFile.DOMPage oldPage,
DOMFile.DOMPage newPage)
Report the new position of nodes after a page has been split. |
void |
setLocation(java.lang.String location)
Set the file location for this DOMFile. |
void |
setOwnerObject(java.lang.Object obj)
The current object owning this file. |
void |
sync()
|
protected void |
unlinkPages(org.dbxml.core.filer.Paged.Page page)
|
boolean |
update(org.dbxml.core.data.Value key,
byte[] value)
Update the key/value pair. |
void |
update(org.dbxml.core.data.Value key,
long p,
byte[] value)
Update the key/value pair where the value is found at address p. |
Methods inherited from class org.dbxml.core.filer.BTree |
addValue, clear, create, createRootNode, drop, findValue, getFixedKeyLen, getIndexBufferStats, getRootNode, query, remove, remove, removeValue, setRootNode |
Methods inherited from class org.dbxml.core.filer.Paged |
deleteArrayInt, deleteArrayLong, deleteArrayShort, deleteArrayValue, exists, getFile, getFileHeader, getFreePage, getPage, getPageSize, insertArrayInt, insertArrayLong, insertArrayShort, insertArrayValue, isOpened, isReadOnly, setFile, setPageSize, unlinkPages, writeValue, writeValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte FREE_LIST
public static final byte LOB
public static final byte RECORD
protected static final short OVERFLOW
Constructor Detail |
public DOMFile(int buffers, int dataBuffers)
buffers
- the number of btree buffers to usedataBuffers
- the number of data page bufferspublic DOMFile(java.io.File file)
file
- the file to usepublic DOMFile(java.io.File file, int buffers)
file
- the file to usebuffers
- size of the data page bufferpublic DOMFile(java.io.File file, int buffers, int dataBuffers)
file
- the file to usebuffers
- size of the buffer for btree pagesdataBuffers
- size of the buffer for data pagespublic DOMFile(java.io.File file, int buffers, short keyLen)
file
- the file to usebuffers
- size of the data page bufferkeyLen
- key size if all keys have the same lengthMethod Detail |
protected final DOMFile.ClockPageBuffer getPageBuffer()
public long add(byte[] value) throws ReadOnlyException
value
- the value to append
ReadOnlyException
public long insertAfter(DocumentImpl doc, org.dbxml.core.data.Value key, byte[] value)
key
- value
-
public long insertAfter(DocumentImpl doc, long address, byte[] value)
doc
- the document to which the new node belongs.address
- the storage address of the node after which the new value should
be inserted.value
- the value of the new node.
protected final void reportSplit(DocumentImpl doc, DOMFile.DOMPage oldPage, DOMFile.DOMPage newPage)
doc
- oldPage
- newPage
- public boolean close() throws org.dbxml.core.DBException
org.dbxml.core.DBException
- Description of the Exceptionpublic boolean create() throws org.dbxml.core.DBException
org.dbxml.core.DBException
- Description of the Exceptionpublic org.dbxml.core.filer.Paged.FileHeader createFileHeader()
public org.dbxml.core.filer.Paged.FileHeader createFileHeader(boolean read) throws java.io.IOException
read
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic org.dbxml.core.filer.Paged.FileHeader createFileHeader(long pageCount)
pageCount
- Description of the Parameter
public org.dbxml.core.filer.Paged.FileHeader createFileHeader(long pageCount, int pageSize)
pageCount
- Description of the ParameterpageSize
- Description of the Parameter
protected org.dbxml.core.filer.Paged.Page createNewPage()
protected void unlinkPages(org.dbxml.core.filer.Paged.Page page) throws java.io.IOException
java.io.IOException
public org.dbxml.core.filer.Paged.PageHeader createPageHeader()
public java.util.ArrayList findKeys(org.dbxml.core.indexer.IndexQuery query) throws java.io.IOException, org.dbxml.core.filer.BTreeException
query
- Description of the Parameter
java.io.IOException
- Description of the Exception
org.dbxml.core.filer.BTreeException
- Description of the Exceptionpublic java.util.ArrayList findRange(org.dbxml.core.data.Value first, org.dbxml.core.data.Value last) throws java.io.IOException, org.dbxml.core.filer.BTreeException
first
- the first node to retrievelast
- the last node to retrieve
java.io.IOException
- Description of the Exception
org.dbxml.core.filer.BTreeException
- Description of the Exceptionprotected long findValue(java.lang.Object lock, NodeProxy node) throws java.io.IOException, org.dbxml.core.filer.BTreeException
lock
- node
-
java.io.IOException
org.dbxml.core.filer.BTreeException
public java.util.ArrayList findValues(org.dbxml.core.indexer.IndexQuery query) throws java.io.IOException, org.dbxml.core.filer.BTreeException
query
- Description of the Parameter
java.io.IOException
- Description of the Exception
org.dbxml.core.filer.BTreeException
- Description of the Exceptionpublic boolean flush() throws org.dbxml.core.DBException
org.dbxml.core.DBException
- Description of the Exceptionpublic void sync() throws org.dbxml.core.DBException
org.dbxml.core.DBException
public void printStatistics()
public BufferStats getDataBufferStats()
public org.dbxml.core.data.Value get(org.dbxml.core.data.Value key)
key
-
public org.dbxml.core.data.Value get(NodeProxy node)
node
- Description of the Parameter
public org.dbxml.core.data.Value get(long p)
p
- Description of the Parameter
protected byte[] getOverflowValue(long pnum)
protected void removeOverflowValue(long pnum)
protected final DOMFile.DOMPage getCurrentPage(long p)
p
- Description of the Parameter
public void closeDocument()
public boolean open() throws org.dbxml.core.DBException
org.dbxml.core.DBException
- Description of the Exceptionpublic long put(org.dbxml.core.data.Value key, byte[] value) throws ReadOnlyException
key
- Description of the Parametervalue
- Description of the Parameter
ReadOnlyException
public void remove(org.dbxml.core.data.Value key)
key
- Description of the Parameterpublic void remove(long p)
public void remove(org.dbxml.core.data.Value key, long p)
p
- Description of the Parameterpublic final Lock getLock()
getLock
in interface Lockable
Lockable.getLock()
public void setLocation(java.lang.String location)
location
- The new location valuepublic final void setOwnerObject(java.lang.Object obj)
obj
- The new ownerObject valuepublic final void releaseOwner(java.lang.Object obj)
public boolean update(org.dbxml.core.data.Value key, byte[] value) throws ReadOnlyException
key
- Description of the Parametervalue
- Description of the Parameter
ReadOnlyException
public void update(org.dbxml.core.data.Value key, long p, byte[] value) throws ReadOnlyException
key
- Description of the Parameterp
- Description of the Parametervalue
- Description of the Parameter
ReadOnlyException
public java.lang.String getNodeValue(NodeProxy proxy)
protected final DOMFile.RecordPos findValuePosition(long p)
public final void addToBuffer(DOMFile.DOMPage page)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |