Examples of OrientGraphNoTx


Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

    }
  }

  @Override
  public void deinit() {
    final OrientGraphNoTx graph = factory.getNoTx();
    try {
      final long total = graph.countVertices("Client");

      System.out.println("\nTotal objects in Client cluster after the test: " + total);
      System.out.println("Created " + (total - foundObjects));
      Assert.assertEquals(total - foundObjects, threadCycles);

      final long indexedItems = graph.getRawGraph().getMetadata().getIndexManager().getIndex("Client.uid").getSize();
      System.out.println("\nTotal indexed objects after the test: " + indexedItems);

    } finally {
      graph.shutdown();
    }
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (className == null && clusterName == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final OrientGraphNoTx graph = OGraphCommandExecutorSQLFactory.getGraphNoTx();

    final Set<OIdentifiable> sourceRIDs = OSQLEngine.getInstance().parseRIDTarget(graph.getRawGraph(), source, context, iArgs);

    // CREATE EDGES
    final List<ODocument> result = new ArrayList<ODocument>(sourceRIDs.size());

    for (OIdentifiable from : sourceRIDs) {
      final OrientVertex fromVertex = graph.getVertex(from);
      if (fromVertex == null)
        continue;

      final ORID oldVertex = fromVertex.getIdentity().copy();
      final ORID newVertex = fromVertex.moveTo(className, clusterName);
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

  public static OrientGraphNoTx getGraphNoTx() {
    ODatabaseRecord database = ODatabaseRecordThreadLocal.INSTANCE.get();
    if (!(database instanceof ODatabaseDocumentTx))
      database = new ODatabaseDocumentTx((ODatabaseRecordTx) database);

    return new OrientGraphNoTx((ODatabaseDocumentTx) database);
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

  public static void main(String[] args) throws IOException {
    File backupFile = new File("testbackup.zip");
    OutputStream oS = new FileOutputStream(backupFile);

    OrientGraphFactory factory = new OrientGraphFactory("plocal:backupTest", "admin", "admin");
    OrientGraphNoTx graphNoTx = factory.getNoTx();
    graphNoTx.getRawGraph().backup(oS, null, null, null, 1, 1024);

    ZipFile zipFile = new ZipFile(backupFile);
    Enumeration enumeration = zipFile.entries();
    System.out.format("ZipFile : %s%n", zipFile);
    while (enumeration.hasMoreElements()) {
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

  @Override
  public void init() {
    if (factory.exists())
      factory.drop();

    final OrientGraphNoTx graph = factory.getNoTx();

    try {
      if (graph.getVertexType("Client") == null) {
        final OrientVertexType clientType = graph.createVertexType("Client");

        final OrientVertexType.OrientVertexProperty property = clientType.createProperty("uid", OType.STRING);
        //property.createIndex(OClass.INDEX_TYPE.UNIQUE_HASH_INDEX);

        // CREATE ONE CLUSTER PER THREAD
        for (int i = 0; i < getThreads(); ++i) {
          System.out.println("Creating cluster: client_" + i + "...");
          clientType.addCluster("client_" + i);
        }
      }

      OrientVertex superNode = graph.addVertex("class:Client", "name", "superNode");
      final OrientVertex v = graph.addVertex("class:Client", "uid", counter.getAndIncrement());
      superNode.addEdge("test", v);

      superNodeRID = superNode.getIdentity();

    } finally {
      graph.shutdown();
    }
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

    }
  }

  @Override
  public void deinit() {
    final OrientGraphNoTx graph = factory.getNoTx();
    try {
      final long total = graph.countVertices("Client");

      System.out.println("\nTotal objects in Client cluster after the test: " + total);
      System.out.println("Created " + (total));
      Assert.assertEquals(total , threadCycles);

//      final long indexedItems = graph.getRawGraph().getMetadata().getIndexManager().getIndex("Client.uid").getSize();
//      System.out.println("\nTotal indexed objects after the test: " + indexedItems);

    } finally {
      graph.shutdown();
    }
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

  public OScriptGraphOrientWrapper() {
  }

  public OScriptGraphWrapper getGraphNoTx() {
    final ODatabaseDocumentTx threadDatabase = (ODatabaseDocumentTx) ODatabaseRecordThreadLocal.INSTANCE.get().getDatabaseOwner();
    return new OScriptGraphWrapper(new OrientGraphNoTx(threadDatabase));
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

  @Override
  public void init() {
    if (factory.exists())
      factory.drop();

    final OrientGraphNoTx graph = factory.getNoTx();

    try {
      if (graph.getVertexType("Client") == null) {
        final OrientVertexType clientType = graph.createVertexType("Client");

        final OrientVertexType.OrientVertexProperty property = clientType.createProperty("uid", OType.STRING);
        // property.createIndex(OClass.INDEX_TYPE.UNIQUE_HASH_INDEX);

        // CREATE ONE CLUSTER PER THREAD
        for (int i = 0; i < getThreads(); ++i) {
          System.out.println("Creating cluster: client_" + i + "...");
          clientType.addCluster("client_" + i);
        }
      }

    } finally {
      graph.shutdown();
    }
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx

    }
  }

  @Override
  public void deinit() {
    final OrientGraphNoTx graph = factory.getNoTx();
    try {
      final long total = graph.countVertices("Client");

      System.out.println("\nTotal objects in Client cluster after the test: " + total);
      System.out.println("Created " + (total));
      Assert.assertEquals(total, threadCycles);

      final long indexedItems = graph.getRawGraph().getMetadata().getIndexManager().getIndex("Client.uid").getSize();
      System.out.println("\nTotal indexed objects after the test: " + indexedItems);

    } finally {
      graph.shutdown();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.