@@ -307,6 +307,18 @@ class SingleTierStorage : public Storage<K, V> {
307307 false /* to_dram*/ , is_incr, restore_buff);
308308 return s;
309309 }
310+
311+ void CleanUp () override {
312+ std::vector<K> key_list;
313+ std::vector<void *> value_ptr_list;
314+ kv_->GetSnapshot (&key_list, &value_ptr_list);
315+
316+ int list_size = key_list.size ();
317+ for (int i = 0 ; i < list_size; i++) {
318+ kv_->Remove (key_list[i]);
319+ feat_desc_->Deallocate (value_ptr_list[i]);
320+ }
321+ }
310322
311323 protected:
312324 virtual void Shrink (std::vector<K>& key_list,
@@ -453,6 +465,10 @@ class HbmStorage : public SingleTierStorage<K, V> {
453465 GPUHashTable<K, V>* HashTable () override {
454466 return SingleTierStorage<K, V>::kv_->HashTable ();
455467 }
468+
469+ void CleanUp () override {
470+ LOG (FATAL) << " Function [CleanUp] of HbmStorage is not implemented." ;
471+ }
456472 protected:
457473 Status RestoreFeatures (int64 key_num, int bucket_num, int64 partition_id,
458474 int64 partition_num, int64 value_len, bool is_filter,
@@ -495,6 +511,11 @@ class HbmStorageWithCpuKv: public SingleTierStorage<K, V> {
495511 Status TryInsert (K key, void * value_ptr) {
496512 return SingleTierStorage<K, V>::kv_->Insert (key, value_ptr);
497513 }
514+
515+ void CleanUp () override {
516+ LOG (FATAL) << " Function [CleanUp] of HbmStorageWithCPUKv is not implemented." ;
517+ }
518+
498519 public:
499520 friend class HbmDramStorage <K, V>;
500521 friend class HbmDramSsdStorage <K, V>;
@@ -521,6 +542,10 @@ class PmemMemkindStorage : public SingleTierStorage<K, V> {
521542 }
522543 ~PmemMemkindStorage () override {}
523544
545+ void CleanUp () override {
546+ LOG (FATAL) << " Function [CleanUp] of PmemMemkindStorage is not implemented." ;
547+ }
548+
524549 TF_DISALLOW_COPY_AND_ASSIGN (PmemMemkindStorage);
525550};
526551
@@ -537,6 +562,10 @@ class PmemLibpmemStorage : public SingleTierStorage<K, V> {
537562 return SingleTierStorage<K, V>::kv_->Commit (keys, value_ptr);
538563 }
539564
565+ void CleanUp () override {
566+ LOG (FATAL) << " Function [CleanUp] of PmemLibpmemStorage is not implemented." ;
567+ }
568+
540569 TF_DISALLOW_COPY_AND_ASSIGN (PmemLibpmemStorage);
541570
542571 protected:
@@ -577,6 +606,11 @@ class LevelDBStore : public SingleTierStorage<K, V> {
577606 key_list, emb_index, value_len,
578607 leveldb_kv, SingleTierStorage<K, V>::feat_desc_);
579608 }
609+
610+ void CleanUp () override {
611+ LOG (FATAL) << " Function [CleanUp] of LevelDBStorage is not implemented." ;
612+ }
613+
580614 public:
581615 friend class DramLevelDBStore <K, V>;
582616};
@@ -646,6 +680,10 @@ class SsdHashStorage : public SingleTierStorage<K, V> {
646680 reinterpret_cast <SSDHashKV<K, V>*>(SingleTierStorage<K, V>::kv_);
647681 ssd_kv->SetSsdRecordDescriptor (ssd_rec_desc);
648682 }
683+
684+ void CleanUp () override {
685+ LOG (FATAL) << " Function [CleanUp] of SsdHashStorage is not implemented." ;
686+ }
649687 public:
650688 friend class DramSsdHashStorage <K, V>;
651689#if GOOGLE_CUDA
0 commit comments