metastore

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactionCommandHandler added in v1.11.0

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

func NewCompactionCommandHandler added in v1.11.0

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

func (*CompactionCommandHandler) GetCompactionPlanUpdate added in v1.11.0

func (*CompactionCommandHandler) UpdateCompactionPlan added in v1.11.0

type CompactionService added in v1.11.0

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

func NewCompactionService added in v1.11.0

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

func (*CompactionService) PollCompactionJobs added in v1.11.0

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."`
	DataDir          string             `yaml:"data_dir"`
	MinReadyDuration time.Duration      `yaml:"min_ready_duration" category:"advanced"`
	Raft             raft.Config        `yaml:"raft"`
	Index            index.Config       `yaml:",inline" category:"advanced"`
	DLQRecovery      dlq.RecoveryConfig `yaml:",inline" 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 Index added in v1.11.0

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

type IndexBlockFinder added in v1.11.0

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

type IndexCommandHandler added in v1.11.0

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

func NewIndexCommandHandler added in v1.11.0

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

func (*IndexCommandHandler) AddBlock added in v1.11.0

type IndexQuerier added in v1.11.0

type IndexQuerier interface {
	QueryMetadata(*bbolt.Tx, index.MetadataQuery) iter.Iterator[*metastorev1.BlockMeta]
}

type IndexReplacer added in v1.11.0

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

type IndexService added in v1.11.0

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

func NewIndexService added in v1.11.0

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

func (*IndexService) AddBlock added in v1.11.0

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

func (*IndexService) AddRecoveredBlock added in v1.11.0

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

func (*IndexService) GetBlockMetadata added in v1.11.0

type MetadataQueryService added in v1.11.0

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

func NewMetadataQueryService added in v1.11.0

func NewMetadataQueryService(
	logger log.Logger,
	state State,
	index IndexQuerier,
) *MetadataQueryService

func (*MetadataQueryService) QueryMetadata added in v1.11.0

type Metastore

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

func New

func New(
	config Config,
	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 added in v1.11.0

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

func (*Metastore) Service

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

type PlacementStats added in v1.11.0

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

type Raft added in v1.11.0

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 added in v1.11.0

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 added in v1.11.0

type TenantIndex interface {
	GetTenantStats(tenant string) *metastorev1.TenantStats
}

type TenantService added in v1.11.0

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

func NewTenantService added in v1.11.0

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

func (*TenantService) DeleteTenant added in v1.11.0

func (*TenantService) GetTenant added in v1.11.0

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

type TombstoneDeleter added in v1.11.0

type TombstoneDeleter interface {
	DeleteTombstones(*bbolt.Tx, *raft.Log, ...*metastorev1.Tombstones) error
	AddTombstones(*bbolt.Tx, *raft.Log, *metastorev1.Tombstones) error
}

type Tombstones added in v1.11.0

type Tombstones interface {
	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