code: private Action executeAndLog(final Action a) throws IOException
     {
        a.execute(MultiIndex.this);
        redoLog.append(a);
        // please note that flushing the redo log is only required on
        // commit, but we also want to keep track of new indexes for sure.
        // otherwise it might happen that unused index folders are orphaned
        // after a crash.
        if (a.getType() == Action.TYPE_COMMIT || a.getType() == Action.TYPE_ADD_INDEX)
        {
           redoLog.flush();
        }
        return a;
     }
docs: Executes action <code>a</code> and appends the action to the redo log if
  successful.
  
  @param a
  the <code>Action</code> to execute.
  @return the executed action.
  @throws IOException
  if an error occurs while executing the action or appending
  the action to the redo log.