bkadmin

package
v0.0.0-...-beb2ecc Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UrlPath for the Admin API
	UrlPath         = "/api/v1"
	UrlConfig       = UrlPath + "/config"
	UrlLedger       = UrlPath + "/ledger"
	UrlBookie       = UrlPath + "/bookie"
	UrlAutoRecovery = UrlPath + "/autorecovery"
)
View Source
const (
	UrlLedgerDelete   = UrlLedger + "/delete"
	UrlLedgerList     = UrlLedger + "/list"
	UrlLedgerMetadata = UrlLedger + "/metadata"
	UrlLedgerRead     = UrlLedger + "/read"
)
View Source
const (
	UrlBookieList                = UrlBookie + "/list_bookies"
	UrlBookieListInfo            = UrlBookie + "/list_bookie_info"
	UrlBookieLastLogMark         = UrlBookie + "/last_log_mark"
	UrlBookieListDiskFile        = UrlBookie + "/list_disk_file"
	UrlBookieExpandStorage       = UrlBookie + "/expand_storage"
	UrlBookieGc                  = UrlBookie + "/gc"
	UrlBookieGcSuspendCompaction = UrlBookie + "/gc/gc_suspend_compaction"
	UrlBookieGcResumeCompaction  = UrlBookie + "/gc/gc_resume_compaction"
	UrlBookieGcDetails           = UrlBookie + "/gc_details"
	UrlBookieState               = UrlBookie + "/state"
	UrlBookieSanity              = UrlBookie + "/sanity"
	UrlBookieStateReadOnly       = UrlBookie + "/state/readonly"
	UrlBookieReady               = UrlBookie + "/is_ready"
	UrlBookieInfo                = UrlBookie + "/info"
	UrlBookieClusterInfo         = UrlBookie + "/cluster_info"
)
View Source
const (
	UrlAutoRecoveryStatus                    = UrlAutoRecovery + "/status"
	UrlAutoRecoveryBookie                    = UrlAutoRecovery + "/bookie"
	UrlAutoRecoveryListUnderReplicatedLedger = UrlAutoRecovery + "/list_under_replicated_ledger"
	UrlAutoRecoveryWhoIsAuditor              = UrlAutoRecovery + "/who_is_auditor"
	UrlAutoRecoveryTriggerAudit              = UrlAutoRecovery + "/trigger_audit"
	UrlAutoRecoveryLostBookieRecoveryDelay   = UrlAutoRecovery + "/lost_bookie_recovery_delay"
	UrlAutoRecoveryDecommission              = UrlAutoRecovery + "/decommission"
)
View Source
const UrlConfigServerConfig = UrlConfig + "/server_config"
View Source
const UrlHeartbeat = "/heartbeat"

Variables

This section is empty.

Functions

func HttpCheck

func HttpCheck(response *http.Response) error

func HttpCheckReadBytes

func HttpCheckReadBytes(response *http.Response) ([]byte, error)

func RandBytes

func RandBytes(n int64) []byte

func RandStr

func RandStr(n int64) string

func ReadAll

func ReadAll(r io.Reader) (string, error)

func StatusNok

func StatusNok(code int) bool

func StatusOk

func StatusOk(code int) bool

Types

type Auditor

type Auditor struct {
	Auditor string `json:"Auditor"`
}

type AutoRecovery

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

func (*AutoRecovery) AutoRecoveryStatus

func (b *AutoRecovery) AutoRecoveryStatus() (*AutoRecoveryStatus, error)

func (*AutoRecovery) Decommission

func (b *AutoRecovery) Decommission(bookieId string) error

func (*AutoRecovery) ListUnderReplicatedLedger

func (b *AutoRecovery) ListUnderReplicatedLedger(reqData ListUnderReplicatedLedgerReqData) (
	*UnderReplicatedLedger, error)

func (*AutoRecovery) LostBookieRecoveryDelay

func (b *AutoRecovery) LostBookieRecoveryDelay(delaySeconds int64) error

func (*AutoRecovery) LostBookieRecoveryDelayByDefault

func (b *AutoRecovery) LostBookieRecoveryDelayByDefault() error

func (*AutoRecovery) RecoveryBookie

func (b *AutoRecovery) RecoveryBookie(reqData RecoveryBookieReqData) error

func (*AutoRecovery) TriggerAudit

func (b *AutoRecovery) TriggerAudit() error

func (*AutoRecovery) WhoIsAuditor

func (b *AutoRecovery) WhoIsAuditor() (*Auditor, error)

type AutoRecoveryStatus

type AutoRecoveryStatus struct {
	Enabled bool `json:"enabled"`
}

type BookieInfo

type BookieInfo struct {
	FreeSpace  int64
	TotalSpace int64
}

type BookieStatus

type BookieStatus struct {
	Running                        bool
	ReadOnly                       bool
	ShuttingDown                   bool
	AvailableForHighPriorityWrites bool
}

type Bookies

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

func (*Bookies) BookieInfo

func (b *Bookies) BookieInfo() (*BookieInfo, error)

func (*Bookies) ExpandStorage

