Source code for lmcache.experimental.lookup_server.abstract_server
import abc
from typing import List, Optional, Tuple
from lmcache.utils import CacheEngineKey
[docs]
class LookupServerInterface(metaclass=abc.ABCMeta):
[docs]
@abc.abstractmethod
def lookup(self, key: CacheEngineKey) -> Optional[Tuple[str, int]]:
"""
Perform lookup in the lookup server.
"""
raise NotImplementedError
[docs]
@abc.abstractmethod
def insert(
self,
key: CacheEngineKey,
):
"""
Perform insert in the lookup server.
"""
raise NotImplementedError
[docs]
@abc.abstractmethod
def remove(
self,
key: CacheEngineKey,
):
"""
Perform remove in the lookup server.
"""
raise NotImplementedError
[docs]
@abc.abstractmethod
def batched_remove(
self,
keys: List[CacheEngineKey],
):
"""
Perform batched remove in the lookup server.
"""
raise NotImplementedError