gcpbigtable

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 53 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Cloud Bigtable

Parity grade: B · SDK cloud.google.com/go/bigtable@v1.58.0 · last audited 2026-10-25 (fa4903d9d)

Coverage

Metric Value
PARITY entries audited 67 (60 ok, 7 partial)
Feature families 7 (4 ok, 3 partial)
Known gaps 1
Deferred items 0
Resource leaks clean
Known gaps
  • Memory layers (Get/List/UpdateMemoryLayer), hot tablets (ListHotTablets) and PrepareQuery/ExecuteQuery (a GoogleSQL for Bigtable engine, which logical and materialized view queries also need) are UNIMPLEMENTED, as are the session RPCs (OpenTable, OpenAuthorizedView, GetClientConfiguration) and ReadRows and SampleRowKeys addressed by materialized_view_name (explicit UNIMPLEMENTED); they fall through to UnimplementedBigtableServer (grpc.go dataServer). Change records have no GARBAGE_COLLECTION type (there is no background collector).

More

Documentation

Index

Constants

View Source
const DefaultPort = 8137

DefaultPort is the dedicated gRPC and REST listener's default TCP port.

Variables

View Source
var ErrNilAppContext = errors.New("gcpbigtable: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type API

type API struct {
	Instances adminpb.BigtableInstanceAdminServer
	Tables    adminpb.BigtableTableAdminServer
	// contains filtered or unexported fields
}

API groups the Bigtable services for in-process callers (dashboard proxy).

func (*API) ReadRows

func (a *API) ReadRows(req *btpb.ReadRowsRequest) ([]*btpb.Row, error)

ReadRows runs a read and returns the matching rows grouped by family and column.

type ConfigProvider

type ConfigProvider interface {
	GetGCPBigtableSettings() Settings
}

ConfigProvider extracts Bigtable configuration from the AppContext Config.

type Handler

type Handler struct {
	Backend *InMemoryBackend

	Port int
	// contains filtered or unexported fields
}

Handler serves the Cloud Bigtable admin and data APIs on a dedicated gRPC and REST listener.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Handler; callers override Port from Settings.

func (*Handler) API

func (h *Handler) API() *API

API exposes the instance and table admin services plus row reads.

func (*Handler) Addr

func (h *Handler) Addr() string

Addr returns the bound listener address, or "" before StartWorker.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(*echo.Context) string

ExtractOperation is unused: requests never reach the shared router.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(*echo.Context) string

ExtractResource is unused: requests never reach the shared router.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations lists the supported gRPC methods.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns a 404 handler; the real API is on the dedicated port.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: Cloud Bigtable runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the listener, forcing a close after a short grace period.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller.

type InMemoryBackend

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

InMemoryBackend holds all Cloud Bigtable state under one lock.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend.

func (*InMemoryBackend) CheckAndMutateRow

CheckAndMutateRow applies one of two mutation lists depending on whether the predicate matches the row.

func (*InMemoryBackend) CheckConsistency

CheckConsistency reports whether all writes before the token reached every cluster; replication is synchronous here.

func (*InMemoryBackend) CopyBackup

CopyBackup copies a READY backup that is not itself a copy into a cluster, possibly of another instance.

func (*InMemoryBackend) CreateAppProfile

CreateAppProfile creates an app profile.

func (*InMemoryBackend) CreateAuthorizedView

CreateAuthorizedView creates a subset view of a table.

func (*InMemoryBackend) CreateBackup

CreateBackup snapshots a table into a backup stored in a cluster.

func (*InMemoryBackend) CreateCluster

CreateCluster adds a cluster to an instance.

func (*InMemoryBackend) CreateInstance

CreateInstance creates an instance with its clusters.

func (*InMemoryBackend) CreateLogicalView

CreateLogicalView stores a named query over the instance's tables.

func (*InMemoryBackend) CreateMaterializedView

func (b *InMemoryBackend) CreateMaterializedView(
	in *adminpb.CreateMaterializedViewRequest,
) (*longrunningpb.Operation, error)

CreateMaterializedView stores a named continuously-maintained query.

func (*InMemoryBackend) CreateSchemaBundle

CreateSchemaBundle stores a proto or Avro schema bundle on a table.

func (*InMemoryBackend) CreateTable

func (b *InMemoryBackend) CreateTable(in *adminpb.CreateTableRequest) (*adminpb.Table, error)

CreateTable creates a table with its column families and split points.

func (*InMemoryBackend) DeleteAppProfile

func (b *InMemoryBackend) DeleteAppProfile(in *adminpb.DeleteAppProfileRequest) (*emptypb.Empty, error)

DeleteAppProfile deletes an app profile.

func (*InMemoryBackend) DeleteAuthorizedView

func (b *InMemoryBackend) DeleteAuthorizedView(in *adminpb.DeleteAuthorizedViewRequest) (*emptypb.Empty, error)

DeleteAuthorizedView removes a view unless it is protected.

func (*InMemoryBackend) DeleteBackup

func (b *InMemoryBackend) DeleteBackup(name string) (*emptypb.Empty, error)

DeleteBackup deletes a backup.

func (*InMemoryBackend) DeleteCluster

func (b *InMemoryBackend) DeleteCluster(name string) (*emptypb.Empty, error)

DeleteCluster deletes a cluster and its backups; the last cluster of an instance cannot be deleted.

func (*InMemoryBackend) DeleteInstance

func (b *InMemoryBackend) DeleteInstance(name string) (*emptypb.Empty, error)

DeleteInstance deletes an instance and everything in it.

func (*InMemoryBackend) DeleteLogicalView

func (b *InMemoryBackend) DeleteLogicalView(in *adminpb.DeleteLogicalViewRequest) (*emptypb.Empty, error)

DeleteLogicalView removes a logical view unless it is protected.

func (*InMemoryBackend) DeleteMaterializedView

func (b *InMemoryBackend) DeleteMaterializedView(in *adminpb.DeleteMaterializedViewRequest) (*emptypb.Empty, error)

DeleteMaterializedView removes a materialized view unless it is protected.

func (*InMemoryBackend) DeleteSchemaBundle

func (b *InMemoryBackend) DeleteSchemaBundle(in *adminpb.DeleteSchemaBundleRequest) (*emptypb.Empty, error)

DeleteSchemaBundle removes a bundle.

func (*InMemoryBackend) DeleteTable

func (b *InMemoryBackend) DeleteTable(name string) (*emptypb.Empty, error)

DeleteTable deletes a table unless it is protected.

func (*InMemoryBackend) DropRowRange

func (b *InMemoryBackend) DropRowRange(in *adminpb.DropRowRangeRequest) (*emptypb.Empty, error)

DropRowRange deletes the rows with a key prefix, or all rows.

func (*InMemoryBackend) GenerateConsistencyToken

GenerateConsistencyToken issues a token for CheckConsistency.

func (*InMemoryBackend) GetAppProfile

func (b *InMemoryBackend) GetAppProfile(name string) (*adminpb.AppProfile, error)

GetAppProfile returns an app profile.

func (*InMemoryBackend) GetAuthorizedView

GetAuthorizedView returns a view; BASIC (the default) omits the subset, FULL includes it.

func (*InMemoryBackend) GetBackup

func (b *InMemoryBackend) GetBackup(name string) (*adminpb.Backup, error)

GetBackup returns a backup.

func (*InMemoryBackend) GetCluster

func (b *InMemoryBackend) GetCluster(name string) (*adminpb.Cluster, error)

GetCluster returns a cluster.

func (*InMemoryBackend) GetIamPolicy

func (b *InMemoryBackend) GetIamPolicy(resource string, version int32) (*iampb.Policy, error)

GetIamPolicy returns the policy of an instance, table or backup at the requested version.

func (*InMemoryBackend) GetInstance

func (b *InMemoryBackend) GetInstance(name string) (*adminpb.Instance, error)

GetInstance returns an instance.

func (*InMemoryBackend) GetLogicalView

GetLogicalView returns one logical view.

func (*InMemoryBackend) GetMaterializedView

GetMaterializedView returns one materialized view.

func (*InMemoryBackend) GetSchemaBundle

GetSchemaBundle returns one bundle.

func (*InMemoryBackend) GetTable

GetTable returns a table in the requested view (SCHEMA_VIEW by default).

func (*InMemoryBackend) InitialChangeStreamPartitions

func (b *InMemoryBackend) InitialChangeStreamPartitions(
	req *btpb.GenerateInitialChangeStreamPartitionsRequest,
) ([]*btpb.StreamPartition, error)

InitialChangeStreamPartitions splits the key space of a change-stream table along its split points.

func (*InMemoryBackend) ListAppProfiles

ListAppProfiles lists the app profiles of an instance.

func (*InMemoryBackend) ListAuthorizedViews

ListAuthorizedViews lists the views of a table (NAME_ONLY by default).

func (*InMemoryBackend) ListBackups

ListBackups lists the backups of a cluster, or of every cluster of an instance when the cluster is "-".

func (*InMemoryBackend) ListClusters

ListClusters lists the clusters of an instance, or of every instance in a project when the instance is "-".

func (*InMemoryBackend) ListInstances

ListInstances lists the instances of a project.

func (*InMemoryBackend) ListLogicalViews

ListLogicalViews lists the logical views of an instance.

func (*InMemoryBackend) ListMaterializedViews

ListMaterializedViews lists the materialized views of an instance.

func (*InMemoryBackend) ListSchemaBundles

ListSchemaBundles lists the bundles of a table.

func (*InMemoryBackend) ListTables

ListTables lists the tables of an instance (NAME_ONLY by default).

func (*InMemoryBackend) ModifyColumnFamilies

func (b *InMemoryBackend) ModifyColumnFamilies(in *adminpb.ModifyColumnFamiliesRequest) (*adminpb.Table, error)

ModifyColumnFamilies creates, updates and drops column families atomically.

func (*InMemoryBackend) MutateRow

MutateRow atomically applies mutations to one row.

func (*InMemoryBackend) MutateRows

MutateRows applies each entry atomically and independently; the result holds one status per entry.

func (*InMemoryBackend) PartialUpdateCluster

PartialUpdateCluster updates the masked fields of a cluster.

func (*InMemoryBackend) PartialUpdateInstance

PartialUpdateInstance updates the masked fields of an instance.

func (*InMemoryBackend) PingAndWarm

func (b *InMemoryBackend) PingAndWarm(req *btpb.PingAndWarmRequest) error

PingAndWarm checks that the instance exists.

func (*InMemoryBackend) ReadModifyWriteRow

ReadModifyWriteRow applies append and increment rules to a row and returns the cells it wrote.

func (*InMemoryBackend) ReadRows

func (b *InMemoryBackend) ReadRows(req *btpb.ReadRowsRequest) (*ReadResult, error)

ReadRows evaluates a read: row selection, filter, reversal and the row limit.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads a snapshot, replacing all state.

func (*InMemoryBackend) RestoreTable

RestoreTable creates a new table from a backup.

func (*InMemoryBackend) SampleRowKeys

SampleRowKeys returns approximate split points with the cumulative size of the rows before each.

func (*InMemoryBackend) SetIamPolicy

func (b *InMemoryBackend) SetIamPolicy(in *iampb.SetIamPolicyRequest) (*iampb.Policy, error)

SetIamPolicy replaces a policy; a stale etag aborts the call.

func (*InMemoryBackend) SetKeyChecker

func (b *InMemoryBackend) SetKeyChecker(c cmek.Checker)

SetKeyChecker validates cluster encryption keys against Cloud KMS; without one, keys are accepted unchecked.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises every instance with its clusters, profiles, tables, rows, backups and operations.

func (*InMemoryBackend) StreamChanges

StreamChanges delivers the committed changes of a partition from the requested position. With an end_time it returns once that time has passed; otherwise it keeps delivering until the context ends, with a heartbeat every heartbeat_duration.

func (*InMemoryBackend) TestIamPermissions

TestIamPermissions reports the requested Bigtable permissions as granted: the emulator authorises all callers.

func (*InMemoryBackend) UndeleteTable

UndeleteTable restores a table deleted within the last seven days. The table comes back with deletion protection enabled and without its IAM bindings, as the managing-tables page documents.

func (*InMemoryBackend) UpdateAppProfile

UpdateAppProfile updates the masked fields of an app profile; an empty mask replaces every field.

func (*InMemoryBackend) UpdateAuthorizedView

UpdateAuthorizedView updates the masked fields; a stale etag aborts the call.

func (*InMemoryBackend) UpdateBackup

UpdateBackup changes a backup's expiry.

func (*InMemoryBackend) UpdateCluster

func (b *InMemoryBackend) UpdateCluster(in *adminpb.Cluster) (*longrunningpb.Operation, error)

UpdateCluster changes the serve_nodes of a cluster.

func (*InMemoryBackend) UpdateInstance

func (b *InMemoryBackend) UpdateInstance(in *adminpb.Instance) (*adminpb.Instance, error)

UpdateInstance replaces an instance's display name and type.

func (*InMemoryBackend) UpdateLogicalView

UpdateLogicalView changes the masked fields; a stale etag aborts the call.

func (*InMemoryBackend) UpdateMaterializedView

func (b *InMemoryBackend) UpdateMaterializedView(
	in *adminpb.UpdateMaterializedViewRequest,
) (*longrunningpb.Operation, error)

UpdateMaterializedView changes deletion protection; the query is immutable.

func (*InMemoryBackend) UpdateSchemaBundle

UpdateSchemaBundle replaces the schema of a bundle; the kind of schema cannot change.

func (*InMemoryBackend) UpdateTable

UpdateTable updates the masked table-level settings.

type Provider

type Provider struct{}

Provider implements service.Provider for Google Cloud Bigtable. It serves gRPC and REST on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.

func (*Provider) Init

Init creates the backend and handler; the port is bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type ReadResult

type ReadResult struct {
	Stats *btpb.ReadIterationStats
	Rows  []*ResultRow
}

ReadResult is the outcome of one ReadRows call.

type ResultRow

type ResultRow struct {
	Key   string
	Cells []fcell
}

ResultRow is one scanned row; a row the filter emptied has no cells.

type Settings

type Settings struct {
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 209-byte string literal not displayed */
}

Settings holds service-level configuration, embedded in the root CLI command as CLI.GCPBigtable.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider is available.

Jump to

Keyboard shortcuts

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