public void copyPackAsIs(PackOutputStream out, CachedPack pack, boolean validate) throws IOException { ((DhtCachedPack) pack).copyAsIs(out, validate, this); }
@Override public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep) { DhtObjectRepresentation objrep = (DhtObjectRepresentation) rep; if (keySet == null) init(); return keySet.contains(objrep.getChunkKey()); }
void copyAsIs(PackOutputStream out, boolean validate, DhtReader ctx) throws IOException { if (keyList == null) init(); // Clear the recent chunks because all of the reader's // chunk limit should be made available for prefetch. int cacheLimit = ctx.getOptions().getChunkLimit(); ctx.getRecentChunks().setMaxBytes(0); try { Prefetcher p = new Prefetcher(ctx, 0, cacheLimit); p.push(Arrays.asList(keyList)); copyPack(out, p, validate); } finally { ctx.getRecentChunks().setMaxBytes(cacheLimit); } }
public Collection<CachedPack> getCachedPacks() throws IOException { if (cachedPacks == null) { Collection<CachedPackInfo> info; Collection<CachedPack> packs; try { info = db.repository().getCachedPacks(repo); } catch (TimeoutException e) { throw new DhtTimeoutException(e); } packs = new ArrayList<CachedPack>(info.size()); for (CachedPackInfo i : info) packs.add(new DhtCachedPack(i)); cachedPacks = packs; } return cachedPacks; }
throw new DhtException(MessageFormat.format(DhtText .get().wrongChunkPositionInCachedPack, rowKey(), base.getChunkKey(), "[not written]", key, Long.valueOf(exp))); throw new DhtException(MessageFormat.format(DhtText .get().wrongChunkPositionInCachedPack, rowKey(), base.getChunkKey(), act, key, Long.valueOf(exp)));
void copyAsIs(PackOutputStream out, boolean validate, DhtReader ctx) throws IOException { if (keyList == null) init(); // Clear the recent chunks because all of the reader's // chunk limit should be made available for prefetch. int cacheLimit = ctx.getOptions().getChunkLimit(); ctx.getRecentChunks().setMaxBytes(0); try { Prefetcher p = new Prefetcher(ctx, 0, cacheLimit); p.push(Arrays.asList(keyList)); copyPack(out, p, validate); } finally { ctx.getRecentChunks().setMaxBytes(cacheLimit); } }
public Collection<CachedPack> getCachedPacks() throws IOException { if (cachedPacks == null) { Collection<CachedPackInfo> info; Collection<CachedPack> packs; try { info = db.repository().getCachedPacks(repo); } catch (TimeoutException e) { throw new DhtTimeoutException(e); } packs = new ArrayList<CachedPack>(info.size()); for (CachedPackInfo i : info) packs.add(new DhtCachedPack(i)); cachedPacks = packs; } return cachedPacks; }
throw new DhtException(MessageFormat.format(DhtText .get().wrongChunkPositionInCachedPack, rowKey(), base.getChunkKey(), "[not written]", key, Long.valueOf(exp))); throw new DhtException(MessageFormat.format(DhtText .get().wrongChunkPositionInCachedPack, rowKey(), base.getChunkKey(), act, key, Long.valueOf(exp)));
@Override public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep) { DhtObjectRepresentation objrep = (DhtObjectRepresentation) rep; if (keySet == null) init(); return keySet.contains(objrep.getChunkKey()); }
public void copyPackAsIs(PackOutputStream out, CachedPack pack, boolean validate) throws IOException { ((DhtCachedPack) pack).copyAsIs(out, validate, this); }