Skip to content

Instantly share code, notes, and snippets.

@jonasnick
Created April 9, 2014 17:37
Show Gist options
  • Save jonasnick/10295467 to your computer and use it in GitHub Desktop.
Save jonasnick/10295467 to your computer and use it in GitHub Desktop.
@Test
public void testDelete() {
StorageRootInMemory storage = new StorageRootInMemory(ZooConfig.getFilePageSize());
StorageChannelOutput out = storage.getWriter(false);
int pageId = out.allocateAndSeek(DATA_TYPE.GENERIC_INDEX, 0);
out.writeShort((short) -1);
out.flush();
assertEquals(2, storage.statsGetPageCount());
System.out.println(storage.getFsm().debugPageIds());
storage.reportFreePage(pageId);
assertEquals(2, storage.statsGetPageCount());
assertTrue(storage.getFsm().debugIsPageIdInFreeList(pageId));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment