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
+2 -1
View File
@@ -13,6 +13,7 @@ import photon
import plasma
USE_VALGRIND = False
PLASMA_STORE_MEMORY = 1000000000
class TestPhotonClient(unittest.TestCase):
@@ -23,7 +24,7 @@ class TestPhotonClient(unittest.TestCase):
# Start Plasma.
plasma_executable = os.path.join(os.path.abspath(os.path.dirname(__file__)), "../../plasma/build/plasma_store")
plasma_socket = "/tmp/plasma_store{}".format(random.randint(0, 10000))
self.p2 = subprocess.Popen([plasma_executable, "-s", plasma_socket])
self.p2 = subprocess.Popen([plasma_executable, "-s", plasma_socket, "-m", str(PLASMA_STORE_MEMORY)])
time.sleep(0.1)
self.plasma_client = plasma.PlasmaClient(plasma_socket)
scheduler_executable = os.path.join(os.path.abspath(os.path.dirname(__file__)), "../build/photon_scheduler")