void close(boolean skipDiskFlush) throws StoreException {
    long startTimeInMs = time.milliseconds();
    try {
      if (persistorTask != null) {
        persistorTask.cancel(false);
      }
      if (!skipDiskFlush) {
        persistor.write();
        if (hardDeleter != null) {
          try {
            hardDeleter.shutdown();
          } catch (Exception e) {
            logger.error("Index : {} error while persisting cleanup token", dataDir, e);
          }
        }
        try {
          cleanShutdownFile.createNewFile();
          if (config.storeSetFilePermissionEnabled) {
            Files.setPosixFilePermissions(cleanShutdownFile.toPath(), config.storeOperationFilePermission);
          }
        } catch (IOException e) {
          logger.error("Index : {} error while creating clean shutdown file", dataDir, e);
        }
      }
    } finally {
      metrics.indexShutdownTimeInMs.update(time.milliseconds() - startTimeInMs);
    }
  }
Closes the index
@param skipDiskFlush whether to skip any disk flush operations.
@throws StoreException
ambry-store/src/main/java/com/github/ambry/store/PersistentIndex.java