| Constructor and Description |
|---|
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). |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the database.
|
void |
closeIndex(IndexToken.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(IndexToken.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.
|
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 contextjava.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 - namespacesjava.io.IOException - I/O Exceptionpublic void init()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic void close()
Datapublic void closeIndex(IndexToken.IndexType type)
DatacloseIndex in class Datatype - index to be closedpublic void setIndex(IndexToken.IndexType type, Index index)
Datapublic boolean startUpdate()
DatastartUpdate in class Datapublic void finishUpdate()
DatafinishUpdate in class Datapublic IOFile updateFile()
public byte[] text(int pre,
boolean text)
Datapublic long textItr(int pre,
boolean text)
Datapublic double textDbl(int pre,
boolean text)
Datapublic int textLen(int pre,
boolean text)
Dataprotected void delete(int pre,
boolean text)
Dataprotected void updateText(int pre,
byte[] value,
int kind)
DataupdateText in class Datapre - pre valuevalue - contentkind - node kindprotected void indexBegin()
Dataprotected void indexEnd()
Dataprotected long index(int pre,
int id,
byte[] value,
int kind)
Dataprotected void indexDelete(int pre,
int size)
DataindexDelete in class Datapre - pre value of the node to deletesize - number of descendants