LCOV - code coverage report
Current view: top level - vnsw/agent/resource_manager - mirror_index.cc (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 0 18 0.0 %
Date: 2026-11-09 02:10:49 Functions: 0 3 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
       3             :  * Copyright Contributors to the OpenSDN project
       4             :  */
       5             : 
       6             : #include "cmn/agent.h"
       7             : #include "cmn/agent_cmn.h"
       8             : #include <sandesh/sandesh_types.h>
       9             : #include <sandesh/sandesh.h>
      10             : #include "resource_manager/resource_manager.h"
      11             : #include "resource_manager/resource_table.h"
      12             : #include "resource_manager/resource_cmn.h"
      13             : #include "mirror_index.h"
      14             : #include "resource_manager/resource_manager_types.h"
      15             : #include "resource_manager/resource_backup.h"
      16             : 
      17           0 : MirrorIndexResourceKey::MirrorIndexResourceKey (ResourceManager *rm,
      18           0 :     const string& analyzer_name):IndexResourceKey(rm, Resource::MIRROR_INDEX),
      19           0 :     analyzer_name_(analyzer_name) {
      20             : 
      21           0 : }
      22             : 
      23           0 : void MirrorIndexResourceKey::Backup(ResourceData *data, uint16_t op){
      24           0 :     IndexResourceData *index_data = static_cast<IndexResourceData *>(data);
      25           0 :     if (op == ResourceBackupReq::DEL) {
      26             :         rm()->backup_mgr()->
      27           0 :            sandesh_maps().DeleteMirrorResourceEntry(index_data->index());
      28             :     } else {
      29           0 :         MirrorIndexResource backup_data;
      30           0 :         backup_data.set_analyzer_name(analyzer_name_);
      31           0 :         backup_data.set_time_stamp(UTCTimestampUsec());
      32             :         rm()->backup_mgr()->
      33           0 :             sandesh_maps().AddMirrorResourceEntry(index_data->index(),
      34             :                                                          backup_data);
      35           0 :     }
      36           0 :     rm()->backup_mgr()->sandesh_maps().mirror_index_table().TriggerBackup();
      37             : 
      38           0 : }
      39             : 
      40           0 : bool MirrorIndexResourceKey::IsLess(const ResourceKey &rhs) const {
      41           0 :     const MirrorIndexResourceKey * key =
      42             :         static_cast<const MirrorIndexResourceKey*> (&rhs);
      43           0 :     return analyzer_name_ < key->analyzer_name_;
      44             : }

Generated by: LCOV version 1.14