59 std::shared_ptr<CongestionReporter> congestionReporter);
61 IceFlow(
const std::string &dagFileName,
const std::string &nodeName,
64 IceFlow(
const std::string &dagFileName,
const std::string &nodeName,
66 std::shared_ptr<CongestionReporter> congestionReporter);
70 DAGParser dagParser,
const std::string &nodeName, ndn::Face &face,
71 std::optional<std::shared_ptr<CongestionReporter>> congestionReporter);
74 const std::string &dagFileName,
const std::string &nodeName,
76 std::optional<std::shared_ptr<CongestionReporter>> congestionReporter);
83 const std::string &getNodePrefix();
85 const std::string &getSyncPrefix();
87 void pushData(
const std::string &downstreamEdgeName,
88 std::vector<uint8_t> payload);
90 void registerConsumerCallback(
const std::string &upstreamEdgeName,
91 ConsumerCallback consumerCallback);
93 void registerProsumerCallback(
const std::string &upstreamEdgeName,
94 ProsumerCallback prosumerCallback);
96 void repartitionConsumer(
const std::string &upstreamEdgeName,
97 std::vector<uint32_t> partitions);
99 void repartitionProducer(
const std::string &downstreamEdgeName,
100 uint64_t numberOfPartitions);
102 std::unordered_map<std::string, EdgeConsumptionStats> getConsumerStats();
104 std::unordered_map<std::string, EdgeProductionStats> getProducerStats();
106 void reportCongestion(
const std::string &edgeName,
107 CongestionReason congestionReason);
109 std::vector<Edge> getDownstreamEdges();
111 std::optional<Edge> getDownstreamEdge(uint32_t index);
113 std::vector<Edge> getUpstreamEdges();
115 std::optional<Edge> getUpstreamEdge(uint32_t index);
117 nlohmann::json::object_t getApplicationConfiguration() {
118 return m_node.applicationConfiguration;
121 template <
typename T>
122 std::optional<T> getApplicationParameter(
const std::string &key) {
123 auto applicationConfiguration = getApplicationConfiguration();
125 if (!applicationConfiguration.contains(key)) {
130 auto value = applicationConfiguration.at(key).get<T>();
131 return std::optional(value);
139 onMissingData(
const std::vector<ndn::svs::MissingDataInfo> &missing_data);
142 ndn::KeyChain m_keyChain;
145 bool m_running =
false;
147 std::shared_ptr<ndn::svs::SVSPubSub> m_svsPubSub;
149 std::string m_nodePrefix;
150 std::string m_syncPrefix;
152 std::unordered_map<std::string, IceflowProducer> m_iceflowProducers;
154 std::unordered_map<std::string, IceflowConsumer> m_iceflowConsumers;
156 std::optional<std::shared_ptr<CongestionReporter>> m_congestionReporter;
160 std::vector<Edge> m_downstreamEdges;
162 std::vector<Edge> m_upstreamEdges;