Examples of OrientVertexType


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

    try {
      OrientGraphFactory localFactory = new OrientGraphFactory("plocal:target/server0/databases/" + getDatabaseName());
      OrientGraphNoTx graphNoTx = localFactory.getNoTx();

      try {
        final OrientVertexType clientType = graphNoTx.createVertexType("Client");
        for (int i = 1; i < serverInstance.size(); ++i) {
          final String serverName = serverInstance.get(i).getServerInstance().getDistributedManager().getLocalNodeName();
          clientType.addCluster("client_" + serverName);
        }

        graphNoTx.createVertexType("Product");
        graphNoTx.createVertexType("Hobby");
View Full Code Here

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

      OrientGraphFactory factory = new OrientGraphFactory("plocal:target/server" + s + "/databases/" + getDatabaseName());
      OrientGraphNoTx g = factory.getNoTx();

      try {
        System.out.println("Creating vertex class Client" + s + " against server " + g + "...");
        OrientVertexType t = g.createVertexType("Client" + s);
        t.createProperty("name", OType.STRING).setMandatory(true);

        System.out.println("Creating vertex class Knows" + s + " against server " + g + "...");
        g.createEdgeType("Knows" + s);
      } finally {
        g.shutdown();
View Full Code Here

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

  private void initGraph() {
    OrientGraph graph = new OrientGraph(URL);
    graph.setAutoStartTx(false);
    graph.commit();

    final OrientVertexType vertexType = graph.createVertexType("TestVertex");
    vertexType.createProperty("uuid", OType.STRING);
    vertexType.createIndex("TestVertexUuidIndex", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "uuid");

    final OrientEdgeType edgeType = graph.createEdgeType("TestEdge");
    edgeType.createProperty("uuid", OType.STRING);
    edgeType.createIndex("TestEdgeUuidIndex", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "uuid");
    graph.shutdown();
View Full Code Here

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

    graph.setAutoStartTx(false);
    graph.commit();

    if (graph.getEdgeType("Knows") == null) {
      OrientEdgeType knows = graph.createEdgeType("Knows");
      OrientVertexType person = graph.createVertexType("Person");

      person.createEdgeProperty(Direction.OUT, "Knows").setOrdered(true);
    }

    graph.setAutoStartTx(true);

    mainPerson = graph.addVertex("class:Person", new Object[] { "index", 0 });
View Full Code Here

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

  @Test
  public void testEmbeddedListAsVertexProperty() {
    OrientGraph g = new OrientGraph(URL, "admin", "admin");

    try {
      OrientVertexType vertexType = g.createVertexType("EmbeddedClass");
      vertexType.createProperty("embeddedList", OType.EMBEDDEDLIST);

      OrientVertex vertex = g.addVertex("class:EmbeddedClass");

      List<ODocument> embeddedList = new ArrayList<ODocument>();
      ODocument docOne = new ODocument();
View Full Code Here

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

  @Override
  public void init() {
    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);
        }

        foundObjects = 0;
      } else
        foundObjects = graph.countVertices("Client");
View Full Code Here

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

    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());
View Full Code Here

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

    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
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.