|
OpenSDN source code
|
#include <db_table.h>


Classes | |
| class | TableWalker |
| class | WalkWorker |
Public Types | |
| typedef boost::intrusive_ptr< DBTableWalk > | DBTableWalkRef |
| typedef boost::function< bool(DBTablePartBase *, DBEntryBase *)> | WalkFn |
| typedef boost::function< void(DBTableWalkRef, DBTableBase *)> | WalkCompleteFn |
Public Types inherited from DBTableBase | |
| typedef boost::function< void(DBTablePartBase *, DBEntryBase *)> | ChangeCallback |
| typedef int | ListenerId |
Public Member Functions | |
| DBTable (DB *db, const std::string &name) | |
| virtual | ~DBTable () |
| void | Init () |
| virtual std::unique_ptr< DBEntry > | AllocEntry (const DBRequestKey *key) const =0 |
| virtual size_t | Hash (const DBEntry *entry) const |
| virtual size_t | Hash (const DBRequestKey *key) const |
| virtual DBTablePartition * | AllocPartition (int index) |
| virtual void | Input (DBTablePartition *tbl_partition, DBClient *client, DBRequest *req) |
| virtual DBEntry * | Add (const DBRequest *req) |
| virtual bool | OnChange (DBEntry *entry, const DBRequest *req) |
| virtual bool | Delete (DBEntry *entry, const DBRequest *req) |
| void | NotifyAllEntries () |
| DBEntry * | Find (const DBEntry *entry) |
| const DBEntry * | Find (const DBEntry *entry) const |
| DBEntry * | Find (const DBRequestKey *key, int id=-1) |
| const DBEntry * | Find (const DBRequestKey *key, int id=-1) const |
| DBEntry * | FindNoLock (const DBEntry *entry) |
| DBEntry * | FindNoLock (const DBRequestKey *key) |
| virtual DBTablePartBase * | GetTablePartition (const DBRequestKey *key) |
| virtual const DBTablePartBase * | GetTablePartition (const DBRequestKey *key) const |
| virtual DBTablePartBase * | GetTablePartition (const DBEntryBase *entry) |
| virtual const DBTablePartBase * | GetTablePartition (const DBEntryBase *entry) const |
| virtual DBTablePartBase * | GetTablePartition (const int index) |
| virtual const DBTablePartBase * | GetTablePartition (const int index) const |
| virtual void | Change (DBEntryBase *entry) |
| virtual int | PartitionCount () const |
| virtual size_t | Size () const |
| DBTableWalkRef | AllocWalker (WalkFn walk_fn, WalkCompleteFn walk_complete) |
| void | ReleaseWalker (DBTableWalkRef &walk) |
| void | WalkTable (DBTableWalkRef walk) |
| void | WalkAgain (DBTableWalkRef walk) |
| void | SetWalkIterationToYield (int count) |
| int | GetWalkIterationToYield () |
| void | SetWalkTaskId (int task_id) |
| int | GetWalkerTaskId () |
Public Member Functions inherited from DBTableBase | |
| DBTableBase (DB *db, const std::string &name) | |
| virtual | ~DBTableBase () |
| bool | Enqueue (DBRequest *req) |
| void | EnqueueRemove (DBEntryBase *db_entry) |
| virtual void | AddRemoveCallback (const DBEntryBase *entry, bool add) const |
| ListenerId | Register (ChangeCallback callback, const std::string &name="unspecified") |
| void | Unregister (ListenerId listener) |
| void | RunNotify (DBTablePartBase *tpart, DBEntryBase *entry) |
| void | AddToDBStateCount (ListenerId listener, int count) |
| uint64_t | GetDBStateCount (ListenerId listener) |
| bool | empty () const |
| virtual void | RetryDelete () |
| virtual bool | MayDelete () const |
| DB * | database () |
| const DB * | database () const |
| const std::string & | name () const |
| bool | HasListeners () const |
| size_t | GetListenerCount () const |
| void | FillListeners (std::vector< ShowTableListener > *listeners) const |
| uint64_t | enqueue_count () const |
| void | incr_enqueue_count () |
| void | reset_enqueue_count () |
| uint64_t | input_count () const |
| void | incr_input_count () |
| void | reset_input_count () |
| uint64_t | notify_count () const |
| void | incr_notify_count () |
| void | reset_notify_count () |
| bool | HasWalkers () const |
| uint64_t | walker_count () const |
| void | incr_walker_count () |
| uint64_t | decr_walker_count () |
| uint64_t | walk_request_count () const |
| uint64_t | walk_complete_count () const |
| uint64_t | walk_cancel_count () const |
| uint64_t | walk_again_count () const |
| uint64_t | walk_count () const |
| void | incr_walk_request_count () |
| void | incr_walk_complete_count () |
| void | incr_walk_cancel_count () |
| void | incr_walk_again_count () |
| void | incr_walk_count () |
Static Public Member Functions | |
| static void | DBStateClear (DBTable *table, ListenerId id) |
Static Public Attributes | |
| static const int | kIterationToYield = 256 |
Static Public Attributes inherited from DBTableBase | |
| static const int | kInvalidId = -1 |
Private Member Functions | |
| int | GetPartitionId (const DBRequestKey *key) |
| int | GetPartitionId (const DBEntry *entry) |
| void | StartWalk () |
| bool | InvokeWalkCb (DBTablePartBase *part, DBEntryBase *entry) |
| void | WalkDone () |
| bool | WalkCallback (DBTablePartBase *tpart, DBEntryBase *entry) |
| void | WalkCompleteCallback (DBTableBase *tbl_base) |
| DISALLOW_COPY_AND_ASSIGN (DBTable) | |
Static Private Member Functions | |
| static void | db_walker_wait () |
Private Attributes | |
| std::unique_ptr< TableWalker > | walker_ |
| std::vector< DBTablePartition * > | partitions_ |
| DBTable::DBTableWalkRef | walk_ref_ |
| int | walker_task_id_ |
| int | max_walk_iteration_to_yield_ |
Friends | |
| class | DBTableWalkMgr |
Definition at line 168 of file db_table.h.
| typedef boost::intrusive_ptr<DBTableWalk> DBTable::DBTableWalkRef |
Definition at line 170 of file db_table.h.
| typedef boost::function<void(DBTableWalkRef, DBTableBase *)> DBTable::WalkCompleteFn |
Definition at line 180 of file db_table.h.
| typedef boost::function<bool(DBTablePartBase *, DBEntryBase *)> DBTable::WalkFn |
Definition at line 177 of file db_table.h.
| DBTable::DBTable | ( | DB * | db, |
| const std::string & | name | ||
| ) |
Definition at line 389 of file db_table.cc.
|
virtual |
Reimplemented in ServiceInstanceTable, VxLanTable, VrfAssignTable, PhysicalDeviceVnTable, AgentOperDBTable, NextHopTable, MplsTable, MirrorTable, CryptTunnelTable, and PolicyTable.
Definition at line 430 of file db_table.cc.

