Documentation ¶
Index ¶
- Constants
- func CheckAgentErrorsOnSegments(c *cluster.Cluster, fpInfo filepath.FilePathInfo) error
- func CheckGpexpandRunning(errMsg GpexpandFailureMessage)
- func CleanUpHelperFilesOnAllHosts(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func CleanUpSegmentHelperProcesses(c *cluster.Cluster, fpInfo filepath.FilePathInfo, operation string)
- func CommandExists(cmd string) bool
- func CopyFile(src, dest string) error
- func CreateSegmentPipeOnAllHosts(oid string, c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func CreateSkipFileOnSegments(oid string, tableName string, c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func DollarQuoteString(literal string) string
- func EscapeSingleQuotes(str string) string
- func Exists(slice []string, val string) bool
- func FileExists(filename string) bool
- func GetFileHash(filename string) ([32]byte, error)
- func GetSecretKey(pluginName string, mdd string) (string, error)
- func InitializePipeThroughParameters(compress bool, compressionType string, compressionLevel int)
- func InitializeSignalHandler(cleanupFunc func(bool), procDesc string, termFlag *bool)
- func LogExecutionTime(start time.Time, name string)
- func MakeFQN(schema string, object string) string
- func MustPrintf(file io.Writer, s string, v ...interface{}) uint64
- func MustPrintln(file io.Writer, v ...interface{}) uint64
- func OpenFileForWrite(filename string) (*os.File, error)
- func QuoteIdent(connectionPool *dbconn.DBConn, ident string) string
- func RelationIsExcludedByUser(inRelationsUserInput []string, exRelationsUserInput []string, tableFQN string) bool
- func RemoveFileIfExists(filename string) error
- func SchemaIsExcludedByUser(inSchemasUserInput []string, exSchemasUserInput []string, schemaName string) bool
- func SetPipeThroughProgram(compression PipeThroughProgram)
- func SliceToQuotedString(slice []string) string
- func StartGpbackupHelpers(c *cluster.Cluster, fpInfo filepath.FilePathInfo, operation string, ...)
- func TerminateHangingCopySessions(connectionPool *dbconn.DBConn, fpInfo filepath.FilePathInfo, 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 VerifyHelperVersionOnSegments(version string, c *cluster.Cluster)
- func WriteOidListToSegments(oidList []string, c *cluster.Cluster, fpInfo filepath.FilePathInfo, ...)
- func WriteOids(writer io.Writer, oidList []string) error
- func WriteOidsToFile(filename string, oidList []string)
- func WriteToFileAndMakeReadOnly(filename string, contents []byte) error
- type CompressionLevelsDescription
- type FileWithByteCount
- type FilterSet
- type GpexpandFailureMessage
- type GpexpandSensor
- type PipeThroughProgram
- type PluginConfig
- func (plugin *PluginConfig) BackupFile(filenamePath string) error
- func (plugin *PluginConfig) BackupPluginVersion() string
- func (plugin *PluginConfig) BackupSegmentTOCs(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func (plugin *PluginConfig) CanRestoreSubset() bool
- func (plugin *PluginConfig) CheckPluginExistsOnAllHosts(c *cluster.Cluster) string
- func (plugin *PluginConfig) CleanupPluginForBackup(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func (plugin *PluginConfig) CleanupPluginForRestore(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func (plugin *PluginConfig) CopyPluginConfigToAllHosts(c *cluster.Cluster)
- func (plugin *PluginConfig) DeletePluginConfigWhenEncrypting(c *cluster.Cluster)
- func (plugin *PluginConfig) GetPluginName(c *cluster.Cluster) (pluginName string, err error)
- func (plugin *PluginConfig) MustBackupFile(filenamePath string)
- func (plugin *PluginConfig) MustRestoreFile(filenamePath string)
- func (plugin *PluginConfig) RestoreSegmentTOCs(c *cluster.Cluster, fpInfo filepath.FilePathInfo, isResizeRestore bool, ...)
- func (plugin *PluginConfig) SetBackupPluginVersion(timestamp string, historicalPluginVersion string)
- func (plugin *PluginConfig) SetupPluginForBackup(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func (plugin *PluginConfig) SetupPluginForRestore(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
- func (plugin *PluginConfig) UsesEncryption() bool
- type PluginScope
- type ProgressBar
- type VerboseProgressBar
Constants ¶
const ( BackupPreventedByGpexpandMessage GpexpandFailureMessage = `Greenplum expansion currently in process, please re-run gpbackup when the expansion has completed` RestorePreventedByGpexpandMessage GpexpandFailureMessage = `` /* 268-byte string literal not displayed */ CoordinatorDataDirQuery = `select datadir from gp_segment_configuration where content=-1 and role='p'` GpexpandTemporaryTableStatusQuery = `SELECT status FROM gpexpand.status ORDER BY updated DESC LIMIT 1` GpexpandStatusTableExistsQuery = `` /* 156-byte string literal not displayed */ GpexpandStatusFilename = "gpexpand.status" )
const ( PB_NONE = iota PB_INFO PB_VERBOSE //Verbose progress bar logs every 10 percent INCR_PERCENT = 10 )
* 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 = "1.1.0"
const MINIMUM_GPDB5_VERSION = "1.1.0"
const RequiredPluginVersion = "0.3.0"
const SecretKeyFile = ".encrypt"
Variables ¶
This section is empty.
Functions ¶
func CheckAgentErrorsOnSegments ¶
func CheckAgentErrorsOnSegments(c *cluster.Cluster, fpInfo filepath.FilePathInfo) error
func CheckGpexpandRunning ¶
func CheckGpexpandRunning(errMsg GpexpandFailureMessage)
func CleanUpHelperFilesOnAllHosts ¶
func CleanUpHelperFilesOnAllHosts(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
func CleanUpSegmentHelperProcesses ¶
func CleanUpSegmentHelperProcesses(c *cluster.Cluster, fpInfo filepath.FilePathInfo, operation string)
func CommandExists ¶
func CreateSegmentPipeOnAllHosts ¶
func CreateSegmentPipeOnAllHosts(oid string, c *cluster.Cluster, fpInfo filepath.FilePathInfo)
* The reason that gprestore is in charge of creating the first pipe to ensure * that the first pipe is created before the first COPY FROM is issued. If * gpbackup_helper was in charge of creating the first pipe, there is a * possibility that the COPY FROM commands start before gpbackup_helper is done * starting up and setting up the first pipe.
func DollarQuoteString ¶
Dollar-quoting logic is based on appendStringLiteralDQ() in pg_dump.
func EscapeSingleQuotes ¶
func FileExists ¶
func GetFileHash ¶
func InitializeSignalHandler ¶
func LogExecutionTime ¶
func MustPrintln ¶
func RemoveFileIfExists ¶
func SchemaIsExcludedByUser ¶
func SetPipeThroughProgram ¶
func SetPipeThroughProgram(compression PipeThroughProgram)
func SliceToQuotedString ¶
func StartGpbackupHelpers ¶
func TerminateHangingCopySessions ¶
func TerminateHangingCopySessions(connectionPool *dbconn.DBConn, fpInfo filepath.FilePathInfo, appName string)
TODO: Uniquely identify COPY commands in the multiple data file case to allow terminating sessions
func UnquoteIdent ¶
func ValidateFQNs ¶
Since we currently split schema and table on the dot (.), we can't allow users to filter backup or restore tables with dots in the schema or table.
func ValidateFullPath ¶
func WriteOidListToSegments ¶
func WriteOidsToFile ¶
Types ¶
type CompressionLevelsDescription ¶
A description of compression levels for some compression type
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 GpexpandFailureMessage ¶
type GpexpandFailureMessage string
type GpexpandSensor ¶
type GpexpandSensor struct {
// contains filtered or unexported fields
}
func NewGpexpandSensor ¶
func NewGpexpandSensor(myfs vfs.Filesystem, conn *dbconn.DBConn) GpexpandSensor
func (GpexpandSensor) IsGpexpandRunning ¶
func (sensor GpexpandSensor) IsGpexpandRunning() (bool, error)
type PipeThroughProgram ¶
type PipeThroughProgram struct { Name string OutputCommand string InputCommand string Extension string }
func GetPipeThroughProgram ¶
func GetPipeThroughProgram() PipeThroughProgram
type PluginConfig ¶
type PluginConfig struct { ExecutablePath string `yaml:"executablepath"` ConfigPath string `yaml:"-"` Options map[string]string `yaml:"options"` // contains filtered or unexported fields }
func ReadPluginConfig ¶
func ReadPluginConfig(configFile string) (*PluginConfig, error)
func (*PluginConfig) BackupFile ¶
func (plugin *PluginConfig) BackupFile(filenamePath string) error
func (*PluginConfig) BackupPluginVersion ¶
func (plugin *PluginConfig) BackupPluginVersion() string
func (*PluginConfig) BackupSegmentTOCs ¶
func (plugin *PluginConfig) BackupSegmentTOCs(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
func (*PluginConfig) CanRestoreSubset ¶
func (plugin *PluginConfig) CanRestoreSubset() bool
func (*PluginConfig) CheckPluginExistsOnAllHosts ¶
func (plugin *PluginConfig) CheckPluginExistsOnAllHosts(c *cluster.Cluster) string
func (*PluginConfig) CleanupPluginForBackup ¶
func (plugin *PluginConfig) CleanupPluginForBackup(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
func (*PluginConfig) CleanupPluginForRestore ¶
func (plugin *PluginConfig) CleanupPluginForRestore(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
func (*PluginConfig) CopyPluginConfigToAllHosts ¶
func (plugin *PluginConfig) CopyPluginConfigToAllHosts(c *cluster.Cluster)
func (*PluginConfig) DeletePluginConfigWhenEncrypting ¶
func (plugin *PluginConfig) DeletePluginConfigWhenEncrypting(c *cluster.Cluster)
func (*PluginConfig) GetPluginName ¶
func (plugin *PluginConfig) GetPluginName(c *cluster.Cluster) (pluginName string, err error)
func (*PluginConfig) MustBackupFile ¶
func (plugin *PluginConfig) MustBackupFile(filenamePath string)
func (*PluginConfig) MustRestoreFile ¶
func (plugin *PluginConfig) MustRestoreFile(filenamePath string)
func (*PluginConfig) RestoreSegmentTOCs ¶
func (plugin *PluginConfig) RestoreSegmentTOCs(c *cluster.Cluster, fpInfo filepath.FilePathInfo, isResizeRestore bool, origSize int, destSize int)
func (*PluginConfig) SetBackupPluginVersion ¶
func (plugin *PluginConfig) SetBackupPluginVersion(timestamp string, historicalPluginVersion string)
func (*PluginConfig) SetupPluginForBackup ¶
func (plugin *PluginConfig) SetupPluginForBackup(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
func (*PluginConfig) SetupPluginForRestore ¶
func (plugin *PluginConfig) SetupPluginForRestore(c *cluster.Cluster, fpInfo filepath.FilePathInfo)
func (*PluginConfig) UsesEncryption ¶
func (plugin *PluginConfig) UsesEncryption() bool
type PluginScope ¶
type PluginScope string
const ( COORDINATOR PluginScope = "coordinator" MASTER PluginScope = "master" SEGMENT_HOST PluginScope = "segment_host" SEGMENT PluginScope = "segment" )
The COORDINATOR and MASTER scopes are identical in function, we just support both so that creators of existing plugins as of GPDB 6 need not (re)write them to support the GPDB 7 verbiage. Plugin code should use COORDINATOR when carrying out internal functionality, but check for both COORDINATOR and MASTER when expecting external input.
type ProgressBar ¶
func NewProgressBar ¶
func NewProgressBar(count int, prefix string, showProgressBar int) ProgressBar
type VerboseProgressBar ¶
type VerboseProgressBar struct { *pb.ProgressBar // contains filtered or unexported fields }
func NewVerboseProgressBar ¶
func NewVerboseProgressBar(count int, prefix string) *VerboseProgressBar
func (*VerboseProgressBar) Increment ¶
func (vpb *VerboseProgressBar) Increment() int