/** {@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(); }
/** {@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(); }
@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 = cache.getOrCreate(packDsc, packKey); if (index != null) p.setPackIndex(index); db.addPack(p); clear(); }
private long beginObject(int type, long len) throws IOException { if (packOut == null) beginPack(); long offset = packOut.getCount(); packOut.beginObject(type, len); return offset; }
private long beginObject(int type, long len) throws IOException { if (packOut == null) beginPack(); long offset = packOut.getCount(); packOut.beginObject(type, len); return offset; }
private long beginObject(int type, long len) throws IOException { if (packOut == null) beginPack(); long offset = packOut.getCount(); packOut.beginObject(type, len); return offset; }