cleanup comments and no-op implementations

This commit is contained in:
David Kagan 2023-04-03 12:30:40 -04:00
parent 65219c65fc
commit 3a3f38759e
3 changed files with 2 additions and 27 deletions

6
api.go
View file

@ -765,9 +765,7 @@ func (api *API) DeleteField(ctx context.Context, indexName string, fieldName str
return nil
}
// DeleteShard deletes a given shard in an index.
// This is me taking a stab at implementing this logic, currently
// a no-op implementation - DK
// DeleteShard is currently a no-op implementation deletes a given shard in an index.
func (api *API) DeleteShard(ctx context.Context, indexName string, shardID uint64) error {
if err := api.validate(apiDeleteShard); err != nil {
return errors.Wrap(err, "validating api method")
@ -791,8 +789,6 @@ func (api *API) DeleteShard(ctx context.Context, indexName string, shardID uint6
return errors.Wrapf(err, "deleting shard")
}
// Since this is serverless, don't need to send to all nodes.
return nil
}

View file

@ -332,19 +332,8 @@ func (api *API) pushJobsTableKeys(ctx context.Context, jobs chan<- directiveJobT
qtid := tkey.QualifiedTableID()
for _, partition := range partitions {
api.serverlessStorage.RemoveTableKeyResource(qtid, partition)
// think about the holder as that's the local disk space
// NOTE: index = table --> don't want to delete the whole index/table
// maybe search via indexes in the translatestores in index.go?
// FeatureBase storage has no concept of database or org, so when we create an index in
// FeatureBase which maps to a qtbl, the name of that index is the TableKey,
// which is made up of org/database/tableID
//maybe start with shards, since multiple shards belong to a partition
api.Holder().Index(string(tkey)).TranslateStore(int(partition)) //.Delete(records *roaring.Bitmap)
// this implementation is going to be much more difficult
//implement this via no-op
// currently a no-op implementation
api.DeletePartition(ctx, string(qtid.Name), int(partition))
}
}
@ -443,7 +432,6 @@ func (api *API) pushJobsFieldKeys(ctx context.Context, jobs chan<- directiveJobT
api.serverlessStorage.RemoveFieldKeyResource(qtid, field)
// Attempt at implementing deletion from disk -- DK
// deleting field from disk
err := api.DeleteField(ctx, string(tkey), string(field))
if err != nil {
errors.Wrapf(err, "error deleting field")

View file

@ -1020,15 +1020,6 @@ func (i *Index) DeleteField(name string) error {
// This is currently a no-op implementation
func (i *Index) DeleteShard(ctx context.Context, indexName string, shardID uint64) error {
// Delete shard
// --> need to make schemator DeleteShard too?
// --> --> --> The real question is where to actually delete the shard? and how? Through fields? Views?
// --> --> shards and partitions aren't part of schema?
// ???
i.holder.txf.DeleteShardFromStore(indexName, shardID)
// profit
return nil
}