Package com.orientechnologies.orient.client.remote

Examples of com.orientechnologies.orient.client.remote.OServerAdmin


  private static OrientGraphFactory factory;

  @Before
  public void setUp() throws IOException {
    if (DB_URL.startsWith("remote:")) {
      OServerAdmin serverAdmin = new OServerAdmin(DB_URL);
      serverAdmin.connect("root", ODatabaseHelper.getServerRootPassword());

      if (serverAdmin.existsDatabase(OrientGraphTest.getStorageType())) {
        serverAdmin.dropDatabase(OrientGraphTest.getStorageType());
      }
      serverAdmin.createDatabase(DB_URL, "graph", OrientGraphTest.getStorageType());
    } else {
      OrientGraph graph = new OrientGraph(DB_URL, DB_USER, DB_PASSWORD);
      graph.drop();
    }
    factory = new OrientGraphFactory(DB_URL).setupPool(5, 10);
View Full Code Here


  }

  @AfterClass
  public static void afterClass() throws IOException {
    if (DB_URL.startsWith("remote:")) {
      OServerAdmin serverAdmin = new OServerAdmin(DB_URL);
      serverAdmin.connect("root", ODatabaseHelper.getServerRootPassword());

      if (serverAdmin.existsDatabase(OrientGraphTest.getStorageType())) {
        serverAdmin.dropDatabase(OrientGraphTest.getStorageType());
      }
    } else {
      OrientGraph graph = new OrientGraph(DB_URL, DB_USER, DB_PASSWORD);
      graph.drop();
    }
View Full Code Here

      else
        return graph;
    }

    try {
      final OServerAdmin serverAdmin = new OServerAdmin(url);
      serverAdmin.connect("root", "root");
      if (!serverAdmin.existsDatabase(OrientGraphTest.getStorageType()))
        serverAdmin.createDatabase("graph", OrientGraphTest.getStorageType());

      serverAdmin.close();

    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
View Full Code Here

      final OrientGraphFactory factory = graphFactories.remove(url);
      if (factory != null)
        factory.close();

      final OServerAdmin serverAdmin = new OServerAdmin(url);
      serverAdmin.connect("root", "root");

      if (serverAdmin.existsDatabase(OrientGraphTest.getStorageType()))
        serverAdmin.dropDatabase(OrientGraphTest.getStorageType());

      serverAdmin.close();
    } catch (Exception e) {
      throw new IllegalStateException(e);
    }
  }
View Full Code Here

  public void testFromEmbeddedToSBTreeAndBack() throws IOException {
    OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD.setValue(7);
    OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD.setValue(4);

    if (database.getStorage() instanceof OStorageProxy) {
      OServerAdmin server = new OServerAdmin(database.getURL()).connect("root", ODatabaseHelper.getServerRootPassword());
      server.setGlobalConfiguration(OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD, 7);
      server.setGlobalConfiguration(OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD, 4);
    }

    ORidBag ridBag = new ORidBag();
    ODocument document = new ODocument();
    document.field("ridBag", ridBag);
View Full Code Here

          latch.await();

          for (int i = 0; i < 1000; i++) {
            if (url.startsWith("remote")) {
              new OServerAdmin(url).connect("admin", "admin").freezeCluster(testClusterId, "plocal");
            } else {
              connection.freezeCluster(testClusterId);
            }
            System.out.println("frozen " + System.currentTimeMillis());
            final long startRecords = countInsertedRecords(connection);

            TimeUnit.MILLISECONDS.sleep(500);

            final long endRecords = countInsertedRecords(connection);

            assertEquals(startRecords, endRecords);

            System.out.println("released " + System.currentTimeMillis());
            if (url.startsWith("remote")) {
              new OServerAdmin(url).connect("admin", "admin").releaseCluster(testClusterId, "plocal");
            } else {
              connection.releaseCluster(testClusterId);
            }

            TimeUnit.MILLISECONDS.sleep(500);
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.client.remote.OServerAdmin

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.