version

package
v0.0.0-...-8ba21cc Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// MinTiKVVersion is the version of the minimal compatible TiKV.
	// The min version should be 7.x because we adapt to tidb concurrency ddl implementations.
	MinTiKVVersion = semver.New("7.1.0-alpha")

	// MinTiCDCVersion is the version of the minimal allowed TiCDC version.
	MinTiCDCVersion = semver.New("6.3.0-alpha")
	// MaxTiCDCVersion is the version of the maximum allowed TiCDC version.
	// for version `x.y.z`, max allowed `x+2.0.0`
	MaxTiCDCVersion = semver.New("10.0.0-alpha")
)
View Source
var (
	ReleaseVersion = "None"
	BuildTS        = "None"
	GitHash        = "None"
	GitBranch      = "None"
)

Version information.

Functions

func CheckClusterVersion

func CheckClusterVersion(
	ctx context.Context, client pd.Client, pdAddrs []string,
	credential *security.Credential, errorTiKVIncompat bool,
) error

CheckClusterVersion check TiKV and PD version. need only one PD alive and match the cdc version.

func CheckStoreVersion

func CheckStoreVersion(ctx context.Context, client pd.Client, storeID uint64) error

CheckStoreVersion checks whether the given TiKV is compatible with this CDC. If storeID is 0, it checks all TiKV.

func CheckTiCDCVersion

func CheckTiCDCVersion(versions map[string]struct{}) error

CheckTiCDCVersion return true if all cdc instance have valid semantic version the whole cluster only allow at most 2 different version instances and should in the range [MinTiCDCVersion, MaxTiCDCVersion)

func GetRawInfo

func GetRawInfo() string

GetRawInfo returns basic version information string.

func LogVersionInfo

func LogVersionInfo(app string)

LogVersionInfo prints the CDC version information.

func ReleaseSemver

func ReleaseSemver() string

ReleaseSemver returns a valid Semantic Versions or an empty if the ReleaseVersion is not set at compile time.

func SanitizeVersion

func SanitizeVersion(v string) string

SanitizeVersion remove the prefix "v" and suffix git hash.

Types

type CreatorVersionGate

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

CreatorVersionGate determines the introduced version and compatibility of some features based on the creator's version value.

func NewCreatorVersionGate

func NewCreatorVersionGate(version string) *CreatorVersionGate

NewCreatorVersionGate creates the creator version gate.

func (*CreatorVersionGate) ChangefeedAcceptProtocolInMysqlSinURI

func (g *CreatorVersionGate) ChangefeedAcceptProtocolInMysqlSinURI() bool

ChangefeedAcceptProtocolInMysqlSinURI determines whether to accept protocol in mysql sink uri or configure based on the creator's version.

func (*CreatorVersionGate) ChangefeedAcceptUnknownProtocols

func (g *CreatorVersionGate) ChangefeedAcceptUnknownProtocols() bool

ChangefeedAcceptUnknownProtocols determines whether to accept unknown protocols based on the creator's version.

func (*CreatorVersionGate) ChangefeedInheritSchedulerConfigFromV66

func (g *CreatorVersionGate) ChangefeedInheritSchedulerConfigFromV66() bool

ChangefeedInheritSchedulerConfigFromV66 determines whether to inherit changefeed scheduler config created by v6.6.0.

func (*CreatorVersionGate) ChangefeedStateFromAdminJob

func (g *CreatorVersionGate) ChangefeedStateFromAdminJob() bool

ChangefeedStateFromAdminJob determines if admin job is the state of changefeed based on the version of the creator.

type TiCDCClusterVersion

type TiCDCClusterVersion struct {
	*semver.Version
}

TiCDCClusterVersion is the version of TiCDC cluster

func GetTiCDCClusterVersion

func GetTiCDCClusterVersion(captureVersion []string) (TiCDCClusterVersion, error)

GetTiCDCClusterVersion returns the version of ticdc cluster

func (*TiCDCClusterVersion) LessThan500RC

func (v *TiCDCClusterVersion) LessThan500RC() bool

LessThan500RC returns true if th cluster version is less than 5.0.0-rc

func (*TiCDCClusterVersion) ShouldEnableUnifiedSorterByDefault

func (v *TiCDCClusterVersion) ShouldEnableUnifiedSorterByDefault() bool

ShouldEnableUnifiedSorterByDefault returns whether Unified Sorter should be enabled by default

func (*TiCDCClusterVersion) ShouldRunCliWithOpenAPI

func (v *TiCDCClusterVersion) ShouldRunCliWithOpenAPI() bool

ShouldRunCliWithOpenAPI returns whether to run cmd cli with open api

Jump to

Keyboard shortcuts

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