veyron/services/store: Implement Object.WatchGlob().
WatchGlob is implemented with a new watch request processor,
globProcessor. globProcessor maintains a copy of the store state, which
it updates after every transaction. After every transaction,
globProcessor computes the set of names that match the pattern, and
sends changes for all names that have been deleted or updated.
Runtime is O(|path| + |matches|), and the memory used is
O(|store| + |matches|), per request.
This approach will fail at scale. We could improve performance by
1) tracking only matches, updating references after each transaction.
2) sharing the store state across requests.
WatchGlob returns values of type *store.Entry.
Other:
- add store/server.entryTransformStream, to transforms storage.Entry to
store.Entry.
- add primitives/object.entryTransformStream, to transforms store.Entry
to storage.Entry.
- add query.GlobIterator, for efficient access to the ids of matching
objects.
- expose cell.GetEntry.
- refactor watch test utils for better code reuse.
- add state.DeepCopy for testing.
Change-Id: Ifa3bd0bbfa9fd1259e4274e36cb71ec29c021241
16 files changed