client

package
v0.0.0-...-c55d01b Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentPort = 8443
)

Variables

This section is empty.

Functions

func AgentUrl

func AgentUrl(host string) string

func BuildConfig

func BuildConfig(h *hazelcastv1alpha1.Hazelcast, pool *x509.CertPool, cert *tls.Certificate, logger hzlogger.Logger) hazelcast.Config

func HazelcastUrl

func HazelcastUrl(h *hazelcastv1alpha1.Hazelcast) string

func RestUrl

Types

type AddBatchPublisherRequest

type AddBatchPublisherRequest struct {
	TargetCluster            string
	Endpoints                string
	QueueCapacity            int32
	BatchSize                int32
	BatchMaxDelayMillis      int32
	ResponseTimeoutMillis    int32
	AckType                  hazelcastv1alpha1.AcknowledgementType
	QueueFullBehavior        hazelcastv1alpha1.FullBehaviorSetting
	ConsistencyCheckStrategy ConsistencyCheckStrategy
}

type BackupService

type BackupService interface {
	ChangeClusterState(ctx context.Context, newState codecTypes.ClusterState) error
	TriggerHotRestartBackup(ctx context.Context) error
	InterruptHotRestartBackup(ctx context.Context) error
}

type Client

type Client interface {
	Running() bool
	IsClientConnected() bool
	AreAllMembersAccessible() bool

	ClusterId() hztypes.UUID
	OrderedMembers() []cluster.MemberInfo
	InvokeOnMember(ctx context.Context, req *proto.ClientMessage, uuid hztypes.UUID, opts *proto.InvokeOptions) (*proto.ClientMessage, error)
	InvokeOnRandomTarget(ctx context.Context, req *proto.ClientMessage, opts *proto.InvokeOptions) (*proto.ClientMessage, error)

	Shutdown(ctx context.Context) error
}

type ClientRegistry

type ClientRegistry interface {
	GetOrCreate(ctx context.Context, nn types.NamespacedName) (Client, error)
	Get(ns types.NamespacedName) (Client, bool)
	Delete(ctx context.Context, ns types.NamespacedName) error
}

type ClusterStateService

type ClusterStateService interface {
	ClusterState(ctx context.Context) (codecTypes.ClusterState, error)
	ChangeClusterState(ctx context.Context, newState codecTypes.ClusterState) error
}

type ConsistencyCheckStrategy

type ConsistencyCheckStrategy byte
const (
	None ConsistencyCheckStrategy = iota
	MerkleTrees
)

type EventResponseFunc

type EventResponseFunc func(WanSyncMapResponse)

type HazelcastClient

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

func NewClient

func NewClient(ctx context.Context, config hazelcast.Config) (*HazelcastClient, error)

func (*HazelcastClient) AreAllMembersAccessible

func (cl *HazelcastClient) AreAllMembersAccessible() bool

func (*HazelcastClient) ClusterId

func (cl *HazelcastClient) ClusterId() hztypes.UUID

func (*HazelcastClient) InvokeOnMember

func (cl *HazelcastClient) InvokeOnMember(ctx context.Context, req *proto.ClientMessage, uuid hztypes.UUID, opts *proto.InvokeOptions) (*proto.ClientMessage, error)

func (*HazelcastClient) InvokeOnRandomTarget

func (cl *HazelcastClient) InvokeOnRandomTarget(ctx context.Context, req *proto.ClientMessage, opts *proto.InvokeOptions) (*proto.ClientMessage, error)

func (*HazelcastClient) IsClientConnected

func (cl *HazelcastClient) IsClientConnected() bool

func (*HazelcastClient) OrderedMembers

func (cl *HazelcastClient) OrderedMembers() []cluster.MemberInfo

func (*HazelcastClient) Running

func (cl *HazelcastClient) Running() bool

func (*HazelcastClient) Shutdown

func (cl *HazelcastClient) Shutdown(ctx context.Context) error

type HazelcastClientRegistry

type HazelcastClientRegistry struct {
	K8sClient k8sClient.Client
	// contains filtered or unexported fields
}

func (*HazelcastClientRegistry) Delete

func (*HazelcastClientRegistry) Get

func (*HazelcastClientRegistry) GetOrCreate

type HzBackupService

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

func NewBackupService

func NewBackupService(cl Client) *HzBackupService

func (*HzBackupService) ChangeClusterState

func (bs *HzBackupService) ChangeClusterState(ctx context.Context, newState codecTypes.ClusterState) error

func (*HzBackupService) InterruptHotRestartBackup

func (bs *HzBackupService) InterruptHotRestartBackup(ctx context.Context) error

func (*HzBackupService) TriggerHotRestartBackup

func (bs *HzBackupService) TriggerHotRestartBackup(ctx context.Context) error

type HzClusterStateService

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

func NewClusterStateService

func NewClusterStateService(cl Client) *HzClusterStateService

func (*HzClusterStateService) ChangeClusterState

func (bs *HzClusterStateService) ChangeClusterState(ctx context.Context, newState codecTypes.ClusterState) error

func (*HzClusterStateService) ClusterState

type HzJetService

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

func (HzJetService) ExportSnapshot

func (h HzJetService) ExportSnapshot(ctx context.Context, jobId int64, name string, cancelJob bool) (int64, error)

func (HzJetService) JobSummaries

func (h HzJetService) JobSummaries(ctx context.Context) ([]types.JobAndSqlSummary, error)

func (HzJetService) JobSummary

