forked from cockroachdb/cockroach
-
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.
This introduces the concept of an Engine specific for use in a log store. In other words, it's the beginnings of a logical separation of the state machine and log engines, i.e. cockroachdb#16624. For now, both continue to be backed by the same storage.Engine, and LogEngine is not correctly used in all places. For example, snapshot application hasn't yet been updated to account for the possibility of two separate engines and writes a set of SSTS that is atomically ingested into the single engine currently present but which logically spans both engines (cockroachdb#93251). Epic: CRDB-220 Release note: None
- Loading branch information
Showing
10 changed files
with
68 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package logstore | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/storage" | ||
|
||
// Engine is the interface through which the log store interacts with the | ||
// storage engine. | ||
// | ||
// This is identical to storage.Engine but extends it with a marker such that | ||
// callers can be deliberate about the separation between the log engine and | ||
// the state machine engine. | ||
type Engine interface { | ||
storage.Engine | ||
logStoreEngine() | ||
} | ||
|
||
type logEngine struct { | ||
storage.Engine | ||
} | ||
|
||
func (eng *logEngine) logStoreEngine() {} | ||
|
||
// NewLogEngine wraps the provided storage.Engine as an Engine. | ||
func NewLogEngine(eng storage.Engine) Engine { | ||
return &logEngine{Engine: eng} | ||
} |
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