void reloadLog(boolean initIndex) throws IOException, StoreException {
    long segmentCapacity = log.getSegmentCapacity();
    if (index != null) {
      index.close(false);
    }
    log.close(false);
    log = new Log(tempDirStr, LOG_CAPACITY, StoreTestUtils.DEFAULT_DISK_SPACE_ALLOCATOR,
        createStoreConfig(segmentCapacity, true), metrics, null);
    index = null;
    if (initIndex) {
      initIndex(null);
    }
  }
Reloads the log and index by closing and recreating the class variables.
@param initIndex creates the index instance if {@code true}, if not, sets {@link #index} to {@code null} and it
                 has to be initialized with a call to {@link #initIndex(ScheduledExecutorService)}.
@throws IOException
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/CuratedLogIndexState.java