org.eclipse.jgit.lib.ObjectDatabase for a single thread.
Readers that can support efficient reuse of pack encoded objects should also
implement the companion interface
org..
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | ObjectReader.
Wraps a delegate ObjectReader. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | OBJ_ANY
Type hint indicating the caller doesn't know the type. |
| protected int | streamFileThreshold
The threshold at which a file will be streamed rather than loaded entirely into memory. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AbbreviatedObjectId | Returns: SHA-1 abbreviation.object identity that needs to be abbreviated. objectId)Obtain a unique abbreviation (prefix) of an object SHA-1. |
| public AbbreviatedObjectId | Returns: SHA-1 abbreviation. If no matching objects exist in the repository, the abbreviation will match the minimum length.object identity that needs to be abbreviated. objectId, int minimum length of the abbreviated string. Must be in the range
[2, 40]. len)Obtain a unique abbreviation (prefix) of an object SHA-1. |
| public abstract void | close()
Redeclares java. Closes this resource, relinquishing any underlying resources. |
| public ObjectReachabilityChecker | Returns: the most efficient object reachability checker for this repository.objectwalk for use by the reachability checker ow)Create an object reachability checker that will use bitmaps if possible. |
| public ReachabilityChecker | Returns: the most efficient reachability checker for this repository.revwalk for use by the reachability checker rw)Create a reachability checker that will use bitmaps if possible. |
| public BitmapIndex | Returns: the index or null if one does not exist.An index that can be used to speed up ObjectWalks. |
| public Optional | Returns: the commit-graph or empty if the commit-graph does not exist or is invalid; always returns empty when core.commitGraph is false (default is false).Get the commit-graph for this repository if available. |
| public ObjectInserter | Returns: theorg. from which this
reader was created using inserter.newReader(), or null if
this reader was not created from an inserter.Get the |
| public long | Returns: size of object in bytes.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.Get only the size of an object. |
| public < type of T extends ObjectId> AsyncObjectSizeQueueObjectId | Returns: queue to read object sizes from.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)Asynchronous object size lookup. |
| public abstract Set | Returns: IDs of shallow commitsReturns IDs for those commits which should be considered as shallow. |
| public int | Returns: the threshold in bytesReturns the threshold at which a file will be streamed rather than loaded entirely into memory |
| public boolean | Returns: true if the specified object is stored in this database.identity of the object to test for existence of. objectId)Does the requested object exist in this database? |
| public boolean | Returns: true if the specified object is stored in this database.identity of the object to test for existence of. 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.Does the requested object exist in this database? |
| public boolean | Returns: true if the object size is equal or smaller than the threshold valueidentity 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. size)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 abstract ObjectReader | Returns: a brand new reader, using the same data source.Construct a new reader from the same data. |
| public ObjectLoader | Returns: aorg. for accessing the
object.identity of the object to open. objectId)Open an object from this database. |
| public abstract ObjectLoader | Returns: aorg. for accessing the
object.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.Open an object from this database. |
| public < type of T extends ObjectId> AsyncObjectLoaderQueueObjectId | Returns: queue to read the objects from.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)Asynchronous object opening. |
| public abstract Collection | Returns: candidates that begin with the abbreviated identity.abbreviated id to resolve to a complete identity. The
abbreviation must have a length of at least 2. id)Resolve an abbreviated ObjectId to its full form. |
| public void | setAvoidUnreachableObjects(boolean
true to avoid unreachable objects. avoid)Advise the reader to avoid unreachable objects. |
| public void | setStreamFileThreshold(int
the new threshold threshold)Sets the threshold at which a file will be streamed rather than loaded entirely into memory |
| OBJ_ANY | back to summary |
|---|---|
| public static final int OBJ_ANY Type hint indicating the caller doesn't know the type. | |
| streamFileThreshold | back to summary |
|---|---|
| protected int streamFileThreshold The threshold at which a file will be streamed rather than loaded entirely into memory.
| |
| ObjectReader | back to summary |
|---|---|
| public ObjectReader() | |
| abbreviate | back to summary |
|---|---|
| public AbbreviatedObjectId abbreviate(AnyObjectId objectId) throws IOException Obtain a unique abbreviation (prefix) of an object SHA-1.
This method uses a reasonable default for the minimum length. Callers who
don't care about the minimum length should prefer this method.
The returned abbreviation would expand back to the argument ObjectId when
passed to
| |
| abbreviate | back to summary |
|---|---|
| public AbbreviatedObjectId abbreviate(AnyObjectId objectId, int len) throws IOException Obtain a unique abbreviation (prefix) of an object SHA-1.
The returned abbreviation would expand back to the argument ObjectId when
passed to
| |
| close | back to summary |
|---|---|
| public abstract void close() Redeclares java. Doc from java. 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.
| |
| createObjectReachabilityChecker | back to summary |
|---|---|
| public ObjectReachabilityChecker createObjectReachabilityChecker(ObjectWalk ow) throws IOException Create an object reachability checker that will use bitmaps if possible.
This reachability checker accepts any object as target. For checks
exclusively between commits, use
| |
| createReachabilityChecker | back to summary |
|---|---|
| public ReachabilityChecker createReachabilityChecker(RevWalk rw) throws IOException Create a reachability checker that will use bitmaps if possible.
| |
| getBitmapIndex | back to summary |
|---|---|
| public BitmapIndex getBitmapIndex() throws IOException An index that can be used to speed up ObjectWalks.
| |
| getCommitGraph | back to summary |
|---|---|
| public Optional 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() Get the
| |
| getObjectSize | back to summary |
|---|---|
| public long getObjectSize(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException 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.
| |
| getObjectSize | back to summary |
|---|---|
| public <T extends ObjectId> AsyncObjectSizeQueue Asynchronous object size lookup.
| |
| getShallowCommits | back to summary |
|---|---|
| public abstract Set Returns IDs for those commits which should be considered as shallow.
| |
| getStreamFileThreshold | back to summary |
|---|---|
| public int getStreamFileThreshold() Returns the threshold at which a file will be streamed rather than loaded entirely into memory
| |
| has | back to summary |
|---|---|
| public boolean has(AnyObjectId objectId) throws IOException Does the requested object exist in this database?
| |
| has | back to summary |
|---|---|
| public boolean has(AnyObjectId objectId, int typeHint) throws IOException Does the requested object exist in this database?
| |
| isNotLargerThan | back to summary |
|---|---|
| public boolean isNotLargerThan(AnyObjectId objectId, int typeHint, long size) throws MissingObjectException, IncorrectObjectTypeException, IOException Check if the object size is less or equal than certain value By default, it reads the object from storage to get the size. Subclasses can implement more efficient lookups.
| |
| newReader | back to summary |
|---|---|
| public abstract ObjectReader newReader() 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) throws MissingObjectException, IOException Open an object from this database.
| |
| open | back to summary |
|---|---|
| public abstract ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException Open an object from this database.
| |
| open | back to summary |
|---|---|
| public <T extends ObjectId> AsyncObjectLoaderQueue Asynchronous object opening.
| |
| resolve | back to summary |
|---|---|
| public abstract Collection 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.
| |
| setAvoidUnreachableObjects | back to summary |
|---|---|
| public void setAvoidUnreachableObjects(boolean avoid) Advise the reader to avoid unreachable objects. While enabled the reader will skip over anything previously proven to be unreachable. This may be dangerous in the face of concurrent writes.
| |
| setStreamFileThreshold | back to summary |
|---|---|
| public void setStreamFileThreshold(int threshold) Sets the threshold at which a file will be streamed rather than loaded entirely into memory
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AbbreviatedObjectId | abbreviate(AnyObjectId
object identity that needs to be abbreviated. objectId)Overrides org. Obtain a unique abbreviation (prefix) of an object SHA-1. |
| public AbbreviatedObjectId | abbreviate(AnyObjectId
object identity that needs to be abbreviated. objectId, int minimum length of the abbreviated string. Must be in the range
[2, 40]. len)Overrides org. Obtain a unique abbreviation (prefix) of an object SHA-1. |
| public void | close()
Implements abstract org. Implements java. Closes this resource, relinquishing any underlying resources. |
| protected abstract ObjectReader | Returns: delegate ObjectReader to handle all processing.Get delegate ObjectReader to handle all processing |
| public BitmapIndex | getBitmapIndex()
Overrides org. An index that can be used to speed up ObjectWalks. |
| public Optional | getCommitGraph()
Overrides org. Get the commit-graph for this repository if available. |
| public ObjectInserter | getCreatedFromInserter()
Overrides org. Get the |
| 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 <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, 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 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? |
| public boolean | has(AnyObjectId
identity of the object to test for existence of. 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. Does the requested object exist in this database? |
| 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)Overrides org. Open an object from this database. |
| 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, 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. |
| 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 | setAvoidUnreachableObjects(boolean
true to avoid unreachable objects. avoid)Overrides org. Advise the reader to avoid unreachable objects. |
| Filter | back to summary |
|---|---|
| public Filter() | |
| abbreviate | back to summary |
|---|---|
| public AbbreviatedObjectId abbreviate(AnyObjectId objectId) throws IOException Overrides org. Doc from org. Obtain a unique abbreviation (prefix) of an object SHA-1.
This method uses a reasonable default for the minimum length. Callers who
don't care about the minimum length should prefer this method.
The returned abbreviation would expand back to the argument ObjectId when
passed to
| |
| abbreviate | back to summary |
|---|---|
| public AbbreviatedObjectId abbreviate(AnyObjectId objectId, int len) throws IOException Overrides org. Doc from org. Obtain a unique abbreviation (prefix) of an object SHA-1.
The returned abbreviation would expand back to the argument ObjectId when
passed to
| |
| 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.
| |
| delegate | back to summary |
|---|---|
| protected abstract ObjectReader delegate() Get delegate ObjectReader to handle all processing
| |
| getBitmapIndex | back to summary |
|---|---|
| public BitmapIndex getBitmapIndex() throws IOException Overrides org. Doc from org. An index that can be used to speed up ObjectWalks.
| |
| 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
| |
| 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.
| |
| getObjectSize | back to summary |
|---|---|
| public <T extends ObjectId> AsyncObjectSizeQueue Overrides org. Doc from org. Asynchronous object size lookup.
| |
| 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?
| |
| has | back to summary |
|---|---|
| public boolean has(AnyObjectId objectId, int typeHint) throws IOException Overrides org. Doc from org. Does the requested object exist in this database?
| |
| 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) throws MissingObjectException, IOException Overrides org. Doc from org. Open an object from this database.
| |
| 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.
| |
| open | back to summary |
|---|---|
| public <T extends ObjectId> AsyncObjectLoaderQueue Overrides org. Doc from org. Asynchronous object opening.
| |
| 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.
| |
| setAvoidUnreachableObjects | back to summary |
|---|---|
| public void setAvoidUnreachableObjects(boolean avoid) Overrides org. Doc from org. Advise the reader to avoid unreachable objects. While enabled the reader will skip over anything previously proven to be unreachable. This may be dangerous in the face of concurrent writes.
| |