Examples of OIndexManagerProxy


Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

  private void init(final boolean iLoad) {
    // ODatabaseRecordThreadLocal.INSTANCE.set(database);

    schemaClusterId = database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME);

    indexManager = new OIndexManagerProxy(database.getStorage().getResource(OIndexManager.class.getSimpleName(),
        new Callable<OIndexManager>() {
          public OIndexManager call() {
            OIndexManager instance;
            if (database.getStorage() instanceof OStorageEmbedded)
              instance = new OIndexManagerShared(database);
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

  private void init(final boolean iLoad) {
    // ODatabaseRecordThreadLocal.INSTANCE.set(database);

    schemaClusterId = database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME);

    indexManager = new OIndexManagerProxy(database.getStorage().getResource(OIndexManager.class.getSimpleName(),
        new Callable<OIndexManager>() {
          public OIndexManager call() {
            OIndexManager instance;
            if (database.getStorage() instanceof OStorageEmbedded)
              instance = new OIndexManagerShared(database);
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

    oClass.createProperty("fSeven", OType.STRING);
  }

  @Test
  public void testCreateSimpleKeyInvalidNameIndex() {
    final OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    try {
      indexManager.createIndex("simple:key", OClass.INDEX_TYPE.UNIQUE.toString(), new OSimpleKeyIndexDefinition(OType.INTEGER),
          null, null, null);
      fail();
    } catch (Exception e) {
      if (e instanceof OResponseProcessingException)
        e = (Exception) e.getCause();
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

    }
  }

  @Test
  public void testCreateSimpleKeyIndexTest() {
    final OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    final OIndex result = indexManager.createIndex("simplekey", OClass.INDEX_TYPE.UNIQUE.toString(), new OSimpleKeyIndexDefinition(
        OType.INTEGER), null, null, null);

    assertEquals(result.getName(), "simplekey");

    indexManager.reload();
    assertNull(database.getMetadata().getIndexManager().getClassIndex(CLASS_NAME, "simplekey"));
    assertEquals(database.getMetadata().getIndexManager().getIndex("simplekey").getName(), result.getName());
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

    assertEquals(database.getMetadata().getIndexManager().getIndex("simplekey").getName(), result.getName());
  }

  @Test
  public void testCreateNullKeyDefinitionIndexTest() {
    final OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    final OIndex result = indexManager.createIndex("nullkey", OClass.INDEX_TYPE.UNIQUE.toString(), null, null, null, null);

    assertEquals(result.getName(), "nullkey");
    indexManager.reload();

    assertNull(database.getMetadata().getIndexManager().getClassIndex(CLASS_NAME, "nullkey"));
    assertEquals(database.getMetadata().getIndexManager().getIndex("nullkey").getName(), result.getName());
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

    assertEquals(database.getMetadata().getIndexManager().getIndex("nullkey").getName(), result.getName());
  }

  @Test
  public void testCreateOnePropertyIndexTest() {
    final OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    final OIndex result = indexManager.createIndex("propertyone", OClass.INDEX_TYPE.UNIQUE.toString(),
        new OPropertyIndexDefinition(CLASS_NAME, "fOne", OType.INTEGER), new int[] { database.getClusterIdByName(CLASS_NAME) },
        null, null);

    assertEquals(result.getName(), "propertyone");

    indexManager.reload();
    assertEquals(database.getMetadata().getIndexManager().getClassIndex(CLASS_NAME, "propertyone").getName(), result.getName());

  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

  }

  @Test
  public void createCompositeIndexTestWithoutListener() {
    final OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    final OIndex result = indexManager.createIndex(
        "compositeone",
        OClass.INDEX_TYPE.NOTUNIQUE.toString(),
        new OCompositeIndexDefinition(CLASS_NAME, Arrays.asList(new OPropertyIndexDefinition(CLASS_NAME, "fOne", OType.INTEGER),
            new OPropertyIndexDefinition(CLASS_NAME, "fTwo", OType.STRING)

        )), new int[] { database.getClusterIdByName(CLASS_NAME) }, null, null);

    assertEquals(result.getName(), "compositeone");

    indexManager.reload();
    assertEquals(database.getMetadata().getIndexManager().getClassIndex(CLASS_NAME, "compositeone").getName(), result.getName());
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

      public void onCompletition(final Object iTask, final boolean iSucceed) {
        atomicInteger.incrementAndGet();
      }
    };

    final OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    final OIndex result = indexManager.createIndex(
        "compositetwo",
        OClass.INDEX_TYPE.NOTUNIQUE.toString(),
        new OCompositeIndexDefinition(CLASS_NAME, Arrays.asList(new OPropertyIndexDefinition(CLASS_NAME, "fOne", OType.INTEGER),
            new OPropertyIndexDefinition(CLASS_NAME, "fTwo", OType.STRING), new OPropertyIndexDefinition(CLASS_NAME, "fThree",
                OType.BOOLEAN)

        )), new int[] { database.getClusterIdByName(CLASS_NAME) }, progressListener, null);

    assertEquals(result.getName(), "compositetwo");
    assertEquals(atomicInteger.get(), 2);

    indexManager.reload();
    assertEquals(database.getMetadata().getIndexManager().getClassIndex(CLASS_NAME, "compositetwo").getName(), result.getName());

  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

          instance.load();
        return instance;
      }
    }), database);

    indexManager = new OIndexManagerProxy(database.getStorage().getResource(OIndexManager.class.getSimpleName(),
        new Callable<OIndexManager>() {
          public OIndexManager call() {
            OIndexManager instance;
            if (database.getStorage() instanceof OStorageProxy)
              instance = new OIndexManagerRemote(database);
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManagerProxy

  }

  public void rebuildIndexes() {
    database.getMetadata().getIndexManager().reload();

    OIndexManagerProxy indexManager = database.getMetadata().getIndexManager();

    listener.onMessage("\nRebuild of stale indexes...");
    for (String indexName : indexesToRebuild) {

      if (indexManager.getIndex(indexName) == null) {
        listener.onMessage("\nIndex " + indexName + " is skipped because it is absent in imported DB.");
        continue;
      }

      listener.onMessage("\nStart rebuild index " + indexName);
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.