coordinator

package
v0.0.0-...-2300135 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

The catalog backed by databases using GORM.

func NewTableCatalog

func NewTableCatalog(txImpl dbmodel.ITransaction, metaDomain dbmodel.IMetaDomain) *Catalog

func (*Catalog) CheckCollection

func (tc *Catalog) CheckCollection(ctx context.Context, collectionID types.UniqueID) (bool, error)

Returns true if collection is deleted (either soft-deleted or hard-deleted) and false otherwise.

func (*Catalog) CreateCollection

func (tc *Catalog) CreateCollection(ctx context.Context, createCollection *model.CreateCollection, ts types.Timestamp) (*model.Collection, bool, error)

func (*Catalog) CreateCollectionAndSegments

func (tc *Catalog) CreateCollectionAndSegments(ctx context.Context, createCollection *model.CreateCollection, createSegments []*model.CreateSegment, ts types.Timestamp) (*model.Collection, bool, error)

func (*Catalog) CreateDatabase

func (tc *Catalog) CreateDatabase(ctx context.Context, createDatabase *model.CreateDatabase, ts types.Timestamp) (*model.Database, error)

func (*Catalog) CreateSegment

func (tc *Catalog) CreateSegment(ctx context.Context, createSegment *model.CreateSegment, ts types.Timestamp) (*model.Segment, error)

func (*Catalog) CreateTenant

func (tc *Catalog) CreateTenant(ctx context.Context, createTenant *model.CreateTenant, ts types.Timestamp) (*model.Tenant, error)

func (*Catalog) DeleteCollection

func (tc *Catalog) DeleteCollection(ctx context.Context, deleteCollection *model.DeleteCollection, softDelete bool) error

func (*Catalog) DeleteSegment

func (tc *Catalog) DeleteSegment(ctx context.Context, segmentID types.UniqueID, collectionID types.UniqueID) error

DeleteSegment is a no-op. Segments are deleted as part of atomic delete of collection. Keeping this API so that older clients continue to work.

func (*Catalog) FlushCollectionCompaction

func (tc *Catalog) FlushCollectionCompaction(ctx context.Context, flushCollectionCompaction *model.FlushCollectionCompaction) (*model.FlushCollectionInfo, error)

func (*Catalog) GetAllDatabases

func (tc *Catalog) GetAllDatabases(ctx context.Context, ts types.Timestamp) ([]*model.Database, error)

func (*Catalog) GetAllTenants

func (tc *Catalog) GetAllTenants(ctx context.Context, ts types.Timestamp) ([]*model.Tenant, error)

func (*Catalog) GetCollections

func (tc *Catalog) GetCollections(ctx context.Context, collectionID types.UniqueID, collectionName *string, tenantID string, databaseName string, limit *int32, offset *int32) ([]*model.Collection, error)

func (*Catalog) GetDatabases

func (tc *Catalog) GetDatabases(ctx context.Context, getDatabase *model.GetDatabase, ts types.Timestamp) (*model.Database, error)

func (*Catalog) GetSegments

func (tc *Catalog) GetSegments(ctx context.Context, segmentID types.UniqueID, segmentType *string, scope *string, collectionID types.UniqueID) ([]*model.Segment, error)

func (*Catalog) GetSoftDeletedCollections

func (tc *Catalog) GetSoftDeletedCollections(ctx context.Context, collectionID *string, tenantID string, databaseName string, limit int32) ([]*model.Collection, error)

func (*Catalog) GetTenants

func (tc *Catalog) GetTenants(ctx context.Context, getTenant *model.GetTenant, ts types.Timestamp) (*model.Tenant, error)

func (*Catalog) GetTenantsLastCompactionTime

func (tc *Catalog) GetTenantsLastCompactionTime(ctx context.Context, tenantIDs []string) ([]*dbmodel.Tenant, error)

func (*Catalog) ResetState

func (tc *Catalog) ResetState(ctx context.Context) error

func (*Catalog) SetTenantLastCompactionTime

func (tc *Catalog) SetTenantLastCompactionTime(ctx context.Context, tenantID string, lastCompactionTime int64) error

func (*Catalog) UpdateCollection

func (tc *Catalog) UpdateCollection(ctx context.Context, updateCollection *model.UpdateCollection, ts types.Timestamp) (*model.Collection, error)

func (*Catalog) UpdateSegment

func (tc *Catalog) UpdateSegment(ctx context.Context, updateSegment *model.UpdateSegment, ts types.Timestamp) (*model.Segment, error)

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

