Skip to content

Commit

Permalink
New console command "list propeties" to display db's custom properties
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed May 11, 2013
1 parent 56bce13 commit 4c609da
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import com.orientechnologies.orient.core.command.script.OCommandExecutorScript;
import com.orientechnologies.orient.core.command.script.OCommandScript;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.config.OStorageEntryConfiguration;
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract;
Expand Down Expand Up @@ -952,7 +953,7 @@ public void info() {
if (currentDatabaseName != null) {
out.println("Current database: " + currentDatabaseName + " (url=" + currentDatabase.getURL() + ")");

OStorage stg = currentDatabase.getStorage();
final OStorage stg = currentDatabase.getStorage();

out.println("\nTotal size: " + OFileUtils.getSizeAsString(stg.getSize()));

Expand All @@ -971,12 +972,27 @@ public void info() {
out.println(" (" + localStorage.getHoles() + " holes, total size of holes: " + OFileUtils.getSizeAsString(holeSize) + ")");
}

listProperties();
listClusters();
listClasses();
listIndexes();
}
}

@ConsoleCommand(description = "Display the database properties")
public void listProperties() {
if (currentDatabase == null)
return;

final OStorage stg = currentDatabase.getStorage();

if (stg.getConfiguration().properties != null) {
out.println("\nDB CUSTOM PROPERTIES:\n");
for (OStorageEntryConfiguration cfg : stg.getConfiguration().properties)
out.println(String.format("%-30s : %s", cfg.name, cfg.value));
}
}

@ConsoleCommand(aliases = { "desc" }, description = "Display the schema of a class")
public void infoClass(@ConsoleParameter(name = "class-name", description = "The name of the class") final String iClassName) {
if (currentDatabaseName == null) {
Expand Down

0 comments on commit 4c609da

Please sign in to comment.