cluster

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllocClusterIDPrefix = "ClusterID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

func NewCluster

func NewCluster(logger *zap.Logger, metadata *metadata.ClusterMetadata, client *clientv3.Client, rootPath string) (*Cluster, error)

func (*Cluster) GetMetadata added in v1.2.0

func (c *Cluster) GetMetadata() *metadata.ClusterMetadata

func (*Cluster) GetProcedureFactory added in v1.2.0

func (c *Cluster) GetProcedureFactory() *coordinator.Factory

func (*Cluster) GetProcedureManager added in v1.2.0

func (c *Cluster) GetProcedureManager() procedure.Manager

func (*Cluster) GetSchedulerManager added in v1.2.0

func (c *Cluster) GetSchedulerManager() manager.SchedulerManager

func (*Cluster) GetShardNodes added in v1.2.7

func (c *Cluster) GetShardNodes() metadata.GetShardNodesResult

func (*Cluster) GetShards added in v1.2.7

func (c *Cluster) GetShards() []storage.ShardID

func (*Cluster) Start added in v1.2.0

func (c *Cluster) Start(ctx context.Context) error

func (*Cluster) Stop added in v1.2.0

func (c *Cluster) Stop(ctx context.Context) error

type Manager

type Manager interface {
	// Start must be called before manager is used.
	Start(ctx context.Context) error
	// Stop must be called before manager is dropped.
	Stop(ctx context.Context) error

	ListClusters(ctx context.Context) ([]*Cluster, error)
	CreateCluster(ctx context.Context, clusterName string, opts metadata.CreateClusterOpts) (*Cluster, error)
	UpdateCluster(ctx context.Context, clusterName string, opt metadata.UpdateClusterOpts) error
	GetCluster(ctx context.Context, clusterName string) (*Cluster, error)
	// AllocSchemaID means get or create schema.
	// The second output parameter bool: Returns true if the table was newly created.
	AllocSchemaID(ctx context.Context, clusterName, schemaName string) (storage.SchemaID, bool, error)
	GetTables(clusterName, schemaName string, tableNames []string) ([]metadata.TableInfo, error)
	GetTablesByIDs(clusterName string, tableID []storage.TableID) ([]metadata.TableInfo, error)
	GetTablesByShardIDs(clusterName, nodeName string, shardIDs []storage.ShardID) (map[storage.ShardID]metadata.ShardTables, error)
	DropTable(ctx context.Context, clusterName, schemaName, tableName string) error
	RouteTables(ctx context.Context, clusterName, schemaName string, tableNames []string) (metadata.RouteTablesResult, error)
	GetNodeShards(ctx context.Context, clusterName string) (metadata.GetNodeShardsResult, error)

	RegisterNode(ctx context.Context, clusterName string, registeredNode metadata.RegisteredNode) error
	GetRegisteredNode(ctx context.Context, clusterName string, node string) (metadata.RegisteredNode, error)
	ListRegisteredNodes(ctx context.Context, clusterName string) ([]metadata.RegisteredNode, error)
}

func NewManagerImpl

func NewManagerImpl(storage storage.Storage, kv clientv3.KV, client *clientv3.Client, rootPath string, idAllocatorStep uint, topologyType storage.TopologyType) (Manager, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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