| Modifier and Type | Field and Description |
|---|---|
| private DeltaBaseCache | |
| private final ObjectInserter | |
| pack-priv final FileObjectDatabase | |
| private Inflater | |
| pack-priv final byte[] | tempId
Temporary buffer large enough for at least one raw object id. |
| private ByteWindow |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| pack-priv int | Returns: number of bytes actually copied; this may be less thancnt if cnt exceeded the number of bytes
available.the file the desired window is stored within. pack, long position within the file to read from. position, final byte[] destination buffer to copy into. dstbuf, int offset within dstoff, final int dstbuf to start copying into.number of bytes to copy. This value may exceed the number of
bytes remaining in the window starting at offset
cnt)position.Copy bytes from the window to a caller supplied buffer. |
| public void | copyObjectAsIs(PackOutputStream
stream the object should be written to. out, ObjectToPack the object's saved representation information. otp, boolean if true the representation must be validated and not be
corrupt before being reused. If false, validation may be
skipped as it will be performed elsewhere in the processing
pipeline. validate)Implements org. Output a previously selected representation. |
| public void | copyPackAsIs(PackOutputStream
stream to append the pack onto. out, CachedPack the cached pack to send. pack)Implements org. Append an entire pack's contents onto the output stream. |
| pack-priv void | |
| public BitmapIndex | getBitmapIndex()
Overrides org. An index that can be used to speed up ObjectWalks. |
| public Collection | getCachedPacksAndUpdate(BitmapIndex.
the bitmap that contains all of the objects the client wants. needBitmapImplements org. Obtain the available cached packs that match the bitmap and update the bitmap by removing the items that are in the CachedPack. |
| public Optional | getCommitGraph()
Overrides org. Get the commit-graph for this repository if available. |
| public ObjectInserter | getCreatedFromInserter()
Overrides org. Get the |
| pack-priv DeltaBaseCache | |
| public long | getObjectSize(AnyObjectId
identity of the object to open. objectId, int hint about the type of object being requested, e.g.
typeHint)org.;
OBJ_ANY if the object type is not known, or does not
matter to the caller.Overrides org. Get only the size of an object. |
| public Set | getShallowCommits()
Implements abstract org. Returns IDs for those commits which should be considered as shallow. |
| public boolean | has(AnyObjectId
identity of the object to test for existence of. objectId)Overrides org. Does the requested object exist in this database? |
| pack-priv int | Returns: number of bytes inflated intodstbuf.the file the desired window is stored within. pack, long position within the file to read from. position, final byte[] destination buffer the inflater should output decompressed
data to. Must be large enough to store the entire stream,
unless headerOnly is true. dstbuf, boolean if true the caller wants only headerOnly)dstbuf.length bytes.Inflate a region of the pack starting at |
| pack-priv Inflater | |
| public LocalObjectToPack | newObjectToPack(AnyObjectId
the id of the object that will be packed. objectId, int the Git type of the object that will be packed. type)Implements org. Allocate a new |
| public ObjectReader | newReader()
Implements abstract org. Construct a new reader from the same data. |
| public ObjectLoader | open(AnyObjectId
identity of the object to open. objectId, int hint about the type of object being requested, e.g.
typeHint)org.;
OBJ_ANY if the object type is not known, or does not
matter to the caller.Implements abstract org. Open an object from this database. |
| pack-priv void | |
| private void | |
| pack-priv ByteArrayWindow | |
| public Collection | resolve(AbbreviatedObjectId
abbreviated id to resolve to a complete identity. The
abbreviation must have a length of at least 2. id)Implements abstract org. Resolve an abbreviated ObjectId to its full form. |
| public void | selectObjectRepresentation(PackWriter
the packer that will write the object in the near future. packer, ProgressMonitor progress monitor, implementation should update the monitor
once for each item in the iteration when selection is done. monitor, Iterable<ObjectToPack> the objects that are being packed. objects)Implements org. Select the best object representation for a packer. |
| public void | writeObjects(PackOutputStream
the stream to write each object to. out, List<ObjectToPack> the list of objects to write. Objects should be written in
approximately this order. Implementors may resort the list
elements in-place during writing if desired. list)Implements org. Write objects to the pack stream in roughly the order given. |
| baseCache | back to summary |
|---|---|
| private DeltaBaseCache baseCache | |
| createdFromInserter | back to summary |
|---|---|
| private final ObjectInserter createdFromInserter
| |
| db | back to summary |
|---|---|
| pack-priv final FileObjectDatabase db | |
| inf | back to summary |
|---|---|
| private Inflater inf | |
| tempId | back to summary |
|---|---|
| pack-priv final byte[] tempId Temporary buffer large enough for at least one raw object id. | |
| window | back to summary |
|---|---|
| private ByteWindow window | |
| WindowCursor | back to summary |
|---|---|
| pack-priv WindowCursor(FileObjectDatabase db) | |
| WindowCursor | back to summary |
|---|---|
| pack-priv WindowCursor(FileObjectDatabase db, ObjectDirectoryInserter createdFromInserter) | |
| close | back to summary |
|---|---|
| public void close() Implements abstract org. Implements java. Doc from org. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
Release any resources used by this reader. A reader that has been released can be used again, but may need to be released after the subsequent usage. Release the current window cursor.
| |
| copy | back to summary |
|---|---|
| pack-priv int copy(final Pack pack, long position, final byte[] dstbuf, int dstoff, final int cnt) throws IOException Copy bytes from the window to a caller supplied buffer.
| |
| copyObjectAsIs | back to summary |
|---|---|
| public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp, boolean validate) throws IOException, StoredObjectRepresentationNotAvailableException Implements org. Doc from org. Output a previously selected representation.
Implementors must write the object header before copying the raw data to the output stream. The typical implementation is like: MyToPack mtp = (MyToPack) otp; byte[] raw; if (validate) raw = validate(mtp); // throw SORNAE here, if at all else raw = readFast(mtp); out.writeHeader(mtp, mtp.inflatedSize); out.write(raw);
| |
| copyPackAsIs | back to summary |
|---|---|
| public void copyPackAsIs(PackOutputStream out, CachedPack pack) throws IOException Implements org. Doc from org. Append an entire pack's contents onto the output stream. The entire pack, excluding its header and trailing footer is sent.
| |
| copyPackAsIs | back to summary |
|---|---|
| pack-priv void copyPackAsIs(final Pack pack, final long length, final PackOutputStream out) throws IOException | |
| getBitmapIndex | back to summary |
|---|---|
| public BitmapIndex getBitmapIndex() throws IOException Overrides org. Doc from org. An index that can be used to speed up ObjectWalks.
| |
| getCachedPacksAndUpdate | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Obtain the available cached packs that match the bitmap and update the bitmap by removing the items that are in the CachedPack. A cached pack has known starting points and may be sent entirely as-is, with almost no effort on the sender's part.
| |
| getCommitGraph | back to summary |
|---|---|
| public Optional Overrides org. Doc from org. Get the commit-graph for this repository if available. The commit graph can be created/modified/deleted while the repository is open and specific implementations decide when to refresh it.
| |
| getCreatedFromInserter | back to summary |
|---|---|
| public ObjectInserter getCreatedFromInserter() Overrides org. Doc from org. Get the
| |
| getDeltaBaseCache | back to summary |
|---|---|
| pack-priv DeltaBaseCache getDeltaBaseCache() | |
| getObjectSize | back to summary |
|---|---|
| public long getObjectSize(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException Overrides org. Doc from org. Get only the size of an object. The default implementation of this method opens an ObjectLoader. Databases are encouraged to override this if a faster access method is available to them.
| |
| getShallowCommits | back to summary |
|---|---|
| public Set Implements abstract org. Doc from org. Returns IDs for those commits which should be considered as shallow.
| |
| has | back to summary |
|---|---|
| public boolean has(AnyObjectId objectId) throws IOException Overrides org. Doc from org. Does the requested object exist in this database?
| |
| inflate | back to summary |
|---|---|
| pack-priv int inflate(final Pack pack, long position, final byte[] dstbuf, boolean headerOnly) throws IOException, DataFormatException Inflate a region of the pack starting at
| |
| inflater | back to summary |
|---|---|
| pack-priv Inflater inflater() | |
| newObjectToPack | back to summary |
|---|---|
| public LocalObjectToPack newObjectToPack(AnyObjectId objectId, int type) Implements org. Doc from org. Allocate a new
| |
| newReader | back to summary |
|---|---|
| public ObjectReader newReader() Implements abstract org. Doc from org. Construct a new reader from the same data. Applications can use this method to build a new reader from the same data source, but for an different thread.
| |
| open | back to summary |
|---|---|
| public ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException Implements abstract org. Doc from org. Open an object from this database.
| |
| pin | back to summary |
|---|---|
| pack-priv void pin(Pack pack, long position) throws IOException | |
| prepareInflater | back to summary |
|---|---|
| private void prepareInflater() | |
| quickCopy | back to summary |
|---|---|
| pack-priv ByteArrayWindow quickCopy(Pack p, long pos, long cnt) throws IOException | |
| resolve | back to summary |
|---|---|
| public Collection Implements abstract org. Doc from org. Resolve an abbreviated ObjectId to its full form. This method searches for an ObjectId that begins with the abbreviation, and returns at least some matching candidates. If the returned collection is empty, no objects start with this abbreviation. The abbreviation doesn't belong to this repository, or the repository lacks the necessary objects to complete it. If the collection contains exactly one member, the abbreviation is (currently) unique within this database. There is a reasonably high probability that the returned id is what was previously abbreviated. If the collection contains 2 or more members, the abbreviation is not unique. In this case the implementation is only required to return at least 2 candidates to signal the abbreviation has conflicts. User friendly implementations should return as many candidates as reasonably possible, as the caller may be able to disambiguate further based on context. However since databases can be very large (e.g. 10 million objects) returning 625,000 candidates for the abbreviation "0" is simply unreasonable, so implementors should draw the line at around 256 matches.
| |
| selectObjectRepresentation | back to summary |
|---|---|
| public void selectObjectRepresentation(PackWriter packer, ProgressMonitor monitor, Iterable<ObjectToPack> objects) throws IOException, MissingObjectException Implements org. Doc from org. Select the best object representation for a packer.
Implementations should iterate through all available representations of
an object, and pass them in turn to the PackWriter though
If the implementation returns CachedPack from
The implementation may choose to consider multiple objects at once on concurrent threads, but must evaluate all representations of an object within the same thread.
| |
| writeObjects | back to summary |
|---|---|
| public void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException Implements org. Doc from org. Write objects to the pack stream in roughly the order given.
for (ObjectToPack obj : list) out.writeObject(obj)However more sophisticated implementors may try to perform some (small) reordering to access objects that are stored close to each other at roughly the same time. Implementations may choose to write objects out of order, but this may increase pack file size due to using a larger header format to reach a delta base that is later in the stream. It may also reduce data locality for the reader, slowing down data access. Invoking org.
will cause
copyObjectAsIs(PackOutputStream, ObjectToPack, boolean) to be
invoked recursively on this if the current object is scheduled
for reuse.
| |