Documentation ¶
Overview ¶
Copyright (c) YugabyteDB, Inc.
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.
Copyright (c) YugabyteDB, Inc.
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.
Copyright (c) YugabyteDB, Inc.
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.
Copyright (c) YugabyteDB, Inc.
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.
Copyright (c) YugabyteDB, Inc.
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
- Variables
- func AskPrompt(args ...string) bool
- func CleanDir(dir string)
- func ContainsAnySubstringFromSlice(slice []string, s string) bool
- func ContainsString(list []string, str string) bool
- func CsvStringToSlice(str string) []string
- func ErrExit(formatString string, args ...interface{})
- func FileOrFolderExists(path string) bool
- func FileOrFolderExistsWithGlobPattern(path string) bool
- func ForEachLineInFile(filePath string, callback func(line string) bool) error
- func ForEachMatchingLineInFile(filePath string, re *regexp.Regexp, callback func(matches []string) bool) error
- func GenerateRandomString(length int) string
- func GetEnvAsInt(key string, fallback int) int
- func GetExportSchemaObjectList(sourceDBType string) []string
- func GetFSUtilizationPercentage(path string) (int, error)
- func GetMapKeysSorted(m map[string]*string) []string
- func GetObjectDirPath(schemaDirPath string, objType string) string
- func GetObjectFileName(schemaDirPath string, objType string) string
- func GetObjectFilePath(schemaDirPath string, objType string) string
- func GetObjectNameListFromReport(report Report, objType string) []string
- func GetRedactedURLs(urlList []string) []string
- func GetSchemaObjectList(sourceDBType string) []string
- func GetSortedKeys(tablesProgressMetadata map[string]*TableProgressMetadata) []string
- func GetSqlStmtToPrint(stmt string) string
- func GitCommitHash() string
- func HumanReadableByteCount(bytes int64) string
- func IsDirectoryEmpty(pathPattern string) bool
- func IsQuotedString(str string) bool
- func LookupIP(name string) []string
- func PrettifyHtmlString(htmlStr string) string
- func PrettifyJsonString(jsonStr string) string
- func PrintAndLog(formatString string, args ...interface{})
- func PrintIfTrue(message string, args ...bool)
- func PrintSqlStmtIfDDL(stmt string, fileName string)
- func ReadTableNameListFromFile(filePath string) ([]string, error)
- func Readline(r *bufio.Reader) (string, error)
- func SetDifference(includeList []string, excludeList []string) []string
- func ToCaseInsensitiveNames(names []string) []string
- func Wait(args ...string)
- type BoolStr
- type DBObject
- type IndexInfo
- type Issue
- type Report
- type Segment
- type Summary
- type TableProgressMetadata
- type TailReader
Constants ¶
const ( TABLE_MIGRATION_NOT_STARTED = iota TABLE_MIGRATION_IN_PROGRESS TABLE_MIGRATION_DONE TABLE_MIGRATION_COMPLETED YB_VOYAGER_NULL_STRING = "__YBV_NULL__" )
const ( SNAPSHOT_ONLY = "snapshot-only" SNAPSHOT_AND_CHANGES = "snapshot-and-changes" CHANGES_ONLY = "changes-only" )
const ( // This constant must be updated on every release. YB_VOYAGER_VERSION = "1.6.5" // @Refer: https://icinga.com/blog/2022/05/25/embedding-git-commit-information-in-go-binaries/ GIT_COMMIT_HASH = "$Format:%H$" )
Variables ¶
var DoNotPrompt bool
var TableMetadataStatusMap = map[int]string{
0: "NOT-STARTED",
1: "EXPORTING",
2: "DONE",
3: "DONE",
}
var WaitChannel = make(chan int)
var WaitGroup sync.WaitGroup
Functions ¶
func ContainsAnySubstringFromSlice ¶ added in v1.6.2
func ContainsString ¶ added in v1.6.0
func CsvStringToSlice ¶
func FileOrFolderExists ¶
func FileOrFolderExistsWithGlobPattern ¶ added in v1.6.0
func ForEachLineInFile ¶ added in v1.5.0
func ForEachMatchingLineInFile ¶ added in v1.5.0
func GenerateRandomString ¶ added in v1.4.0
func GetEnvAsInt ¶ added in v1.5.0
func GetExportSchemaObjectList ¶ added in v1.6.0
func GetFSUtilizationPercentage ¶ added in v1.5.0
func GetMapKeysSorted ¶ added in v1.5.0
func GetObjectDirPath ¶
func GetObjectFileName ¶
func GetObjectFilePath ¶
func GetRedactedURLs ¶ added in v0.81.0
func GetSchemaObjectList ¶
func GetSortedKeys ¶
func GetSortedKeys(tablesProgressMetadata map[string]*TableProgressMetadata) []string
func GetSqlStmtToPrint ¶ added in v0.83.0
func GitCommitHash ¶
func GitCommitHash() string
func HumanReadableByteCount ¶ added in v1.4.0
func IsDirectoryEmpty ¶
func IsQuotedString ¶
func PrettifyHtmlString ¶
func PrettifyJsonString ¶
func PrintAndLog ¶
func PrintAndLog(formatString string, args ...interface{})
func PrintIfTrue ¶
func PrintSqlStmtIfDDL ¶ added in v0.83.0
func ReadTableNameListFromFile ¶ added in v1.6.0
read the file and return slice of csv
func SetDifference ¶ added in v0.81.0
func ToCaseInsensitiveNames ¶ added in v0.81.0
Types ¶
type TableProgressMetadata ¶
type TableProgressMetadata struct { TableName *sqlname.SourceName InProgressFilePath string FinalFilePath string Status int //(0: NOT-STARTED, 1: IN-PROGRESS, 2: DONE, 3: COMPLETED) CountLiveRows int64 CountTotalRows int64 FileOffsetToContinue int64 // This might be removed later IsPartition bool ParentTable string }
type TailReader ¶ added in v1.2.0
type TailReader struct {
// contains filtered or unexported fields
}
func NewTailReader ¶ added in v1.2.0
func NewTailReader(r io.Reader, getLastValidOffsetFn func() (int64, error)) *TailReader