Use Plasma with LRU refreshing integrated (#6050)

This commit is contained in:
Philipp Moritz
2019-11-03 16:19:05 -08:00
committed by GitHub
parent 894885593c
commit 1c5446851a
8 changed files with 53 additions and 25 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ async def _async_init():
if handler is None:
worker = ray.worker.global_worker
plasma_client = thread_safe_client(
plasma.connect(worker.node.plasma_store_socket_name, None, 0, 300))
plasma.connect(worker.node.plasma_store_socket_name, 300))
loop = asyncio.get_event_loop()
plasma_client.subscribe()
rsock = plasma_client.get_notification_socket()
+6 -1
View File
@@ -39,7 +39,12 @@ class PlasmaProtocol(asyncio.Protocol):
i += INT64_SIZE
segment = self._buffer[i:i + msg_len]
i += msg_len
messages.append(self.plasma_client.decode_notification(segment))
(object_ids, object_sizes,
metadata_sizes) = self.plasma_client.decode_notifications(segment)
assert len(object_ids) == len(object_sizes) == len(metadata_sizes)
for j in range(len(object_ids)):
messages.append((object_ids[j], object_sizes[j],
metadata_sizes[j]))
self._buffer = self._buffer[i:]
self.plasma_event_handler.process_notifications(messages)