示例#1
0
  @Test
  public void testRemove() throws Exception {
    addAscending(0L, 1L, VALUE_COUNT);
    btree.sync();

    Thread.sleep(500L);
    long startTime = System.currentTimeMillis();

    remove(0L, 4L, VALUE_COUNT / 4);
    btree.sync();

    long endTime = System.currentTimeMillis();
    printTime(startTime, endTime, "testRemove");
  }
示例#2
0
  private void testRangeScan(long rangeSize) throws Exception {
    addAscending(0L, 1L, VALUE_COUNT);
    btree.sync();

    byte[] minData = new byte[8];
    byte[] maxData = new byte[8];

    Thread.sleep(500L);
    long startTime = System.currentTimeMillis();

    for (long minValue = 0L; minValue < VALUE_COUNT; minValue += rangeSize) {
      ByteArrayUtil.putLong(minValue, minData, 0);
      ByteArrayUtil.putLong(minValue + rangeSize, maxData, 0);

      RecordIterator iter = btree.iterateRange(minData, maxData);
      try {
        while (iter.next() != null) {}
      } finally {
        iter.close();
      }
    }

    long endTime = System.currentTimeMillis();
    printTime(startTime, endTime, "testRangeScan" + rangeSize);
  }
示例#3
0
  @Test
  public void testAddRandom() throws Exception {
    Thread.sleep(500L);
    long startTime = System.currentTimeMillis();

    addRandom(VALUE_COUNT);
    btree.sync();

    long endTime = System.currentTimeMillis();
    printTime(startTime, endTime, "testAddRandom");
  }
示例#4
0
  @Test
  public void testFullScan() throws Exception {
    addAscending(0L, 1L, VALUE_COUNT);
    btree.sync();

    Thread.sleep(500L);
    long startTime = System.currentTimeMillis();

    RecordIterator iter = btree.iterateAll();
    try {
      while (iter.next() != null) {}
    } finally {
      iter.close();
    }

    long endTime = System.currentTimeMillis();
    printTime(startTime, endTime, "testFullScan");
  }