sqlccl

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Overview

Package sqlccl is a generated protocol buffer package.

It is generated from these files:

cockroach/pkg/ccl/sqlccl/backup.proto

It has these top-level messages:

BackupDescriptor

Index

Constants

View Source
const (
	// BackupDescriptorName is the file name used for serialized
	// BackupDescriptor protos.
	BackupDescriptorName = "BACKUP"
	// BackupDescriptorCheckpointName is the file name used to store the
	// serialized BackupDescriptor proto while the backup is in progress.
	BackupDescriptorCheckpointName = "BACKUP-CHECKPOINT"
	// BackupFormatInitialVersion is the first version of backup and its files.
	BackupFormatInitialVersion uint32 = 0
)

Variables

View Source
var (
	ErrInvalidLengthBackup = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBackup   = fmt.Errorf("proto: integer overflow")
)
View Source
var BackupCheckpointInterval = time.Minute

BackupCheckpointInterval is the interval at which backup progress is saved to durable storage.

BackupImplicitSQLDescriptors are descriptors for tables that are implicitly included in every backup, plus their parent database descriptors.

Functions

func LoadCSV added in v1.1.0

func LoadCSV(
	ctx context.Context,
	table string,
	dataFiles []string,
	dest string,
	comma, comment rune,
	nullif *string,
	sstMaxSize int64,
	tempDir string,
) (csvCount, kvCount, sstCount int64, err error)

LoadCSV converts CSV files into enterprise backup format.

func ValidatePreviousBackups

func ValidatePreviousBackups(ctx context.Context, uris []string) (hlc.Timestamp, error)

ValidatePreviousBackups checks that the timestamps of previous backups are consistent. The most recently backed-up time is returned.

Types

type BackupDescriptor

type BackupDescriptor struct {
	StartTime cockroach_util_hlc.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime" json:"start_time"`
	EndTime   cockroach_util_hlc.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime" json:"end_time"`
	// Spans contains the spans requested for backup. The keyranges covered by
	// `files` may be a subset of this if there were ranges with no changes since
	// the last backup. For all tables in the backup descriptor, these spans must
	// completely cover each table's span. For example, if a table with ID 51 were
	// being backed up, then the span `/Table/5{1-2}` must be completely covered.
	Spans         []cockroach_roachpb1.Span                           `protobuf:"bytes,3,rep,name=spans" json:"spans"`
	Files         []BackupDescriptor_File                             `protobuf:"bytes,4,rep,name=files" json:"files"`
	Descriptors   []cockroach_sql_sqlbase1.Descriptor                 `protobuf:"bytes,5,rep,name=descriptors" json:"descriptors"`
	EntryCounts   cockroach_roachpb3.BulkOpSummary                    `protobuf:"bytes,12,opt,name=entry_counts,json=entryCounts" json:"entry_counts"`
	Dir           cockroach_roachpb3.ExportStorage                    `protobuf:"bytes,7,opt,name=dir" json:"dir"`
	FormatVersion uint32                                              `protobuf:"varint,8,opt,name=format_version,json=formatVersion,proto3" json:"format_version,omitempty"`
	ClusterID     github_com_cockroachdb_cockroach_pkg_util_uuid.UUID `` /* 141-byte string literal not displayed */
	// node_id and build_info of the gateway node (which writes the descriptor).
	NodeID    github_com_cockroachdb_cockroach_pkg_roachpb.NodeID `` /* 142-byte string literal not displayed */
	BuildInfo cockroach_build.Info                                `protobuf:"bytes,11,opt,name=build_info,json=buildInfo" json:"build_info"`
}

BackupDescriptor represents a consistent snapshot of ranges.

Each range snapshot includes a path to data that is a diff of the data in that key range between a start and end timestamp. The end timestamp of all ranges in a backup is the same, but the start may vary (to allow individual tables to be backed up on different schedules).

func Load

func Load(
	ctx context.Context,
	db *gosql.DB,
	r io.Reader,
	database, uri string,
	ts hlc.Timestamp,
	loadChunkBytes int64,
	tempPrefix string,
) (BackupDescriptor, error)

Load converts r into SSTables and backup descriptors. database is the name of the database into which the SSTables will eventually be written. uri is the storage location. ts is the time at which the MVCC data will be set. loadChunkBytes is the size at which to create a new SSTable (which will translate into a new range during restore); set to 0 to use the zone's default range max / 2.

func (*BackupDescriptor) Descriptor

func (*BackupDescriptor) Descriptor() ([]byte, []int)

func (*BackupDescriptor) Marshal

func (m *BackupDescriptor) Marshal() (dAtA []byte, err error)

func (*BackupDescriptor) MarshalTo

func (m *BackupDescriptor) MarshalTo(dAtA []byte) (int, error)

func (*BackupDescriptor) ProtoMessage

func (*BackupDescriptor) ProtoMessage()

func (*BackupDescriptor) Reset

func (m *BackupDescriptor) Reset()

func (*BackupDescriptor) Size

func (m *BackupDescriptor) Size() (n int)

func (*BackupDescriptor) String

func (m *BackupDescriptor) String() string

func (*BackupDescriptor) Unmarshal

func (m *BackupDescriptor) Unmarshal(dAtA []byte) error

type BackupDescriptor_File

type BackupDescriptor_File struct {
	Span        cockroach_roachpb1.Span          `protobuf:"bytes,1,opt,name=span" json:"span"`
	Path        string                           `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Sha512      []byte                           `protobuf:"bytes,4,opt,name=sha512,proto3" json:"sha512,omitempty"`
	EntryCounts cockroach_roachpb3.BulkOpSummary `protobuf:"bytes,6,opt,name=entry_counts,json=entryCounts" json:"entry_counts"`
}

BackupDescriptor_File represents a file that contains the diff for a key range between two timestamps.

func (*BackupDescriptor_File) Descriptor

func (*BackupDescriptor_File) Descriptor() ([]byte, []int)

func (*BackupDescriptor_File) Marshal

func (m *BackupDescriptor_File) Marshal() (dAtA []byte, err error)

func (*BackupDescriptor_File) MarshalTo

func (m *BackupDescriptor_File) MarshalTo(dAtA []byte) (int, error)

func (*BackupDescriptor_File) ProtoMessage

func (*BackupDescriptor_File) ProtoMessage()

func (*BackupDescriptor_File) Reset

func (m *BackupDescriptor_File) Reset()

func (*BackupDescriptor_File) Size

func (m *BackupDescriptor_File) Size() (n int)

func (*BackupDescriptor_File) String

func (m *BackupDescriptor_File) String() string

func (*BackupDescriptor_File) Unmarshal

func (m *BackupDescriptor_File) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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