1
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file. See the AUTHORS file for names of contributors.
5
// File names used by DB code
7
#ifndef STORAGE_LEVELDB_DB_FILENAME_H_
8
#define STORAGE_LEVELDB_DB_FILENAME_H_
12
#include "leveldb/slice.h"
13
#include "leveldb/status.h"
14
#include "port/port.h"
27
kInfoLogFile // Either the current one, or an old one
30
// Return the name of the log file with the specified number
31
// in the db named by "dbname". The result will be prefixed with
33
extern std::string LogFileName(const std::string& dbname, uint64_t number);
35
// Return the name of the sstable with the specified number
36
// in the db named by "dbname". The result will be prefixed with
38
extern std::string TableFileName(const std::string& dbname, uint64_t number);
40
// Return the name of the descriptor file for the db named by
41
// "dbname" and the specified incarnation number. The result will be
42
// prefixed with "dbname".
43
extern std::string DescriptorFileName(const std::string& dbname,
46
// Return the name of the current file. This file contains the name
47
// of the current manifest file. The result will be prefixed with
49
extern std::string CurrentFileName(const std::string& dbname);
51
// Return the name of the lock file for the db named by
52
// "dbname". The result will be prefixed with "dbname".
53
extern std::string LockFileName(const std::string& dbname);
55
// Return the name of a temporary file owned by the db named "dbname".
56
// The result will be prefixed with "dbname".
57
extern std::string TempFileName(const std::string& dbname, uint64_t number);
59
// Return the name of the info log file for "dbname".
60
extern std::string InfoLogFileName(const std::string& dbname);
62
// Return the name of the old info log file for "dbname".
63
extern std::string OldInfoLogFileName(const std::string& dbname);
65
// If filename is a leveldb file, store the type of the file in *type.
66
// The number encoded in the filename is stored in *number. If the
67
// filename was successfully parsed, returns true. Else return false.
68
extern bool ParseFileName(const std::string& filename,
72
// Make the CURRENT file point to the descriptor file with the
74
extern Status SetCurrentFile(Env* env, const std::string& dbname,
75
uint64_t descriptor_number);
78
} // namespace leveldb
80
#endif // STORAGE_LEVELDB_DB_FILENAME_H_