Commit Graph

5070 Commits

Author SHA1 Message Date
David Glasser
16cc4edc07 make OplogTailer a real class 2013-12-02 19:17:42 -08:00
David Glasser
cf665da9d4 Update comments in observeChangesWithOplog 2013-12-02 19:17:42 -08:00
David Glasser
a6fc84aed8 It's now OK for MongoPollster constructor to yield 2013-12-02 19:17:42 -08:00
David Glasser
4fa09c32cd extract MongoPollster to its own file 2013-12-02 19:17:42 -08:00
David Glasser
67f9ce8b84 stream ALL initial adds
simplify internal state of ObserveMultiplexer
2013-12-02 19:17:41 -08:00
Slava Kim
97043de7e4 Move LOGICAL_OPERATORS back to file scope 2013-12-02 19:17:41 -08:00
Slava Kim
2a4189a32a Move _combineSelectorAndProjection to a separate file
Move _isSelectorAffectedByModifier and _canSelectorBecomeTrueByModifier
Exctract server-only files and tests to server-only part of the package
2013-12-02 19:17:41 -08:00
David Glasser
5953b30897 Stuff from in-person code review 2013-12-02 19:17:41 -08:00
David Glasser
f50f88f83d Minimize _noYieldsAllowed block
Previously, observeChangesWithOplog was in it, and it can yield (if we
need to wait for the global oplog handle to be ready)
2013-12-02 19:17:41 -08:00
David Glasser
3a73ccdc38 Fix use of crossbar 2013-12-02 19:17:41 -08:00
David Glasser
8f664a1236 Use "selector matches specific IDs" code in oplog 2013-12-02 19:17:41 -08:00
David Glasser
58e1749104 De-singletonize InvalidationCrossbar 2013-12-02 19:17:40 -08:00
Slava Kim
9a24e33002 Use LocalCollection._canSelectorBecomeTrueByModifier in oplog fetching pruning 2013-12-02 19:17:40 -08:00
Slava Kim
604a48f64f Implement _canSelectorBecomeTrueByModifier
Is used to prune unnecessary fetches in oplog tailing.
2013-12-02 19:17:40 -08:00
David Glasser
b9511cad19 Stream initial adds to the first handle
(and to any other handles added before any initial adds come in)
2013-12-02 19:17:40 -08:00
David Glasser
de5a92d51f Add a comment and assertion to _sendAdds 2013-12-02 19:17:40 -08:00
David Glasser
9d59058963 Refactor observe dedup; support it for oplog. 2013-12-02 19:17:40 -08:00
David Glasser
1d3d38d6b1 Refactor observe-from-observe-changes
Specifically, factor out the logic that keeps a cache of the current
cursor contents from the part that calls observe callbacks.

Also:
- move IdMap from mongo-livedata to minimongo
- get rid of references to the 'moved' callback which no longer exists
2013-12-02 19:17:40 -08:00
David Glasser
2527766ad6 Move observe-from-observe-changes into own file 2013-12-02 19:17:39 -08:00
David Glasser
e9e39d2cb2 Rename $OPLOG_URL to $MONGO_OPLOG_URL 2013-12-02 19:17:39 -08:00
Slava Kim
3a06be789e Merge branch 'oplog-clever-fields' into oplog 2013-12-02 19:17:39 -08:00
Slava Kim
b3cd37af59 Fix typos 2013-12-02 19:17:39 -08:00
Slava Kim
cc260af22d Handle the $where operator in the selector and projection combination 2013-12-02 19:17:39 -08:00
Slava Kim
d5ea98799d Tests on $where 2013-12-02 19:17:39 -08:00
Slava Kim
a8fd4eefb5 Make "getPathsWithoutNumericKeys" a package scope variable rather than globally available underscore method. 2013-12-02 19:17:39 -08:00
Slava Kim
891e3324ea Remove an outdated comment. Fix typos 2013-12-02 19:17:38 -08:00
Slava Kim
a39ce59c35 More tests on combining a selector with a fields projection:
A case when a selector has a path with numbered keys overlapping with fields.
2013-12-02 19:17:38 -08:00
Slava Kim
b1f8930630 Projection function never retains anything from passed doc.
Always does deep copy.
2013-12-02 19:17:38 -08:00
Slava Kim
74c9373d3a Define projection function contract: returned doc shouldn't retain anything from the passed argument. 2013-12-02 19:17:38 -08:00
Slava Kim
afb2aaece7 Filter out modified object
If modifier sets fields we don't like in cache, for example
2013-12-02 19:17:38 -08:00
Slava Kim
3a8c36e1de Test to catch modifier affecting fields projected out 2013-12-02 19:17:38 -08:00
Slava Kim
c126857968 Apply shared projection to anything stored in the cache. 2013-12-02 19:17:38 -08:00
Slava Kim
13a98748a1 Implement combine selector and projection for both including and excluding projections. 2013-12-02 19:17:37 -08:00
Slava Kim
ba674e98e8 Tests for exclusive projections.
TDD FTW
2013-12-02 19:17:37 -08:00
Slava Kim
24d1b31f52 Mark tests for inclusive projections 2013-12-02 19:17:37 -08:00
Slava Kim
3bf1e6a1a8 Fix error reporting 2013-12-02 19:17:37 -08:00
Slava Kim
3134595722 Tests for combination of selector and inclusive projection 2013-12-02 19:17:37 -08:00
Slava Kim
562b9823a8 Implement combinattion of selector and projection for inclusive projection. 2013-12-02 19:17:37 -08:00
Slava Kim
5851f19a7a Make conflictFn also a conflict resolution function 2013-12-02 19:17:37 -08:00
Slava Kim
0ee8f95452 Define interface for selector-fields merger 2013-12-02 19:17:37 -08:00
Slava Kim
8a4b58d987 More on deep/shallow cloning 2013-12-02 19:17:36 -08:00
Slava Kim
132221262c Refactor out the tree construction. 2013-12-02 19:17:36 -08:00
Slava Kim
034d2e628b Remove a couple of EJSON clones we don't need 2013-12-02 19:17:36 -08:00
David Glasser
254d7695bc Refactorings by slava. 2013-12-02 19:17:36 -08:00
Nick Martin
5f1b721823 Fix meteor run to look at the OPLOG_URL environment variable. 2013-12-02 19:17:36 -08:00
David Glasser
77b5631f42 Separate projection functions into separate file. 2013-12-02 19:17:36 -08:00
Slava Kim
8a00f1d713 Fix basic fields projection. 2013-12-02 19:17:36 -08:00
Slava Kim
2bbd69ad2c Tests to prove the basic fields implementation was wrong. 2013-12-02 19:17:35 -08:00
Slava Kim
e793c9d948 Remove unnecessary check.
This removed check will never be false as we pass the oplog selector that looks
for 'o.drop' and we assume that you can get only one command per oplog record.
2013-12-02 19:17:35 -08:00
Slava Kim
008c74df4b OPLOG_URL is accessed only by appConfig. 2013-12-02 19:17:35 -08:00