|
pure virtual |
Implemented in ServiceInstanceTable, PolicySetTable, PolicyTable, IFMapServerTable, IFMapLinkTable, IFMapAgentTable, RTargetTable, MvpnTable, InetVpnTable, Inet6VpnTable, Inet6Table, InetTable, EvpnTable, ErmVpnTable, VxLanTable, VrfAssignTable, VrfTable, VnTable, VmTable, TagTable, SgTable, SecurityLoggingObjectTable, QosQueueTable, AgentQosConfigTable, PhysicalDeviceVnTable, PhysicalDeviceTable, NextHopTable, MulticastPolicyTable, MplsTable, MirrorTable, InterfaceTable, HealthCheckTable, ForwardingClassTable, CryptTunnelTable, BridgeDomainTable, AgentRouteTable, and AclTable.
|
virtual |
Reimplemented in AgentDBTable.
Definition at line 420 of file db_table.cc.
| DBTable::DBTableWalkRef DBTable::AllocWalker | ( | WalkFn | walk_fn, |
| WalkCompleteFn | walk_complete | ||
| ) |
|
virtual |
Implements DBTableBase.
Definition at line 434 of file db_table.cc.

|
inlinestaticprivate |
Definition at line 309 of file db_table.h.
|
static |
Reimplemented in ServiceInstanceTable, MirrorTable, VxLanTable, PhysicalDeviceVnTable, AgentOperDBTable, NextHopTable, MplsTable, CryptTunnelTable, and PolicyTable.
Definition at line 443 of file db_table.cc.
|
private |
| DBEntry * DBTable::Find | ( | const DBRequestKey * | key, |
| int | id = -1 |
||
| ) |
| const DBEntry * DBTable::Find | ( | const DBRequestKey * | key, |
| int | id = -1 |
||
| ) | const |
| DBEntry * DBTable::FindNoLock | ( | const DBRequestKey * | key | ) |
|
private |
|
private |
|
virtual |
Implements DBTableBase.
Definition at line 474 of file db_table.cc.

