Documentation
¶
Index ¶
- type SafePointManager
- func (manager *SafePointManager) LoadGCSafePoint() (uint64, error)
- func (manager *SafePointManager) UpdateGCSafePoint(newSafePoint uint64) (oldSafePoint uint64, err error)
- func (manager *SafePointManager) UpdateServiceGCSafePoint(serviceID string, newSafePoint uint64, ttl int64, now time.Time) (minServiceSafePoint *endpoint.ServiceSafePoint, updated bool, err error)
- type SafePointV2Manager
- func (manager *SafePointV2Manager) LoadGCSafePoint(keyspaceID uint32) (*endpoint.GCSafePointV2, error)
- func (manager *SafePointV2Manager) RemoveServiceSafePoint(keyspaceID uint32, serviceID string, now time.Time) (*endpoint.ServiceSafePointV2, error)
- func (manager *SafePointV2Manager) UpdateGCSafePoint(gcSafePoint *endpoint.GCSafePointV2) (oldGCSafePoint *endpoint.GCSafePointV2, err error)
- func (manager *SafePointV2Manager) UpdateServiceSafePoint(serviceSafePoint *endpoint.ServiceSafePointV2, now time.Time) (*endpoint.ServiceSafePointV2, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SafePointManager ¶
type SafePointManager struct {
// contains filtered or unexported fields
}
SafePointManager is the manager for safePoint of GC and services.
func NewSafePointManager ¶
func NewSafePointManager(store endpoint.GCSafePointStorage, cfg config.PDServerConfig) *SafePointManager
NewSafePointManager creates a SafePointManager of GC and services.
func (*SafePointManager) LoadGCSafePoint ¶
func (manager *SafePointManager) LoadGCSafePoint() (uint64, error)
LoadGCSafePoint loads current GC safe point from storage.
func (*SafePointManager) UpdateGCSafePoint ¶
func (manager *SafePointManager) UpdateGCSafePoint(newSafePoint uint64) (oldSafePoint uint64, err error)
UpdateGCSafePoint updates the safepoint if it is greater than the previous one it returns the old safepoint in the storage.
func (*SafePointManager) UpdateServiceGCSafePoint ¶
func (manager *SafePointManager) UpdateServiceGCSafePoint(serviceID string, newSafePoint uint64, ttl int64, now time.Time) (minServiceSafePoint *endpoint.ServiceSafePoint, updated bool, err error)
UpdateServiceGCSafePoint update the safepoint for a specific service.
type SafePointV2Manager ¶
SafePointV2Manager is the manager for GCSafePointV2 and ServiceSafePointV2.
func NewSafePointManagerV2 ¶
func NewSafePointManagerV2( ctx context.Context, keyspaceStore endpoint.KeyspaceStorage, v2Storage endpoint.SafePointV2Storage, v1Storage endpoint.GCSafePointStorage, ) *SafePointV2Manager
NewSafePointManagerV2 returns a new SafePointV2Manager.
func (*SafePointV2Manager) LoadGCSafePoint ¶
func (manager *SafePointV2Manager) LoadGCSafePoint(keyspaceID uint32) (*endpoint.GCSafePointV2, error)
LoadGCSafePoint returns GCSafePointV2 of keyspaceID.
func (*SafePointV2Manager) RemoveServiceSafePoint ¶
func (manager *SafePointV2Manager) RemoveServiceSafePoint(keyspaceID uint32, serviceID string, now time.Time) (*endpoint.ServiceSafePointV2, error)
RemoveServiceSafePoint remove keyspace service safe point with the given keyspaceID and serviceID.
func (*SafePointV2Manager) UpdateGCSafePoint ¶
func (manager *SafePointV2Manager) UpdateGCSafePoint(gcSafePoint *endpoint.GCSafePointV2) (oldGCSafePoint *endpoint.GCSafePointV2, err error)
UpdateGCSafePoint is used to update gc safe point for given keyspace.
func (*SafePointV2Manager) UpdateServiceSafePoint ¶
func (manager *SafePointV2Manager) UpdateServiceSafePoint(serviceSafePoint *endpoint.ServiceSafePointV2, now time.Time) (*endpoint.ServiceSafePointV2, error)
UpdateServiceSafePoint update keyspace service safe point with the given serviceSafePoint.