void select(Iterable<T> objects) throws IOException { selectInBatches(Context.FAST_MISSING_OK, lookInCache(objects)); // Not all of the selection ran with fast options. if (retryMissingObjects && !retry.isEmpty()) { batches.release(concurrentBatches); selectInBatches(Context.READ_REPAIR, retry); } if (progress != null) progress.pollForUpdates(); }
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()); }
startQuery(options, batch); batch = new HashMap<ObjectIndexKey, T>();
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()); }
startQuery(options, batch); batch = new HashMap<ObjectIndexKey, T>();
void select(Iterable<T> objects) throws IOException { selectInBatches(Context.FAST_MISSING_OK, lookInCache(objects)); // Not all of the selection ran with fast options. if (retryMissingObjects && !retry.isEmpty()) { batches.release(concurrentBatches); selectInBatches(Context.READ_REPAIR, retry); } if (progress != null) progress.pollForUpdates(); }
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(); }