[HiCache] Clear kvcache in storage backend with fastAPI (#9750)

Co-authored-by: hzh0425 <hzh0425@apache.org>
This commit is contained in:
Teng Ma
2025-08-31 17:41:44 +08:00
committed by GitHub
parent 9a0d0b754d
commit f05c68733e
8 changed files with 84 additions and 4 deletions

View File

@@ -125,6 +125,15 @@ class HiRadixCache(RadixCache):
height += 1
return height
def clear_storage_backend(self):
if self.enable_storage:
self.cache_controller.storage_backend.clear()
logger.info("Hierarchical cache storage backend cleared successfully!")
return True
else:
logger.warning("Hierarchical cache storage backend is not enabled.")
return False
def write_backup(self, node: TreeNode, write_back=False):
host_indices = self.cache_controller.write(
device_indices=node.value,