Improved overflow support: Indexing rescanner#26
Conversation
…tches' into improved-overflow-support/indexing-rescanner
…support/indexing-rescanner
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## improved-overflow-support-main #26 +/- ##
==================================================================
+ Coverage 80.0% 80.1% +0.1%
- Complexity 110 120 +10
==================================================================
Files 14 16 +2
Lines 486 539 +53
Branches 47 53 +6
==================================================================
+ Hits 389 432 +43
- Misses 69 75 +6
- Partials 28 32 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sungshik
left a comment
There was a problem hiding this comment.
Clarifying comments
src/main/java/engineering/swat/watch/impl/overflows/IndexingRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/MemorylessRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/MemorylessRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/MemorylessRescanner.java
Show resolved
Hide resolved
DavyLandman
left a comment
There was a problem hiding this comment.
On first glance it looks good. I'm curious about the perf impacts of this.
I'm curious what the effect is of replacing the existing one this one?
As in, this code is not yet run in the torture test.
src/main/java/engineering/swat/watch/impl/overflows/IndexingRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/IndexingRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/MemorylessRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/MemorylessRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/IndexingRescanner.java
Outdated
Show resolved
Hide resolved
sungshik
left a comment
There was a problem hiding this comment.
Thanks for the review! The low-hanging fruit is done. I'm leaving one conversation open and will first experiment a bit with performance.
src/main/java/engineering/swat/watch/impl/overflows/IndexingRescanner.java
Show resolved
Hide resolved
src/main/java/engineering/swat/watch/impl/overflows/IndexingRescanner.java
Show resolved
Hide resolved
79bc0b0 to
924492d
Compare
Regarding performance...There happen to be two torture tests that use a non-recursive directory watch, so I ran them with/without indexing (repeated 20x). Here are the preliminary/anecdotal results, just to get a rough idea:
A working hypothesis to explain the difference is that Test 1 has 2000 threads that concurrently try to access the file system to index the test directory, while Test 2 has only 4 such threads. In the spirt of "many small PRs", I'll go ahead and merge this one, and I'll add a TODO to #20 to separately conduct a more serious comparison (see also this comment) to understand the performance tradeoff, and optimize if needed/possible. |
This PR implements the generation of synthetic
CREATED/MODIFIED/DELETEDevents forDIRTYfiles to auto-handle overflow events. There are two new classes:IndexingRescannerandBaseFileVisitor. To conveniently reuse some of the functionality ofMemorylessRescanner, there are refactoring-kind-of changes in that class, too.