See the base org. documentation for
details. Notably, a reader is not thread safe.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| protected static interface | DfsReader.
Announces when data is loaded by reader |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private DeltaBaseCache | |
| private DfsBlock | |
| pack-priv final DfsObjDatabase | db
Database this reader loads objects from. |
| private static final Comparator | |
| private Inflater | |
| private DfsPackFile | |
| private static final int | |
| private static final Comparator | |
| private static final Comparator | |
| private List | |
| pack-priv final DfsReaderIoStats. | |
| pack-priv final byte[] | tempId
Temporary buffer large enough for at least one raw object id. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addPackLoadListener(DfsReader.
a listener listenerAdd listener to record loads by this reader |
| private static boolean | |
| private static ObjectLoader | |
| 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. file, long position within the file to read from. position, byte[] destination buffer to copy into. dstbuf, int offset within dstoff, 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)pos.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. |
| protected BitmapIndex | Returns: an instance of BitmapIndexpackBitmapIndex found in a pack (never null) packBitmapIndex)Give subclasses a chance to record pack index stats |
| pack-priv void | |
| pack-priv void | |
| private <T extends ObjectId> Iterable | |
| private List | |
| private <T extends ObjectId> void | |
| private DfsPackFile | |
| private List | |
| 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. |
| pack-priv DeltaBaseCache | |
| public DfsReaderIoStats | Returns: IO statistics accumulated by this reader.Get IO statistics accumulated by this reader. |
| public <T extends ObjectId> AsyncObjectSizeQueue | getObjectSize(Iterable<T>
objects to get the size of from the object store. The supplied
collection must not be modified until the queue has finished. objectIds, final boolean if true missing objects are reported by calling failure with a
MissingObjectException. This may be more expensive for the
implementation to guarantee. If false the implementation may
choose to report MissingObjectException, or silently skip over
the object with no warning. reportMissing)Overrides org. Asynchronous object size lookup. |
| 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. |
| pack-priv DfsReaderOptions | |
| 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? |
| private boolean | |
| 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, 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 | |
| private boolean | |
| public boolean | isNotLargerThan(AnyObjectId
identity of the object to open. objectId, int hint about the type of object being requested, e.g.
typeHint, long org.;
OBJ_ANY if the object type is not known, or does not
matter to the caller.threshold value for the size of the object in bytes. limit)Overrides org. Check if the object size is less or equal than certain value By default, it reads the object from storage to get the size. |
| public DfsObjectToPack | 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. |
| public <T extends ObjectId> AsyncObjectLoaderQueue | open(Iterable<T>
objects to open from the object store. The supplied collection
must not be modified until the queue has finished. objectIds, final boolean if true missing objects are reported by calling failure with a
MissingObjectException. This may be more expensive for the
implementation to guarantee. If false the implementation may
choose to report MissingObjectException, or silently skip over
the object with no warning. reportMissing)Overrides org. Asynchronous object opening. |
| private ObjectLoader | |
| pack-priv void | |
| private void | |
| pack-priv DfsBlock | |
| 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. |
| private void | |
| private Optional | |
| private boolean | |
| 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 | setAvoidUnreachableObjects(boolean
true to avoid unreachable objects. avoid)Overrides org. Advise the reader to avoid unreachable objects. |
| private boolean | |
| private List | |
| private void | trySelectRepresentation(PackWriter packer, ProgressMonitor monitor, Iterable<ObjectToPack> objects, List<DfsPackFile> packs, boolean skipFound)
|
| pack-priv void | |
| 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. |