diff

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Apache-2.0 Imports: 19 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 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 AdjustTableSelectColumn

func AdjustTableSelectColumn(e *service.Engine, schemaName, tableName string, sourceCharacterSet, nlsComp string,
	sourceTableCollation string, sourceSchemaCollation string, oracleCollation bool, onlyCheckRows bool) ([]string, string, string, error)

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

func FilterOracleNUMBERColumn

func FilterOracleNUMBERColumn(e *service.Engine, schemaName, tableName, indexFiledName string, numberCols []string, onlyCheckRows bool) (string, error)

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

func OracleDiffMySQLTable

func OracleDiffMySQLTable(engine *service.Engine, cfg *config.CfgFile) error

func PreDiffCheck

func PreDiffCheck(exporterTableSlice []string, cfg *config.CfgFile, engine *service.Engine) error

func Report

func Report(targetSchema string, dm service.DataDiffMeta, engine *service.Engine, reportRes chan<- ReportSummary, onlyCheckRows bool) error

func StartTableDiff

func StartTableDiff(partSyncTableInfo, waitSyncTableInfo []string, cfg *config.CfgFile, engine *service.Engine,
	characterSet string, nlsComp string, tblCollation map[string]string, schemaCollation string, oraCollation bool, fixFileMW *o2m.FileMW) error

Types

type DBSummary

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

数据对比报告

type Diff

type Diff struct {
	ChunkSize                   int
	DiffThreads                 int
	OnlyCheckRows               bool
	IgnoreStructCheck           bool
	SourceSchema                string
	SourceTable                 string
	IndexFields                 string
	Range                       string
	SourceCharacterSet, NlsComp string
	SourceTableCollation        string
	SourceSchemaCollation       string
	OracleCollation             bool
	InsertBatchSize             int
	SyncMode                    string
	Engine                      *service.Engine `json:"-"`
}

Diff 数据对比

func NewDiff

func NewDiff(cfg *config.CfgFile, engine *service.Engine, exportTableSlice []string, sourceCharacterSet, nlsComp string,
	sourceTableCollation map[string]string,
	sourceSchemaCollation string,
	oracleCollation bool) ([]Diff, error)

func PreSplitChunk

func PreSplitChunk(cfg *config.CfgFile, engine *service.Engine, exportTableSlice []string, sourceCharacterSet, nlsComp string,
	sourceTableCollation map[string]string,
	sourceSchemaCollation string,
	oracleCollation bool) ([]Diff, error)

func (*Diff) SplitChunk

func (d *Diff) SplitChunk(workerID int, globalSCN uint64) error

func (*Diff) String

func (d *Diff) String() string

type ReportSummary

type ReportSummary struct {
	CRC32Result string
	SourceName  string
	TargetName  string
	SourceRows  map[string]int64
	TargetRows  map[string]int64
	Range       string
}

Jump to

Keyboard shortcuts

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