Documentation
¶
Overview ¶
Package validation provides dependency validation for CBT models
Package validation provides dependency validation for CBT models
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrModelNotFound = errors.New("model not found") ErrDependencyNotFound = errors.New("dependency model not found") ErrRangeNotAvailable = errors.New("required range not available") ErrRangeNotCovered = errors.New("range not fully covered") ErrNotTransformationModel = errors.New("model is not a transformation") ErrInvalidDependencyType = errors.New("invalid dependency type") ErrInvalidModelType = errors.New("invalid dependency model type") ErrFailedModelCast = errors.New("failed to cast model to transformation") )
Validation-specific errors
var ( // ErrNotSQLModel is returned when external model is not a SQL model ErrNotSQLModel = errors.New("external model is not a SQL model") )
Functions ¶
This section is empty.
Types ¶
type DependencyStatus ¶
type DependencyStatus struct {
ModelID string
Available bool
MinPos uint64
MaxPos uint64
Error error
}
DependencyStatus represents the status of a single dependency
type DependencyValidator ¶
type DependencyValidator struct {
// contains filtered or unexported fields
}
DependencyValidator implements the DependencyValidator interface
func NewDependencyValidator ¶
func NewDependencyValidator( log *logrus.Logger, chClient clickhouse.ClientInterface, adminService *admin.Service, modelsService *models.Service, ) *DependencyValidator
NewDependencyValidator creates a new dependency validator
func (*DependencyValidator) GetInitialPosition ¶
func (v *DependencyValidator) GetInitialPosition(ctx context.Context, modelID string) (uint64, error)
GetInitialPosition calculates the initial position for a model based on its dependencies Returns the earliest position where all dependencies have data available
func (*DependencyValidator) ValidateDependencies ¶
func (v *DependencyValidator) ValidateDependencies(ctx context.Context, modelID string, position, interval uint64) (Result, error)
ValidateDependencies checks if all dependencies are satisfied for a model at a given position
type ExternalModelValidator ¶
type ExternalModelValidator struct {
// contains filtered or unexported fields
}
ExternalModelValidator implements the ExternalModelExecutor interface
func NewExternalModelExecutor ¶
func NewExternalModelExecutor(log *logrus.Logger, chClient clickhouse.ClientInterface, adminService *admin.Service, modelsService *models.Service) *ExternalModelValidator
NewExternalModelExecutor creates a new external model executor The cacheManager can be nil if caching is not desired
type Result ¶
type Result struct {
CanProcess bool
Dependencies []DependencyStatus
Errors []error
}
Result contains the result of dependency validation