Top Inners Fields Constructors Methods
org.eclipse.jgit.internal.storage.pack

pack-priv final Class DeltaWindow

extends Object
Class Inheritance
Imports
java.io.EOFException, .IOException, .OutputStream, java.util.zip.Deflater, org.eclipse.jgit.errors.IncorrectObjectTypeException, .LargeObjectException, .MissingObjectException, org.eclipse.jgit.lib.ObjectReader, .ProgressMonitor, org.eclipse.jgit.storage.pack.PackConfig, org.eclipse.jgit.util.TemporaryBuffer

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private DeltaWindowEntry
bestBase

If we have chosen a base, the window entry it was created from.

private final long
private long
private final PackConfig
private int
private Deflater
deflater

Used to compress cached deltas.

private Object
private final DeltaCache
private int
private int
private long
loaded

Amount of memory we have loaded right now.

private final int
maxDepth

Maximum depth we should create for any delta chain.

private final long
maxMemory

Maximum number of bytes to admit to the window at once.

private final ProgressMonitor
private static final boolean
private static final boolean
private final ObjectReader
private DeltaWindowEntry
res

Window entry of the object we are currently considering.

private final ObjectToPack[]

Constructor Summary

AccessConstructor and Description
pack-priv
DeltaWindow(PackConfig pc, DeltaCache dc, ObjectReader or, ProgressMonitor pm, long bpu, ObjectToPack[] in, int beginIndex, int endIndex)

Method Summary

Modifier and TypeMethod and Description
private byte[]
private void
private void
private void
private void
private static int
deflateBound(int insz)

private Deflater
private boolean
private int
private static long
private static long
private DeltaIndex
private void
pack-priv synchronized DeltaTask.Slice
pack-priv void
private void
private void
pack-priv synchronized boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bestBaseback to summary
private DeltaWindowEntry bestBase

If we have chosen a base, the window entry it was created from.

bytesPerUnitback to summary
private final long bytesPerUnit
bytesProcessedback to summary
private long bytesProcessed
configback to summary
private final PackConfig config
curback to summary
private int cur
deflaterback to summary
private Deflater deflater

Used to compress cached deltas.

deltaBufback to summary
private Object deltaBuf
deltaCacheback to summary
private final DeltaCache deltaCache
deltaLenback to summary
private int deltaLen
endback to summary
private int end
loadedback to summary
private long loaded

Amount of memory we have loaded right now.

maxDepthback to summary
private final int maxDepth

Maximum depth we should create for any delta chain.

maxMemoryback to summary
private final long maxMemory

Maximum number of bytes to admit to the window at once.

monitorback to summary
private final ProgressMonitor monitor
NEXT_RESback to summary
private static final boolean NEXT_RES
NEXT_SRCback to summary
private static final boolean NEXT_SRC
readerback to summary
private final ObjectReader reader
resback to summary
private DeltaWindowEntry res

Window entry of the object we are currently considering.

toSearchback to summary
private final ObjectToPack[] toSearch

Constructor Detail

DeltaWindowback to summary
pack-priv DeltaWindow(PackConfig pc, DeltaCache dc, ObjectReader or, ProgressMonitor pm, long bpu, ObjectToPack[] in, int beginIndex, int endIndex)

Method Detail

bufferback to summary
private byte[] buffer(DeltaWindowEntry ent) throws MissingObjectException, IncorrectObjectTypeException, IOException, LargeObjectException
cacheDeltaback to summary
private void cacheDelta(ObjectToPack srcObj, ObjectToPack resObj)
checkLoadableback to summary
private void checkLoadable(DeltaWindowEntry ent, long need)
clearback to summary
private void clear(DeltaWindowEntry ent)
clearWindowOnTypeSwitchback to summary
private void clearWindowOnTypeSwitch()
deflateBoundback to summary
private static int deflateBound(int insz)
deflaterback to summary
private Deflater deflater()
deltaback to summary
private boolean delta(DeltaWindowEntry src) throws IOException
deltaSizeLimitback to summary
private int deltaSizeLimit(DeltaWindowEntry src)
estimateIndexSizeback to summary
private static long estimateIndexSize(DeltaWindowEntry ent)
estimateSizeback to summary
private static long estimateSize(ObjectToPack ent)
indexback to summary
private DeltaIndex index(DeltaWindowEntry ent) throws MissingObjectException, IncorrectObjectTypeException, IOException, LargeObjectException
keepInWindowback to summary
private void keepInWindow()
remainingback to summary
pack-priv synchronized DeltaTask.Slice remaining()
searchback to summary
pack-priv void search() throws IOException
searchInWindowback to summary
private void searchInWindow() throws IOException
selectDeltaBaseback to summary
private void selectDeltaBase(DeltaWindowEntry src, OutputStream delta)
tryStealWorkback to summary
pack-priv synchronized boolean tryStealWork(DeltaTask.Slice s)
org.eclipse.jgit.internal.storage.pack back to summary

pack-priv final Class DeltaWindow.ArrayStream

extends OutputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final byte[]
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
ArrayStream(int max)

Method Summary

Modifier and TypeMethod and Description
public void
write(int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

public void
write(byte[]
the data.
b
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Inherited from java.io.OutputStream:
closeflushnullOutputStreamwrite

Field Detail

bufback to summary
pack-priv final byte[] buf
cntback to summary
pack-priv int cnt

Constructor Detail

ArrayStreamback to summary
pack-priv ArrayStream(int max)

Method Detail

writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
org.eclipse.jgit.internal.storage.pack back to summary

pack-priv final Class DeltaWindow.ZipStream

extends OutputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Deflater
private int
private final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
ZipStream(Deflater deflater, byte[] zbuf)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
public void
write(byte[]
the data.
b
,
int
the start offset in the data.
off
,
int
the number of bytes to write.
len
)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

public void
write(int
the byte.
b
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

Inherited from java.io.OutputStream:
closeflushnullOutputStreamwrite

Field Detail

deflaterback to summary
private final Deflater deflater
outPtrback to summary
private int outPtr
zbufback to summary
private final byte[] zbuf

Constructor Detail

ZipStreamback to summary
pack-priv ZipStream(Deflater deflater, byte[] zbuf)

Method Detail

finishback to summary
pack-priv int finish() throws IOException
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.
writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
b:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.