2016-02-10 00:12:00 +01:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-16 01:03:42 +02: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-06 01:16:46 +02: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 05:44:08 +02:00
|
|
|
#include "file/filename.h"
|
2017-04-04 03:27:24 +02:00
|
|
|
#include "rocksdb/env.h"
|
2015-08-06 01:16:46 +02:00
|
|
|
|
|
|
|
namespace rocksdb {
|
|
|
|
|
|
|
|
Status GetInfoLogList(DB* db, std::vector<std::string>* info_log_list) {
|
|
|
|
if (!db) {
|
|
|
|
return Status::InvalidArgument("DB pointer is not valid");
|
|
|
|
}
|
2019-05-31 19:45:20 +02:00
|
|
|
std::string parent_path;
|
2015-08-06 01:16:46 +02:00
|
|
|
const Options& options = db->GetOptions();
|
2019-05-31 19:45:20 +02:00
|
|
|
return GetInfoLogFiles(options.env, options.db_log_dir, db->GetName(),
|
|
|
|
&parent_path, info_log_list);
|
2015-08-06 01:16:46 +02:00
|
|
|
}
|
|
|
|
} // namespace rocksdb
|