Skip to content
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
12 changes: 9 additions & 3 deletions src/Service/KeeperCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ using ThreadPoolPtr = std::shared_ptr<ThreadPool>;
MULTI_READ,
CHECK_NOT_EXISTS,
CREATE_IF_NOT_EXISTS,
REMOVE_RECURSIVE,
CHECK_STAT,
TRY_REMOVE,
LIST_WITH_STAT_AND_DATA,
GET_CHILDREN_RECURSIVE,
MAX,
};

Expand All @@ -60,9 +65,10 @@ using ThreadPoolPtr = std::shared_ptr<ThreadPool>;
};

inline constexpr auto CURRENT_KEEPER_API_VERSION = KeeperApiVersion::WITH_MULTI_READ;
// 0b11110000 enable FILTERED_LIST & MULTI_READ & CHECK_NOT_EXISTS & CREATE_IF_NOT_EXISTS,
// For example, set 0b10110000 to disable MULTI_READ
inline const std::string CURRENT_KEEPER_FEATURE_FLAGS = "\xF0";
// 0b11111111 0b10000000 enable all 9 feature flags:
// FILTERED_LIST, MULTI_READ, CHECK_NOT_EXISTS, CREATE_IF_NOT_EXISTS,
// REMOVE_RECURSIVE, CHECK_STAT, TRY_REMOVE, LIST_WITH_STAT_AND_DATA, GET_CHILDREN_RECURSIVE
inline const std::string CURRENT_KEEPER_FEATURE_FLAGS = "\xFF\x80";
#endif

struct RequestId;
Expand Down
382 changes: 358 additions & 24 deletions src/Service/KeeperStore.cpp

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/Service/WatchManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ void WatchManager::registerWatches(const String & path, int64_t session_id, Coor
std::lock_guard lock(watch_mutex);
auto watches_type = opnum == Coordination::OpNum::List
|| opnum == Coordination::OpNum::SimpleList
|| opnum == Coordination::OpNum::FilteredList ? WatchType::List : WatchType::Data;
|| opnum == Coordination::OpNum::FilteredList
|| opnum == Coordination::OpNum::FilteredListWithStatsAndData ? WatchType::List : WatchType::Data;

switch (watches_type)
{
Expand All @@ -37,6 +38,7 @@ ResponsesForSessions WatchManager::processWatches(const String & path, Coordinat
case Coordination::OpNum::Create:
return processWatches(path, Coordination::Event::CREATED);
case Coordination::OpNum::Remove:
case Coordination::OpNum::TryRemove:
return processWatches(path, Coordination::Event::DELETED);
case Coordination::OpNum::Set:
return processWatches(path, Coordination::Event::CHANGED);
Expand Down
Loading
Loading