Skip to content

Commit

Permalink
chore: method signature renaming
Browse files Browse the repository at this point in the history
Signed-off-by: Jeronimo <jeronimo.irazabal@gmail.com>
  • Loading branch information
jeroiraz committed May 16, 2024
1 parent 4b0d5c3 commit df7de67
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion adapters/repos/db/lsmkv/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func (b *Bucket) GetErrNotFound(key []byte) ([]byte, error) {
}
}

return b.disk.getErrNotFound(key)
return b.disk.getErrDeleted(key)
}

// GetBySecondary retrieves an object using one of its secondary keys. A bucket
Expand Down
6 changes: 3 additions & 3 deletions adapters/repos/db/lsmkv/segment_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ func (sg *SegmentGroup) getWithUpperSegmentBoundary(key []byte, topMostSegment i
return nil, nil
}

func (sg *SegmentGroup) getErrNotFound(key []byte) ([]byte, error) {
func (sg *SegmentGroup) getErrDeleted(key []byte) ([]byte, error) {
sg.maintenanceLock.RLock()
defer sg.maintenanceLock.RUnlock()

return sg.getWithUpperSegmentBoundaryErrNotFound(key, len(sg.segments)-1)
return sg.getWithUpperSegmentBoundaryErrDeleted(key, len(sg.segments)-1)
}

func (sg *SegmentGroup) getWithUpperSegmentBoundaryErrNotFound(key []byte, topMostSegment int) ([]byte, error) {
func (sg *SegmentGroup) getWithUpperSegmentBoundaryErrDeleted(key []byte, topMostSegment int) ([]byte, error) {
// assumes "replace" strategy

// start with latest and exit as soon as something is found, thus making sure
Expand Down
2 changes: 1 addition & 1 deletion adapters/repos/db/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (i *Index) overwriteObjects(ctx context.Context,
continue
}
// valid update
found, err := s.ObjectByIDErrNotFound(ctx, data.ID, nil, additional.Properties{})
found, err := s.ObjectByIDErrDeleted(ctx, data.ID, nil, additional.Properties{})
if err != nil && errors.Is(err, lsmkv.Deleted) {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion adapters/repos/db/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type ShardLike interface {
PutObject(context.Context, *storobj.Object) error
PutObjectBatch(context.Context, []*storobj.Object) []error
ObjectByID(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error)
ObjectByIDErrNotFound(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error)
ObjectByIDErrDeleted(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error)
Exists(ctx context.Context, id strfmt.UUID) (bool, error)
ObjectSearch(ctx context.Context, limit int, filters *filters.LocalFilter, keywordRanking *searchparams.KeywordRanking, sort []filters.Sort, cursor *filters.Cursor, additional additional.Properties) ([]*storobj.Object, []float32, error)
ObjectVectorSearch(ctx context.Context, searchVector []float32, targetDist float32, limit int, filters *filters.LocalFilter, sort []filters.Sort, groupBy *searchparams.GroupBy, additional additional.Properties) ([]*storobj.Object, []float32, error)
Expand Down
4 changes: 2 additions & 2 deletions adapters/repos/db/shard_lazyloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ func (l *LazyLoadShard) ObjectByID(ctx context.Context, id strfmt.UUID, props se
return l.shard.ObjectByID(ctx, id, props, additional)
}

func (l *LazyLoadShard) ObjectByIDErrNotFound(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error) {
func (l *LazyLoadShard) ObjectByIDErrDeleted(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error) {
if err := l.Load(ctx); err != nil {
return nil, err
}
return l.shard.ObjectByIDErrNotFound(ctx, id, props, additional)
return l.shard.ObjectByIDErrDeleted(ctx, id, props, additional)
}

func (l *LazyLoadShard) Exists(ctx context.Context, id strfmt.UUID) (bool, error) {
Expand Down
2 changes: 1 addition & 1 deletion adapters/repos/db/shard_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/weaviate/weaviate/entities/storobj"
)

func (s *Shard) ObjectByIDErrNotFound(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error) {
func (s *Shard) ObjectByIDErrDeleted(ctx context.Context, id strfmt.UUID, props search.SelectProperties, additional additional.Properties) (*storobj.Object, error) {
idBytes, err := uuid.MustParse(id.String()).MarshalBinary()
if err != nil {
return nil, err
Expand Down

0 comments on commit df7de67

Please sign in to comment.