newPacks.add(oldPack); } else if (dsc.hasFileExt(PackExt.PACK)) { newPacks.add(new DfsPackFile(cache, dsc)); foundNew = true;
/** {@inheritDoc} */ @Override public void flush() throws IOException { if (packDsc == null) return; if (packOut == null) throw new IOException(); byte[] packHash = packOut.writePackFooter(); packDsc.addFileExt(PACK); packDsc.setFileSize(PACK, packOut.getCount()); packOut.close(); packOut = null; sortObjectsById(); PackIndex index = writePackIndex(packDsc, packHash, objectList); db.commitPack(Collections.singletonList(packDsc), null); rollback = false; DfsPackFile p = new DfsPackFile(cache, packDsc); if (index != null) p.setPackIndex(index); db.addPack(p); clear(); }
rollback = false; DfsPackFile p = new DfsPackFile(blockCache, packDsc); p.setBlockSize(blockSize); if (packIndex != null)
DfsPackFile getOrCreate(DfsPackDescription dsc, DfsPackKey key) { // TODO This table grows without bound. It needs to clean up // entries that aren't in cache anymore, and aren't being used // by a live DfsObjDatabase reference. synchronized (packCache) { DfsPackFile pack = packCache.get(dsc); if (pack != null && pack.invalid()) { packCache.remove(dsc); pack = null; } if (pack == null) { if (key == null) key = new DfsPackKey(); pack = new DfsPackFile(this, dsc, key); packCache.put(dsc, pack); } return pack; } }
newPacks.add(oldPack); } else if (dsc.hasFileExt(PackExt.PACK)) { newPacks.add(new DfsPackFile(cache, dsc)); foundNew = true;
/** {@inheritDoc} */ @Override public void flush() throws IOException { if (packDsc == null) return; if (packOut == null) throw new IOException(); byte[] packHash = packOut.writePackFooter(); packDsc.addFileExt(PACK); packDsc.setFileSize(PACK, packOut.getCount()); packOut.close(); packOut = null; sortObjectsById(); PackIndex index = writePackIndex(packDsc, packHash, objectList); db.commitPack(Collections.singletonList(packDsc), null); rollback = false; DfsPackFile p = new DfsPackFile(cache, packDsc); if (index != null) p.setPackIndex(index); db.addPack(p); clear(); }
rollback = false; DfsPackFile p = new DfsPackFile(blockCache, packDsc); p.setBlockSize(blockSize); if (packIndex != null)