MCPcopy
hub / github.com/ray-project/ray / get_async

Method get_async

python/ray/data/random_access_dataset.py:138–150  ·  view source on GitHub ↗

Asynchronously finds the record for a single key. Args: key: The key of the record to find. Returns: ObjectRef containing the record (in pydict form), or None if not found.

(self, key: Any)

Source from the content-addressed store, hash-verified

136 return block_to_workers, worker_to_blocks
137
138 def get_async(self, key: Any) -> ObjectRef[Any]:
139 """Asynchronously finds the record for a single key.
140
141 Args:
142 key: The key of the record to find.
143
144 Returns:
145 ObjectRef containing the record (in pydict form), or None if not found.
146 """
147 block_index = self._find_le(key)
148 if block_index is None:
149 return ray.put(None)
150 return self._worker_for(block_index).get.remote(block_index, key)
151
152 def multiget(self, keys: List[Any]) -> List[Optional[Any]]:
153 """Synchronously find the records for a list of keys.

Callers 4

test_basicFunction · 0.45
test_empty_blocksFunction · 0.45
test_statsFunction · 0.45
_fetchFunction · 0.45

Calls 4

_find_leMethod · 0.95
_worker_forMethod · 0.95
putMethod · 0.65
remoteMethod · 0.45

Tested by 3

test_basicFunction · 0.36
test_empty_blocksFunction · 0.36
test_statsFunction · 0.36