code: protected void setReadWrite() throws IOException
     {
        // Release all the current threads
        synchronized (updateMonitor)
        {
           indexUpdateMonitor.setUpdateInProgress(false, true);
           updateMonitor.notifyAll();
           releaseMultiReader();
        }
  
        this.redoLog = new RedoLog(indexDir);
        redoLogApplied = redoLog.hasEntries();
  
        // run recovery
        Recovery.run(this, redoLog);
  
        // enqueue unused segments for deletion
        enqueueUnusedSegments();
        attemptDelete();
  
        // now that we are ready, start index merger
        initMerger();
  
        if (redoLogApplied)
        {
           // wait for the index merge to finish pending jobs
           try
           {
              merger.waitUntilIdle();
           }
           catch (InterruptedException e)
           {
              // move on
           }
           flush();
        }
  
        if (indexNames.size() > 0)
        {
           scheduleFlushTask();
        }
     }
docs: Sets mode to READ_WRITE, initiating recovery process
  
  @throws IOException