func (HzJetService) ResumeJob

func (h HzJetService) ResumeJob(ctx context.Context, jobId int64) error

func (HzJetService) RunJob

func (h HzJetService) RunJob(ctx context.Context, jobMetadata types.JobMetaData) error

func (HzJetService) UpdateJobState

func (h HzJetService) UpdateJobState(ctx context.Context, job types.JetTerminateJob) error

type HzStatusService

type HzStatusService struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStatusService

func NewStatusService(n types.NamespacedName, cl Client, l logr.Logger, channel chan event.GenericEvent) *HzStatusService

func (*HzStatusService) GetStatus

func (ss *HzStatusService) GetStatus() *Status

func (*HzStatusService) GetTimedMemberState

func (ss *HzStatusService) GetTimedMemberState(ctx context.Context, uuid hztypes.UUID) (*codecTypes.TimedMemberStateWrapper, error)

func (*HzStatusService) Start

func (ss *HzStatusService) Start()

func (*HzStatusService) Stop

func (ss *HzStatusService) Stop()

func (*HzStatusService) UpdateMembers

func (ss *HzStatusService) UpdateMembers(ctx context.Context)

type HzStatusServiceRegistry

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

func (*HzStatusServiceRegistry) Create

func (*HzStatusServiceRegistry) Delete

func (*HzStatusServiceRegistry) Get

type HzWanService

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

func NewWanService

func NewWanService(cl Client, name, pubId string) *HzWanService

func (*HzWanService) AddBatchPublisherConfig

func (ws *HzWanService) AddBatchPublisherConfig(ctx context.Context, request *AddBatchPublisherRequest) error

func (*HzWanService) ChangeWanState

func (ws *HzWanService) ChangeWanState(ctx context.Context, state codecTypes.WanReplicationState) error

func (*HzWanService) ClearWanQueue

func (ws *HzWanService) ClearWanQueue(ctx context.Context) error

type JetService

type JetService interface {
	RunJob(ctx context.Context, jobMetadata types.JobMetaData) error
	JobSummary(ctx context.Context, job *hazelcastv1alpha1.JetJob) (types.JobAndSqlSummary, error)
	JobSummaries(ctx context.Context) ([]types.JobAndSqlSummary, error)
	UpdateJobState(ctx context.Context, job types.JetTerminateJob) error
	ResumeJob(ctx context.Context, jobId int64) error
	ExportSnapshot(ctx context.Context, jobId int64, name string, cancelJob bool) (int64, error)
}

func NewJetService

func NewJetService(client Client) JetService

type LogrHzClientLoggerAdapter

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

func NewLogrHzClientLoggerAdapter

func NewLogrHzClientLoggerAdapter(rootLogger logr.Logger, level logger.Level, h *hazelcastv1alpha1.Hazelcast) (*LogrHzClientLoggerAdapter, error)

func (*LogrHzClientLoggerAdapter) Enabled

func (l *LogrHzClientLoggerAdapter) Enabled() bool

func (*LogrHzClientLoggerAdapter) Log

func (l *LogrHzClientLoggerAdapter) Log(weight logger.Weight, formatter func() string)

func (*LogrHzClientLoggerAdapter) Logger

type MemberData

type MemberData struct {
	Address     string
	UUID        string
	Version     string
	LiteMember  bool
	MemberState string
	Master      bool
	Partitions  int32
	Name        string
}

func (MemberData) String

func (m MemberData) String() string

type Status

type Status struct {
	MemberDataMap           map[hztypes.UUID]*MemberData
	ClusterHotRestartStatus codecTypes.ClusterHotRestartStatus
}

type StatusService

type StatusService interface {
	Start()
	UpdateMembers(ctx context.Context)
	GetStatus() *Status
	GetTimedMemberState(ctx context.Context, uuid hztypes.UUID) (*codecTypes.TimedMemberStateWrapper, error)
	Stop()
}

type StatusServiceRegistry

type StatusServiceRegistry interface {
	Create(ns types.NamespacedName, cl Client, l logr.Logger, channel chan event.GenericEvent) StatusService
	Get(ns types.NamespacedName) (StatusService, bool)
	Delete(ns types.NamespacedName)
}

type StatusTicker

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

type WanService

type WanService interface {
	AddBatchPublisherConfig(ctx context.Context, request *AddBatchPublisherRequest) error
	ChangeWanState(ctx context.Context, state codecTypes.WanReplicationState) error
	ClearWanQueue(ctx context.Context) error
	WanSyncMap(ctx context.Context, mapName string) error
}

type WanSyncMapRequest

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

func NewWanSyncMapRequest

func NewWanSyncMapRequest(hzResource types.NamespacedName, wanSync, mapName, wanName, publisherId string) WanSyncMapRequest

type WanSyncMapResponse

type WanSyncMapResponse struct {
	MapName       types.NamespacedName
	HazelcastName types.NamespacedName
	Event         codecTypes.MCEvent
}

type WanSyncService

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

func NewWanSyncService

func NewWanSyncService(registry ClientRegistry) *WanSyncService

func (*WanSyncService) AddWanSyncRequests

func (s *WanSyncService) AddWanSyncRequests(ws types.NamespacedName, wsrs []WanSyncMapRequest)

func (*WanSyncService) StartSyncJob

func (s *WanSyncService) StartSyncJob(ctx context.Context, f EventResponseFunc, logger logr.Logger)

Jump to

Keyboard shortcuts

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