[HiStorage] Remove delete and clear as necessary methods (#10039)

This commit is contained in:
Zhiqiang Xie
2025-09-05 19:27:26 -07:00
committed by GitHub
parent beac202bfd
commit 0b8c5721f1
2 changed files with 0 additions and 26 deletions

View File

@@ -103,20 +103,6 @@ class HiCacheStorage(ABC):
"""
pass
@abstractmethod
def delete(self, key: str) -> bool:
"""
Delete the entry associated with the given key.
"""
pass
@abstractmethod
def clear(self) -> bool:
"""
Clear all entries in the storage.
"""
pass
def batch_exists(self, keys: List[str]) -> int:
"""
Check if the keys exist in the storage.
@@ -227,15 +213,6 @@ class HiCacheFile(HiCacheStorage):
tensor_path = os.path.join(self.file_path, f"{key}.bin")
return os.path.exists(tensor_path)
def delete(self, key: str) -> None:
key = self._get_suffixed_key(key)
tensor_path = os.path.join(self.file_path, f"{key}.bin")
try:
os.remove(tensor_path)
except FileNotFoundError:
logger.warning(f"Key {key} does not exist. Cannot delete.")
return
def clear(self) -> bool:
try:
for filename in os.listdir(self.file_path):

View File

@@ -264,9 +264,6 @@ class MooncakeStore(HiCacheStorage):
return i // key_multiplier
return len(query_keys) // key_multiplier
def delete(self, key) -> None:
raise (NotImplementedError)
def close(self):
# MooncakeDistributedStore will automatically call the destructor, so
# it is unnecessary to close it manually.