Documentation
¶
Overview ¶
Package gcp contains a GCP-based storage implementation for Tessera.
TODO: decide whether to rename this package.
This storage implementation uses GCS for long-term storage and serving of entry bundles and log tiles, and Spanner for coordinating updates to GCS when multiple instances of a personality binary are running.
A single GCS bucket is used to hold entry bundles and log internal tiles. The object keys for the bucket are selected so as to conform to the expected layout of a tile-based log.
A Spanner database provides a transactional mechanism to allow multiple frontends to safely update the contents of the log.
Index ¶
- Constants
- func New(ctx context.Context, cfg Config) (tessera.Driver, error)
- type Appender
- type Config
- type LogReader
- func (lr *LogReader) IntegratedSize(ctx context.Context) (uint64, error)
- func (lr *LogReader) NextIndex(ctx context.Context) (uint64, error)
- func (lr *LogReader) ReadCheckpoint(ctx context.Context) ([]byte, error)
- func (lr *LogReader) ReadEntryBundle(ctx context.Context, i uint64, p uint8) ([]byte, error)
- func (lr *LogReader) ReadTile(ctx context.Context, l, i uint64, p uint8) ([]byte, error)
- func (lr *LogReader) StreamEntries(ctx context.Context, startEntry, N uint64) iter.Seq2[stream.Bundle, error]
- type MigrationStorage
- type Storage
Constants ¶
const ( DefaultIntegrationSizeLimit = 5 * 4096 // SchemaCompatibilityVersion represents the expected version (e.g. layout & serialisation) of stored data. // // A binary built with a given version of the Tessera library is compatible with stored data created by a different version // of the library if and only if this value is the same as the compatibilityVersion stored in the Tessera table. // // NOTE: if changing this version, you need to consider whether end-users are going to update their schema instances to be // compatible with the new format, and provide a means to do it if so. SchemaCompatibilityVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
Appender is an implementation of the Tessera appender lifecycle contract.
type Config ¶
type Config struct { // Bucket is the name of the GCS bucket to use for storing log state. Bucket string // BucketPrefix is an optional prefix to prepend to all log resource paths. // This can be used e.g. to store multiple logs in the same bucket. BucketPrefix string // Spanner is the GCP resource URI of the spanner database instance to use. Spanner string }
Config holds GCP project and resource configuration for a storage instance.
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
func (*LogReader) IntegratedSize ¶
func (*LogReader) ReadCheckpoint ¶
func (*LogReader) ReadEntryBundle ¶
type MigrationStorage ¶
type MigrationStorage struct {
// contains filtered or unexported fields
}
MigrationStorgage implements the tessera.MigrationTarget lifecycle contract.
func (*MigrationStorage) AwaitIntegration ¶
func (*MigrationStorage) IntegratedSize ¶
func (m *MigrationStorage) IntegratedSize(ctx context.Context) (uint64, error)
func (*MigrationStorage) SetEntryBundle ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a GCP based storage implementation for Tessera.
func (*Storage) MigrationWriter ¶
func (s *Storage) MigrationWriter(ctx context.Context, opts *tessera.MigrationOptions) (migrate.MigrationWriter, tessera.LogReader, error)
MigrationWriter creates a new GCP storage for the MigrationTarget lifecycle mode.