v1

package
v1.52.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPartitioningNotSupported = errors.New("datastore does not implement BulkExportPartitioner")

ErrPartitioningNotSupported is returned by PlanPartitionedExport when the underlying datastore does not implement BulkExportPartitioner.

Functions

func BulkExport

func BulkExport(ctx context.Context, ds datastore.ReadOnlyDatastore, batchSize uint64, req *v1.BulkExportRelationshipsRequest, fallbackRevision datastore.Revision, sender func(response *v1.BulkExportRelationshipsResponse) error) error

BulkExport implements the BulkExportRelationships API functionality. Given a datastore.Datastore, it will export stream via the sender all relationships matched by the incoming request. If no cursor is provided, it will fallback to the provided revision.

func StreamPartitionedExport added in v1.52.0

StreamPartitionedExport returns an iterator over relationships in a single partition. Use PlanPartitionedExport first to obtain partitions.

The returned iterator streams rows lazily from the datastore. The caller is responsible for iterating and handling errors:

iter, err := v1.StreamPartitionedExport(ctx, ds, req)
if err != nil { ... }
for rel, err := range iter {
    if err != nil { ... }
    // process rel
}

Types

type ExportPartition added in v1.52.0

type ExportPartition struct {
	Index      uint32
	LowerBound dsoptions.Cursor // nil = start of table (exclusive)
	UpperBound dsoptions.Cursor // nil = end of table (inclusive)
}

ExportPartition represents a non-overlapping portion of the relationship table that can be streamed independently.

type ExportPlan added in v1.52.0

type ExportPlan struct {
	Partitions []ExportPartition
}

ExportPlan contains the partitions for a partitioned export.

func PlanPartitionedExport added in v1.52.0

func PlanPartitionedExport(ctx context.Context, ds datastore.Datastore, desiredPartitions uint32) (*ExportPlan, error)

PlanPartitionedExport plans a partitioned export by splitting the relationship table into non-overlapping key ranges for parallel streaming.

type StreamRequest added in v1.52.0

type StreamRequest struct {
	Partition ExportPartition
	Revision  datastore.Revision
}

StreamRequest contains the parameters for streaming a single partition.

Jump to

Keyboard shortcuts

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