-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstable: introduce objstorage interface
This change introduces `objstorage.Provider` which replaces uses of `vfs.FS` / `vfs.File` in sstable code. We pull out the write-buffering and read-ahead logic into the Provider implementation. This simplifies the sstable reader code considerably. The provider will be extended to support shared storage, along the following lines: - define a new `SharedObjectStore` interface - the Provider stores a `SharedObjectStore` instance - the Provider maintains internally a mapping from `FileNum` to backend type (local vs shared). Methods like `OpenForReading` use the mapping to talk to the correct backend. - `Create` needs to be augmented with extra information (e.g. LSM level?) to decide where a new object is created
- Loading branch information
1 parent
b418e86
commit 08787ac
Showing
36 changed files
with
1,022 additions
and
544 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2023 The LevelDB-Go and Pebble Authors. All rights reserved. Use | ||
// of this source code is governed by a BSD-style license that can be found in | ||
// the LICENSE file. | ||
|
||
package objstorage | ||
|
||
import "io" | ||
|
||
// NoopReadaheadHandle can be used by Readable implementations that don't | ||
// support read-ahead. | ||
type NoopReadaheadHandle struct { | ||
io.ReaderAt | ||
} | ||
|
||
// MakeNoopReadaheadHandle initializes a NoopReadaheadHandle. | ||
func MakeNoopReadaheadHandle(r io.ReaderAt) NoopReadaheadHandle { | ||
return NoopReadaheadHandle{ReaderAt: r} | ||
} | ||
|
||
var _ ReadaheadHandle = (*NoopReadaheadHandle)(nil) | ||
|
||
// Close is part of the ReadaheadHandle interface. | ||
func (*NoopReadaheadHandle) Close() error { return nil } | ||
|
||
// MaxReadahead is part of the ReadaheadHandle interface. | ||
func (*NoopReadaheadHandle) MaxReadahead() {} | ||
|
||
// RecordCacheHit is part of the ReadaheadHandle interface. | ||
func (*NoopReadaheadHandle) RecordCacheHit(offset, size int64) {} |
Oops, something went wrong.