@Override public void close() throws IOException { if (mClosed) { return; } try { if (mBlockIsRead) { mWorkerClient.accessBlock(mBlockId); ClientContext.getClientMetrics().incBlocksReadLocal(1); } mWorkerClient.unlockBlock(mBlockId); } catch (TachyonException e) { throw new IOException(e); } finally { mContext.releaseWorkerClient(mWorkerClient); mCloser.close(); if (mBuffer != null && mBuffer.isDirect()) { BufferUtils.cleanDirectBuffer(mBuffer); } } mClosed = true; }