/** @return estimated unpacked size of the object, in bytes . */ final int size() { return object.getWeight(); }
boolean canCache(int length, ObjectToPack src, ObjectToPack res) { // If the cache would overflow, don't store. // if (0 < size && size < used + length) { checkForGarbageCollectedObjects(); if (0 < size && size < used + length) return false; } if (length < entryLimit) { used += length; return true; } // If the combined source files are multiple megabytes but the delta // is on the order of a kilobyte or two, this was likely costly to // construct. Cache it anyway, even though its over the limit. // if (length >> 10 < (src.getWeight() >> 20) + (res.getWeight() >> 21)) { used += length; return true; } return false; }
private static long estimateSize(ObjectToPack ent) { return DeltaIndex.estimateIndexSize(ent.getWeight()); }
static int getAdjustedWeight(ObjectToPack o) { // Edge objects and those with reused deltas do not need to be // compressed. For compression calculations, ignore their weights. if (o.isEdge() || o.doNotAttemptDelta()) { return 0; } return o.getWeight(); }
@Override public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
/** @return estimated unpacked size of the object, in bytes . */ final int size() { return object.getWeight(); }
/** @return estimated unpacked size of the object, in bytes . */ final int size() { return object.getWeight(); }
} else { if (bytesPerUnit <= (bytesProcessed += next.getWeight())) { int d = (int) (bytesProcessed / bytesPerUnit); monitor.update(d);
boolean canCache(int length, ObjectToPack src, ObjectToPack res) { // If the cache would overflow, don't store. // if (0 < size && size < used + length) { checkForGarbageCollectedObjects(); if (0 < size && size < used + length) return false; } if (length < entryLimit) { used += length; return true; } // If the combined source files are multiple megabytes but the delta // is on the order of a kilobyte or two, this was likely costly to // construct. Cache it anyway, even though its over the limit. // if (length >> 10 < (src.getWeight() >> 20) + (res.getWeight() >> 21)) { used += length; return true; } return false; }
boolean canCache(int length, ObjectToPack src, ObjectToPack res) { // If the cache would overflow, don't store. // if (0 < size && size < used + length) { checkForGarbageCollectedObjects(); if (0 < size && size < used + length) return false; } if (length < entryLimit) { used += length; return true; } // If the combined source files are multiple megabytes but the delta // is on the order of a kilobyte or two, this was likely costly to // construct. Cache it anyway, even though its over the limit. // if (length >> 10 < (src.getWeight() >> 20) + (res.getWeight() >> 21)) { used += length; return true; } return false; }
private static long estimateSize(ObjectToPack ent) { return DeltaIndex.estimateIndexSize(ent.getWeight()); }
private static long estimateSize(ObjectToPack ent) { return DeltaIndex.estimateIndexSize(ent.getWeight()); }
static int getAdjustedWeight(ObjectToPack o) { // Edge objects and those with reused deltas do not need to be // compressed. For compression calculations, ignore their weights. if (o.isEdge() || o.doNotAttemptDelta()) { return 0; } return o.getWeight(); }
static int getAdjustedWeight(ObjectToPack o) { // Edge objects and those with reused deltas do not need to be // compressed. For compression calculations, ignore their weights. if (o.isEdge() || o.doNotAttemptDelta()) { return 0; } return o.getWeight(); }
if (otp.getWeight() <= nWeight) return;
public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
@Override public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
} else { if (bytesPerUnit <= (bytesProcessed += next.getWeight())) { int d = (int) (bytesProcessed / bytesPerUnit); monitor.update(d);
} else { if (bytesPerUnit <= (bytesProcessed += next.getWeight())) { int d = (int) (bytesProcessed / bytesPerUnit); monitor.update(d);
if (otp.getWeight() <= nWeight) return;