Пример #1
0
  @Test
  public void test_store_reopen() {
    long recid = engine.recordPut("aaa", Serializer.STRING_SERIALIZER);

    engine.commit();
    reopenStore();

    String aaa = engine.recordGet(recid, Serializer.STRING_SERIALIZER);
    assertEquals("aaa", aaa);
  }
Пример #2
0
  @Test
  public void test_store_reopen_over_2GB() {
    Assume.assumeTrue(CC.FULL_TEST);

    byte[] data = new byte[11111];
    final long max = Volume.BUF_SIZE * 2L / data.length;
    final int hash = Arrays.hashCode(data);

    List<Long> recids = new ArrayList<Long>();

    for (int i = 0; i < max; i++) {
      long recid = engine.recordPut(data, Serializer.BYTE_ARRAY_SERIALIZER);
      recids.add(recid);
    }

    reopenStore();

    for (long recid : recids) {
      byte[] b = engine.recordGet(recid, Serializer.BYTE_ARRAY_SERIALIZER);
      assertEquals(hash, Arrays.hashCode(b));
    }
  }