dsutils

package
v0.0.0-...-650f6e2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package dsutils provides beam transformations and utilities to interact with Google Datastore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllKeysWithHexPrefix

func GetAllKeysWithHexPrefix(
	s beam.Scope,
	cloudProject string,
	namespaces beam.PCollection,
	kind string,
	opts ReadOptions,
) beam.PCollection

GetAllKeysWithHexPrefix queries all the keys from datastore for the given kind in the given namespaces (in a PCollection<string>) and returns PCollection<KeyBatch>.

func GetAllNamespaces

func GetAllNamespaces(s beam.Scope, cloudProject string) beam.PCollection

GetAllNamespaces queries all the namespaces from datastore and returns PCollection<string>.

Types

type HexPosClaim

type HexPosClaim struct {
	Value string
	End   bool
}

type KeyBatch

type KeyBatch struct {
	Namespace string
	Keys      []*datastore.Key
}

type NamespaceCount

type NamespaceCount struct {
	Namespace      string
	EstimatedCount int64
}

type ReadOptions

type ReadOptions struct {
	// HexPrefixLength is the minimum guaranteed length of hex prefix in
	// `ParentKind`'s key. The hex prefix will be used to divide the read queries
	// to make it run faster should the beam runner decides more parallelism is
	// needed.
	HexPrefixLength int
	// OutputBatchSize controls the number of datastore keys in a given output
	// batch.
	OutputBatchSize int
	// MinEstimatedCount is the count used as a floor when estimating the number
	// of entities of the specified Kind in a namespace when the stats is not
	// available or is too small. This can happen when the kind was just added to
	// the namespace and stats hasn't been updated yet.
	MinEstimatedCount int64
	// InitialSplitSize is the size used to split the query DoFn on start up.
	InitialSplitSize int64
}

Jump to

Keyboard shortcuts

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