public abstract static class ObjectReader.Filter extends ObjectReader
ObjectReader.FilterOBJ_ANY, streamFileThreshold| Constructor and Description | 
|---|
Filter()  | 
| Modifier and Type | Method and Description | 
|---|---|
AbbreviatedObjectId | 
abbreviate(AnyObjectId objectId)
Obtain a unique abbreviation (prefix) of an object SHA-1. 
 | 
AbbreviatedObjectId | 
abbreviate(AnyObjectId objectId,
          int len)
Obtain a unique abbreviation (prefix) of an object SHA-1. 
 | 
void | 
close() | 
protected abstract ObjectReader | 
delegate()  | 
BitmapIndex | 
getBitmapIndex()
An index that can be used to speed up ObjectWalks. 
 | 
ObjectInserter | 
getCreatedFromInserter()
Get the  
ObjectInserter from which this
 reader was created using inserter.newReader() | 
long | 
getObjectSize(AnyObjectId objectId,
             int typeHint)
Get only the size of an object. 
 | 
<T extends ObjectId> | 
getObjectSize(Iterable<T> objectIds,
             boolean reportMissing)
Asynchronous object size lookup. 
 | 
Set<ObjectId> | 
getShallowCommits()
Returns IDs for those commits which should be considered as shallow. 
 | 
boolean | 
has(AnyObjectId objectId)
Does the requested object exist in this database? 
 | 
boolean | 
has(AnyObjectId objectId,
   int typeHint)
Does the requested object exist in this database? 
 | 
ObjectReader | 
newReader()
Construct a new reader from the same data. 
 | 
ObjectLoader | 
open(AnyObjectId objectId)
Open an object from this database. 
 | 
ObjectLoader | 
open(AnyObjectId objectId,
    int typeHint)
Open an object from this database. 
 | 
<T extends ObjectId> | 
open(Iterable<T> objectIds,
    boolean reportMissing)
Asynchronous object opening. 
 | 
Collection<ObjectId> | 
resolve(AbbreviatedObjectId id)
Resolve an abbreviated ObjectId to its full form. 
 | 
void | 
setAvoidUnreachableObjects(boolean avoid)
Advise the reader to avoid unreachable objects. 
 | 
getStreamFileThreshold, setStreamFileThresholdprotected abstract ObjectReader delegate()
public ObjectReader newReader()
ObjectReaderApplications can use this method to build a new reader from the same data source, but for an different thread.
newReader in class ObjectReaderpublic AbbreviatedObjectId abbreviate(AnyObjectId objectId) throws IOException
ObjectReaderObjectReader.resolve(AbbreviatedObjectId), assuming no new objects
 are added to this repository between calls.abbreviate in class ObjectReaderobjectId - object identity that needs to be abbreviated.IOException - the object store cannot be read.public AbbreviatedObjectId abbreviate(AnyObjectId objectId, int len) throws IOException
ObjectReaderObjectReader.resolve(AbbreviatedObjectId), assuming no new objects
 are added to this repository between calls.
 The default implementation of this method abbreviates the id to the
 minimum length, then resolves it to see if there are multiple results.
 When multiple results are found, the length is extended by 1 and resolve
 is tried again.abbreviate in class ObjectReaderobjectId - object identity that needs to be abbreviated.len - minimum length of the abbreviated string. Must be in the range
            [2, ].IOException - the object store cannot be read.public Collection<ObjectId> resolve(AbbreviatedObjectId id) throws IOException
ObjectReaderresolve in class ObjectReaderid - abbreviated id to resolve to a complete identity. The
            abbreviation must have a length of at least 2.IOException - the object store cannot be read.public boolean has(AnyObjectId objectId) throws IOException
ObjectReaderhas in class ObjectReaderobjectId - identity of the object to test for existence of.IOException - the object store cannot be accessed.public boolean has(AnyObjectId objectId, int typeHint) throws IOException
ObjectReaderhas in class ObjectReaderobjectId - identity of the object to test for existence of.typeHint - hint about the type of object being requested, e.g.
            Constants.OBJ_BLOB;
            ObjectReader.OBJ_ANY if the object type is not known, or does not
            matter to the caller.IncorrectObjectTypeException - typeHint was not OBJ_ANY, and the object's actual type does
             not match typeHint.IOException - the object store cannot be accessed.public ObjectLoader open(AnyObjectId objectId) throws MissingObjectException, IOException
ObjectReaderopen in class ObjectReaderobjectId - identity of the object to open.ObjectLoader for accessing the
         object.MissingObjectException - the object does not exist.IOException - the object store cannot be accessed.public ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException
ObjectReaderopen in class ObjectReaderobjectId - identity of the object to open.typeHint - hint about the type of object being requested, e.g.
            Constants.OBJ_BLOB;
            ObjectReader.OBJ_ANY if the object type is not known, or does not
            matter to the caller.ObjectLoader for accessing the
         object.MissingObjectException - the object does not exist.IncorrectObjectTypeException - typeHint was not OBJ_ANY, and the object's actual type does
             not match typeHint.IOException - the object store cannot be accessed.public Set<ObjectId> getShallowCommits() throws IOException
ObjectReadergetShallowCommits in class ObjectReaderIOExceptionpublic <T extends ObjectId> AsyncObjectLoaderQueue<T> open(Iterable<T> objectIds, boolean reportMissing)
ObjectReaderopen in class ObjectReaderobjectIds - objects to open from the object store. The supplied collection
            must not be modified until the queue has finished.reportMissing - 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.public long getObjectSize(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException
ObjectReaderThe default implementation of this method opens an ObjectLoader. Databases are encouraged to override this if a faster access method is available to them.
getObjectSize in class ObjectReaderobjectId - identity of the object to open.typeHint - hint about the type of object being requested, e.g.
            Constants.OBJ_BLOB;
            ObjectReader.OBJ_ANY if the object type is not known, or does not
            matter to the caller.MissingObjectException - the object does not exist.IncorrectObjectTypeException - typeHint was not OBJ_ANY, and the object's actual type does
             not match typeHint.IOException - the object store cannot be accessed.public <T extends ObjectId> AsyncObjectSizeQueue<T> getObjectSize(Iterable<T> objectIds, boolean reportMissing)
ObjectReadergetObjectSize in class ObjectReaderobjectIds - objects to get the size of from the object store. The supplied
            collection must not be modified until the queue has finished.reportMissing - 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.public void setAvoidUnreachableObjects(boolean avoid)
ObjectReaderWhile enabled the reader will skip over anything previously proven to be unreachable. This may be dangerous in the face of concurrent writes.
setAvoidUnreachableObjects in class ObjectReaderavoid - true to avoid unreachable objects.public BitmapIndex getBitmapIndex() throws IOException
ObjectReadergetBitmapIndex in class ObjectReaderIOException - when the index fails to load@Nullable public ObjectInserter getCreatedFromInserter()
ObjectReaderObjectInserter from which this
 reader was created using inserter.newReader()getCreatedFromInserter in class ObjectReaderObjectInserter from which this
         reader was created using inserter.newReader(), or null if
         this reader was not created from an inserter.public void close()
ObjectReaderRelease 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.
close in interface AutoCloseableclose in class ObjectReaderCopyright © 2020 Eclipse JGit Project. All rights reserved.