ovsdb-monitor: add json cache
authorAndy Zhou <azhou@nicira.com>
Mon, 16 Mar 2015 22:45:27 +0000 (15:45 -0700)
committerAndy Zhou <azhou@nicira.com>
Mon, 8 Jun 2015 21:28:23 +0000 (14:28 -0700)
commit4c2809787cdbc774428253e2596c15d9daa76898
tree65a4a88ee602a24104b4ad92f637021c98e5cf83
parent6e5a9216f3a16c2de508dbaf960c643219d45fa6
ovsdb-monitor: add json cache

Although multiple jsonrpc monitors can share the same ovsdb monitor,
each change still needs to translated into json object from scratch.
This can be wasteful if multiple jsonrpc monitors are interested in the
same changes.

Json cache improves this by keeping an copy of json object generated
for transaction X to current transaction. When jsonrpc is interested
in a change, the cache is searched first, if an json object is found,
a copy of it is handed back, skipping the regeneration process.

Any commit to the monitor will empty the cache. This can be further
optimized to not throw away the cache if the updated tables and columns
are not being monitored.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovsdb/jsonrpc-server.c
ovsdb/monitor.c
ovsdb/monitor.h