Unified storage kvstore bulk import support (#113791)

* implement batchdelete in datastore

* implement bulkprocess in kv storage_backend

* convert bulkRVs to snowflake
This commit is contained in:
Will Assis
2025-12-04 09:26:50 -05:00
committed by GitHub
parent 64a3c298cf
commit ae4d2324d6
4 changed files with 326 additions and 0 deletions
+21
View File
@@ -537,6 +537,27 @@ func (d *dataStore) Delete(ctx context.Context, key DataKey) error {
return d.kv.Delete(ctx, dataSection, key.String())
}
func (n *dataStore) batchDelete(ctx context.Context, keys []DataKey) error {
for len(keys) > 0 {
batch := keys
if len(batch) > dataBatchSize {
batch = batch[:dataBatchSize]
}
keys = keys[len(batch):]
stringKeys := make([]string, len(batch))
for _, dataKey := range batch {
stringKeys = append(stringKeys, dataKey.String())
}
if err := n.kv.BatchDelete(ctx, dataSection, stringKeys); err != nil {
return err
}
}
return nil
}
// ParseKey parses a string key into a DataKey struct
func ParseKey(key string) (DataKey, error) {
parts := strings.Split(key, "/")