Class DeltaWindow
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.pack.DeltaWindow
-
final class DeltaWindow extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classDeltaWindow.ArrayStream(package private) static classDeltaWindow.ZipStream
-
Field Summary
Fields Modifier and Type Field Description private DeltaWindowEntrybestBaseIf we have chosen a base, the window entry it was created from.private longbytesPerUnitprivate longbytesProcessedprivate PackConfigconfigprivate intcurprivate java.util.zip.DeflaterdeflaterUsed to compress cached deltas.private java.lang.ObjectdeltaBufprivate DeltaCachedeltaCacheprivate intdeltaLenprivate intendprivate longloadedAmount of memory we have loaded right now.private intmaxDepthMaximum depth we should create for any delta chain.private longmaxMemoryMaximum number of bytes to admit to the window at once.private ProgressMonitormonitorprivate static booleanNEXT_RESprivate static booleanNEXT_SRCprivate ObjectReaderreaderprivate DeltaWindowEntryresWindow entry of the object we are currently considering.private ObjectToPack[]toSearch
-
Constructor Summary
Constructors Constructor Description DeltaWindow(PackConfig pc, DeltaCache dc, ObjectReader or, ProgressMonitor pm, long bpu, ObjectToPack[] in, int beginIndex, int endIndex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private byte[]buffer(DeltaWindowEntry ent)private voidcacheDelta(ObjectToPack srcObj, ObjectToPack resObj)private voidcheckLoadable(DeltaWindowEntry ent, long need)private voidclear(DeltaWindowEntry ent)private voidclearWindowOnTypeSwitch()private static intdeflateBound(int insz)private java.util.zip.Deflaterdeflater()private booleandelta(DeltaWindowEntry src)private intdeltaSizeLimit(DeltaWindowEntry src)private static longestimateIndexSize(DeltaWindowEntry ent)private static longestimateSize(ObjectToPack ent)private DeltaIndexindex(DeltaWindowEntry ent)private voidkeepInWindow()(package private) DeltaTask.Sliceremaining()(package private) voidsearch()private voidsearchInWindow()private voidselectDeltaBase(DeltaWindowEntry src, java.io.OutputStream delta)(package private) booleantryStealWork(DeltaTask.Slice s)
-
-
-
Field Detail
-
NEXT_RES
private static final boolean NEXT_RES
- See Also:
- Constant Field Values
-
NEXT_SRC
private static final boolean NEXT_SRC
- See Also:
- Constant Field Values
-
config
private final PackConfig config
-
deltaCache
private final DeltaCache deltaCache
-
reader
private final ObjectReader reader
-
monitor
private final ProgressMonitor monitor
-
bytesPerUnit
private final long bytesPerUnit
-
bytesProcessed
private long bytesProcessed
-
maxMemory
private final long maxMemory
Maximum number of bytes to admit to the window at once.
-
maxDepth
private final int maxDepth
Maximum depth we should create for any delta chain.
-
toSearch
private final ObjectToPack[] toSearch
-
cur
private int cur
-
end
private int end
-
loaded
private long loaded
Amount of memory we have loaded right now.
-
res
private DeltaWindowEntry res
Window entry of the object we are currently considering.
-
bestBase
private DeltaWindowEntry bestBase
If we have chosen a base, the window entry it was created from.
-
deltaLen
private int deltaLen
-
deltaBuf
private java.lang.Object deltaBuf
-
deflater
private java.util.zip.Deflater deflater
Used to compress cached deltas.
-
-
Constructor Detail
-
DeltaWindow
DeltaWindow(PackConfig pc, DeltaCache dc, ObjectReader or, ProgressMonitor pm, long bpu, ObjectToPack[] in, int beginIndex, int endIndex)
-
-
Method Detail
-
remaining
DeltaTask.Slice remaining()
-
tryStealWork
boolean tryStealWork(DeltaTask.Slice s)
-
search
void search() throws java.io.IOException- Throws:
java.io.IOException
-
estimateSize
private static long estimateSize(ObjectToPack ent)
-
estimateIndexSize
private static long estimateIndexSize(DeltaWindowEntry ent)
-
clearWindowOnTypeSwitch
private void clearWindowOnTypeSwitch()
-
clear
private void clear(DeltaWindowEntry ent)
-
searchInWindow
private void searchInWindow() throws java.io.IOException- Throws:
java.io.IOException
-
delta
private boolean delta(DeltaWindowEntry src) throws java.io.IOException
- Throws:
java.io.IOException
-
selectDeltaBase
private void selectDeltaBase(DeltaWindowEntry src, java.io.OutputStream delta)
-
deltaSizeLimit
private int deltaSizeLimit(DeltaWindowEntry src)
-
cacheDelta
private void cacheDelta(ObjectToPack srcObj, ObjectToPack resObj)
-
deflateBound
private static int deflateBound(int insz)
-
keepInWindow
private void keepInWindow()
-
index
private DeltaIndex index(DeltaWindowEntry ent) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException, LargeObjectException
- Throws:
MissingObjectExceptionIncorrectObjectTypeExceptionjava.io.IOExceptionLargeObjectException
-
buffer
private byte[] buffer(DeltaWindowEntry ent) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException, LargeObjectException
- Throws:
MissingObjectExceptionIncorrectObjectTypeExceptionjava.io.IOExceptionLargeObjectException
-
checkLoadable
private void checkLoadable(DeltaWindowEntry ent, long need)
-
deflater
private java.util.zip.Deflater deflater()
-
-