@Test public void testClose() throws Exception { int chunkSize = 1024; TestChunkAllocator chunkAllocator = new TestChunkAllocator(chunkSize); SpaceAllocator spaceAllocator = new SpaceAllocator(chunkAllocator); Assert.assertFalse(chunkAllocator.closed); spaceAllocator.close(); Assert.assertTrue(chunkAllocator.closed); }
@Override public void close() throws IOException { chunkAllocator.close(); }
SpaceAllocator implements Allocator { @Override public void close() throws IOException { chunkAllocator.close(); } }
SpaceAllocator implements Allocator { @Override public void close() throws IOException { chunkAllocator.close(); } SpaceAllocator(Configuration configuration, @Nullable File[] localDirs); @VisibleForTesting  SpaceAllocator(ChunkAllocator chunkAllocator); }
SpaceAllocator implements Allocator { @Override public void close() throws IOException { chunkAllocator.close(); } SpaceAllocator(Configuration configuration, @Nullable File[] localDirs); @VisibleForTesting  SpaceAllocator(ChunkAllocator chunkAllocator); @Override long allocate(int len); @Override void free(long offset); @Override Chunk getChunkById(int chunkId); @Override void close(); }
SpaceAllocator implements Allocator { @Override public void close() throws IOException { chunkAllocator.close(); } SpaceAllocator(Configuration configuration, @Nullable File[] localDirs); @VisibleForTesting  SpaceAllocator(ChunkAllocator chunkAllocator); @Override long allocate(int len); @Override void free(long offset); @Override Chunk getChunkById(int chunkId); @Override void close();  }