configuration

package
v0.0.0-...-a9d0937 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 38 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlobReplicatorFromConfiguration

func NewBlobReplicatorFromConfiguration(configuration *pb.BlobReplicatorConfiguration, source blobstore.BlobAccess, sink BlobAccessInfo, creator BlobReplicatorCreator) (replication.BlobReplicator, error)

NewBlobReplicatorFromConfiguration creates a BlobReplicator object based on a configuration file.

func NewCASAndACBlobAccessFromConfiguration

func NewCASAndACBlobAccessFromConfiguration(terminationGroup program.Group, configuration *pb.BlobstoreConfiguration, grpcClientFactory grpc.ClientFactory, maximumMessageSizeBytes int) (blobstore.BlobAccess, blobstore.BlobAccess, error)

NewCASAndACBlobAccessFromConfiguration is a convenience function to create BlobAccess objects for both the Content Addressable Storage and Action Cache. Most Buildbarn components tend to require access to both these data stores.

Types

type BlobAccessCreator

type BlobAccessCreator interface {
	BlobReplicatorCreator

	// GetBaseDigestKeyFormat() returns the format that leaf
	// instances of BlobAccess (e.g., LocalBlobAccess) should be
	// used to compute keys of digests.
	//
	// For the Content Addressable Storage (CAS), this function may
	// return digest.KeyWithoutInstance, so that identical objects
	// are only stored once.
	GetBaseDigestKeyFormat() digest.KeyFormat
	// GetReadBufferFactory() returns operations that can be used by
	// BlobAccess to create Buffer objects to return data.
	GetReadBufferFactory() blobstore.ReadBufferFactory
	// GetStorageTypeName() returns a short string that identifies
	// the purpose of this storage (e.g., "ac", "cas").
	GetStorageTypeName() string
	// GetCapabilitiesProvider() returns a provider of REv2
	// ServerCapabilities messages that should be returned for
	// backends that can't report their own capabilities. This
	// provider returns sane default values.
	GetDefaultCapabilitiesProvider() capabilities.Provider
	// NewBlockListGrowthPolicy() creates a BlockListGrowthPolicy
	// for LocalBlobAccess that is recommended for this storage type.
	NewBlockListGrowthPolicy(currentBlocks, newBlocks int) (local.BlockListGrowthPolicy, error)
	// NewHierarchicalInstanceNamesLocalBlobAccess() creates a
	// BlobAccess suitable for storing data on the local system that
	// uses hierarchical instance names.
	NewHierarchicalInstanceNamesLocalBlobAccess(keyLocationMap local.KeyLocationMap, locationBlobMap local.LocationBlobMap, globalLock *sync.RWMutex) (blobstore.BlobAccess, error)
	// NewCustomBlobAccess() can be used as a fallback to create
	// BlobAccess instances that only apply to this storage type.
	// For example, CompletenessCheckingBlobAccess is only
	// applicable to the Action Cache.
	NewCustomBlobAccess(configuration *pb.BlobAccessConfiguration, nestedCreator NestedBlobAccessCreator) (BlobAccessInfo, string, error)
	// WrapTopLevelBlobAccess() is called at the very end of
	// NewBlobAccessFromConfiguration() to apply any top-level
	// decorators.
	WrapTopLevelBlobAccess(blobAccess blobstore.BlobAccess) blobstore.BlobAccess
}

BlobAccessCreator contains a set of methods that are invoked by the generic NewBlobAccessFromConfiguration() function to create a BlobAccess of a specific kind (e.g., Action Cache, Content Addressable Storage).

func NewACBlobAccessCreator

func NewACBlobAccessCreator(contentAddressableStorage *BlobAccessInfo, grpcClientFactory grpc.ClientFactory, maximumMessageSizeBytes int) BlobAccessCreator

NewACBlobAccessCreator creates a BlobAccessCreator that can be provided to NewBlobAccessFromConfiguration() to construct a BlobAccess that is suitable for accessing the Action Cache.

func NewCASBlobAccessCreator

func NewCASBlobAccessCreator(grpcClientFactory grpc.ClientFactory, maximumMessageSizeBytes int) BlobAccessCreator

NewCASBlobAccessCreator creates a BlobAccessCreator that can be provided to NewBlobAccessFromConfiguration() to construct a BlobAccess that is suitable for accessing the Content Addressable Storage.

func NewFSACBlobAccessCreator

func NewFSACBlobAccessCreator(grpcClientFactory grpc.ClientFactory, maximumMessageSizeBytes int) BlobAccessCreator

NewFSACBlobAccessCreator creates a BlobAccessCreator that can be provided to NewBlobAccessFromConfiguration() to construct a BlobAccess that is suitable for accessing the File System Access Cache.

func NewICASBlobAccessCreator

func NewICASBlobAccessCreator(grpcClientFactory grpc.ClientFactory, maximumMessageSizeBytes int) BlobAccessCreator

NewICASBlobAccessCreator creates a BlobAccessCreator that can be provided to NewBlobAccessFromConfiguration() to construct a BlobAccess that is suitable for accessing the Indirect Content Addressable Storage.

func NewISCCBlobAccessCreator

func NewISCCBlobAccessCreator(grpcClientFactory grpc.ClientFactory, maximumMessageSizeBytes int) BlobAccessCreator

NewISCCBlobAccessCreator creates a BlobAccessCreator that can be provided to NewBlobAccessFromConfiguration() to construct a BlobAccess that is suitable for accessing the Initial Size Class Cache.

type BlobAccessInfo

type BlobAccessInfo struct {
	BlobAccess      blobstore.BlobAccess
	DigestKeyFormat digest.KeyFormat
}

BlobAccessInfo contains an instance of BlobAccess and information relevant to its creation. It is returned by functions that construct BlobAccess instances, such as NewBlobAccessFromConfiguration().

func NewBlobAccessFromConfiguration

func NewBlobAccessFromConfiguration(terminationGroup program.Group, configuration *pb.BlobAccessConfiguration, creator BlobAccessCreator) (BlobAccessInfo, error)

NewBlobAccessFromConfiguration creates a BlobAccess object based on a configuration file.

type BlobReplicatorCreator

type BlobReplicatorCreator interface {
	// NewCustomBlobReplicator() can be used as a fallback to create
	// BlobReplicator instances that only apply to this storage
	// type. For example, sending replication requests over gRPC is
	// only supported for the Content Addressable Storage.
	NewCustomBlobReplicator(configuration *pb.BlobReplicatorConfiguration, source blobstore.BlobAccess, sink BlobAccessInfo) (replication.BlobReplicator, error)
}

BlobReplicatorCreator contains a set of methods that are invoked by the generic NewBlobReplicatorFromConfiguration() function to create a BlobReplicator of a specific kind (e.g., Action Cache, Content Addressable Storage).

func NewCASBlobReplicatorCreator

func NewCASBlobReplicatorCreator(grpcClientFactory grpc.ClientFactory) BlobReplicatorCreator

NewCASBlobReplicatorCreator creates a BlobReplicatorCreator that can be provided to NewBlobReplicatorFromConfiguration() to construct a BlobReplicator that is suitable for replicating Content Addressable Storage objects.

type NestedBlobAccessCreator

type NestedBlobAccessCreator interface {
	NewNestedBlobAccess(configuration *pb.BlobAccessConfiguration, creator BlobAccessCreator) (BlobAccessInfo, error)
}

NestedBlobAccessCreator is a helper type that implementations of BlobAccessCreator may use to construct nested instances of BlobAccess. For example, ACBlobAccessCreator will call into this interface to create the backend of CompletenessCheckingBlobAccess.

Jump to

Keyboard shortcuts

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