Documentation
¶
Index ¶
- Constants
- Variables
- func ArrayIsDuplicated(elems []string) bool
- func CloseDataFile(f *os.File)
- func CopyFile(src, dest string) error
- func CurrentTimestamp() string
- func DollarQuoteString(literal string) string
- func EscapeSingleQuotes(str string) string
- func Exists(slice []string, val string) bool
- func GetUserAndHostInfo() (string, string, string)
- func GetVersion() string
- func HandleSingleDashes(args []string) []string
- func InitializePipeThroughParameters(compress bool, compressionType string, compressionLevel int)
- func InitializeSignalHandler(cleanupFunc func(bool), procDesc string, termFlag *bool)
- func MakeFQN(schema string, object string) string
- func MustGetFlagBool(flagName string) bool
- func MustGetFlagInt(flagName string) int
- func MustGetFlagString(flagName string) string
- func MustGetFlagStringArray(flagName string) []string
- func MustGetFlagStringSlice(flagName string) []string
- func MustPrintBytes(file io.Writer, bytes []byte) uint64
- func MustPrintf(file io.Writer, s string, v ...interface{}) uint64
- func MustPrintln(file io.Writer, v ...interface{}) uint64
- func OpenDataFile(filename string) *os.File
- func OpenFileForWrite(filename string) (*os.File, error)
- func ParseMappingFile(lines []string) map[string]string
- func ParseSchemaMappingFile(lines []string) ([]string, []string)
- func QuoteIdent(connectionPool *dbconn.DBConn, ident string) string
- func QuoteTableNames(conn *dbconn.DBConn, tableNames []string) ([]string, error)
- func ReadTableFile(filename string) ([]string, error)
- func ReadTableFileByFlag(flagSet *pflag.FlagSet, flag string) ([]string, error)
- func RedirectStream(reader io.Reader, writeCloser io.WriteCloser) error
- func SetCmdFlags(flagSet *pflag.FlagSet)
- func SetConnection(conn *dbconn.DBConn)
- func SetPipeThroughProgram(compression PipeThroughProgram)
- func SetVersion(v string)
- func SliceToQuotedString(slice []string) string
- func TerminateHangingCopySessions(conn *dbconn.DBConn, appName string)
- func UnquoteIdent(ident string) string
- func ValidateCompressionTypeAndLevel(compressionType string, compressionLevel int) error
- func ValidateFQNs(tableList []string) error
- func ValidateFullPath(path string) error
- func ValidateGPDBVersionCompatibility(connectionPool *dbconn.DBConn)
- func WriteDataFile(f *os.File, line string) error
- func WriteToFileAndMakeReadOnly(filename string, contents []byte) error
- type CompressionLevelsDescription
- type ExtendProgressBar
- type FileWithByteCount
- type FilterSet
- type FqnStruct
- type PipeThroughProgram
- type ProgressBar
- type SegmentHostInfo
- type VerboseProgressBar
Constants ¶
const ( PB_NONE = iota PB_INFO PB_VERBOSE //Verbose progress bar logs every 5 percent INCR_PERCENT = 5 )
* The following constants are used for determining when to display a progress bar * * PB_INFO only shows in info mode because some methods have a different way of * logging in verbose mode and we don't want them to conflict * PB_VERBOSE show a progress bar in INFO and VERBOSE mode * * A simple incremental progress tracker will be shown in info mode and * in verbose mode we will log progress at increments of 10%
const MINIMUM_GPDB4_VERSION = "4.3.17"
const MINIMUM_GPDB5_VERSION = "5.1.0"
Variables ¶
var ( Version string WasTerminated bool /* * Used for synchronizing DoCleanup. In DoInit() we increment the group * and then wait for at least one DoCleanup to finish, either in DoTeardown * or the signal handler. */ CleanupGroup *sync.WaitGroup )
* Non-flag variables
var CmdFlags *pflag.FlagSet
* Command-line flags
Functions ¶
func ArrayIsDuplicated ¶
func CloseDataFile ¶
func CurrentTimestamp ¶
func CurrentTimestamp() string
func DollarQuoteString ¶
Dollar-quoting logic is based on appendStringLiteralDQ() in pg_dump.
func EscapeSingleQuotes ¶
func GetUserAndHostInfo ¶
func GetVersion ¶
func GetVersion() string
func HandleSingleDashes ¶
func InitializeSignalHandler ¶
func MustGetFlagBool ¶
func MustGetFlagInt ¶
func MustGetFlagString ¶
func MustGetFlagStringArray ¶
func MustGetFlagStringSlice ¶
func MustPrintln ¶
func OpenDataFile ¶
func ParseMappingFile ¶
func ParseSchemaMappingFile ¶
func QuoteTableNames ¶
https://github.com/greenplum-db/gpbackup/commit/6e9829cf5c12fb8e66cecd8143ac0a7379e44d01
func ReadTableFile ¶
func ReadTableFileByFlag ¶
func RedirectStream ¶
func RedirectStream(reader io.Reader, writeCloser io.WriteCloser) error
func SetCmdFlags ¶
func SetConnection ¶
func SetPipeThroughProgram ¶
func SetPipeThroughProgram(compression PipeThroughProgram)
func SetVersion ¶
func SetVersion(v string)
func SliceToQuotedString ¶
func UnquoteIdent ¶
func ValidateFQNs ¶
func ValidateFullPath ¶
Types ¶
type CompressionLevelsDescription ¶
A description of compression levels for some compression type
type ExtendProgressBar ¶
func (*ExtendProgressBar) Finish ¶
func (epb *ExtendProgressBar) Finish()
func (*ExtendProgressBar) Increment ¶
func (epb *ExtendProgressBar) Increment()
func (*ExtendProgressBar) Start ¶
func (epb *ExtendProgressBar) Start()
type FileWithByteCount ¶
func NewFileWithByteCount ¶
func NewFileWithByteCount(writer io.Writer) *FileWithByteCount
func NewFileWithByteCountFromFile ¶
func NewFileWithByteCountFromFile(filename string) *FileWithByteCount
func (*FileWithByteCount) Close ¶
func (file *FileWithByteCount) Close()
func (*FileWithByteCount) MustPrint ¶
func (file *FileWithByteCount) MustPrint(s string)
func (*FileWithByteCount) MustPrintf ¶
func (file *FileWithByteCount) MustPrintf(s string, v ...interface{})
func (*FileWithByteCount) MustPrintln ¶
func (file *FileWithByteCount) MustPrintln(v ...interface{})
type FilterSet ¶
* This set implementation can be used in one of two ways. An "include" set * returns true if an item is in the map and false otherwise, while an "exclude" * set returns false if an item is in the map and true otherwise, so that the * set can be used for filtering on items in lists. * * The alwaysMatchesFilter variable causes MatchesFilter() to always return true * if an empty list is passed, so that it doesn't attempt to filter on anything * The isExclude variable controls whether a set is an include set or an exclude * set.
func NewExcludeSet ¶
func NewIncludeSet ¶
func (*FilterSet) MatchesFilter ¶
type FqnStruct ¶
func SeparateSchemaAndTable ¶
type PipeThroughProgram ¶
type PipeThroughProgram struct {
Name string
OutputCommand string
InputCommand string
Extension string
}
func GetPipeThroughProgram ¶
func GetPipeThroughProgram() PipeThroughProgram
type ProgressBar ¶
type ProgressBar interface {
Start()
Finish()
Increment()
}
func NewProgressBar ¶
func NewProgressBar(count int, prefix string, showProgressBar int) ProgressBar
func NewProgressBarEx ¶
func NewProgressBarEx(progress *mpb.Progress, count int, prefix string) ProgressBar
type SegmentHostInfo ¶
func GetSegmentsHost ¶
func GetSegmentsHost(conn *dbconn.DBConn) []SegmentHostInfo
GetSegmentsHost retrieves the content ID and hostname for each primary segment. For Cloudberry Enterprise DB, it attempts to get segments for the warehouse identified by 'SHOW warehouse'. For other databases (GPDB, CBDB), it gets all primary segments.
func GetSegmentsIpAddress ¶
func GetSegmentsIpAddress(conn *dbconn.DBConn, timestamp string) []SegmentHostInfo
GetSegmentsIpAddress resolves the IP address for each primary segment in the Greenplum database. It first retrieves the list of primary segments and their hostnames using the GetSegmentsHost function. Then, for each segment, it calls the getSegmentIpAddress function to resolve the IP address of the segment. The function returns a slice of SegmentIpInfo structs containing the content ID and IP address for each primary segment.
type VerboseProgressBar ¶
func NewVerboseProgressBar ¶
func (*VerboseProgressBar) Finish ¶
func (vpb *VerboseProgressBar) Finish()
func (*VerboseProgressBar) Increment ¶
func (vpb *VerboseProgressBar) Increment()
func (*VerboseProgressBar) Start ¶
func (vpb *VerboseProgressBar) Start()