2016-02-09 23:12:00 +00:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-15 23:03:42 +00:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2015-08-05 23:16:46 +00:00
|
|
|
//
|
|
|
|
// Copyright (c) 2012 Facebook.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "rocksdb/utilities/info_log_finder.h"
|
2019-05-30 03:44:08 +00:00
|
|
|
#include "file/filename.h"
|
2017-04-04 01:27:24 +00:00
|
|
|
#include "rocksdb/env.h"
|
2015-08-05 23:16:46 +00:00
|
|
|
|
2020-02-20 20:07:53 +00:00
|
|
|
namespace ROCKSDB_NAMESPACE {
|
2015-08-05 23:16:46 +00:00
|
|
|
|
|
|
|
Status GetInfoLogList(DB* db, std::vector<std::string>* info_log_list) {
|
|
|
|
if (!db) {
|
|
|
|
return Status::InvalidArgument("DB pointer is not valid");
|
|
|
|
}
|
2019-05-31 17:45:20 +00:00
|
|
|
std::string parent_path;
|
2015-08-05 23:16:46 +00:00
|
|
|
const Options& options = db->GetOptions();
|
2021-01-26 06:07:26 +00:00
|
|
|
return GetInfoLogFiles(options.env->GetFileSystem(), options.db_log_dir,
|
|
|
|
db->GetName(), &parent_path, info_log_list);
|
2015-08-05 23:16:46 +00:00
|
|
|
}
|
2020-02-20 20:07:53 +00:00
|
|
|
} // namespace ROCKSDB_NAMESPACE
|