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 ¶
- type ComputePlanDBAL
- type ComputePlanDBALProvider
- type ComputeTaskDBAL
- type ComputeTaskDBALProvider
- type ComputeTaskOutputCounter
- type DBAL
- type DBALProvider
- type DataManagerDBAL
- type DataManagerDBALProvider
- type DataSampleDBAL
- type DataSampleDBALProvider
- type EventDBAL
- type EventDBALProvider
- type FailureReportDBAL
- type FailureReportDBALProvider
- type FunctionDBAL
- type FunctionDBALProvider
- type ModelDBAL
- type ModelDBALProvider
- type OrganizationDBAL
- type OrganizationDBALProvider
- type PerformanceDBAL
- type PerformanceDBALProvider
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 ¶
ComputeTaskOutputCounter counts registered outputs by identifier
type DBAL ¶
type DBAL interface { OrganizationDBAL DataSampleDBAL FunctionDBAL DataManagerDBAL ComputeTaskDBAL ModelDBAL ComputePlanDBAL PerformanceDBAL EventDBAL FailureReportDBAL }
DBAL stands for Database Abstraction Layer, it exposes methods to interact with asset storage.
type DBALProvider ¶
type DBALProvider interface { OrganizationDBALProvider DataSampleDBALProvider FunctionDBALProvider DataManagerDBALProvider ComputeTaskDBALProvider ModelDBALProvider ComputePlanDBALProvider PerformanceDBALProvider EventDBALProvider FailureReportDBALProvider }
DBALProvider exposes all available DBAL.
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 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
}