metastore

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2025 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactionCommandHandler

type CompactionCommandHandler struct {
	// contains filtered or unexported fields
}

func NewCompactionCommandHandler

func NewCompactionCommandHandler(
	logger log.Logger,
	index IndexReplacer,
	compactor compaction.Compactor,
	planner compaction.Planner,
	scheduler compaction.Scheduler,
	tombstones Tombstones,
) *CompactionCommandHandler

func (*CompactionCommandHandler) GetCompactionPlanUpdate

func (*CompactionCommandHandler) UpdateCompactionPlan

type CompactionService

type CompactionService struct {
	metastorev1.CompactionServiceServer
	// contains filtered or unexported fields
}

func NewCompactionService

func NewCompactionService(
	logger log.Logger,
	raft Raft,
) *CompactionService

type Config

type Config struct {
	Address          string            `yaml:"address"`
	GRPCClientConfig grpcclient.Config `yaml:"grpc_client_config" doc:"description=Configures the gRPC client used to communicate with the metastore."`
	MinReadyDuration time.Duration     `yaml:"min_ready_duration" category:"advanced"`
	Raft             raftnode.Config   `yaml:"raft"`
	FSM              fsm.Config        `yaml:",inline" category:"advanced"`
	Index            index.Config      `yaml:"index" category:"advanced"`
	Compactor        compactor.Config  `yaml:",inline" category:"advanced"`
	Scheduler        scheduler.Config  `yaml:",inline" category:"advanced"`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

type IndexBlockFinder

type IndexBlockFinder interface {
	GetBlocks(*bbolt.Tx, *metastorev1.BlockList) ([]*metastorev1.BlockMeta, error)
}

type IndexCommandHandler

type IndexCommandHandler struct {
	// contains filtered or unexported fields
}

func NewIndexCommandHandler

func NewIndexCommandHandler(
	logger log.Logger,
	index IndexWriter,
	tombstones Tombstones,
	compactor compaction.Compactor,
) *IndexCommandHandler

func (*IndexCommandHandler) AddBlock

func (*IndexCommandHandler) TruncateIndex

type IndexDeleter

type IndexDeleter interface {
	DeleteShard(tx *bbolt.Tx, partition indexstore.Partition, tenant string, shard uint32) error
}

type IndexInserter

type IndexInserter interface {
	InsertBlock(*bbolt.Tx, *metastorev1.BlockMeta) error
}

type IndexPartitionLister

type IndexPartitionLister interface {
	// Partitions provide access to all partitions in the index.
	// They are iterated in the order of their creation and are
	// guaranteed to be thread-safe for reads.
	Partitions(*bbolt.Tx) goiter.Seq[indexstore.Partition]
}

type IndexQuerier

type IndexQuerier interface {
	QueryMetadata(*bbolt.Tx, context.Context, index.MetadataQuery) ([]*metastorev1.BlockMeta, error)
	QueryMetadataLabels(*bbolt.Tx, context.Context, index.MetadataQuery) ([]*typesv1.Labels, error)
}

type IndexReader

type IndexReader interface {
	IndexBlockFinder
	IndexPartitionLister
}

type IndexReplacer

type IndexReplacer interface {
	ReplaceBlocks(*bbolt.Tx, *metastorev1.CompactedBlocks) error
}

type IndexService

type IndexService struct {
	metastorev1.IndexServiceServer
	// contains filtered or unexported fields
}

func NewIndexService

func NewIndexService(
	logger log.Logger,
	raft Raft,
	state State,
	index IndexReader,
	stats PlacementStats,
) *IndexService

func (*IndexService) AddBlock

func (svc *IndexService) AddBlock(
	ctx context.Context,
	req *metastorev1.AddBlockRequest,
) (resp *metastorev1.AddBlockResponse, err error)

func (*IndexService) AddRecoveredBlock

func (svc *IndexService) AddRecoveredBlock(
	ctx context.Context,
	req *metastorev1.AddBlockRequest,
) (*metastorev1.AddBlockResponse, error)

func (*IndexService) GetBlockMetadata

func (*IndexService) TruncateIndex

func (svc *IndexService) TruncateIndex(ctx context.Context, rp retention.Policy) error

type IndexWriter

type IndexWriter interface {
	IndexInserter
	IndexDeleter
}

type Metastore

type Metastore struct {
	// contains filtered or unexported fields
}

func New

func New(
	config Config,
	overrides Overrides,
	logger log.Logger,
	reg prometheus.Registerer,
	healthService health.Service,
	client raftnodepb.RaftNodeServiceClient,
	bucket objstore.Bucket,
	placementMgr *placement.Manager,
) (*Metastore, error)

func (*Metastore) CheckReady

func (m *Metastore) CheckReady(ctx context.Context) error

CheckReady verifies if the metastore is ready to serve requests by ensuring the node is up-to-date with the leader's commit index.

func (*Metastore) Register

func (m *Metastore) Register(server *grpc.Server)

func (*Metastore) Service

func (m *Metastore) Service() services.Service

type Overrides

type Overrides interface {
	retention.Overrides
}

type PlacementStats

type PlacementStats interface {
	RecordStats(iter.Iterator[placement.Sample])
}

type QueryService

type QueryService struct {
	metastorev1.MetadataQueryServiceServer
	// contains filtered or unexported fields
}

func NewQueryService

func NewQueryService(
	logger log.Logger,
	state State,
	index IndexQuerier,
) *QueryService

func (*QueryService) QueryMetadata

func (*QueryService) QueryMetadataLabels

type Raft

type Raft interface {
	Propose(fsm.RaftLogEntryType, proto.Message) (proto.Message, error)
}

Raft represents a Raft consensus protocol interface. Any modifications to the state should be proposed through the Raft interface.

type State

type State interface {
	ConsistentRead(context.Context, func(*bbolt.Tx, raftnode.ReadIndex)) error
}

State represents a consistent read-only view of the metastore. The write interface is provided through the FSM raft command handlers.

type TenantIndex

type TenantIndex interface {
	GetTenantStats(tx *bbolt.Tx, tenant string) *metastorev1.TenantStats
}

type TenantService

type TenantService struct {
	metastorev1.TenantServiceServer
	// contains filtered or unexported fields
}

func NewTenantService

func NewTenantService(
	logger log.Logger,
	state State,
	index TenantIndex,
) *TenantService

func (*TenantService) GetTenant

func (svc *TenantService) GetTenant(
	ctx context.Context,
	req *metastorev1.GetTenantRequest,
) (resp *metastorev1.GetTenantResponse, err error)

type Tombstones

type Tombstones interface {
	AddTombstones(*bbolt.Tx, *raft.Log, *metastorev1.Tombstones) error
	DeleteTombstones(*bbolt.Tx, *raft.Log, ...*metastorev1.Tombstones) error
	Exists(tenant string, shard uint32, block string) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL