cockroach: github.com/cockroachdb/cockroach/pkg/sql/backfill Index | Files

package backfill

import "github.com/cockroachdb/cockroach/pkg/sql/backfill"

Index

Package Files

backfill.go

func ColumnMutationFilter Uses

func ColumnMutationFilter(m sqlbase.DescriptorMutation) bool

ColumnMutationFilter is a filter that allows mutations that add or drop columns.

func ConvertBackfillError Uses

func ConvertBackfillError(
    ctx context.Context, tableDesc *sqlbase.ImmutableTableDescriptor, b *kv.Batch,
) error

ConvertBackfillError returns a cleaner SQL error for a failed Batch.

func IndexMutationFilter Uses

func IndexMutationFilter(m sqlbase.DescriptorMutation) bool

IndexMutationFilter is a filter that allows mutations that add indexes.

type ColumnBackfiller Uses

type ColumnBackfiller struct {
    // contains filtered or unexported fields
}

ColumnBackfiller is capable of running a column backfill for all updateCols.

func (*ColumnBackfiller) InitForDistributedUse Uses

func (cb *ColumnBackfiller) InitForDistributedUse(
    ctx context.Context, flowCtx *execinfra.FlowCtx, desc *sqlbase.ImmutableTableDescriptor,
) error

InitForDistributedUse initializes a ColumnBackfiller for use as part of a backfill operation executing as part of a distributed flow. In this use, the backfill operation manages its own transactions. This separation is necessary due to the different procedure for accessing user defined type metadata as part of a distributed flow.

func (*ColumnBackfiller) InitForLocalUse Uses

func (cb *ColumnBackfiller) InitForLocalUse(
    ctx context.Context,
    evalCtx *tree.EvalContext,
    semaCtx *tree.SemaContext,
    desc *sqlbase.ImmutableTableDescriptor,
) error

InitForLocalUse initializes a ColumnBackfiller for use during local execution within a transaction. In this case, the entire backfill process is occurring on the gateway as part of the user's transaction.

func (*ColumnBackfiller) RunColumnBackfillChunk Uses

func (cb *ColumnBackfiller) RunColumnBackfillChunk(
    ctx context.Context,
    txn *kv.Txn,
    tableDesc *sqlbase.ImmutableTableDescriptor,
    sp roachpb.Span,
    chunkSize int64,
    alsoCommit bool,
    traceKV bool,
) (roachpb.Key, error)

RunColumnBackfillChunk runs column backfill over a chunk of the table using the span sp provided, for all updateCols.

type IndexBackfiller Uses

type IndexBackfiller struct {
    // contains filtered or unexported fields
}

IndexBackfiller is capable of backfilling all the added index.

func (*IndexBackfiller) BuildIndexEntriesChunk Uses

func (ib *IndexBackfiller) BuildIndexEntriesChunk(
    ctx context.Context,
    txn *kv.Txn,
    tableDesc *sqlbase.ImmutableTableDescriptor,
    sp roachpb.Span,
    chunkSize int64,
    traceKV bool,
) ([]sqlbase.IndexEntry, roachpb.Key, error)

BuildIndexEntriesChunk reads a chunk of rows from a table using the span sp provided, and builds all the added indexes.

func (*IndexBackfiller) ContainsInvertedIndex Uses

func (ib *IndexBackfiller) ContainsInvertedIndex() bool

ContainsInvertedIndex returns true if backfilling an inverted index.

func (*IndexBackfiller) Init Uses

func (ib *IndexBackfiller) Init(
    evalCtx *tree.EvalContext, desc *sqlbase.ImmutableTableDescriptor,
) error

Init initializes an IndexBackfiller.

func (*IndexBackfiller) RunIndexBackfillChunk Uses

func (ib *IndexBackfiller) RunIndexBackfillChunk(
    ctx context.Context,
    txn *kv.Txn,
    tableDesc *sqlbase.ImmutableTableDescriptor,
    sp roachpb.Span,
    chunkSize int64,
    alsoCommit bool,
    traceKV bool,
) (roachpb.Key, error)

RunIndexBackfillChunk runs an index backfill over a chunk of the table by tracversing the span sp provided. The backfill is run for the added indexes.

type MutationFilter Uses

type MutationFilter func(sqlbase.DescriptorMutation) bool

MutationFilter is the type of a simple predicate on a mutation.

Package backfill imports 12 packages (graph) and is imported by 4 packages. Updated 2020-08-05. Refresh now. Tools for package owners.