func (b *Bookies) ExpandStorage() error

func (*Bookies) ForceGc

func (b *Bookies) ForceGc(forceMajor, forceMinor bool) error

func (*Bookies) GcStatusList

func (b *Bookies) GcStatusList() ([]*GarbageCollectionStatus, error)

func (*Bookies) GcSuspendStatus

func (b *Bookies) GcSuspendStatus() (bool, bool, error)

func (*Bookies) IsInForceGc

func (b *Bookies) IsInForceGc() (bool, error)

func (*Bookies) IsReadOnly

func (b *Bookies) IsReadOnly() (bool, error)

func (*Bookies) IsReady

func (b *Bookies) IsReady() (bool, error)

func (*Bookies) LastLogMark

func (b *Bookies) LastLogMark() (*LastLogMark, error)

func (*Bookies) List

func (b *Bookies) List() (map[string]*string, error)

func (*Bookies) ListBookieInfo

func (b *Bookies) ListBookieInfo() (map[string]string, error)

func (*Bookies) ListDiskFile

func (b *Bookies) ListDiskFile() (*DiskFile, error)

func (*Bookies) ResumeGc

func (b *Bookies) ResumeGc(major, minor bool) error

func (*Bookies) SetReadOnly

func (b *Bookies) SetReadOnly(readOnly bool) error

func (*Bookies) Status

func (b *Bookies) Status() (*BookieStatus, error)

func (*Bookies) SuspendGc

func (b *Bookies) SuspendGc(major, minor bool) error

type BookkeeperAdmin

type BookkeeperAdmin struct {
	Heartbeat    Heartbeat
	AutoRecovery *AutoRecovery
	Bookies      *Bookies
	Configs      *Configs
	Ledgers      *Ledgers
	// contains filtered or unexported fields
}

func NewBookkeeperAdmin

func NewBookkeeperAdmin(config Config) (*BookkeeperAdmin, error)

func NewDefaultBookkeeperAdmin

func NewDefaultBookkeeperAdmin() (*BookkeeperAdmin, error)

func NewTestBookkeeperAdmin

func NewTestBookkeeperAdmin(t *testing.T, port int) *BookkeeperAdmin

type Config

type Config struct {

	// Host pulsar service address, default localhost
	Host string
	// Port pulsar service port, default 8080
	Port int
	// TlsEnable enable tls, default false
	TlsEnable bool
	// TlsConfig tls config
	TlsConfig *tls.Config
	// ConnectionTimeout connect timeout, default 0, zero means no timeout
	ConnectionTimeout int64
	// contains filtered or unexported fields
}

type Configs

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

func (*Configs) GetConfig

func (c *Configs) GetConfig() (map[string]string, error)

func (*Configs) PutConfig

func (c *Configs) PutConfig(config map[string]string) error

type DiskFile

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

type GarbageCollectionStatus

type GarbageCollectionStatus struct {
	ForceCompacting         bool
	MajorCompacting         bool
	MinorCompacting         bool
	LastMajorCompactionTime int64
	LastMinorCompactionTime int64
	MajorCompactionCounter  int64
	MinorCompactionCounter  int64
}

type Heartbeat

type Heartbeat interface {
	// Heartbeat Get heartbeat status for a specific bookie
	Heartbeat() (bool, error)
}

Heartbeat bookie heartbeat api

func NewHeartbeat

func NewHeartbeat(cli HttpClient) Heartbeat

type HeartbeatImpl

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

func (*HeartbeatImpl) Heartbeat

func (h *HeartbeatImpl) Heartbeat() (bool, error)

Heartbeat Get heartbeat status for a specific bookie

type HttpClient

type HttpClient interface {
	Get(path string) (*http.Response, error)
	Put(path string, body any) (*http.Response, error)
	Delete(path string) (*http.Response, error)
	Do(*http.Request) (*http.Response, error)
}

type HttpClientImpl

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

func (*HttpClientImpl) Delete

func (h *HttpClientImpl) Delete(path string) (*http.Response, error)

func (*HttpClientImpl) Do

func (h *HttpClientImpl) Do(req *http.Request) (*http.Response, error)

func (*HttpClientImpl) Get

func (h *HttpClientImpl) Get(path string) (*http.Response, error)

func (*HttpClientImpl) Put

func (h *HttpClientImpl) Put(path string, body any) (*http.Response, error)

type LastLogMark

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

type Ledgers

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

type ListUnderReplicatedLedgerReqData

type ListUnderReplicatedLedgerReqData struct {
	IncludingBookieId   string
	ExcludingBookieId   string
	PrintMissingReplica bool
}

type RecoveryBookieReqData

type RecoveryBookieReqData struct {
	BookieSrc    []string `json:"bookie_src"`
	DeleteCookie bool     `json:"delete_cookie"`
}

type TestBookkeeper

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

func (*TestBookkeeper) Close

func (tb *TestBookkeeper) Close() error

type UnderReplicatedLedger

type UnderReplicatedLedger struct {
	Ledgers []int64 `json:"missingreplica,omitempty"`
}

Jump to

Keyboard shortcuts

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