Coordinator is the top level component. Currently, it only has the system catalog related APIs and will be extended to support other functionalities such as membership managed and propagation.

func NewCoordinator

func NewCoordinator(ctx context.Context, db *gorm.DB, deleteMode DeleteMode) (*Coordinator, error)

func (*Coordinator) CheckCollection

func (s *Coordinator) CheckCollection(ctx context.Context, collectionID types.UniqueID) (bool, error)

func (*Coordinator) CleanupSoftDeletedCollection

func (s *Coordinator) CleanupSoftDeletedCollection(ctx context.Context, deleteCollection *model.DeleteCollection) error

func (*Coordinator) CreateCollection

func (s *Coordinator) CreateCollection(ctx context.Context, createCollection *model.CreateCollection) (*model.Collection, bool, error)

func (*Coordinator) CreateCollectionAndSegments

func (s *Coordinator) CreateCollectionAndSegments(ctx context.Context, createCollection *model.CreateCollection, createSegments []*model.CreateSegment) (*model.Collection, bool, error)

func (*Coordinator) CreateDatabase

func (s *Coordinator) CreateDatabase(ctx context.Context, createDatabase *model.CreateDatabase) (*model.Database, error)

func (*Coordinator) CreateSegment

func (s *Coordinator) CreateSegment(ctx context.Context, segment *model.CreateSegment) error

func (*Coordinator) CreateTenant

func (s *Coordinator) CreateTenant(ctx context.Context, createTenant *model.CreateTenant) (*model.Tenant, error)

func (*Coordinator) DeleteCollection

func (s *Coordinator) DeleteCollection(ctx context.Context, deleteCollection *model.DeleteCollection) error

func (*Coordinator) DeleteSegment

func (s *Coordinator) DeleteSegment(ctx context.Context, segmentID types.UniqueID, collectionID types.UniqueID) error

DeleteSegment is a no-op. Segments are deleted as part of atomic delete of collection. Keeping this API so that older clients continue to work, since older clients will issue DeleteSegment after a DeleteCollection.

func (*Coordinator) FlushCollectionCompaction

func (s *Coordinator) FlushCollectionCompaction(ctx context.Context, flushCollectionCompaction *model.FlushCollectionCompaction) (*model.FlushCollectionInfo, error)

func (*Coordinator) GetCollections

func (s *Coordinator) GetCollections(ctx context.Context, collectionID types.UniqueID, collectionName *string, tenantID string, databaseName string, limit *int32, offset *int32) ([]*model.Collection, error)

func (*Coordinator) GetDatabase

func (s *Coordinator) GetDatabase(ctx context.Context, getDatabase *model.GetDatabase) (*model.Database, error)

func (*Coordinator) GetSegments

func (s *Coordinator) GetSegments(ctx context.Context, segmentID types.UniqueID, segmentType *string, scope *string, collectionID types.UniqueID) ([]*model.Segment, error)

func (*Coordinator) GetSoftDeletedCollections

func (s *Coordinator) GetSoftDeletedCollections(ctx context.Context, collectionID *string, tenantID string, databaseName string, limit int32) ([]*model.Collection, error)

func (*Coordinator) GetTenant

func (s *Coordinator) GetTenant(ctx context.Context, getTenant *model.GetTenant) (*model.Tenant, error)

func (*Coordinator) GetTenantsLastCompactionTime

func (s *Coordinator) GetTenantsLastCompactionTime(ctx context.Context, tenantIDs []string) ([]*dbmodel.Tenant, error)

func (*Coordinator) ResetState

func (s *Coordinator) ResetState(ctx context.Context) error

func (*Coordinator) SetTenantLastCompactionTime

func (s *Coordinator) SetTenantLastCompactionTime(ctx context.Context, tenantID string, lastCompactionTime int64) error

func (*Coordinator) UpdateCollection

func (s *Coordinator) UpdateCollection(ctx context.Context, collection *model.UpdateCollection) (*model.Collection, error)

func (*Coordinator) UpdateSegment

func (s *Coordinator) UpdateSegment(ctx context.Context, updateSegment *model.UpdateSegment) (*model.Segment, error)

type DeleteMode

type DeleteMode int

DeleteMode represents whether to perform a soft or hard delete

const (
	// SoftDelete marks records as deleted but keeps them in the database
	SoftDelete DeleteMode = iota
	// HardDelete permanently removes records from the database
	HardDelete
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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