info_log_finder.cc 922 B

12345678910111213141516171819202122232425
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. //
  6. // Copyright (c) 2012 Facebook.
  7. // Use of this source code is governed by a BSD-style license that can be
  8. // found in the LICENSE file.
  9. #include "rocksdb/utilities/info_log_finder.h"
  10. #include "file/filename.h"
  11. #include "rocksdb/env.h"
  12. namespace ROCKSDB_NAMESPACE {
  13. Status GetInfoLogList(DB* db, std::vector<std::string>* info_log_list) {
  14. if (!db) {
  15. return Status::InvalidArgument("DB pointer is not valid");
  16. }
  17. std::string parent_path;
  18. const Options& options = db->GetOptions();
  19. return GetInfoLogFiles(options.env, options.db_log_dir, db->GetName(),
  20. &parent_path, info_log_list);
  21. }
  22. } // namespace ROCKSDB_NAMESPACE