Lines Matching refs:group

99     auto group = AddWatcherGroup(keyPrefix);  in AddWatcher()  local
100 WATCHER_CHECK(group != nullptr, return -1, "Failed to create group for %s", keyPrefix.c_str()); in AddWatcher()
103 bool newGroup = group->Empty(); in AddWatcher()
104 AddParamWatcher(group, remoteWatcher); in AddWatcher()
107 SendMessage(group, MSG_ADD_WATCHER); in AddWatcher()
112 keyPrefix.c_str(), remoteWatcherId, group->GetGroupId()); in AddWatcher()
120 auto group = GetWatcherGroup(keyPrefix); in DelWatcher() local
121 WATCHER_CHECK(group != nullptr, return 0, "Can not find group %s", keyPrefix.c_str()); in DelWatcher()
129 DelParamWatcher(group, remoteWatcher); in DelWatcher()
130 if (group->Empty()) { // no watcher, so delete it in DelWatcher()
131 SendMessage(group, MSG_DEL_WATCHER); in DelWatcher()
132 DelWatcherGroup(group); in DelWatcher()
148 auto group = GetWatcherGroup(keyPrefix); in RefreshWatcher() local
149 WATCHER_CHECK(group != nullptr, return 0, "Can not find group %s", keyPrefix.c_str()); in RefreshWatcher()
154 int WatcherManager::SendMessage(WatcherGroupPtr group, int type) in SendMessage() argument
157 std::string key(group->GetKeyPrefix()); in SendMessage()
163 request->id.watcherId = group->GetGroupId(); in SendMessage()
176 …WATCHER_CHECK(ret == 0, return ret, "SendMessage key: %s %d fail!", group->GetKeyPrefix().c_str(),… in SendMessage()
217 WatcherGroupPtr group = GetWatcherGroup(msg->id.watcherId); in ProcessWatcherMessage() local
218 … WATCHER_CHECK(group != NULL, return, "Can not find group for %u %s", msg->id.watcherId, msg->key); in ProcessWatcherMessage()
219 if (!FilterParam(msg->key, group->GetKeyPrefix())) { in ProcessWatcherMessage()
220 … WATCHER_LOGV("Invalid message name '%s' group '%s' ", msg->key, group->GetKeyPrefix().c_str()); in ProcessWatcherMessage()
223 group->ProcessParameterChange(this, msg->key, valueContent->content); in ProcessWatcherMessage()
406 auto group = GetWatcherGroup(node->GetNodeId()); in OnRemoteDied() local
407 if (group == nullptr) { in OnRemoteDied()
411 DelParamWatcher(group, remoteWatcher); in OnRemoteDied()
412 if (group->Empty()) { // no watcher, so delete it in OnRemoteDied()
413 SendMessage(group, MSG_DEL_WATCHER); in OnRemoteDied()
414 DelWatcherGroup(group); in OnRemoteDied()
466 auto group = it->second; in DumpAllGroup() local
467 dprintf(fd, "Watch prefix : %s \n", group->GetKeyPrefix().c_str()); in DumpAllGroup()
468 dprintf(fd, "Watch group id : %u \n", group->GetGroupId()); in DumpAllGroup()
469 dprintf(fd, "Watch count : %u \n", group->GetNodeCount()); in DumpAllGroup()
470 group->TraversalNode(dumpHandle); in DumpAllGroup()
471 count += group->GetNodeCount(); in DumpAllGroup()
512 auto group = GetWatcherGroup(params[1]); in Dump() local
513 if (group == NULL) { in Dump()
518 group->TraversalNode(dumpParamWatcher); in Dump()
532 auto group = ConvertTo<WatcherGroup>(node); in Clear() local
533 WATCHER_LOGV("Delete watcher group %u", group->GetGroupId()); in Clear()
534 delete group; in Clear()
574 int WatcherManager::AddParamWatcher(WatcherGroupPtr group, RemoteWatcherPtr remoteWatcher) in AddParamWatcher() argument
576 WatcherNodePtr nodeGroup = new ParamWatcher(group->GetGroupId()); in AddParamWatcher()
581 group->AddNode(nodeRemote); in AddParamWatcher()
586 int WatcherManager::DelParamWatcher(WatcherGroupPtr group, RemoteWatcherPtr remoteWatcher) in DelParamWatcher() argument
589 remoteWatcher->GetRemoteWatcherId(), group->GetGroupId()); in DelParamWatcher()
590 WatcherNodePtr node = group->GetNode(remoteWatcher->GetRemoteWatcherId()); in DelParamWatcher()
592 group->RemoveNode(node); in DelParamWatcher()
595 node = remoteWatcher->GetNode(group->GetGroupId()); in DelParamWatcher()
618 WatcherGroupPtr group = new WatcherGroup(groupId, keyPrefix); in AddWatcherGroup() local
619 …WATCHER_CHECK(group != nullptr, return nullptr, "Failed to create group for %s", keyPrefix.c_str()… in AddWatcherGroup()
620 watcherGroups_->AddNode(ConvertTo<WatcherNode>(group)); in AddWatcherGroup()
621 groupMap_[keyPrefix] = group; in AddWatcherGroup()
622 return group; in AddWatcherGroup()
645 void WatcherManager::DelWatcherGroup(WatcherGroupPtr group) in DelWatcherGroup() argument
648 WATCHER_LOGI("Delete watcher group %s %u", group->GetKeyPrefix().c_str(), group->GetGroupId()); in DelWatcherGroup()
649 watcherGroups_->RemoveNode(ConvertTo<WatcherNode>(group)); in DelWatcherGroup()
650 auto it = groupMap_.find(group->GetKeyPrefix()); in DelWatcherGroup()
654 delete group; in DelWatcherGroup()