Add basic LRU eviction for the plasma store. (#26)

* Basic functionality for LRU eviction.

* Test eviction.

* Factor out eviction policy.

* Move delete_object into eviction policy.

* Replace array of released objects with an LRU cache (hash table + doubly linked list).

* Finish rebase on master.

* Move actual object deletion away from eviction policy and into plasma store.

* Small fixes.

* Fixes.

* Make remove_object_from_lru_cache always remove the object.

* Minor formatting and comments.

* Pass in allowed memory as argument to Plasma store.

* Small fix.
This commit is contained in:
Robert Nishihara
2016-11-05 21:34:11 -07:00
committed by Philipp Moritz
parent 90a2aa4bf7
commit efe8a295ea
13 changed files with 614 additions and 78 deletions
+11
View File
@@ -205,6 +205,17 @@ class PlasmaClient(object):
"""
self.client.plasma_delete(self.plasma_conn, make_plasma_id(object_id))
def evict(self, num_bytes):
"""Evict some objects until to recover some bytes.
Recover at least num_bytes bytes if possible.
Args:
num_bytes (int): The number of bytes to attempt to recover.
"""
num_bytes_evicted = self.client.plasma_evict(self.plasma_conn, num_bytes)
return num_bytes_evicted
def transfer(self, addr, port, object_id):
"""Transfer local object with id object_id to another plasma instance