mds

package
v3.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mds provides the overall interface to Metadata Services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// TODO(jaffee) director on config is a bit weird? Shouldn't this be set up internally?
	Director controller.Director `toml:"-"`
	// RegistrationBatchTimeout is the time that the controller will
	// wait after a node registers itself to see if any more nodes
	// will register before sending out directives to all nodes which
	// have been registered.
	RegistrationBatchTimeout time.Duration `toml:"registration-batch-timeout"`

	SnappingTurtleTimeout time.Duration

	// Poller
	PollInterval time.Duration `toml:"poll-interval"`

	// Storage
	StorageMethod string `toml:"-"`
	DataDir       string `toml:"-"`

	SnapshotterDir string `toml:"snapshotter-dir"`
	WriteloggerDir string `toml:"writelogger-dir"`

	// Logger
	Logger logger.Logger `toml:"-"`
}

type MDS

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

MDS provides public MDS methods for an MDS service.

func New

func New(cfg Config) *MDS

New returns a new instance of MDS.

func (*MDS) CheckInNode

func (m *MDS) CheckInNode(ctx context.Context, node *dax.Node) error

CheckInNode handles a node check-in request. If MDS is not aware of the node, it will be sent through the RegisterNode process.

func (*MDS) ComputeNodes

func (m *MDS) ComputeNodes(ctx context.Context, qtid dax.QualifiedTableID, shardNums ...dax.ShardNum) ([]dax.ComputeNode, error)

ComputeNodes gets the compute nodes responsible for the table/shards specified in the ComputeNodeRequest.

func (*MDS) CreateDatabase added in v3.29.0

func (m *MDS) CreateDatabase(ctx context.Context, qdb *dax.QualifiedDatabase) error

CreateDatabase handles a create table request.

func (*MDS) CreateField

func (m *MDS) CreateField(ctx context.Context, qtid dax.QualifiedTableID, fld *dax.Field) error

CreateField handles a create Field request.

func (*MDS) CreateTable

func (m *MDS) CreateTable(ctx context.Context, qtbl *dax.QualifiedTable) error

CreateTable handles a create table request.

func (*MDS) DatabaseByID added in v3.29.0

func (m *MDS) DatabaseByID(ctx context.Context, qdbid dax.QualifiedDatabaseID) (*dax.QualifiedDatabase, error)

func (*MDS) DatabaseByName added in v3.29.0

func (m *MDS) DatabaseByName(ctx context.Context, orgID dax.OrganizationID, dbname dax.DatabaseName) (*dax.QualifiedDatabase, error)

func (*MDS) Databases added in v3.29.0

func (m *MDS) Databases(ctx context.Context, orgID dax.OrganizationID, ids ...dax.DatabaseID) ([]*dax.QualifiedDatabase, error)

func (*MDS) DebugNodes

func (m *MDS) DebugNodes(ctx context.Context) ([]*dax.Node, error)

func (*MDS) DeregisterNodes

func (m *MDS) DeregisterNodes(ctx context.Context, addrs ...dax.Address) error

DeregisterNodes handles a request to deregister multiple nodes at once.

func (*MDS) DropDatabase added in v3.29.0

func (m *MDS) DropDatabase(ctx context.Context, qdbid dax.QualifiedDatabaseID) error

func (*MDS) DropField

func (m *MDS) DropField(ctx context.Context, qtid dax.QualifiedTableID, fldName dax.FieldName) error

DropField handles a drop Field request.

func (*MDS) DropTable

func (m *MDS) DropTable(ctx context.Context, qtid dax.QualifiedTableID) error

DropTable handles a drop table request. // TODO(jaffee) how do we reason about consistency here? What if controller DropTable succeeds, but schemar fails?

func (*MDS) IngestPartition

func (m *MDS) IngestPartition(ctx context.Context, qtid dax.QualifiedTableID, partnNum dax.PartitionNum) (dax.Address, error)

IngestPartition handles an ingest partition request.

func (*MDS) IngestShard

