| 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 current database.
|
void |
closeIndex(IndexToken.IndexType type)
Closes the specified index.
|
protected void |
delete(int pre,
boolean text)
Deletes the specified text entry.
|
void |
flush()
Flushes the database.
|
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.
|
boolean |
pinned()
Checks if this database is also opened (pinned) by other instances.
|
static boolean |
pinned(IOFile dbpath,
java.lang.String uuid)
Checks if a database is pinned by processes that have a UUID different to the
specified one.
|
void |
setIndex(IndexToken.IndexType type,
Index index)
Assigns the specified index.
|
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).
|
boolean |
update(boolean updating)
Marks a database as updating.
|
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 flush()
Datapublic void close()
throws java.io.IOException
Datapublic void closeIndex(IndexToken.IndexType type) throws java.io.IOException
DatacloseIndex in class Datatype - index to be closedjava.io.IOException - I/O exceptionpublic void setIndex(IndexToken.IndexType type, Index index)
Datapublic boolean update(boolean updating)
Datapublic IOFile updateFile()
public boolean pinned()
Datapublic static boolean pinned(IOFile dbpath, java.lang.String uuid)
dbpath - database pathuuid - unique idpublic 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