Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename consensus directory to raftex #17

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ add_subdirectory(interface)
add_subdirectory(common)
add_subdirectory(dataman)
add_subdirectory(client)
#add_subdirectory(storage)
add_subdirectory(server)
add_subdirectory(console)
add_subdirectory(consensus)
add_subdirectory(raftex)
#add_subdirectory(storage)

add_dependencies(common third-party)
#add_dependencies(storage_engines common)
Expand Down
8 changes: 0 additions & 8 deletions consensus/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions consensus/Replica.cpp

This file was deleted.

148 changes: 0 additions & 148 deletions consensus/Replica.h

This file was deleted.

8 changes: 8 additions & 0 deletions raftex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
add_library(
raftex_obj OBJECT
FileBasedWal.cpp
)
add_dependencies(raftex_obj common)

add_subdirectory(test)

6 changes: 3 additions & 3 deletions consensus/FileBasedWal.cpp → raftex/FileBasedWal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* (found in the LICENSE.Apache file in the root directory)
*/

#include "consensus/FileBasedWal.h"
#include "raftex/FileBasedWal.h"
#include "fs/FileUtils.h"

namespace vesoft {
namespace vgraph {
namespace consensus {
namespace raftex {

using WalFileInfoPair = FileBasedWal::WalFiles::value_type;
using namespace vesoft::fs;
Expand Down Expand Up @@ -721,7 +721,7 @@ std::unique_ptr<LogIterator> FileBasedWal::iterator(LogID firstLogId) {
new internal::FileBasedWalIterator(shared_from_this(), firstLogId));
}

} // namespace consensus
} // namespace raftex
} // namespace vgraph
} // namespace vesoft

12 changes: 6 additions & 6 deletions consensus/FileBasedWal.h → raftex/FileBasedWal.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* (found in the LICENSE.Apache file in the root directory)
*/

#ifndef CONSENSUS_WAL_FILEBASEDWAL_H_
#define CONSENSUS_WAL_FILEBASEDWAL_H_
#ifndef RAFTEX_WAL_FILEBASEDWAL_H_
#define RAFTEX_WAL_FILEBASEDWAL_H_

#include "base/Base.h"
#include "base/Cord.h"
#include "consensus/Wal.h"
#include "raftex/Wal.h"

namespace vesoft {
namespace vgraph {
namespace consensus {
namespace raftex {

struct FileBasedWalPolicy {
// The life span of the log messages (number of seconds)
Expand Down Expand Up @@ -179,8 +179,8 @@ class FileBasedWal final : public Wal,
std::string msg);
};

} // namespace consensus
} // namespace raftex
} // namespace vgraph
} // namespace vesoft
#endif // CONSENSUS_WAL_FILEBASEDWAL_H_
#endif // RAFTEX_WAL_FILEBASEDWAL_H_

10 changes: 5 additions & 5 deletions consensus/LogIterator.h → raftex/LogIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* (found in the LICENSE.Apache file in the root directory)
*/

#ifndef CONSENSUS_LOGITERATOR_H_
#define CONSENSUS_LOGITERATOR_H_
#ifndef RAFTEX_LOGITERATOR_H_
#define RAFTEX_LOGITERATOR_H_

#include "base/Base.h"

namespace vesoft {
namespace vgraph {
namespace consensus {
namespace raftex {

class LogIterator {
public:
Expand All @@ -28,8 +28,8 @@ class LogIterator {
virtual std::string logMsg() const = 0;
};

} // namespace consensus
} // namespace raftex
} // namespace vgraph
} // namespace vesoft
#endif // CONSENSUS_LOGITERATOR_H_
#endif // RAFTEX_LOGITERATOR_H_

12 changes: 6 additions & 6 deletions consensus/Wal.h → raftex/Wal.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* (found in the LICENSE.Apache file in the root directory)
*/

#ifndef CONSENSUS_WAL_WAL_H_
#define CONSENSUS_WAL_WAL_H_
#ifndef RAFTEX_WAL_WAL_H_
#define RAFTEX_WAL_WAL_H_

#include "base/Base.h"
#include "consensus/LogIterator.h"
#include "raftex/LogIterator.h"

namespace vesoft {
namespace vgraph {
namespace consensus {
namespace raftex {

/**
* Base class for all WAL implementations
Expand All @@ -34,8 +34,8 @@ class Wal {
virtual std::unique_ptr<LogIterator> iterator(int64_t firstLogId) = 0;
};

} // namespace consensus
} // namespace raftex
} // namespace vgraph
} // namespace vesoft
#endif // CONSENSUS_WAL_WAL_H_
#endif // RAFTEX_WAL_WAL_H_

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_executable(
file_based_wal_test
FileBasedWalTest.cpp
$<TARGET_OBJECTS:consensus_obj>
$<TARGET_OBJECTS:raftex_obj>
$<TARGET_OBJECTS:base_obj>
$<TARGET_OBJECTS:thread_obj>
$<TARGET_OBJECTS:fs_obj>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

#include "base/Base.h"
#include <gtest/gtest.h>
#include "consensus/FileBasedWal.h"
#include "raftex/FileBasedWal.h"
#include "fs/TempDir.h"

namespace vesoft {
namespace vgraph {
namespace consensus {
namespace raftex {

using namespace vesoft::fs;

Expand Down