@ Override public synchronized void close ( ) throws IOException { if ( _mode == Mode . CLOSED ) { return ; } _mode = Mode . CLOSED ; try { // THE CALLS ORDERED. _compactor . shutdown ( ) ; // shutdown compactor /* Call syncInternal() to force update changes accumulated in * the last update batch and those generated by data compaction. */ syncInternal ( ) ; // consume compaction batches generated during shutdown /* Submit the current segment index buffer before closing _segmentManager * so that the last writer segment index buffer can be flushed to disk * when _segmentManager.close() is being invoked. */ submitSegmentIndexBuffer ( ) ; _compactor . clear ( ) ; // cleanup compactor internal state _addressArray . close ( ) ; // close address array _segmentManager . close ( ) ; // close segment manager } catch ( Exception e ) { _log . error ( "Failed to close" , e ) ; throw ( e instanceof IOException ) ? ( IOException ) e : new IOException ( e ) ; } finally { _mode = Mode . CLOSED ; _log . info ( "mode=" + _mode ) ; } }
Close to quit from serving requests .