persistence

package
v0.0.0-...-45d3223 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package persistence holds everything related to data persistence. Each asset has its own database abstraction layer (DBAL). Each request is a transaction which is only committed once a successful response is returned.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputePlanDBAL

type ComputePlanDBAL interface {
	ComputePlanExists(key string) (bool, error)
	GetComputePlan(key string) (*asset.ComputePlan, error)
	AddComputePlan(plan *asset.ComputePlan) error
	QueryComputePlans(p *common.Pagination, filter *asset.PlanQueryFilter) ([]*asset.ComputePlan, common.PaginationToken, error)
	SetComputePlanName(plan *asset.ComputePlan, name string) error
	CancelComputePlan(plan *asset.ComputePlan, cancelationDate time.Time) error
	FailComputePlan(plan *asset.ComputePlan, failureDate time.Time) error
	ArePlanTasksRunning(key string) (bool, error)
}

type ComputePlanDBALProvider

type ComputePlanDBALProvider interface {
	GetComputePlanDBAL() ComputePlanDBAL
}

type ComputeTaskDBAL

type ComputeTaskDBAL interface {
	// GetExistingComputeTaskKeys returns a slice with inputs keys existing in storage.
	GetExistingComputeTaskKeys(keys []string) ([]string, error)
	GetComputeTask(key string) (*asset.ComputeTask, error)
	GetComputeTasks(keys []string) ([]*asset.ComputeTask, error)
	AddComputeTasks(task ...*asset.ComputeTask) error
	UpdateComputeTaskStatus(taskKey string, taskStatus asset.ComputeTaskStatus) error
	QueryComputeTasks(p *common.Pagination, filter *asset.TaskQueryFilter) ([]*asset.ComputeTask, common.PaginationToken, error)
	GetComputeTaskChildren(key string) ([]*asset.ComputeTask, error)
	GetComputeTaskParents(key string) ([]*asset.ComputeTask, error)
	// GetComputePlanTasks returns the tasks of the compute plan identified by the given key
	GetComputePlanTasks(key string) ([]*asset.ComputeTask, error)
	GetComputePlanTasksKeys(key string) ([]string, error)
	GetFunctionFromTasksWithStatus(key string, statuses []asset.ComputeTaskStatus) ([]*asset.ComputeTask, error)
	AddComputeTaskOutputAsset(output *asset.ComputeTaskOutputAsset) error
	// CountComputeTaskRegisteredOutputs returns the number of registered outputs by identifier
	CountComputeTaskRegisteredOutputs(key string) (ComputeTaskOutputCounter, error)
	GetComputeTaskOutputAssets(taskKey, identifier string) ([]*asset.ComputeTaskOutputAsset, error)
}

type ComputeTaskDBALProvider

type ComputeTaskDBALProvider interface {
	GetComputeTaskDBAL() ComputeTaskDBAL
}

type ComputeTaskOutputCounter

type ComputeTaskOutputCounter = map[string]int

ComputeTaskOutputCounter counts registered outputs by identifier

type DBAL

DBAL stands for Database Abstraction Layer, it exposes methods to interact with asset storage.

type DataManagerDBAL

type DataManagerDBAL interface {
	AddDataManager(datamanager *asset.DataManager) error
	GetDataManager(key string) (*asset.DataManager, error)
	QueryDataManagers(p *common.Pagination) ([]*asset.DataManager, common.PaginationToken, error)
	DataManagerExists(key string) (bool, error)
	UpdateDataManager(dm *asset.DataManager) error
}

DataManagerDBAL is the database abstraction layer for DataManagers

type DataManagerDBALProvider

type DataManagerDBALProvider interface {
	GetDataManagerDBAL() DataManagerDBAL
}

DataManagerDBALProvider represents an object capable of providing a DataManagerDBAL

type DataSampleDBAL

type DataSampleDBAL interface {
	AddDataSamples(dataSample ...*asset.DataSample) error
	UpdateDataSample(dataSample *asset.DataSample) error
	GetDataSample(key string) (*asset.DataSample, error)
	QueryDataSamples(p *common.Pagination, filter *asset.DataSampleQueryFilter) ([]*asset.DataSample, common.PaginationToken, error)
	DataSampleExists(key string) (bool, error)
	GetDataSampleKeysByManager(managerKey string) ([]string, error)
}

DataSampleDBAL is the database abstraction layer for DataSamples

type DataSampleDBALProvider

type DataSampleDBALProvider interface {
	GetDataSampleDBAL() DataSampleDBAL
}

DataSampleDBALProvider represents an object capable of providing a DataSampleDBAL

type EventDBAL

type EventDBAL interface {
	NewEventID() string
	AddEvents(events ...*asset.Event) error
	QueryEvents(p *common.Pagination, filter *asset.EventQueryFilter, sortOrder asset.SortOrder) ([]*asset.Event, common.PaginationToken, error)
}

type EventDBALProvider

type EventDBALProvider interface {
	GetEventDBAL() EventDBAL
}

type FailureReportDBAL

type FailureReportDBAL interface {
	GetFailureReport(assetKey string) (*asset.FailureReport, error)
	AddFailureReport(f *asset.FailureReport) error
}

type FailureReportDBALProvider

type FailureReportDBALProvider interface {
	GetFailureReportDBAL() FailureReportDBAL
}

type FunctionDBAL

type FunctionDBAL interface {
	AddFunction(obj *asset.Function) error
	GetFunction(key string) (*asset.Function, error)
	QueryFunctions(p *common.Pagination, filter *asset.FunctionQueryFilter) ([]*asset.Function, common.PaginationToken, error)
	FunctionExists(key string) (bool, error)
	UpdateFunction(function *asset.Function) error
}

FunctionDBAL is the database abstraction layer for Functions

type FunctionDBALProvider

type FunctionDBALProvider interface {
	GetFunctionDBAL() FunctionDBAL
}

FunctionDBALProvider represents an object capable of providing an FunctionDBAL

type ModelDBAL

type ModelDBAL interface {
	ModelExists(key string) (bool, error)
	GetModel(key string) (*asset.Model, error)
	GetComputeTaskOutputModels(key string) ([]*asset.Model, error)
	AddModel(m *asset.Model, identifier string) error
	UpdateModel(m *asset.Model) error
}

type ModelDBALProvider

type ModelDBALProvider interface {
	GetModelDBAL() ModelDBAL
}

type OrganizationDBAL

type OrganizationDBAL interface {
	// AddOrganization stores a new organization.
	AddOrganization(organization *asset.Organization) error
	// OrganizationExists returns whether an organization with the given ID is already in store
	OrganizationExists(id string) (bool, error)
	// GetAllOrganizations returns all known organizations
	GetAllOrganizations() ([]*asset.Organization, error)
	// GetOrganization returns an Organization by its ID
	GetOrganization(id string) (*asset.Organization, error)
}

OrganizationDBAL defines the database abstraction layer to manipulate organizations

type OrganizationDBALProvider

type OrganizationDBALProvider interface {
	GetOrganizationDBAL() OrganizationDBAL
}

OrganizationDBALProvider represents an object capable of providing an OrganizationDBAL

type PerformanceDBAL

type PerformanceDBAL interface {
	AddPerformance(perf *asset.Performance, identifier string) error
	QueryPerformances(p *common.Pagination, filter *asset.PerformanceQueryFilter) ([]*asset.Performance, common.PaginationToken, error)
	PerformanceExists(perf *asset.Performance) (bool, error)
}

type PerformanceDBALProvider

type PerformanceDBALProvider interface {
	GetPerformanceDBAL() PerformanceDBAL
}

Jump to

Keyboard shortcuts

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