class_docstr: A group of data block references and their metadata.
  
  Operators take in and produce streams of RefBundles.
  
  Most commonly a RefBundle consists of a single block object reference.
  In some cases, e.g., due to block splitting, or for a reduce task, there may
  be more than one block.
  
  Block bundles have ownership semantics, i.e., shared ownership (similar to C++
  shared_ptr, multiple operators share the same block bundle), or unique ownership
  (similar to C++ unique_ptr, only one operator owns the block bundle). This
  allows operators to know whether they can destroy blocks when they don't need
  them. Destroying blocks eagerly is more efficient than waiting for Python GC /
  Ray reference counting to kick in.
class_docstr_tok: ["A","group","of","data","block","references","and","their","metadata",".","Operators","take","in","and","produce","streams","of","RefBundles",".","Most","commonly","a","RefBundle","consists","of","a","single","block","object","reference",".","In","some","cases",",","e.g.",",","due","to","block","splitting",",","or","for","a","reduce","task",",","there","may","be","more","than","one","block",".","Block","bundles","have","ownership","semantics",",","i.e.",",","shared","ownership","(","similar","to","C++","shared_ptr",",","multiple","operators","share","the","same","block","bundle",")",",","or","unique","ownership","(","similar","to","C++","unique_ptr",",","only","one","operator","owns","the","block","bundle",")",".","This","allows","operators","to","know","whether","they","can","destroy","blocks","when","they","do","n't","need","them",".","Destroying","blocks","eagerly","is","more","efficient","than","waiting","for","Python","GC","\/","Ray","reference","counting","to","kick","in","."]
docstr: Return a location for this bundle's data, if possible.
  
  Caches the resolved location so multiple calls to this are efficient.
docstr_tok: ["Return","a","location","for","this","bundle","'s","data",",","if","possible",".","Caches","the","resolved","location","so","multiple","calls","to","this","are","efficient","."]
code: def get_cached_location(self) -> Optional[NodeIdStr]:
      """Return a location for this bundle's data, if possible.
  
      Caches the resolved location so multiple calls to this are efficient.
      """
      if self._cached_location is None:
          # Only consider the first block in the bundle for now. TODO(ekl) consider
          # taking into account other blocks.
          ref = self.blocks[0][0]
          # This call is pretty fast for owned objects (~5k/s), so we don't need to
          # batch it for now.
          locs = ray.experimental.get_object_locations([ref])
          nodes = locs[ref]["node_ids"]
          if nodes:
              self._cached_location = nodes[0]
          else:
              self._cached_location = ""
      if self._cached_location:
          return self._cached_location
      else:
          return None
  
file_path: ray/python/ray/data/_internal/execution/interfaces/ref_bundle.py
imports: from dataclasses import dataclass
  from typing import Optional, Tuple
  import ray
  from .common import NodeIdStr
  from ray.data._internal.memory_tracing import trace_deallocation
  from ray.data.block import Block, BlockMetadata
  from ray.data.context import DataContext
  from ray.types import ObjectRef
label_desc: Use image node_id 6 for calling the RefBundle obj's underlying member method code with example usage: obj.get_cached_location() and returns: self, None