Module solana_accounts_db::utils

source ·

Constants§

Functions§

  • To allow generating a bank snapshot directory with full state information, we need to hardlink account appendvec files from the runtime operation directory to a snapshot hardlink directory. This is to create the run/ and snapshot sub directories for an account_path provided by the user. These two sub directories are on the same file system partition to allow hard-linking.
  • For all account_paths, create the run/ and snapshot/ sub directories. If an account_path directory does not exist, create it. It returns (account_run_paths, account_snapshot_paths) or error
  • Creates directories if they do not exist, and canonicalizes the paths.
  • Delete the files and subdirectories in a directory. This is useful if the process does not have permission to delete the top level directory it might be able to delete the contents of that directory.
  • Delete directories/files asynchronously to avoid blocking on it. First, in sync context, check if the original path exists, if it does, rename the original path to *_to_be_deleted. If there’s an in-progress deleting thread for this path, return. Then spawn a thread to delete the renamed path.
  • Moves and asynchronously deletes the contents of a directory to avoid blocking on it. The directory is re-created after the move, and should now be empty.