Constructor and Description |
---|
DiskData(MetaData meta)
Default constructor, called from
Open.open(java.lang.String, org.basex.core.Context, org.basex.core.MainOptions) . |
DiskData(MetaData meta,
Names elemNames,
Names attrNames,
PathSummary paths,
Namespaces nspaces)
Internal database constructor, called from
DiskBuilder.build() . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the database.
|
void |
createIndex(IndexType type,
MainOptions options,
Command cmd)
Drops the specified index.
|
protected void |
delete(int pre,
boolean text)
Deletes the specified text entry.
|
boolean |
dropIndex(IndexType type)
Drops the specified index.
|
void |
finishUpdate(MainOptions opts)
Finishes an update operation: removes the update file and the exclusive lock.
|
void |
flush(boolean all)
Flushes updated data.
|
protected long |
index(int pre,
int id,
byte[] value,
int kind)
Indexes a text and returns the reference.
|
protected void |
indexAdd()
Notify the index structures that an add operation is finished.
|
protected void |
indexDelete(int pre,
int size)
Delete a node and its descendants from the corresponding indexes.
|
boolean |
inMemory()
Indicates if this data instance is in main memory or on disk.
|
void |
startUpdate(MainOptions opts)
Starts an update operation: writes a file to disk to indicate that an update is
going on, and exclusively locks the table file.
|
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 (possibly compressed) text (text, comment, pi).
|
protected void |
updateText(int pre,
byte[] value,
int kind)
Updates the specified text or attribute value.
|
public DiskData(MetaData meta) throws IOException
Open.open(java.lang.String, org.basex.core.Context, org.basex.core.MainOptions)
.meta
- meta dataIOException
- I/O Exceptionpublic DiskData(MetaData meta, Names elemNames, Names attrNames, PathSummary paths, Namespaces nspaces) throws IOException
DiskBuilder.build()
.meta
- meta dataelemNames
- element namesattrNames
- attribute namespaths
- path summarynspaces
- namespacesIOException
- I/O Exceptionpublic void close()
Data
public void createIndex(IndexType type, MainOptions options, Command cmd) throws IOException
Data
createIndex
in class Data
type
- index to be droppedoptions
- main optionscmd
- calling commandIOException
- I/O exceptionpublic boolean dropIndex(IndexType type)
Data
public void startUpdate(MainOptions opts) throws IOException
Data
startUpdate
in class Data
opts
- main optionsIOException
- I/O exceptionpublic void finishUpdate(MainOptions opts)
Data
finishUpdate
in class Data
opts
- main optionspublic void flush(boolean all)
Data
public byte[] text(int pre, boolean text)
Data
public long textItr(int pre, boolean text)
Data
Long.MIN_VALUE
is returned if the input is no valid integer.public double textDbl(int pre, boolean text)
Data
Double.NaN
is returned if the input is no valid double.public int textLen(int pre, boolean text)
Data
protected void delete(int pre, boolean text)
Data
protected void updateText(int pre, byte[] value, int kind)
Data
updateText
in class Data
pre
- pre valuevalue
- contentkind
- node kindprotected void indexAdd()
Data
protected long index(int pre, int id, byte[] value, int kind)
Data
protected void indexDelete(int pre, int size)
Data
indexDelete
in class Data
pre
- pre value of the node to deletesize
- number of descendantsCopyright © 2005–2015 BaseX Team. All rights reserved.