Documentation
¶
Overview ¶
Package admin provides administration and caching services for CBT
Index ¶
- Variables
- type CacheExternal
- type CacheManager
- type GapInfo
- type Service
- func (a *Service) DeleteRange(ctx context.Context, modelID string, startPos, endPos uint64) error
- func (a *Service) FindGaps(ctx context.Context, modelID string, minPos, maxPos, interval uint64) ([]GapInfo, error)
- func (a *Service) GetAdminDatabase() string
- func (a *Service) GetAdminTable() string
- func (a *Service) GetCacheManager() *CacheManager
- func (a *Service) GetCoverage(ctx context.Context, modelID string, startPos, endPos uint64) (bool, error)
- func (a *Service) GetFirstPosition(ctx context.Context, modelID string) (uint64, error)
- func (a *Service) GetLastPosition(ctx context.Context, modelID string) (uint64, error)
- func (a *Service) RecordCompletion(ctx context.Context, modelID string, position, interval uint64) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidModelID is returned when model ID format is invalid ErrInvalidModelID = errors.New("invalid model ID format: expected database.table") )
Functions ¶
This section is empty.
Types ¶
type CacheExternal ¶
type CacheExternal struct {
ModelID string `json:"model_id"`
Min uint64 `json:"min"`
Max uint64 `json:"max"`
UpdatedAt time.Time `json:"updated_at"`
TTL time.Duration `json:"ttl"`
}
CacheExternal represents cached external model bounds
type CacheManager ¶
type CacheManager struct {
// contains filtered or unexported fields
}
CacheManager manages Redis-based caching for external models
func NewCacheManager ¶
func NewCacheManager(redisClient *redis.Client) *CacheManager
NewCacheManager creates a new cache manager instance
func (*CacheManager) GetExternal ¶
func (c *CacheManager) GetExternal(ctx context.Context, modelID string) (*CacheExternal, error)
GetExternal retrieves cached external model bounds from Redis
func (*CacheManager) InvalidateExternal ¶
func (c *CacheManager) InvalidateExternal(ctx context.Context, modelID string) error
InvalidateExternal removes external model bounds from cache
func (*CacheManager) SetExternal ¶
func (c *CacheManager) SetExternal(ctx context.Context, cache CacheExternal) error
SetExternal stores external model bounds in Redis cache
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages the admin tracking table for completed transformations
func NewService ¶
func NewService(client clickhouse.ClientInterface, cluster, localSuffix, adminDatabase, adminTable string, redisClient *redis.Client) *Service
NewService creates a new admin table manager
func (*Service) DeleteRange ¶
DeleteRange deletes entries in a range from the admin table
func (*Service) FindGaps ¶
func (a *Service) FindGaps(ctx context.Context, modelID string, minPos, maxPos, interval uint64) ([]GapInfo, error)
FindGaps finds all gaps in the processed data for a model
func (*Service) GetAdminDatabase ¶
GetAdminDatabase returns the admin database name
func (*Service) GetAdminTable ¶
GetAdminTable returns the admin table name
func (*Service) GetCacheManager ¶
func (a *Service) GetCacheManager() *CacheManager
GetCacheManager returns the cache manager instance
func (*Service) GetCoverage ¶
func (a *Service) GetCoverage(ctx context.Context, modelID string, startPos, endPos uint64) (bool, error)
GetCoverage checks if a range is fully covered in the admin table
func (*Service) GetFirstPosition ¶
GetFirstPosition returns the first processed position for a model
func (*Service) GetLastPosition ¶
GetLastPosition returns the last processed position for a model