|
virtual |
|
virtual |
Implements DBTableBase.
Definition at line 463 of file db_table.cc.

|
virtual |
|
virtual |
Implements DBTableBase.
Definition at line 455 of file db_table.cc.
|
virtual |
Definition at line 459 of file db_table.cc.
|
inline |
Definition at line 300 of file db_table.h.
|
inline |
Definition at line 292 of file db_table.h.
|
inlinevirtual |
Reimplemented in VxLanTable, VrfAssignTable, VrfTable, VnTable, VmTable, TagTable, SgTable, QosQueueTable, AgentQosConfigTable, PhysicalDeviceVnTable, PhysicalDeviceTable, NextHopTable, MulticastPolicyTable, MplsTable, MirrorTable, InterfaceTable, HealthCheckTable, ForwardingClassTable, CryptTunnelTable, BridgeDomainTable, AgentRouteTable, PolicySetTable, PolicyTable, AclTable, RTargetTable, MvpnTable, InetVpnTable, Inet6VpnTable, Inet6Table, InetTable, EvpnTable, and ErmVpnTable.
Definition at line 196 of file db_table.h.
|
inlinevirtual |
Reimplemented in VxLanTable, VrfAssignTable, VrfTable, VnTable, VmTable, TagTable, SgTable, QosQueueTable, AgentQosConfigTable, PhysicalDeviceVnTable, PhysicalDeviceTable, NextHopTable, MulticastPolicyTable, MplsTable, MirrorTable, InterfaceTable, HealthCheckTable, ForwardingClassTable, CryptTunnelTable, BridgeDomainTable, AgentRouteTable, PolicySetTable, PolicyTable, AclTable, RTargetTable, MvpnTable, InetVpnTable, Inet6VpnTable, Inet6Table, InetTable, EvpnTable, and ErmVpnTable.
Definition at line 199 of file db_table.h.
| void DBTable::Init | ( | ) |
|
virtual |
Reimplemented in VrfTable, AgentDBTable, BgpTable, IFMapServerTable, IFMapLinkTable, IFMapAgentLinkTable, IFMapAgentTable, and AgentRouteTable.
Definition at line 543 of file db_table.cc.

|
private |
| void DBTable::NotifyAllEntries | ( | ) |
Reimplemented in ServiceInstanceTable, VxLanTable, VrfAssignTable, PhysicalDeviceVnTable, AgentOperDBTable, NextHopTable, MplsTable, MirrorTable, CryptTunnelTable, and PolicyTable.
Definition at line 439 of file db_table.cc.
|
virtual |
Reimplemented in AgentRouteTable, AgentDBTable, IFMapTable, IFMapLinkTable, MvpnTable, and ErmVpnTable.
Definition at line 447 of file db_table.cc.

| void DBTable::ReleaseWalker | ( | DBTable::DBTableWalkRef & | walk | ) |
|
inline |
Definition at line 288 of file db_table.h.
|
inline |
Definition at line 296 of file db_table.h.
|
virtual |
Reimplemented from DBTableBase.
Definition at line 534 of file db_table.cc.
|
private |
| void DBTable::WalkAgain | ( | DBTable::DBTableWalkRef | walk | ) |
|
private |
|
private |
Definition at line 606 of file db_table.cc.
|
private |
| void DBTable::WalkTable | ( | DBTable::DBTableWalkRef | walk | ) |
|
friend |
Definition at line 304 of file db_table.h.
|
static |
Definition at line 182 of file db_table.h.
|
private |
Definition at line 355 of file db_table.h.
|
private |
Definition at line 352 of file db_table.h.
|
private |
Definition at line 353 of file db_table.h.
|
private |
Definition at line 351 of file db_table.h.
|
private |
Definition at line 354 of file db_table.h.