krareT / pub-task

Terark public developing
MIT License
3 stars 6 forks source link

Add db change callback #34

Open rockeet opened 5 years ago

rockeet commented 5 years ago

In rocksdb, add a callback for db to notify db changes to application.

For example, in MyRocks, if MyRocks storage engine has states, and these states is used as cache for some metadata.

In distributed MyRocks, slave node read wal-log to sync master's change on db, thus the states for metadata cache may be staled. By db-change callback, these states can be updated.

This can also be implemented by slaver's wal-log syncer.