public void closeReaderOrWriter ( long sessionId , long blockId ) throws IOException { BlockInfo blockInfo ; try ( LockResource lr = new LockResource ( mLock ) ) { blockInfo = mBlocks . get ( new Key ( sessionId , blockId ) ) ; if ( blockInfo == null ) { LOG . warn ( "Key (block ID: {}, session ID {}) is not found when cleaning up the UFS block." , blockId , sessionId ) ; return ; } } blockInfo . closeReaderOrWriter ( ) ; }
Closes the block reader or writer and checks whether it is necessary to commit the block to Local block store .