Package com.orientechnologies.orient.core.storage

Examples of com.orientechnologies.orient.core.storage.OStorage


  }

  protected ODatabaseDocumentTx getDatabaseInstance(final String iDbName, final String iStorageMode) {
    final String path;

    final OStorage stg = Orient.instance().getStorage(iDbName);
    if (stg != null)
      path = stg.getURL();
    else if (iStorageMode.equals(OEngineLocal.NAME)) {
      path = iStorageMode + ":${ORIENTDB_HOME}/databases/" + iDbName;
    } else if (iStorageMode.equals(OEngineMemory.NAME)) {
      path = iStorageMode + ":" + iDbName;
    } else
View Full Code Here


  }

  public String getStoragePath(final String iName) {
    final String name = iName.indexOf(':') > -1 ? iName.substring(iName.indexOf(':') + 1) : iName;

    final OStorage stg = Orient.instance().getStorage(name);
    if (stg != null)
      // ALREADY OPEN
      return stg.getURL();

    // SEARCH IN CONFIGURED PATHS
    String dbPath = configuration.getStoragePath(name);

    if (dbPath == null) {
View Full Code Here

          parameters.put(kv[0], kv[1]);
        }
      } else
        dbName = iURL;

      OStorage storage;
      if (engine.isShared()) {
        // SEARCH IF ALREADY USED
        storage = storages.get(dbName);
        if (storage == null) {
          // NOT FOUND: CREATE IT
View Full Code Here

    }

    if (currentDatabase != null) {
      out.print("\nDisconnecting from the database [" + currentDatabaseName + "]...");

      final OStorage stg = Orient.instance().getStorage(currentDatabase.getURL());

      currentDatabase.close();

      // FORCE CLOSING OF STORAGE: THIS CLEAN UP REMOTE CONNECTIONS
      if (stg != null)
        stg.close(true);

      currentDatabase = null;
      currentDatabaseName = null;
      currentRecord = null;
View Full Code Here

  @ConsoleCommand(aliases = { "status" }, description = "Display information about the database")
  public void info() {
    if (currentDatabaseName != null) {
      out.println("Current database: " + currentDatabaseName + " (url=" + currentDatabase.getURL() + ")");

      OStorage stg = currentDatabase.getStorage();

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

      if (stg instanceof OStorageRemoteThread) {
        final ODocument clusterConfig = ((OStorageRemoteThread) stg).getClusterConfiguration();
        if (clusterConfig != null)
          out.println("\nCluster configuration: " + clusterConfig.toJSON("indent:2"));
View Full Code Here

  }

  public String getStoragePath(final String iName) {
    final String name = iName.indexOf(':') > -1 ? iName.substring(iName.indexOf(':') + 1) : iName;

    final OStorage stg = Orient.instance().getStorage(name);
    if (stg != null)
      // ALREADY OPEN
      return stg.getURL();

    // SEARCH IN CONFIGURED PATHS
    String dbPath = configuration.getStoragePath(name);

    if (dbPath == null) {
View Full Code Here

          parameters.put(kv[0], kv[1]);
        }
      } else
        dbName = iURL;

      OStorage storage;
      if (engine.isShared()) {
        // SEARCH IF ALREADY USED
        storage = storages.get(dbName);
        if (storage == null) {
          // NOT FOUND: CREATE IT
View Full Code Here

          parameters.put(kv[0], kv[1]);
        }
      } else
        dbName = iURL;

      OStorage storage;
      if (engine.isShared()) {
        // SEARCH IF ALREADY USED
        storage = storages.get(dbName);
        if (storage == null) {
          // NOT FOUND: CREATE IT
View Full Code Here

  }

  protected ODatabaseDocumentTx getDatabaseInstance(final String iDbName, final String iStorageMode) {
    final String path;

    final OStorage stg = Orient.instance().getStorage(iDbName);
    if (stg != null)
      path = stg.getURL();
    else if (iStorageMode.equals(OEngineLocal.NAME)) {
      path = iStorageMode + ":${ORIENTDB_HOME}/databases/" + iDbName;
    } else if (iStorageMode.equals(OEngineMemory.NAME)) {
      path = iStorageMode + ":" + iDbName;
    } else
View Full Code Here

    }

    if (currentDatabase != null) {
      out.print("\nDisconnecting from the database [" + currentDatabaseName + "]...");

      final OStorage stg = Orient.instance().getStorage(currentDatabase.getURL());

      currentDatabase.close();

      // FORCE CLOSING OF STORAGE: THIS CLEAN UP REMOTE CONNECTIONS
      if (stg != null)
        stg.close(true);

      currentDatabase = null;
      currentDatabaseName = null;
      currentRecord = null;
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.storage.OStorage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.