diff --git a/src/Service/KeeperServer.cpp b/src/Service/KeeperServer.cpp index 4a7ca346261..34447322f21 100644 --- a/src/Service/KeeperServer.cpp +++ b/src/Service/KeeperServer.cpp @@ -1,14 +1,17 @@ #include #include + +#include + +#include +#include + #include #include #include #include -#include +#include #include -#include -#include -#include namespace RK { @@ -205,7 +208,7 @@ bool KeeperServer::updateSessionTimeout(int64_t session_id, int64_t session_time if (!result->get()) throw Exception(ErrorCodes::RAFT_ERROR, "Received nullptr when updating session timeout"); - auto buffer = ReadBufferFromNuraftBuffer(*result->get()); + auto buffer = ReadBufferFromNuRaftBuffer(*result->get()); int8_t is_success; Coordination::read(is_success, buffer); diff --git a/src/Service/NuRaftLogSnapshot.cpp b/src/Service/NuRaftLogSnapshot.cpp index ba3f04a0398..77bae3b2e0f 100644 --- a/src/Service/NuRaftLogSnapshot.cpp +++ b/src/Service/NuRaftLogSnapshot.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -710,7 +710,7 @@ bool KeeperSnapshotStore::parseObject(String obj_path, KeeperStore & store) //buf->put(data.data(), data.size()); buf->put(data); buf->pos(0); - ReadBufferFromNuraftBuffer in(buf); + ReadBufferFromNuRaftBuffer in(buf); ptr node = cs_new(); String key; try @@ -778,7 +778,7 @@ bool KeeperSnapshotStore::parseObject(String obj_path, KeeperStore & store) ptr buf = buffer::alloc(data.size() + 1); buf->put(data); buf->pos(0); - ReadBufferFromNuraftBuffer in(buf); + ReadBufferFromNuRaftBuffer in(buf); int64_t session_id; int64_t timeout; try @@ -823,7 +823,7 @@ bool KeeperSnapshotStore::parseObject(String obj_path, KeeperStore & store) ptr buf = buffer::alloc(data.size() + 1); buf->put(data); buf->pos(0); - ReadBufferFromNuraftBuffer in(buf); + ReadBufferFromNuRaftBuffer in(buf); uint64_t acl_id; Coordination::ACLs acls; @@ -845,7 +845,7 @@ bool KeeperSnapshotStore::parseObject(String obj_path, KeeperStore & store) ptr buf = buffer::alloc(data.size() + 1); buf->put(data); buf->pos(0); - ReadBufferFromNuraftBuffer in(buf); + ReadBufferFromNuRaftBuffer in(buf); String key; int64_t value; try diff --git a/src/Service/NuRaftStateMachine.cpp b/src/Service/NuRaftStateMachine.cpp index 06d9995546a..89de1d379f5 100644 --- a/src/Service/NuRaftStateMachine.cpp +++ b/src/Service/NuRaftStateMachine.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include @@ -104,7 +104,7 @@ ptr NuRaftStateMachine::createRequestSession(ptr & if (entry->get_val_type() != nuraft::log_val_type::app_log) return nullptr; - ReadBufferFromNuraftBuffer buffer(entry->get_buf()); + ReadBufferFromNuRaftBuffer buffer(entry->get_buf()); ptr request_for_session = cs_new(); readIntBinary(request_for_session->session_id, buffer); @@ -178,7 +178,7 @@ void NuRaftStateMachine::snapThread() RequestForSession NuRaftStateMachine::parseRequest(nuraft::buffer & data) { - ReadBufferFromNuraftBuffer buffer(data); + ReadBufferFromNuRaftBuffer buffer(data); RequestForSession request_for_session; /// TODO unify digital encoding mode readIntBinary(request_for_session.session_id, buffer); diff --git a/src/Service/ReadBufferFromNuraftBuffer.h b/src/Service/ReadBufferFromNuRaftBuffer.h similarity index 59% rename from src/Service/ReadBufferFromNuraftBuffer.h rename to src/Service/ReadBufferFromNuRaftBuffer.h index 29fc7961823..96ebe9461b8 100644 --- a/src/Service/ReadBufferFromNuraftBuffer.h +++ b/src/Service/ReadBufferFromNuRaftBuffer.h @@ -6,11 +6,11 @@ namespace RK { -class ReadBufferFromNuraftBuffer : public ReadBufferFromMemory +class ReadBufferFromNuRaftBuffer : public ReadBufferFromMemory { public: - explicit ReadBufferFromNuraftBuffer(nuraft::ptr buffer) : ReadBufferFromMemory(buffer->data_begin(), buffer->size()) { } - explicit ReadBufferFromNuraftBuffer(nuraft::buffer & buffer) : ReadBufferFromMemory(buffer.data_begin(), buffer.size()) { } + explicit ReadBufferFromNuRaftBuffer(nuraft::ptr buffer) : ReadBufferFromMemory(buffer->data_begin(), buffer->size()) { } + explicit ReadBufferFromNuRaftBuffer(nuraft::buffer & buffer) : ReadBufferFromMemory(buffer.data_begin(), buffer.size()) { } }; }