mds

package
v3.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 15 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 {
	// Controller
	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"`

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

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

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

type CreateFieldRequest

type CreateFieldRequest struct {
	Table dax.TableName
	Field *dax.Field
}

type DropFieldResponse

type DropFieldResponse struct{}

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) ([]controller.ComputeNode, error)

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

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) 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) 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) Table

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

Table handles a table request.

func (*MDS) TableID

func (m *MDS) TableID(ctx context.Context, qual dax.TableQualifier, name dax.TableName) (dax.QualifiedTableID, error)

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

func (*MDS) Tables

func (m *MDS) Tables(ctx context.Context, qual dax.TableQualifier, 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) ([]controller.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.
alpha
Package alpha contains inter-service implemenations of interfaces.
Package alpha contains inter-service implemenations of interfaces.
http
Package http provides the http implementation of the Director interface.
Package http provides the http implementation of the Director interface.
naive
Package naive contains a naive implementation of the Balancer interface.
Package naive contains a naive implementation of the Balancer interface.
naive/boltdb
Package boltdb contains the boltdb implementation of the Balancer interface.
Package boltdb contains the boltdb implementation of the Balancer 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