private void addObject( final AnyObjectId src, final int type, final int pathHashCode) { final ObjectToPack otp; if (reuseSupport != null) otp = reuseSupport.newObjectToPack(src, type); else otp = new ObjectToPack(src, type); otp.setPathHash(pathHashCode); objectsLists[type].add(otp); objectsMap.add(otp); }
private void searchForReuse(ProgressMonitor monitor, List<ObjectToPack> list) throws IOException, MissingObjectException { pruneCurrentObjectList = false; reuseSupport.selectObjectRepresentation(this, monitor, list); if (pruneCurrentObjectList) pruneEdgesFromObjectList(list); }
private void findObjectsToPackUsingBitmaps( BitmapWalker bitmapWalker, Set<? extends ObjectId> want, Set<? extends ObjectId> have) throws MissingObjectException, IncorrectObjectTypeException, IOException { BitmapBuilder haveBitmap = bitmapWalker.findObjects(have, null, true); BitmapBuilder wantBitmap = bitmapWalker.findObjects(want, haveBitmap, false); BitmapBuilder needBitmap = wantBitmap.andNot(haveBitmap); if (useCachedPacks && reuseSupport != null && !reuseValidate && (excludeInPacks == null || excludeInPacks.length == 0)) cachedPacks.addAll( reuseSupport.getCachedPacksAndUpdate(needBitmap)); for (BitmapObject obj : needBitmap) { ObjectId objectId = obj.getObjectId(); if (exclude(objectId)) { needBitmap.remove(objectId); continue; } filterAndAddObject(objectId, obj.getType(), 0, want); } if (thin) haveObjects = haveBitmap; }
StoredObjectRepresentationNotAvailableException { ObjectReuseAsIs asis = (ObjectReuseAsIs) reader; ObjectToPack target = asis.newObjectToPack(obj, obj.getType()); asis.selectObjectRepresentation(pw, NullProgressMonitor.INSTANCE, Collections.singleton(target)); asis.copyObjectAsIs(new PackOutputStream(NullProgressMonitor.INSTANCE, buf, pw), target, true);
otp.setOffset(out.length()); try { reuseSupport.copyObjectAsIs(out, otp, reuseValidate); out.endObject(); otp.setCRC((int) crc32.getValue()); otp.clearDeltaBase(); otp.clearReuseAsIs(); reuseSupport.selectObjectRepresentation(this, NullProgressMonitor.INSTANCE, Collections.singleton(otp));
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException { if (list.isEmpty()) return; typeStats = stats.objectTypes[list.get(0).getType()]; long beginOffset = out.length(); if (reuseSupport != null) { reuseSupport.writeObjects(out, list); } else { for (ObjectToPack otp : list) out.writeObject(otp); } typeStats.bytes += out.length() - beginOffset; typeStats.cntObjects = list.size(); }
stats.reusedDeltas += deltaCnt; stats.totalDeltas += deltaCnt; reuseSupport.copyPackAsIs(out, pack);
otp.setOffset(out.length()); try { reuseSupport.copyObjectAsIs(out, otp, reuseValidate); out.endObject(); otp.setCRC((int) crc32.getValue()); otp.clearDeltaBase(); otp.clearReuseAsIs(); reuseSupport.selectObjectRepresentation(this, NullProgressMonitor.INSTANCE, Collections.singleton(otp));
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException { if (list.isEmpty()) return; typeStats = stats.objectTypes[list.get(0).getType()]; long beginOffset = out.length(); if (reuseSupport != null) { reuseSupport.writeObjects(out, list); } else { for (ObjectToPack otp : list) out.writeObject(otp); } typeStats.bytes += out.length() - beginOffset; typeStats.cntObjects = list.size(); }
stats.reusedDeltas += deltaCnt; stats.totalDeltas += deltaCnt; reuseSupport.copyPackAsIs(out, pack);
otp.setOffset(out.length()); try { reuseSupport.copyObjectAsIs(out, otp, reuseValidate); out.endObject(); otp.setCRC((int) crc32.getValue()); otp.clearDeltaBase(); otp.clearReuseAsIs(); reuseSupport.selectObjectRepresentation(this, NullProgressMonitor.INSTANCE, Collections.singleton(otp));
private void reselectNonDelta(ObjectToPack otp) throws IOException { otp.clearDeltaBase(); otp.clearReuseAsIs(); boolean old = reuseDeltas; reuseDeltas = false; reuseSupport.selectObjectRepresentation(this, NullProgressMonitor.INSTANCE, Collections.singleton(otp)); reuseDeltas = old; }
private void addObject( final AnyObjectId src, final int type, final int pathHashCode) { final ObjectToPack otp; if (reuseSupport != null) otp = reuseSupport.newObjectToPack(src, type); else otp = new ObjectToPack(src, type); otp.setPathHash(pathHashCode); objectsLists[type].add(otp); objectsMap.add(otp); }
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException { if (list.isEmpty()) return; typeStats = stats.objectTypes[list.get(0).getType()]; long beginOffset = out.length(); if (reuseSupport != null) { reuseSupport.writeObjects(out, list); } else { for (ObjectToPack otp : list) out.writeObject(otp); } typeStats.bytes += out.length() - beginOffset; typeStats.cntObjects = list.size(); }
private void findObjectsToPackUsingBitmaps( BitmapWalker bitmapWalker, Set<? extends ObjectId> want, Set<? extends ObjectId> have) throws MissingObjectException, IncorrectObjectTypeException, IOException { BitmapBuilder haveBitmap = bitmapWalker.findObjects(have, null, true); BitmapBuilder wantBitmap = bitmapWalker.findObjects(want, haveBitmap, false); BitmapBuilder needBitmap = wantBitmap.andNot(haveBitmap); if (useCachedPacks && reuseSupport != null && !reuseValidate && (excludeInPacks == null || excludeInPacks.length == 0)) cachedPacks.addAll( reuseSupport.getCachedPacksAndUpdate(needBitmap)); for (BitmapObject obj : needBitmap) { ObjectId objectId = obj.getObjectId(); if (exclude(objectId)) { needBitmap.remove(objectId); continue; } filterAndAddObject(objectId, obj.getType(), 0, want); } if (thin) haveObjects = haveBitmap; }
stats.reusedDeltas += deltaCnt; stats.totalDeltas += deltaCnt; reuseSupport.copyPackAsIs(out, pack);
private void searchForReuse(ProgressMonitor monitor, List<ObjectToPack> list) throws IOException, MissingObjectException { pruneCurrentObjectList = false; reuseSupport.selectObjectRepresentation(this, monitor, list); if (pruneCurrentObjectList) pruneEdgesFromObjectList(list); }
private void addObject( final AnyObjectId src, final int type, final int pathHashCode) { final ObjectToPack otp; if (reuseSupport != null) otp = reuseSupport.newObjectToPack(src, type); else otp = new ObjectToPack(src, type); otp.setPathHash(pathHashCode); objectsLists[type].add(otp); objectsMap.add(otp); }
private void findObjectsToPackUsingBitmaps( PackWriterBitmapWalker bitmapWalker, Set<? extends ObjectId> want, Set<? extends ObjectId> have) throws MissingObjectException, IncorrectObjectTypeException, IOException { BitmapBuilder haveBitmap = bitmapWalker.findObjects(have, null, true); bitmapWalker.reset(); BitmapBuilder wantBitmap = bitmapWalker.findObjects(want, haveBitmap, false); BitmapBuilder needBitmap = wantBitmap.andNot(haveBitmap); if (useCachedPacks && reuseSupport != null && !reuseValidate && (excludeInPacks == null || excludeInPacks.length == 0)) cachedPacks.addAll( reuseSupport.getCachedPacksAndUpdate(needBitmap)); for (BitmapObject obj : needBitmap) { ObjectId objectId = obj.getObjectId(); if (exclude(objectId)) { needBitmap.remove(objectId); continue; } addObject(objectId, obj.getType(), 0); } if (thin) haveObjects = haveBitmap; }
private void searchForReuse(ProgressMonitor monitor, List<ObjectToPack> list) throws IOException, MissingObjectException { pruneCurrentObjectList = false; reuseSupport.selectObjectRepresentation(this, monitor, list); if (pruneCurrentObjectList) pruneEdgesFromObjectList(list); }