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
2 changes: 1 addition & 1 deletion orchagent/orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ vector<Selectable *> Orch::getSelectables()
return selectables;
}

bool Orch::hasSelectable(ConsumerStateTable *selectable) const
bool Orch::hasSelectable(TableConsumable *selectable) const
{
for(auto it : m_consumerMap) {
if (it.second.m_consumer == selectable) {
Expand Down
9 changes: 5 additions & 4 deletions orchagent/orch.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ extern "C" {
}

#include "dbconnector.h"
#include "table.h"
#include "consumertable.h"
#include "consumerstatetable.h"
#include "producerstatetable.h"

using namespace std;
using namespace swss;
Expand Down Expand Up @@ -40,8 +41,8 @@ typedef pair<string, object_map*> type_map_pair;

typedef map<string, KeyOpFieldsValuesTuple> SyncMap;
struct Consumer {
Consumer(ConsumerStateTable* consumer) :m_consumer(consumer) { }
ConsumerStateTable* m_consumer;
Consumer(TableConsumable* consumer) : m_consumer(consumer) { }
TableConsumable* m_consumer;
/* Store the latest 'golden' status */
SyncMap m_toSync;
};
Expand All @@ -65,7 +66,7 @@ class Orch
virtual ~Orch();

vector<Selectable*> getSelectables();
bool hasSelectable(ConsumerStateTable* s) const;
bool hasSelectable(TableConsumable* s) const;

bool execute(string tableName);
/* Iterate all consumers in m_consumerMap and run doTask(Consumer) */
Expand Down
7 changes: 4 additions & 3 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ void OrchDaemon::start()
continue;
}

Orch *o = getOrchByConsumer((ConsumerStateTable *)s);
o->execute(((ConsumerStateTable *)s)->getTableName());
TableConsumable *c = (TableConsumable *)s;
Orch *o = getOrchByConsumer(c);
o->execute(c->getTableName());

/* After each iteration, periodically check all m_toSync map to
* execute all the remaining tasks that need to be retried. */
Expand All @@ -151,7 +152,7 @@ void OrchDaemon::start()
}
}

Orch *OrchDaemon::getOrchByConsumer(ConsumerStateTable *c)
Orch *OrchDaemon::getOrchByConsumer(TableConsumable *c)
{
SWSS_LOG_ENTER();

Expand Down
2 changes: 1 addition & 1 deletion orchagent/orchdaemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OrchDaemon
std::vector<Orch *> m_orchList;
Select *m_select;

Orch *getOrchByConsumer(ConsumerStateTable *c);
Orch *getOrchByConsumer(TableConsumable *c);
void flush();
};

Expand Down