use of com.tinkerpop.blueprints.impls.orient.OBonsaiTreeRepair in project orientdb by orientechnologies.
the class OGremlinConsole method repairDatabase.
@Override
@ConsoleCommand(description = "Repair database structure", splitInWords = false)
public void repairDatabase(@ConsoleParameter(name = "options", description = "Options: [--fix-graph] [--fix-links] [-v]] [--fix-ridbags] [--fix-bonsai]", optional = true) String iOptions) throws IOException {
checkForDatabase();
final boolean fix_graph = iOptions == null || iOptions.contains("--fix-graph");
if (fix_graph) {
// REPAIR GRAPH
final Map<String, List<String>> options = parseOptions(iOptions);
new OGraphRepair().repair(OrientGraphFactory.getNoTxGraphImplFactory().getGraph(currentDatabase), this, options);
}
final boolean fix_links = iOptions == null || iOptions.contains("--fix-links");
if (fix_links) {
// REPAIR DATABASE AT LOW LEVEL
super.repairDatabase(iOptions);
}
if (!currentDatabase.getURL().startsWith("plocal")) {
message("\n fix-bonsai can be run only on plocal connection \n");
return;
}
final boolean fix_ridbags = iOptions == null || iOptions.contains("--fix-ridbags");
if (fix_ridbags) {
OBonsaiTreeRepair repairer = new OBonsaiTreeRepair();
repairer.repairDatabaseRidbags(currentDatabase, this);
}
final boolean fix_bonsai = iOptions == null || iOptions.contains("--fix-bonsai");
if (fix_bonsai) {
OBonsaiTreeRepair repairer = new OBonsaiTreeRepair();
repairer.repairDatabaseRidbags(currentDatabase, this);
}
}
Aggregations