bookkeeper

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWebServiceURL       = "http://localhost:8080"
	DefaultHTTPTimeOutDuration = 5 * time.Minute
)

Variables

View Source
var ReleaseVersion = "None"

Functions

This section is empty.

Types

type AutoRecovery added in v0.3.0

type AutoRecovery interface {
	// RecoverBookie is used to recovering ledger data for a failed bookie
	RecoverBookie([]string, bool) error

	// ListUnderReplicatedLedger is used to listing all the underreplicated ledgers
	// which have been marked for rereplication
	ListUnderReplicatedLedger(string, string) ([]int64, error)

	// PrintListUnderReplicatedLedger is used to printing the replicate list of the replicated ledgers
	PrintListUnderReplicatedLedger(string, string) (map[int64][]string, error)

	// WhoIsAuditor is used to getting which bookie is the auditor
	WhoIsAuditor() (string, error)

	// TriggerAudit is used to triggering audit by resetting the lostBookieRecoveryDelay
	TriggerAudit() error

	// GetLostBookieRecoveryDelay is used to getting the lostBookieRecoveryDelay of a bookie
	GetLostBookieRecoveryDelay() (string, error)

	// SetLostBookieRecoveryDelay is used to setting the lastBookieRecoverDelay of a bookie
	SetLostBookieRecoveryDelay(int) error

	// Decommission is used to decommissioning a bookie
	Decommission(string) error
}

type Bookie added in v0.3.0

type Bookie interface {
	// LastLogMark gets the last log marker of a bookie
	LastLogMark() (map[string]string, error)

	// ListDiskFile gets all the files on disk of a bookie
	ListDiskFile(bkdata.FileType) (map[string]string, error)

	// ExpandStorage expands storage for a bookie
	ExpandStorage() error

	// GC triggers garbage collection for a bookie
	GC() error

	// GCStatus gets the garbage collection status
	GCStatus() (map[string]string, error)

	// GCDetails gets the garbage collection details
	GCDetails() ([]bkdata.GCStatus, error)

	// State gets the state of a bookie
	State() (*bkdata.State, error)
}

type Bookies added in v0.3.0

type Bookies interface {
	// List lists all the available bookies
	List(bkdata.BookieType, bool) (map[string]string, error)

	// DiskUsageInfo gets the bookies disk usage info of a cluster
	DiskUsageInfo() (map[string]string, error)
}

type Client

type Client interface {
	// Bookie related commands
	Bookie() Bookie
	// Bookies related commands
	Bookies() Bookies
	// Ledger related commands
	Ledger() Ledger
	// AutoRecovery related commands
	AutoRecovery() AutoRecovery
}

func New

func New(config *Config) (Client, error)

type Config

type Config struct {
	WebServiceURL string
	HTTPTimeout   time.Duration
	APIVersion    bkdata.APIVersion
}

Config is used to configure the bookKeeper admin client

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig for a bookKeeper admin client

type Ledger

type Ledger interface {
	// Delete the specified ledger
	Delete(int64) error

	// List all the ledgers and get the metadata
	List(bool) (map[int64]string, error)

	// Get the metadata of a ledger
	Get(int64) (map[int64]bkdata.LedgerMetadata, error)

	// Read a range of entries from a ledger
	Read(int64, int64, int64) (map[string]string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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