private void processResults(Context context, Map<ObjectIndexKey, T> batch, Map<ObjectIndexKey, Collection<ObjectInfo>> objects) { for (T obj : batch.values()) { Collection<ObjectInfo> matches = objects.get(obj); if (matches == null || matches.isEmpty()) { if (retryMissingObjects && context == Context.FAST_MISSING_OK) retry.add(obj); continue; } tmp.clear(); tmp.addAll(matches); ObjectInfo.sort(tmp); if (cacheLoadedInfo) reader.getRecentInfoCache().put(obj, tmp); onResult(obj, tmp); } if (progress != null) progress.update(objects.size()); }
private void processResults(Context context, Map<ObjectIndexKey, T> batch, Map<ObjectIndexKey, Collection<ObjectInfo>> objects) { for (T obj : batch.values()) { Collection<ObjectInfo> matches = objects.get(obj); if (matches == null || matches.isEmpty()) { if (retryMissingObjects && context == Context.FAST_MISSING_OK) retry.add(obj); continue; } tmp.clear(); tmp.addAll(matches); ObjectInfo.sort(tmp); if (cacheLoadedInfo) reader.getRecentInfoCache().put(obj, tmp); onResult(obj, tmp); } if (progress != null) progress.update(objects.size()); }
private Iterable<T> lookInCache(Iterable<T> objects) { RecentInfoCache infoCache = reader.getRecentInfoCache(); List<T> missing = null; for (T obj : objects) { List<ObjectInfo> info = infoCache.get(obj); if (info != null) { onResult(obj, info); if (progress != null) progress.update(1); } else { if (missing == null) { if (objects instanceof List<?>) missing = new ArrayList<T>(((List<?>) objects).size()); else missing = new ArrayList<T>(); } missing.add(obj); } } if (missing != null) return missing; return Collections.emptyList(); }
private Iterable<T> lookInCache(Iterable<T> objects) { RecentInfoCache infoCache = reader.getRecentInfoCache(); List<T> missing = null; for (T obj : objects) { List<ObjectInfo> info = infoCache.get(obj); if (info != null) { onResult(obj, info); if (progress != null) progress.update(1); } else { if (missing == null) { if (objects instanceof List<?>) missing = new ArrayList<T>(((List<?>) objects).size()); else missing = new ArrayList<T>(); } missing.add(obj); } } if (missing != null) return missing; return Collections.emptyList(); }