func (m *MDS) IngestShard(ctx context.Context, qtid dax.QualifiedTableID, shrdNum dax.ShardNum) (dax.Address, error)

IngestShard handles an ingest shard request.

func (*MDS) RegisterNode

func (m *MDS) RegisterNode(ctx context.Context, node *dax.Node) error

RegisterNode handles a node registration request. It does not synchronously do much of anything, but the node will eventually probably get a directive... unless the MDS crashes or something in which case the fact that this endpoint was ever called will be lost to time.

func (*MDS) RegisterNodes

func (m *MDS) RegisterNodes(ctx context.Context, nodes ...*dax.Node) error

RegisterNodes immediately registers the given nodes and sends out new directives synchronously, bypassing the wait time of the RegisterNode endpoint.

func (*MDS) SnapshotFieldKeys

func (m *MDS) SnapshotFieldKeys(ctx context.Context, qtid dax.QualifiedTableID, fldName dax.FieldName) error

SnapshotFieldKeys handles a snapshot field/keys request.

func (*MDS) SnapshotShardData

func (m *MDS) SnapshotShardData(ctx context.Context, qtid dax.QualifiedTableID, shardNum dax.ShardNum) error

SnapshotShardData handles a snapshot shard request.

func (*MDS) SnapshotTable

func (m *MDS) SnapshotTable(ctx context.Context, qtid dax.QualifiedTableID) error

SnapshotTable handles a snapshot table request.

func (*MDS) SnapshotTableKeys

func (m *MDS) SnapshotTableKeys(ctx context.Context, qtid dax.QualifiedTableID, partitionNum dax.PartitionNum) error

SnapshotTableKeys handles a snapshot table/keys request.

func (*MDS) Start

func (m *MDS) Start() error

Start starts MDS services, such as the Poller.

func (*MDS) Stop

func (m *MDS) Stop() error

Stop stops MDS services, such as the Poller and the controller's node registration routine.

func (*MDS) TableByID added in v3.29.0

func (m *MDS) TableByID(ctx context.Context, qtid dax.QualifiedTableID) (*dax.QualifiedTable, error)

TableByID handles a table request.

func (*MDS) TableByName added in v3.29.0

func (m *MDS) TableByName(ctx context.Context, qdbid dax.QualifiedDatabaseID, name dax.TableName) (*dax.QualifiedTable, error)

TableByName handles a table id (i.e. by name) request.

func (*MDS) Tables

func (m *MDS) Tables(ctx context.Context, qdbid dax.QualifiedDatabaseID, ids ...dax.TableID) ([]*dax.QualifiedTable, error)

Tables handles a tables request.

func (*MDS) TranslateNodes

func (m *MDS) TranslateNodes(ctx context.Context, qtid dax.QualifiedTableID, partitionNums ...dax.PartitionNum) ([]dax.TranslateNode, error)

TranslateNodes gets the translate nodes responsible for the table/partitions specified in the TranslateNodeRequest.

Directories

Path Synopsis
Package client is an HTTP client for MDS.
Package client is an HTTP client for MDS.
Package controller provides the core Controller struct.
Package controller provides the core Controller struct.
balancer
Package balancer is an implementation of the controller's Balancer interface.
Package balancer is an implementation of the controller's Balancer interface.
balancer/boltdb
Package boltdb contains the boltdb implementation of the Balancer interface.
Package boltdb contains the boltdb implementation of the Balancer interface.
http
Package http provides the http implementation of the Director interface.
Package http provides the http implementation of the Director interface.
partitioner
Package partitioner provides the Partitioner type, which provides helper methods for determining partitions based on string keys.
Package partitioner provides the Partitioner type, which provides helper methods for determining partitions based on string keys.
Package poller provides the core Poller struct.
Package poller provides the core Poller struct.
Package schemar provides the core Schemar interface.
Package schemar provides the core Schemar interface.
boltdb
Package boltdb contains the boltdb implementation of the Schemar interfaces.
Package boltdb contains the boltdb implementation of the Schemar interfaces.

Jump to

Keyboard shortcuts

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