manager

package
v0.0.0-...-96b211d Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster interface {
	Register(nodeAddresses []string) (*common.Cluster, error)
	RegisterNodesTo(clusterId string, nodeAddresses []string) error

	UnRegisterCluster(clusterId string) error
	UnRegisterNode(nodeId string) error

	Handshake() error

	GetClusters() (common.Clusters, error)
	GetCluster(clusterId string) (*common.Cluster, error)

	Reserve(size uint64) (*common.ReservationMap, error)
	Commit(reservationId string, clusterMap map[string]uint64) error
	Discard(reservationId string) error

	MoveCluster(sourceClusterId string, targetClusterId string) error
	BalanceClusters(clusterIds []string) error
	ChangeState(clusterId string, state common.States) error
	ChangeStateAll(state common.States) error

	CreateSnapshot(clusterId string) error
	DeleteSnapshot(clusterId string, snapshotIndex uint64) error
	RestoreSnapshot(clusterId string, snapshotIndex uint64) error

	Map(sha512HexList []string, mapType common.MapType) (map[string][]string, error)
	Find(sha512Hex string, mapType common.MapType) (string, []string, error)
}

Cluster interface contains functions to handle the cluster administration in the dfs farm

func NewCluster

func NewCluster(clusters data.Clusters, index data.Index, synchronize Synchronize, logger *zap.Logger) (Cluster, error)

NewCluster creates the instance for cluster administration of the dfs farm

type HealthCheck

type HealthCheck interface {
	Start()
	Report() (HealthReport, error)
}

func NewHealthTracker

func NewHealthTracker(
	clusters data.Clusters,
	index data.Index,
	synchronize Synchronize,
	repair Repair,
	logger *zap.Logger,
	interval time.Duration,
) HealthCheck

type HealthReport

type HealthReport map[string]common.NodeList

type Node

type Node interface {
	Handshake(nodeHardwareAddr string, nodeAddress string, size uint64) (string, string, string, error)
	Notify(nodeId string, notificationContainerList common.NotificationContainerList) error
}

func NewNode

func NewNode(clusters data.Clusters, index data.Index, logger *zap.Logger) Node

type Repair

type Repair interface {
	Start(repairType RepairType) error
	Status() data.RepairDetail
}

func NewRepair

func NewRepair(clusters data.Clusters, metadata data.Metadata, index data.Index, operation data.Operation, synchronize Synchronize, logger *zap.Logger) Repair

type RepairType

type RepairType int
const (
	RTFull                         RepairType = 1
	RTStructure                    RepairType = 2
	RTStructureWithIntegrity       RepairType = 3
	RTIntegrity                    RepairType = 4
	RTIntegrityWithChecksumRebuild RepairType = 5
	RTCalculatingMissingChecksum   RepairType = 6
	RTChecksumRebuild              RepairType = 7
)

type Synchronize

type Synchronize interface {
	QueueClusters() error
	QueueCluster(clusterId string, ignoreMaintainMode bool, keepInMaintainMode bool)

	Cluster(clusterId string, ignoreMaintainMode bool, keepInMaintainMode bool, waitFullSync bool) error
}

func NewSynchronize

func NewSynchronize(clusters data.Clusters, index data.Index, logger *zap.Logger) Synchronize

Jump to

Keyboard shortcuts

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