Package org.basex.core.cmd
Class Optimize
java.lang.Object
org.basex.core.jobs.Job
org.basex.core.Command
org.basex.core.cmd.ACreate
org.basex.core.cmd.Optimize
Evaluates the 'optimize' command and optimizes the data structures of
the currently opened database. Indexes and statistics are refreshed,
which is especially helpful after updates.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns detailed progress information.static voidOptimizes a database after updates.static voidoptimize(Data data, boolean enforceText, boolean enforceAttr, boolean enforceToken, boolean enforceFt, Optimize cmd) Optimizes the structures of a database.static voidOptimizes the structures of a database.doubleReturns a progress value (0 - 1).protected booleanrun()Executes the command and serializes the result (internal call).booleanReturns true if this command can be stopped.Methods inherited from class org.basex.core.cmd.ACreate
addLocks, newData, supportsProgMethods inherited from class org.basex.core.Command
addLocks, baseURI, baseURI, build, close, error, exception, execute, execute, getOption, getOption, info, info, init, maxResults, result, run, run, setInput, setInput, toString, toString, updated, updating
-
Constructor Details
-
Optimize
public Optimize()Default constructor.
-
-
Method Details
-
run
protected boolean run()Description copied from class:CommandExecutes the command and serializes the result (internal call). -
progressInfo
public double progressInfo()Description copied from class:JobReturns a progress value (0 - 1). Can be overwritten to give more specific feedback.- Overrides:
progressInfoin classJob- Returns:
- header information
-
stoppable
public boolean stoppable()Description copied from class:CommandReturns true if this command can be stopped. This method is only required by the GUI. -
detailedInfo
Description copied from class:JobReturns detailed progress information. Can be overwritten to give more specific feedback.- Overrides:
detailedInfoin classJob- Returns:
- header information
-
finish
Optimizes a database after updates.- Parameters:
data- data- Throws:
IOException- I/O Exception
-
optimize
Optimizes the structures of a database.- Parameters:
data- datacmd- calling command instance (may benull)- Throws:
IOException- I/O Exception during index rebuild
-
optimize
public static void optimize(Data data, boolean enforceText, boolean enforceAttr, boolean enforceToken, boolean enforceFt, Optimize cmd) throws IOException Optimizes the structures of a database.- Parameters:
data- dataenforceText- enforce creation or deletion of text indexenforceAttr- enforce creation or deletion of attribute indexenforceToken- enforce creation or deletion of token indexenforceFt- enforce creation or deletion of full-text indexcmd- calling command instance (may benull)- Throws:
IOException- I/O Exception during index rebuild
-