-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Adding an option to subscribe using Patches instead. Utilizing FsdbSubManager which handles the data parsing for us. Once I have confidence of the functionality here, I will benchmark the difference and clean up the old Path subscription The LoadBalancer change was needed to work with some of these visitors. Cannot have a dependant type named Fields which overshadowes the actual Fields struct Differential Revision: D58571195 fbshipit-source-id: 3bb8eaa05fce9e85e85963ebead78c152e80c8e6
- Loading branch information
1 parent
ebd90b6
commit e5805ea
Showing
10 changed files
with
190 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
#include "fboss/agent/FsdbAdaptedSubManager.h" | ||
|
||
namespace facebook::fboss { | ||
|
||
template class fsdb::FsdbSubManager< | ||
fsdb::CowStorage<fsdb::FsdbOperStateRoot, FsdbOperStateRoot>, | ||
true /* IsCow */>; | ||
|
||
} // namespace facebook::fboss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
#pragma once | ||
|
||
#include "fboss/agent/state/SwitchState.h" | ||
#include "fboss/fsdb/client/FsdbSubManager.h" | ||
#include "fboss/fsdb/if/FsdbModel.h" | ||
#include "fboss/thrift_cow/storage/CowStorage.h" | ||
|
||
namespace facebook::fboss { | ||
|
||
/* | ||
Creating an instantiation of FsdbSubManager that returns fully adapted | ||
SwitchState types. To do this, first we have to adapt all the way to fsdb root | ||
*/ | ||
|
||
using k_fsdb_model = fsdb::fsdb_model_tags::strings; | ||
|
||
class AgentData; | ||
RESOLVE_STRUCT_MEMBER(AgentData, k_fsdb_model::switchState, SwitchState); | ||
class AgentData : public ThriftStructNode<AgentData, fsdb::AgentData> { | ||
public: | ||
using BaseT = ThriftStructNode<AgentData, fsdb::AgentData>; | ||
using BaseT::modify; | ||
// Inherit the constructors required for clone() | ||
using BaseT::BaseT; | ||
friend class CloneAllocator; | ||
}; | ||
|
||
class FsdbOperStateRoot; | ||
RESOLVE_STRUCT_MEMBER(FsdbOperStateRoot, k_fsdb_model::agent, AgentData); | ||
class FsdbOperStateRoot | ||
: public ThriftStructNode<FsdbOperStateRoot, fsdb::FsdbOperStateRoot> { | ||
public: | ||
using BaseT = ThriftStructNode<FsdbOperStateRoot, fsdb::FsdbOperStateRoot>; | ||
using BaseT::modify; | ||
// Inherit the constructors required for clone() | ||
using BaseT::BaseT; | ||
friend class CloneAllocator; | ||
}; | ||
|
||
extern template class fsdb::FsdbSubManager< | ||
fsdb::CowStorage<fsdb::FsdbOperStateRoot, FsdbOperStateRoot>, | ||
true /* IsCow */>; | ||
using FsdbAdaptedSubManager = fsdb::FsdbSubManager< | ||
fsdb::CowStorage<fsdb::FsdbOperStateRoot, FsdbOperStateRoot>, | ||
true /* IsCow */>; | ||
|
||
} // namespace facebook::fboss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters