create either a CollectionPrefetcher or a ReferencePrefetcher
517519
public RelationshipPrefetcher createRelationshipPrefetcher(ClassDescriptor anOwnerCld, String aRelationshipName)
    {
        ObjectReferenceDescriptor ord;
        
        ord = anOwnerCld.getCollectionDescriptorByName(aRelationshipName);
        if (ord == null)
        {
            ord = anOwnerCld.getObjectReferenceDescriptorByName(aRelationshipName);
            if (ord == null)
            {
                throw new PersistenceBrokerException("Relationship named '" + aRelationshipName
                        + "' not found in owner class " + (anOwnerCld != null ? anOwnerCld.getClassNameOfObject() : null));
            }
        }
        return createRelationshipPrefetcher(ord);
    }
81507
Multimap<String, Map.Entry<InetAddress, Collection<Range<Token>>>> toFetch()
    {
        return toFetch;
    }
674268
public String getCollectionImplType(Reference ref) {
		String collectionType = getRefCollectionType(ref);
		return getCollectionImplType(collectionType);
	}
355284
protected Query[] buildPrefetchQueries(Collection proxies, Collection realSubjects)
    {
        Collection queries = new ArrayList();
        Collection idsSubset;
        Object proxy;
        IndirectionHandler handler;
        Identity id;
        Class realClass;
        HashMap classToIds = new HashMap();
        Class topLevelClass = getItemClassDescriptor().getClassOfObject();
        PersistenceBroker pb = getBroker();
        ObjectCache cache = pb.serviceObjectCache();

        for (Iterator it = proxies.iterator(); it.hasNext(); )
        {
            proxy = it.next();
            handler = ProxyHelper.getIndirectionHandler(proxy);

            if (handler == null)
            {
                continue;
            }
            
            id = handler.getIdentity();
            if (cache.lookup(id) != null)
            {
                realSubjects.add(pb.getObjectByIdentity(id));
                continue;
            }
            realClass = id.getObjectsRealClass();
            if (realClass == null)
            {
                realClass = Object.class; // to remember that the real class is unknown
            }
            idsSubset = (HashSet) classToIds.get(realClass);
            if (idsSubset == null)
            {
                idsSubset = new HashSet();
                classToIds.put(realClass, idsSubset);
            }
            idsSubset.add(id);
            if (idsSubset.size() == pkLimit)
            {
                Query query;
                if (realClass == Object.class)
                {
                    query = buildPrefetchQuery(topLevelClass, idsSubset, true);
                }
                else
                {
                    query = buildPrefetchQuery(realClass, idsSubset, false);
                }
                queries.add(query);
                idsSubset.clear();
            }
        }

        for (Iterator it = classToIds.entrySet().iterator(); it.hasNext(); )
        {
            Map.Entry entry = (Map.Entry) it.next();
            realClass = (Class) entry.getKey();
            idsSubset = (HashSet) entry.getValue();
            if (idsSubset.size() > 0)
            {
                Query query;
                if (realClass == Object.class)
                {
                    query = buildPrefetchQuery(topLevelClass, idsSubset, true);
                }
                else
                {
                    query = buildPrefetchQuery(realClass, idsSubset, false);
                }
                queries.add(query);
            }
        }

        return (Query[]) queries.toArray(new Query[queries.size()]);
    }
161832
def _fetch_all(self):
        
        if self._result_cache is None:
            self._result_cache = list(self.iterator())
            # TODO: Do we have to test for ValuesListIterable, ValuesIterable,
            # and FlatValuesListIterable here?
            if self._iterable_class == ModelIterable:
                for x in self._result_cache:
                    self._set_item_querytime(x)
        if self._prefetch_related_lookups and not self._prefetch_done:
            self._prefetch_related_objects()
1207259
private void fetchIfNeeded(long remainingBytes)
  {
    if ((fetchFutures.isEmpty() || fetchFutures.peekLast().isDone())
        && remainingBytes <= prefetchConfig.getPrefetchTriggerBytes()) {
      Future<Void> fetchFuture = fetchExecutor.submit(() -> {
        fetch();
        return null;
      });
      fetchFutures.add(fetchFuture);
    }
  }
522900
public DataFetcher getDataFetcher(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition) {
        return getDataFetcherImpl(parentType, fieldDefinition, dataFetcherMap, systemDataFetcherMap);
    }
1137874
function onFetching(model, columns, options) {
        if (options.forUpdate && options.transacting) {
            options.query.forUpdate();
        }
    }
854290
@Nonnull
  public TypeaheadDataset setPrefetch (@Nullable final ISimpleURL aURL)
  {
    return setPrefetch (aURL == null ? null : new TypeaheadPrefetch (aURL));
  }
508440
public final void mFETCH() throws RecognitionException {
		try {
			int _type = FETCH;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:28:7: ( 'fetch' )
			// hql.g:28:9: 'fetch'
			{
			match("fetch"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1031937
public static <T, K, S, X extends Collection<T>> X loadNToOne(X list,
			Function<T, K> keyGetter,
			Function<Collection<K>, Collection<S>> loader,
			Function<S, K> loadedKeyGetter, BiConsumer<T, S> match) {
		if (list == null || list.size() == 0)
			return list;

		Set<K> keys = toSet(list, keyGetter);
		if (keys == null || keys.size() == 0)
			return list;

		Collection<S> subs = loader.apply(keys);
		if (subs == null || subs.size() == 0)
			return list;

		HashMap<K, S> map = toHashMap(subs, loadedKeyGetter);
		for (T item : list) {
			K key = keyGetter.apply(item);
			if (key == null)
				continue;

			S sub = map.get(key);
			if (sub == null)
				continue;
			match.accept(item, sub);
		}

		return list;
	}
270730
public PrefetchResponse prefetch(String url) {
        return prefetch(new PrefetchRequest().addTask(new PrefetchTask().withUrl(url)));
    }
659585
private void fetch() {
    	next.clear();
        // We need to remember for what thread the IEnumVARIANT was marshaled. Because if we want to interpret this
        // VARIANT as an interface pointer later on, we need to do this in the same thread!
        next.thread = e.getComThread();
        int r = e.next(1,next);
        if(r==0) {
            next = null;
            e.dispose();
        }
    }
383143
function buildRefetchMap(
  context: GraphQLCompilerContext,
): Map<string, Fragment> {
  const refetchOperations = new Map();
  const errors = eachWithErrors(context.documents(), node => {
    if (node.kind !== 'Fragment') {
      return;
    }
    const refetchName = getRefetchQueryName(node);
    if (refetchName === null) {
      return;
    }
    const previousOperation = refetchOperations.get(refetchName);
    if (previousOperation != null) {
      throw createUserError(
        `Duplicate definition for @refetchable operation '${refetchName}' from fragments '${
          node.name
        }' and '${previousOperation.name}'`,
        [node.loc, previousOperation.loc],
      );
    }
    refetchOperations.set(refetchName, node);
  });
  if (errors != null && errors.length !== 0) {
    throw createCombinedError(errors, 'RelayRefetchableFragmentTransform');
  }
  const transformed = inferRootArgumentDefinitions(context);
  return new Map(
    Array.from(refetchOperations.entries(), ([name, fragment]) => {
      return [name, transformed.getFragment(fragment.name)];
    }),
  );
}
648326
def plasma_prefetch(object_id):
    """"""
    local_sched_client = ray.worker.global_worker.raylet_client
    ray_obj_id = ray.ObjectID(object_id)
    local_sched_client.fetch_or_reconstruct([ray_obj_id], True)
53213
protected Query buildPrefetchQuery(Collection ids)
    {
        CollectionDescriptor cds = getCollectionDescriptor();
        QueryByCriteria query = buildPrefetchQuery(ids, cds.getForeignKeyFieldDescriptors(getItemClassDescriptor()));

        // check if collection must be ordered
        if (!cds.getOrderBy().isEmpty())
        {
            Iterator iter = cds.getOrderBy().iterator();
            while (iter.hasNext())
            {
                query.addOrderBy((FieldHelper) iter.next());
            }
        }

        return query;
    }
1153471
public ManageableCollection getCollectionByQuery(Class collectionClass, Query query, boolean lazy) throws PersistenceBrokerException
    {
        ManageableCollection result;

        try
        {
            // BRJ: return empty Collection  for null query
            if (query == null)
            {
                result = (ManageableCollection)collectionClass.newInstance();
            }
            else
            {
                if (lazy)
                {
                    result = pb.getProxyFactory().createCollectionProxy(pb.getPBKey(), query, collectionClass);
                }
                else
                {
                    result = getCollectionByQuery(collectionClass, query.getSearchClass(), query);
                }
            }
            return result;
        }
        catch (Exception e)
        {
            if(e instanceof PersistenceBrokerException)
            {
                throw (PersistenceBrokerException) e;
            }
            else
            {
                throw new PersistenceBrokerException(e);
            }
        }
    }