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 class
DeltaWindow.ArrayStream
(package private) static class
DeltaWindow.ZipStream
-
Field Summary
Fields Modifier and Type Field Description private DeltaWindowEntry
bestBase
If we have chosen a base, the window entry it was created from.private long
bytesPerUnit
private long
bytesProcessed
private PackConfig
config
private int
cur
private java.util.zip.Deflater
deflater
Used to compress cached deltas.private java.lang.Object
deltaBuf
private DeltaCache
deltaCache
private int
deltaLen
private int
end
private long
loaded
Amount of memory we have loaded right now.private int
maxDepth
Maximum depth we should create for any delta chain.private long
maxMemory
Maximum number of bytes to admit to the window at once.private ProgressMonitor
monitor
private static boolean
NEXT_RES
private static boolean
NEXT_SRC
private ObjectReader
reader
private DeltaWindowEntry
res
Window 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 void
cacheDelta(ObjectToPack srcObj, ObjectToPack resObj)
private void
checkLoadable(DeltaWindowEntry ent, long need)
private void
clear(DeltaWindowEntry ent)
private void
clearWindowOnTypeSwitch()
private static int
deflateBound(int insz)
private java.util.zip.Deflater
deflater()
private boolean
delta(DeltaWindowEntry src)
private int
deltaSizeLimit(DeltaWindowEntry src)
private static long
estimateIndexSize(DeltaWindowEntry ent)
private static long
estimateSize(ObjectToPack ent)
private DeltaIndex
index(DeltaWindowEntry ent)
private void
keepInWindow()
(package private) DeltaTask.Slice
remaining()
(package private) void
search()
private void
searchInWindow()
private void
selectDeltaBase(DeltaWindowEntry src, java.io.OutputStream delta)
(package private) boolean
tryStealWork(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:
MissingObjectException
IncorrectObjectTypeException
java.io.IOException
LargeObjectException
-
buffer
private byte[] buffer(DeltaWindowEntry ent) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException, LargeObjectException
- Throws:
MissingObjectException
IncorrectObjectTypeException
java.io.IOException
LargeObjectException
-
checkLoadable
private void checkLoadable(DeltaWindowEntry ent, long need)
-
deflater
private java.util.zip.Deflater deflater()
-
-