Hadoop-17413. Release elastic byte buffer pool at close

- Contributed by Sneha Vijayarajan
This commit is contained in:
Sneha Vijayarajan 2020-12-15 10:15:37 +05:30 committed by GitHub
parent 0da00fc743
commit 5bf977e6b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,7 @@ public class AbfsOutputStream extends OutputStream implements Syncable, StreamCa
* blocks. After the data is sent to the service, the buffer is returned
* back to the queue
*/
private final ElasticByteBufferPool byteBufferPool
private ElasticByteBufferPool byteBufferPool
= new ElasticByteBufferPool();
private final Statistics statistics;
@ -297,6 +297,7 @@ public class AbfsOutputStream extends OutputStream implements Syncable, StreamCa
bufferIndex = 0;
closed = true;
writeOperations.clear();
byteBufferPool = null;
if (!threadExecutor.isShutdown()) {
threadExecutor.shutdownNow();
}