| Modifier and Type | Class and Description |
|---|---|
| private static record | |
| private static interface | |
| private static class | |
| private static record | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static long | |
| private List | |
| private static boolean | Returns: true if the offset fits in 31 bitsobject offset offset)If there is at least one offset value larger than 2^32-1, then the large offset chunk must exist, and offsets larger than 2^31-1 must be stored in it instead |
| public void | write(ProgressMonitor
progress monitor monitor, OutputStream stream to write the multipack index file outputStream, Map<String, PackIndex> pairs of name and index for each pack to include in the
multipack index. inputs)Writes the inputs in the multipack index format in the outputStream. |
| private void | writeCheckSum(CancellableDigestOutputStream
output stream used to write out)Write final checksum of the data written to the stream |
| private void | writeChunkLookup(CancellableDigestOutputStream
output stream to write out, List<MultiPackIndexWriter.list of chunks in the order they are expected to be written chunkHeadersWrite a table of "chunkId, start-offset", with a special value "0, end-of-previous_chunk", to mark the end. |
| private void | writeFanoutTable(MultiPackIndexWriter.
write context ctxWrite the fanout table for the object ids Table with 256 entries (one byte), where the ith entry, F[i], stores the number of OIDs with first byte at most i. |
| private void | writeHeader(CancellableDigestOutputStream
output stream to write out, int number of chunks this multipack index is going to have numChunks, int number of packs covered by this multipack index packCount)Write the first 12 bytes of the multipack index. |
| private void | writeObjectLargeOffsets(MultiPackIndexWriter.
writer context ctxWrite the large offset chunk A list of large offsets (long). |
| private void | writeObjectOffsets(MultiPackIndexWriter.
write context ctxWrite the object offsets chunk A list of offsets, parallel to the list of OIDs. |
| private void | writeOidLookUp(MultiPackIndexWriter.
write context ctxWrite the OID lookup chunk A list of OIDs in sha1 order. |
| private void | writePackfileNames(MultiPackIndexWriter.
writer context ctxWrite the list of packfiles chunk List of packfiles (in lexicographical order) with an \0 at the end |
| private void | writeRidx(MultiPackIndexWriter.
write context ctxWrites the reverse index chunk This stores the position of the objects in the main index, ordered first by pack and then by offset |
| LIMIT_31_BITS | back to summary |
|---|---|
| private static final int LIMIT_31_BITS | |
| MIDX_HEADER_SIZE | back to summary |
|---|---|
| private static final int MIDX_HEADER_SIZE | |
| MultiPackIndexWriter | back to summary |
|---|---|
| public MultiPackIndexWriter() | |
| calculateExpectedSize | back to summary |
|---|---|
| private static long calculateExpectedSize(List<MultiPackIndexWriter. | |
| createChunkHeaders | back to summary |
|---|---|
| private List | |
| fitsIn31bits | back to summary |
|---|---|
| private static boolean fitsIn31bits(long offset) If there is at least one offset value larger than 2^32-1, then the large offset chunk must exist, and offsets larger than 2^31-1 must be stored in it instead
| |
| write | back to summary |
|---|---|
| public void write(ProgressMonitor monitor, OutputStream outputStream, Map<String, PackIndex> inputs) throws IOException Writes the inputs in the multipack index format in the outputStream.
| |
| writeCheckSum | back to summary |
|---|---|
| private void writeCheckSum(CancellableDigestOutputStream out) throws IOException Write final checksum of the data written to the stream
| |
| writeChunkLookup | back to summary |
|---|---|
| private void writeChunkLookup(CancellableDigestOutputStream out, List<MultiPackIndexWriter. Write a table of "chunkId, start-offset", with a special value "0, end-of-previous_chunk", to mark the end.
| |
| writeFanoutTable | back to summary |
|---|---|
| private void writeFanoutTable(MultiPackIndexWriter. Write the fanout table for the object ids Table with 256 entries (one byte), where the ith entry, F[i], stores the number of OIDs with first byte at most i. Thus, F[255] stores the total number of objects.
| |
| writeHeader | back to summary |
|---|---|
| private void writeHeader(CancellableDigestOutputStream out, int numChunks, int packCount) throws IOException Write the first 12 bytes of the multipack index. These bytes include things like magic number, version, number of chunks...
| |
| writeObjectLargeOffsets | back to summary |
|---|---|
| private void writeObjectLargeOffsets(MultiPackIndexWriter. Write the large offset chunk A list of large offsets (long). The regular offset chunk will point to a position here.
| |
| writeObjectOffsets | back to summary |
|---|---|
| private void writeObjectOffsets(MultiPackIndexWriter. Write the object offsets chunk
A list of offsets, parallel to the list of OIDs. If the offset is too
large (see
| |
| writeOidLookUp | back to summary |
|---|---|
| private void writeOidLookUp(MultiPackIndexWriter. Write the OID lookup chunk A list of OIDs in sha1 order.
| |
| writePackfileNames | back to summary |
|---|---|
| private void writePackfileNames(MultiPackIndexWriter. Write the list of packfiles chunk List of packfiles (in lexicographical order) with an \0 at the end
| |
| writeRidx | back to summary |
|---|---|
| private void writeRidx(MultiPackIndexWriter. Writes the reverse index chunk This stores the position of the objects in the main index, ordered first by pack and then by offset
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final long | |
| private final MultiPackIndexWriter. | writerFn
Record Component accessed by writerFn(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public long | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| public MultiPackIndexWriter. |
| chunkId | back to summary |
|---|---|
| private final int chunkId Record Component accessed by chunkId(). | |
| size | back to summary |
|---|---|
| private final long size Record Component accessed by size(). | |
| writerFn | back to summary |
|---|---|
| private final MultiPackIndexWriter. Record Component accessed by writerFn(). | |
| ChunkHeader | back to summary |
|---|---|
| private ChunkHeader(int chunkId, long size, MultiPackIndexWriter. | |
| chunkId | back to summary |
|---|---|
| public int chunkId() Record Component getter of chunkId. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| size | back to summary |
|---|---|
| public long size() Record Component getter of size. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |
| writerFn | back to summary |
|---|---|
| public MultiPackIndexWriter. Record Component getter of writerFn. | |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| write | back to summary |
|---|---|
| public void write(MultiPackIndexWriter. | |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final byte[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | Returns: the position of the just inserted offset (as in number of offsets, NOT in bytes)a large offset largeOffset)Add an offset to the large offset chunk |
| bytePosition | back to summary |
|---|---|
| private int bytePosition | |
| offsets | back to summary |
|---|---|
| private final byte[] offsets | |
| LargeOffsets | back to summary |
|---|---|
| pack-priv LargeOffsets(int largeOffsetsCount) | |
| append | back to summary |
|---|---|
| pack-priv int append(long largeOffset) Add an offset to the large offset chunk
| |
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final int | position
Record Component accessed by position(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public long | |
| public int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| offset | back to summary |
|---|---|
| private final long offset Record Component accessed by offset(). | |
| position | back to summary |
|---|---|
| private final int position Record Component accessed by position(). | |
| OffsetPosition | back to summary |
|---|---|
| private OffsetPosition(long offset, int position) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| offset | back to summary |
|---|---|
| public long offset() Record Component getter of offset. | |
| position | back to summary |
|---|---|
| public int position() Record Component getter of position. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final PackIndexMerger | |
| pack-priv final MultiPackIndexWriter. | |
| pack-priv final CancellableDigestOutputStream |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| data | back to summary |
|---|---|
| pack-priv final PackIndexMerger data | |
| largeOffsets | back to summary |
|---|---|
| pack-priv final MultiPackIndexWriter. | |
| out | back to summary |
|---|---|
| pack-priv final CancellableDigestOutputStream out | |
| WriteContext | back to summary |
|---|---|
| pack-priv WriteContext(CancellableDigestOutputStream out, PackIndexMerger data) | |