Package org.basex.data
Class MetaData
java.lang.Object
org.basex.data.MetaData
This class provides meta information on a database.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
FieldsModifier and TypeFieldDescriptionAttribute index: names to include.booleanIndicates if an attribute index exists.booleanFlag for automatic index updating.booleanFlag for full-text case sensitivity.booleanIndicate if the database may be corrupt.booleanIndicates if the attribute index is to be recreated.booleanIndicates if the full-text index is to be recreated.booleanIndicates if the text index is to be recreated.booleanIndicates if the token index is to be recreated.booleanFlag for full-text diacritics removal.final IOFileDatabase directory.booleanDirty flag.Full-text index: names to include.booleanIndicates if a full-text index exists.longSize of initially imported resources.Language of full-text search index.intLast (highest) id assigned to a node.intMaximum number of categories.intMaximum length of index entries.Database name.intNumber of stored XML documents.Path to initially imported resources.intNumber of nodes.intSplit size for creating indexes.booleanFlag for full-text stemming.Full-text stopword file.Text index: names to include.booleanIndicates if a text index exists.longDatabase timestamp.Token index: names to tokenize.booleanIndicates if a token index exists.booleanFlag for activated automatic index update.booleanIndicates if index structures are out-dated. -
Constructor Summary
ConstructorsConstructorDescriptionMetaData(String name, MainOptions options, StaticOptions sopts) Constructor.MetaData(MainOptions options) Constructor for a main-memory database instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidAssigns parser information.Returns a reference to the specified binary file.Returns the binary directory.Returns a file instance for the specified database file.longdbSize()Returns the disk size of the database.longdbTime()Returns the disk timestamp of the database.booleanDrops the specified database files.static IOFileCreates a database file.booleanReturns if the specified index exists.voidSets availability of the specified index.Returns the included names for the specified index type.voidnames(IndexType type, MainOptions options) Assigns include names options to the specified index type.static StringNormalizes a database path.booleanoldindex()Returns true if the indexes need to be updated.voidread()Reads in all meta data.voidupdate()Notifies the meta structures of an update and invalidates the indexes.Returns a file that indicates ongoing updates.
-
Field Details
-
dir
Database directory. Set tonullif database is in main memory. -
name
Database name. -
original
Path to initially imported resources. -
inputsize
public long inputsizeSize of initially imported resources. -
time
public long timeDatabase timestamp. -
ndocs
public int ndocsNumber of stored XML documents. -
textindex
public boolean textindexIndicates if a text index exists. -
attrindex
public boolean attrindexIndicates if an attribute index exists. -
tokenindex
public boolean tokenindexIndicates if a token index exists. -
ftindex
public boolean ftindexIndicates if a full-text index exists. -
updindex
public boolean updindexFlag for activated automatic index update. -
autooptimize
public boolean autooptimizeFlag for automatic index updating. -
createtext
public boolean createtextIndicates if the text index is to be recreated. -
createattr
public boolean createattrIndicates if the attribute index is to be recreated. -
createtoken
public boolean createtokenIndicates if the token index is to be recreated. -
createft
public boolean createftIndicates if the full-text index is to be recreated. -
textinclude
Text index: names to include. -
attrinclude
Attribute index: names to include. -
tokeninclude
Token index: names to tokenize. -
ftinclude
Full-text index: names to include. -
stemming
public boolean stemmingFlag for full-text stemming. -
casesens
public boolean casesensFlag for full-text case sensitivity. -
diacritics
public boolean diacriticsFlag for full-text diacritics removal. -
stopwords
Full-text stopword file. -
maxcats
public int maxcatsMaximum number of categories. -
maxlen
public int maxlenMaximum length of index entries. -
splitsize
public int splitsizeSplit size for creating indexes. -
language
Language of full-text search index. -
uptodate
public boolean uptodateIndicates if index structures are out-dated. -
corrupt
public boolean corruptIndicate if the database may be corrupt. -
dirty
public boolean dirtyDirty flag. -
size
public int sizeNumber of nodes. -
lastid
public int lastidLast (highest) id assigned to a node. Can be-1if database is empty.
-
-
Constructor Details
-
MetaData
Constructor for a main-memory database instance.- Parameters:
options- database options
-
MetaData
Constructor.- Parameters:
name- name of the databaseoptions- database optionssopts- static options
-
-
Method Details
-
normPath
Normalizes a database path. Converts backslashes and removes duplicate and leading slashes. Returnsnullif the path contains invalid characters.- Parameters:
path- input path- Returns:
- normalized path or
null
-
file
Creates a database file.- Parameters:
path- database pathname- filename- Returns:
- database filename
-
oldindex
public boolean oldindex()Returns true if the indexes need to be updated.- Returns:
- result of check
-
dbSize
public long dbSize()Returns the disk size of the database.- Returns:
- database size
-
dbTime
public long dbTime()Returns the disk timestamp of the database.- Returns:
- database size
-
dbFile
Returns a file instance for the specified database file. Should only be called if database is disk-based.- Parameters:
filename- filename- Returns:
- database filename
-
binaryDir
Returns the binary directory.- Returns:
- binary directory, or
nullif this is a main-memory database
-
updateFile
Returns a file that indicates ongoing updates.- Returns:
- updating file
-
binary
Returns a reference to the specified binary file.- Parameters:
path- internal file path- Returns:
- path, or
nullif this is a main-memory database of if the resource path cannot be resolved (e.g. because it points to a parent directory).
-
drop
Drops the specified database files. Should only be called if database is disk-based.- Parameters:
pattern- file pattern ornullif all files are to be deleted- Returns:
- result of check
-
read
Reads in all meta data.- Throws:
IOException- exception
-
index
Returns if the specified index exists.- Parameters:
type- index type- Returns:
- result of check
-
index
Sets availability of the specified index.- Parameters:
type- index typeexists- indicates if the index exists
-
names
Returns the included names for the specified index type.- Parameters:
type- index type- Returns:
- index
-
names
Assigns include names options to the specified index type.- Parameters:
type- index typeoptions- main options
-
update
public void update()Notifies the meta structures of an update and invalidates the indexes. -
assign
Assigns parser information.- Parameters:
parser- parser
-