diff --git a/api.go b/api.go index d0e27c798..64e16c2eb 100644 --- a/api.go +++ b/api.go @@ -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 } diff --git a/api_directive.go b/api_directive.go index 543d9c5c6..3d9698ddb 100644 --- a/api_directive.go +++ b/api_directive.go @@ -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") diff --git a/index.go b/index.go index c062cf36d..8e85941e4 100644 --- a/index.go +++ b/index.go @@ -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 }