fork of https://github.com/oxigraph/rocksdb and https://github.com/facebook/rocksdb for nextgraph and oxigraph
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
995 B
49 lines
995 B
12 years ago
|
// Copyright 2008-present Facebook. All Rights Reserved.
|
||
|
|
||
|
#ifndef STORAGE_LEVELDB_DB_LOG_FILE_H_
|
||
|
#define STORAGE_LEVELDB_DB_LOG_FILE_H_
|
||
|
|
||
|
namespace leveldb {
|
||
|
|
||
|
enum WalFileType {
|
||
|
kArchivedLogFile = 0,
|
||
|
kAliveLogFile = 1
|
||
|
} ;
|
||
|
|
||
|
class LogFile {
|
||
|
|
||
|
public:
|
||
|
uint64_t logNumber;
|
||
|
WalFileType type;
|
||
|
|
||
|
LogFile(uint64_t logNum,WalFileType logType) :
|
||
|
logNumber(logNum),
|
||
|
type(logType) {}
|
||
|
|
||
|
LogFile(const LogFile& that) {
|
||
|
logNumber = that.logNumber;
|
||
|
type = that.type;
|
||
|
}
|
||
|
|
||
|
bool operator < (const LogFile& that) const {
|
||
|
return logNumber < that.logNumber;
|
||
|
}
|
||
|
|
||
|
std::string ToString() const {
|
||
|
char response[100];
|
||
|
const char* typeOfLog;
|
||
|
if (type == kAliveLogFile) {
|
||
|
typeOfLog = "Alive Log";
|
||
|
} else {
|
||
|
typeOfLog = "Archived Log";
|
||
|
}
|
||
|
sprintf(response,
|
||
|
"LogNumber : %ld LogType : %s",
|
||
|
logNumber,
|
||
|
typeOfLog);
|
||
|
return std::string(response);
|
||
|
}
|
||
|
};
|
||
|
} // namespace leveldb
|
||
|
#endif // STORAGE_LEVELDB_DB_LOG_FILE_H_
|