o2t

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Copyright © 2020 Marvin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impliec. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PreTableStructCheck

func PreTableStructCheck(ctx context.Context, cfg *config.Config, metaDB *meta.Meta, exporters []string) error

Types

type Chunk

type Chunk struct {
	Ctx              context.Context `json:"-"`
	ChunkID          int             `json:"chunk_id"`
	SourceGlobalSCN  uint64          `json:"source_global_scn"`
	SourceTable      string          `json:"source_table"`
	TargetTable      string          `json:"target_table"`
	IsPartition      string          `json:"is_partition"`
	SourceColumnInfo string          `json:"source_column_info"`
	TargetColumnInfo string          `json:"target_column_info"`
	WhereColumn      string          `json:"where_column"`
	WhereRange       string          `json:"where_range"` // chunk split need
	Cfg              *config.Config  `json:"-"`
	Oracle           *oracle.Oracle  `json:"-"`
	MySQL            *mysql.MySQL    `json:"-"`
	MetaDB           *meta.Meta      `json:"-"`
}

Chunk 数据对比

func NewChunk

func NewChunk(ctx context.Context, cfg *config.Config, oracle *oracle.Oracle, mysql *mysql.MySQL, metaDB *meta.Meta,
	chunkID int, sourceGlobalSCN uint64, sourceTable, targetTable string, isPartition string, sourceColumnInfo, targetColumnInfo string,
	whereColumn string) *Chunk

func (*Chunk) CustomTableConfig

func (c *Chunk) CustomTableConfig() (customColumn string, customRange string, err error)

func (*Chunk) Split

func (c *Chunk) Split() error

func (*Chunk) String

func (c *Chunk) String() string

type Compare

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

func NewCompare

func NewCompare(ctx context.Context, cfg *config.Config) (*Compare, error)

func (*Compare) AdjustCompareConfig

func (r *Compare) AdjustCompareConfig(sourceDBCharset string) error

func (*Compare) NewCompare

func (r *Compare) NewCompare() error

type DBSummary

type DBSummary struct {
	Columns   []string
	StringSet *strset.Set
	Crc32Val  uint32
	Rows      int64
}

type Report

type Report struct {
	DataCompareMeta meta.DataCompareMeta `json:"data_compare_meta"`
	Mysql           *mysql.MySQL         `json:"-"`
	Oracle          *oracle.Oracle       `json:"-"`
	OnlyCheckRows   bool                 `json:"only_check_rows"`
}

func NewReport

func NewReport(dataCompareMeta meta.DataCompareMeta, mysql *mysql.MySQL, oracle *oracle.Oracle, onlyCheckRows bool) *Report

func (*Report) CheckMySQLRows

func (r *Report) CheckMySQLRows(mysqlQuery string) (int64, error)

func (*Report) CheckOracleRows

func (r *Report) CheckOracleRows(oracleQuery string) (int64, error)

func (*Report) GenDBQuery

func (r *Report) GenDBQuery() (oracleQuery string, mysqlQuery string)

func (*Report) Report

func (r *Report) Report() (string, error)

func (*Report) ReportCheckCRC32

func (r *Report) ReportCheckCRC32() (string, error)

func (*Report) ReportCheckRows

func (r *Report) ReportCheckRows() (string, error)

func (*Report) String

func (r *Report) String() string

type Task

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

func NewPartCompareTableTask

func NewPartCompareTableTask(ctx context.Context, cfg *config.Config, compareTables []string, mysql *mysql.MySQL, oracle *oracle.Oracle, tableNameRule map[string]string) []*Task

func NewWaitCompareTableTask

func NewWaitCompareTableTask(ctx context.Context, cfg *config.Config, compareTables []string, oracleCollation bool, mysql *mysql.MySQL, oracle *oracle.Oracle,
	tableNameRule map[string]string) []*Task

func (*Task) AdjustDBSelectColumn

func (t *Task) AdjustDBSelectColumn() (sourceColumnInfo string, targetColumnInfo string, err error)

字段查询以 ORACLE 字段为主 Date/Timestamp 字段类型格式化 Interval Year/Day 数据字符 TO_CHAR 格式化

func (*Task) FilterDBWhereColumn

func (t *Task) FilterDBWhereColumn() (string, error)

筛选 NUMBER 字段以及判断表是否存在主键/唯一键/唯一索引 第一优先级配置文件指定字段【忽略是否存在索引】 第二优先级任意取某个主键/唯一索引 NUMBER 字段 第三优先级取某个唯一性 DISTINCT 高的索引 NUMBER 字段 如果表没有索引 NUMBER 字段或者没有 NUMBER 字段则报错

func (*Task) IsPartitionTable

func (t *Task) IsPartitionTable() (string, error)

Jump to

Keyboard shortcuts

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