Examples of BigKey


Examples of net.sf.joafip.btreeplus.entity.BigKey

    initialize();
  }

  private void initialize() throws TestException {
    try {
      lessThanMinKey = DATA_RECORD_KEY_MANAGER.createKey(new BigKey(-1));
      maxKey = DATA_RECORD_KEY_MANAGER.createKey(new BigKey(
          Long.MAX_VALUE));
    } catch (Exception exception) {
      throw new TestException(exception);
    }
  }
View Full Code Here

Examples of net.sf.joafip.btreeplus.entity.BigKey

  public void testBalanceRightToLeft() throws HeapException {
    final int max = 8 * 8 * 2;
    for (int identifier = 0; identifier < max; identifier++) {
      try {
        dataManager.writeDataRecord(DATA_RECORD_KEY_MANAGER
            .createKey(new BigKey(identifier)),// NOPMD
            createData(identifier));
        // final String result =
        /**/BtreePlusDataMgrIntegrityChecker.getInstance()
            .checkIntegrity(dataManager, lessThanMinKey, maxKey)
            .toString();
        // System.out.println(result);
      } catch (Throwable throwable) {// NOPMD
        throw new HeapException("after add #" + identifier, throwable);// NOPMD
      }
      for (int k = 0; k <= identifier; k++) {
        final byte[] data = dataManager
            .readDataRecord(DATA_RECORD_KEY_MANAGER
                .createKey(new BigKey(k)));// NOPMD
        assertNotNull("after add #" + identifier + " must found #" + k,
            data);
        assertTrue("bad value", Arrays.equals(createData(k), data));
      }
    }
View Full Code Here

Examples of net.sf.joafip.btreeplus.entity.BigKey

  public void testBalanceLeftToRight() throws HeapException {
    final int max = 8 * 8 * 2;
    for (int identifier = max - 1; identifier >= 0; identifier--) {
      try {
        dataManager.writeDataRecord(DATA_RECORD_KEY_MANAGER
            .createKey(new BigKey(identifier)),// NOPMD
            createData(identifier));
        // final String result =
        /**/BtreePlusDataMgrIntegrityChecker.getInstance()
            .checkIntegrity(dataManager, lessThanMinKey, maxKey)
            .toString();
        // System.out.println(result);
      } catch (Throwable throwable) {// NOPMD
        throw new HeapException("after add #" + identifier, throwable);
      }
      for (int k = identifier; k < max; k++) {
        final byte[] data = dataManager
            .readDataRecord(DATA_RECORD_KEY_MANAGER
                .createKey(new BigKey(k)));// NOPMD
        assertNotNull("after add #" + identifier + " must found #" + k,
            data);
        assertTrue("bad value", Arrays.equals(createData(k), data));
      }
    }
View Full Code Here

Examples of net.sf.joafip.btreeplus.entity.BigKey

    final Iterator<DataRecordIdentifier> iterator = dataManager
        .dataRecordIterator();
    for (int identifier = 0; identifier < max; identifier++) {
      assertTrue("must has next", iterator.hasNext());
      assertEquals("bad value",
          DATA_RECORD_KEY_MANAGER.createKey(new BigKey(identifier)),// NOPMD
          iterator.next());
    }
    assertFalse("must not has next", iterator.hasNext());
  }
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.