[kv_offload+HMA][4/N]: Support sliding window lookup (#36645)
Signed-off-by: Or Ozeri <oro@il.ibm.com> Co-authored-by: Nicolò Lucchesi <nlucches@redhat.com>
This commit is contained in:
co-authored by
Nicolò Lucchesi
parent
2aab9acf48
commit
f774ba028a
@@ -84,18 +84,9 @@ class CPUOffloadingManager(OffloadingManager):
|
||||
|
||||
# --- OffloadingManager interface ---
|
||||
|
||||
def lookup(
|
||||
self,
|
||||
keys: Iterable[OffloadKey],
|
||||
req_context: ReqContext,
|
||||
) -> int | None:
|
||||
hit_count = 0
|
||||
for key in keys:
|
||||
block = self._policy.get(key)
|
||||
if block is None or not block.is_ready:
|
||||
break
|
||||
hit_count += 1
|
||||
return hit_count
|
||||
def lookup(self, key: OffloadKey, req_context: ReqContext) -> bool | None:
|
||||
block = self._policy.get(key)
|
||||
return block is not None and block.is_ready
|
||||
|
||||
def prepare_load(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user