|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.xindice.core.filer.Paged
net.jxta.impl.xindice.core.filer.BTree
net.jxta.impl.xindice.core.filer.BTreeFiler
public final class BTreeFiler
BTreeFiler is a Filer implementation based on the BTree class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.jxta.impl.xindice.core.filer.BTree |
---|
BTree.BTreeFileHeader, BTree.BTreePageHeader, BTree.BTreeRootInfo |
Nested classes/interfaces inherited from class net.jxta.impl.xindice.core.filer.Paged |
---|
Paged.FileHeader, Paged.Page, Paged.PageHeader |
Field Summary | |
---|---|
protected static byte |
RECORD
|
Fields inherited from class net.jxta.impl.xindice.core.filer.BTree |
---|
BRANCH, LEAF, STREAM |
Fields inherited from class net.jxta.impl.xindice.core.filer.Paged |
---|
DELETED, NO_PAGE, OVERFLOW, sync, UNUSED |
Constructor Summary | |
---|---|
BTreeFiler()
|
Method Summary | |
---|---|
boolean |
create()
create creates a new DBObject and any associated resources for the new DBObject, such as disk files, etc. |
Paged.FileHeader |
createFileHeader()
createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader. |
Paged.FileHeader |
createFileHeader(boolean read)
createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader. |
Paged.FileHeader |
createFileHeader(long pageCount)
createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader. |
Paged.FileHeader |
createFileHeader(long pageCount,
int pageSize)
createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader. |
Paged.PageHeader |
createPageHeader()
createPageHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a PageHeader. |
boolean |
deleteRecord(Key key)
deleteRecord removes a Record from the Filer based on the specified Key. |
String |
getName()
getName retrieves the contextually important name of the object |
long |
getRecordCount()
getRecordCount returns the number of Records in the Filer. |
RecordSet |
getRecordSet()
getRecordSet returns a RecordSet object for the current Filer. |
boolean |
open()
open opens the DBObject |
Record |
readRecord(Key key)
readRecord returns a Record from the Filer based on the specified Key. |
Record |
readRecord(long pos)
readRecord returns a Record from the Filer at the specified position. |
void |
setLocation(String dir,
String file)
|
long |
writeRecord(Key key,
Value value)
writeRecord writes a Value to the Filer based on the specified Key. |
long |
writeRecord(Key key,
Value value,
long lifetime,
long expiration)
|
long |
writeRecord(long pos,
Value value)
|
Methods inherited from class net.jxta.impl.xindice.core.filer.BTree |
---|
addValue, addValue, createBTreeRoot, createBTreeRoot, findBTreeRoot, findBTreeRoot, findValue, findValue, getRootNode, getRootNode, query, query, removeValue, removeValue, setRootNode, setRootNode, setSync |
Methods inherited from class net.jxta.impl.xindice.core.filer.Paged |
---|
addDirty, checkOpened, close, closeDescriptor, deleteArrayInt, deleteArrayLong, deleteArrayShort, deleteArrayValue, drop, exists, flush, getDescriptor, getFile, getFileHeader, getFreePage, getPage, insertArrayInt, insertArrayLong, insertArrayShort, insertArrayValue, isOpened, putDescriptor, readValue, readValue, setFile, unlinkPages, unlinkPages, writeValue, writeValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.jxta.impl.xindice.core.filer.Filer |
---|
flush |
Methods inherited from interface net.jxta.impl.xindice.core.DBObject |
---|
close, drop, exists, isOpened |
Field Detail |
---|
protected static final byte RECORD
Constructor Detail |
---|
public BTreeFiler()
Method Detail |
---|
public void setLocation(String dir, String file)
public String getName()
Named
getName
in interface Named
public boolean open() throws DBException
DBObject
open
in interface DBObject
open
in class BTree
DBException
- if a DB error occurspublic boolean create() throws DBException
DBObject
create
in interface DBObject
create
in class BTree
DBException
- if a DB error occurspublic Record readRecord(Key key) throws DBException
Filer
readRecord
in interface Filer
key
- The Record's Key
DBException
- if a db exception occurspublic Record readRecord(long pos) throws DBException
Filer
readRecord
in interface Filer
pos
- The Record's position
DBException
- if a db exception occurspublic long writeRecord(Key key, Value value) throws DBException
Filer
writeRecord
in interface Filer
key
- The Record's Keyvalue
- The Record's Value
DBException
- if a db exception occurspublic long writeRecord(Key key, Value value, long lifetime, long expiration) throws DBException
DBException
public long writeRecord(long pos, Value value) throws DBException
DBException
public boolean deleteRecord(Key key) throws DBException
Filer
deleteRecord
in interface Filer
key
- The Record's Key
DBException
- if a db exception occurspublic long getRecordCount() throws DBException
Filer
getRecordCount
in interface Filer
DBException
- if a db exception occurspublic RecordSet getRecordSet() throws DBException
Filer
getRecordSet
in interface Filer
DBException
- if a db exception occurspublic Paged.FileHeader createFileHeader()
Paged
createFileHeader
in class BTree
public Paged.FileHeader createFileHeader(boolean read) throws IOException
Paged
createFileHeader
in class BTree
read
- If true, reads the FileHeader from disk
IOException
- if an exception occurspublic Paged.FileHeader createFileHeader(long pageCount)
Paged
createFileHeader
in class BTree
pageCount
- The number of pages to allocate for primary storage
public Paged.FileHeader createFileHeader(long pageCount, int pageSize)
Paged
createFileHeader
in class BTree
pageCount
- The number of pages to allocate for primary storagepageSize
- The size of a Page (should be a multiple of a FS block)
public Paged.PageHeader createPageHeader()
Paged
createPageHeader
in class BTree
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |