Пример #1
0
  @Override
  @Test(enabled = false)
  public void init() throws Exception {
    String buildDirectory = System.getProperty("buildDirectory", ".");
    if (buildDirectory == null) buildDirectory = ".";

    databaseDocumentTx =
        new ODatabaseDocumentTx("local:" + buildDirectory + "/uniqueHashIndexTest");
    if (databaseDocumentTx.exists()) {
      databaseDocumentTx.open("admin", "admin");
      databaseDocumentTx.drop();
    }

    databaseDocumentTx.create();

    long maxMemory = 2L * 1024 * 1024 * 1024;
    System.out.println("Max memory :" + maxMemory);
    buffer =
        new O2QCache(
            maxMemory,
            15000,
            ODirectMemoryFactory.INSTANCE.directMemory(),
            null,
            OHashIndexBucket.MAX_BUCKET_SIZE_BYTES,
            (OStorageLocal) databaseDocumentTx.getStorage(),
            false);
    hashIndex = new OUniqueHashIndex();

    hashIndex.create(
        "uhashIndexTest",
        new OSimpleKeyIndexDefinition(OType.STRING),
        databaseDocumentTx,
        OMetadata.CLUSTER_INDEX_NAME,
        new int[0],
        null);
  }
Пример #2
0
 @Override
 @Test(enabled = false)
 public void deinit() throws Exception {
   hashIndex.delete();
   databaseDocumentTx.drop();
 }
Пример #3
0
 @Override
 @Test(enabled = false)
 public void cycle() throws Exception {
   String key = "bsadfasfas" + random.nextInt();
   hashIndex.put(key, new ORecordId(0, new OClusterPositionLong(0)));
 }