ObjectWriter(DhtReader ctx, Prefetcher prefetch) { this.ctx = ctx; this.prefetch = prefetch; batchSize = ctx.getOptions().getObjectIndexBatchSize(); metaBatches = new Semaphore(batchSize); metaError = new AtomicReference<DhtException>(); allVisits = new LinkedHashMap<ChunkKey, Integer>(); allMeta = new HashMap<ChunkKey, ChunkMeta>(); metaMissing = new HashSet<ChunkKey>(); metaToRead = new HashSet<ChunkKey>(); curVisit = 1; }
ObjectWriter(DhtReader ctx, Prefetcher prefetch) { this.ctx = ctx; this.prefetch = prefetch; batchSize = ctx.getOptions().getObjectIndexBatchSize(); metaBatches = new Semaphore(batchSize); metaError = new AtomicReference<DhtException>(); allVisits = new LinkedHashMap<ChunkKey, Integer>(); allMeta = new HashMap<ChunkKey, ChunkMeta>(); metaMissing = new HashSet<ChunkKey>(); metaToRead = new HashSet<ChunkKey>(); curVisit = 1; }
private synchronized void startBatch(final Context ctx) { final int batchSize = options.getObjectIndexBatchSize(); final Map<ObjectIndexKey, T> batch = new HashMap<ObjectIndexKey, T>(); while (toFind.hasNext() && batch.size() < batchSize) { T obj = toFind.next(); batch.put(ObjectIndexKey.create(repo, obj), obj); } final AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>> cb; cb = new AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>>() { public void onSuccess(Map<ObjectIndexKey, Collection<ObjectInfo>> r) { processResults(ctx, batch, r); } public void onFailure(DhtException e) { processFailure(e); } }; db.objectIndex().get(ctx, batch.keySet(), cb); runningBatches++; }
private synchronized void startBatch(final Context ctx) { final int batchSize = options.getObjectIndexBatchSize(); final Map<ObjectIndexKey, T> batch = new HashMap<ObjectIndexKey, T>(); while (toFind.hasNext() && batch.size() < batchSize) { T obj = toFind.next(); batch.put(ObjectIndexKey.create(repo, obj), obj); } final AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>> cb; cb = new AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>>() { public void onSuccess(Map<ObjectIndexKey, Collection<ObjectInfo>> r) { processResults(ctx, batch, r); } public void onFailure(DhtException e) { processFailure(e); } }; db.objectIndex().get(ctx, batch.keySet(), cb); runningBatches++; }
private void selectInBatches(Context options, Iterable<T> objects) throws DhtException { final int batchSize = reader.getOptions() .getObjectIndexBatchSize();
private void selectInBatches(Context options, Iterable<T> objects) throws DhtException { final int batchSize = reader.getOptions() .getObjectIndexBatchSize();
setObjectIndexBatchSize(rc.getInt("core", "dht", "objectIndexBatchSize", getObjectIndexBatchSize()));
setObjectIndexBatchSize(rc.getInt("core", "dht", "objectIndexBatchSize", getObjectIndexBatchSize()));