private void clearInternal ( boolean clearMeta ) { // Close all known segments for ( int segId = 0 , cnt = _segList . size ( ) ; segId < cnt ; segId ++ ) { Segment seg = _segList . get ( segId ) ; if ( seg != null ) { try { if ( seg . getMode ( ) == Segment . Mode . READ_WRITE ) { seg . force ( ) ; } seg . close ( false ) ; } catch ( IOException e ) { _log . warn ( "failed to close segment " + seg . getSegmentId ( ) ) ; } finally { _segList . set ( segId , null ) ; } } } if ( clearMeta ) { try { updateMeta ( ) ; } catch ( IOException e ) { _log . warn ( "failed to clear segment meta" ) ; } } _segList . clear ( ) ; _recycleList . clear ( ) ; }
Clears this SegmentManager .