forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
objstorageprovider: use cache in ReadAt
This commit adds code to optionally use the shared cache when reading from an object. When the read is for a compaction, we don't want to populate the cache (but we do want to read from it if the data is already there).
- Loading branch information
1 parent
bceae16
commit f98d3df
Showing
13 changed files
with
122 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
objstorage/objstorageprovider/sharedcache/testdata/cache/compaction_reads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
write 200000 | ||
---- | ||
|
||
read 10000 1024 | ||
---- | ||
misses=1 | ||
|
||
# This should be in the cache. | ||
read-for-compaction 2000 4096 | ||
---- | ||
misses=0 | ||
|
||
# This should miss the cache. | ||
read-for-compaction 100000 4096 | ||
---- | ||
misses=1 | ||
|
||
# This should miss the cache again - we don't populate the cache when doing | ||
# compaction reads. | ||
read-for-compaction 100000 4096 | ||
---- | ||
misses=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ misses=1 | |
|
||
read 3145671 57 | ||
---- | ||
misses=1 | ||
misses=0 |
Oops, something went wrong.