|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.Data
org.basex.data.DiskData
public final class DiskData
This class stores and organizes the database table and the index structures
for textual content in a compressed disk structure.
The table mapping is documented in Data
.
Field Summary |
---|
Fields inherited from class org.basex.data.Data |
---|
atnindex, ATTR, atvindex, cache, COMM, DOC, ELEM, ftxindex, meta, nspaces, paths, PI, pins, resources, tagindex, TEXT, txtindex |
Constructor Summary | |
---|---|
DiskData(MetaData md,
Names nm,
Names at,
PathSummary ps,
Namespaces n)
Internal database constructor, called from DiskBuilder.build() . |
|
DiskData(java.lang.String db,
Context ctx)
Default constructor, called from Open.open(java.lang.String, org.basex.core.Context) . |
Method Summary | |
---|---|
void |
close()
Closes the database. |
void |
closeIndex(IndexType type)
Closes the specified index. |
protected void |
delete(int pre,
boolean text)
Deletes the specified text entry. |
void |
finishUpdate()
Finishes an update operation: removes the update file and the exclusive lock. |
protected long |
index(int pre,
int id,
byte[] value,
int kind)
Indexes a text and returns the reference. |
protected void |
indexBegin()
Notify the index structures that an update operation is started. |
protected void |
indexDelete(int pre,
int size)
Delete a node and its descendants from the corresponding indexes. |
protected void |
indexEnd()
Notify the index structures that an update operation is finished. |
void |
init()
Initializes the database. |
void |
setIndex(IndexType type,
Index index)
Assigns the specified index. |
boolean |
startUpdate()
Starts an update operation: writes a file to disk to indicate that an update is going on, and exclusively locks the table. |
byte[] |
text(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value. |
double |
textDbl(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value as double value. |
long |
textItr(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value as integer value. |
int |
textLen(int pre,
boolean text)
Returns the byte length of a text (text, comment, pi). |
IOFile |
updateFile()
Returns a file that indicates ongoing updates. |
protected void |
updateText(int pre,
byte[] value,
int kind)
Updates the specified text or attribute value. |
Methods inherited from class org.basex.data.Data |
---|
atom, attr, attSize, attValue, count, delete, dist, dist, doc, elem, id, info, inMemory, insert, insert, insertAttr, iter, kind, name, name, ns, nsFlag, nsFlag, parent, pre, pre, replace, size, size, text, toString, update, update, uri |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DiskData(java.lang.String db, Context ctx) throws java.io.IOException
Open.open(java.lang.String, org.basex.core.Context)
.
db
- name of databasectx
- database context
java.io.IOException
- I/O Exceptionpublic DiskData(MetaData md, Names nm, Names at, PathSummary ps, Namespaces n) throws java.io.IOException
DiskBuilder.build()
.
md
- meta datanm
- tagsat
- attributesps
- path summaryn
- namespaces
java.io.IOException
- I/O ExceptionMethod Detail |
---|
public void init() throws java.io.IOException
java.io.IOException
- I/O exceptionpublic void close()
Data
close
in class Data
public void closeIndex(IndexType type)
Data
closeIndex
in class Data
type
- index to be closedpublic void setIndex(IndexType type, Index index)
Data
setIndex
in class Data
type
- index to be openedindex
- index instancepublic boolean startUpdate()
Data
startUpdate
in class Data
public void finishUpdate()
Data
finishUpdate
in class Data
public IOFile updateFile()
public byte[] text(int pre, boolean text)
Data
text
in class Data
pre
- pre valuetext
- text/attribute flag
public long textItr(int pre, boolean text)
Data
textItr
in class Data
pre
- pre valuetext
- text/attribute flag
public double textDbl(int pre, boolean text)
Data
textDbl
in class Data
pre
- pre valuetext
- text/attribute flag
public int textLen(int pre, boolean text)
Data
textLen
in class Data
pre
- pre valuetext
- text/attribute flag
protected void delete(int pre, boolean text)
Data
delete
in class Data
pre
- pre valuetext
- text (text, comment or pi) or attribute flagprotected void updateText(int pre, byte[] value, int kind)
Data
updateText
in class Data
pre
- pre valuevalue
- contentkind
- node kindprotected void indexBegin()
Data
protected void indexEnd()
Data
protected long index(int pre, int id, byte[] value, int kind)
Data
index
in class Data
pre
- pre valueid
- id valuevalue
- text to be indexedkind
- node kind
protected void indexDelete(int pre, int size)
Data
indexDelete
in class Data
pre
- pre value of the node to deletesize
- number of descendants
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |