johnyangk commented on a change in pull request #223: [NEMO-388] Off-heap 
memory management (reuse ByteBuffer)
URL: https://github.com/apache/incubator-nemo/pull/223#discussion_r307131937
 
 

 ##########
 File path: 
runtime/executor/src/test/java/org/apache/nemo/runtime/executor/data/DirectByteBufferOutputStreamTest.java
 ##########
 @@ -33,71 +34,79 @@
  */
 public class DirectByteBufferOutputStreamTest {
   private DirectByteBufferOutputStream outputStream;
+  private static final MemoryPoolAssigner memoryPoolAssigner = new 
MemoryPoolAssigner(1, 32);
 
   @Before
-  public void setup(){
-    outputStream = new DirectByteBufferOutputStream();
+  public void setup() throws MemoryAllocationException {
+    outputStream = new DirectByteBufferOutputStream(memoryPoolAssigner);
   }
 
   @Test
-  public void testSingleWrite() {
+  public void testSingleWrite() throws IOException, IllegalAccessException {
     int value = 1;
     outputStream.write(value);
     assertEquals(value, outputStream.toByteArray()[0]);
+    outputStream.release();
 
 Review comment:
   Seeing this made me wonder whether DirectByteBufferOutputStream#release() 
can be replaced with DirectByteBufferOutputStream#close(), which is empty at 
the moment.
   
   I'll think more about this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to