Package org.eclipse.jgit.lib
Interface AsyncObjectLoaderQueue<T extends ObjectId>
-
- Type Parameters:
T
- type of identifier supplied to the call that made the queue.
- All Superinterfaces:
AsyncOperation
public interface AsyncObjectLoaderQueue<T extends ObjectId> extends AsyncOperation
Queue to open objects asynchronously. A queue may perform background decompression of objects and supply them (possibly out-of-order) to the application.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
getCurrent()
Get the current object, null if the implementation lost track.ObjectId
getObjectId()
Get the ObjectId of the current object.boolean
next()
Position this queue onto the next available result.ObjectLoader
open()
Obtain a loader to read the object.-
Methods inherited from interface org.eclipse.jgit.lib.AsyncOperation
cancel, release
-
-
-
-
Method Detail
-
next
boolean next() throws MissingObjectException, IOException
Position this queue onto the next available result. Even if this method returns true,open()
may still throwMissingObjectException
if the underlying object database was concurrently modified and the current object is no longer available.- Returns:
- true if there is a result available; false if the queue has finished its input iteration.
- Throws:
MissingObjectException
- the object does not exist. If the implementation is retaining the application's objectsgetCurrent()
will be the current object that is missing. There may be more results still available, so the caller should continue invoking next to examine another result.IOException
- the object store cannot be accessed.
-
getCurrent
T getCurrent()
Get the current object, null if the implementation lost track.- Returns:
- the current object, null if the implementation lost track.
Implementations may for performance reasons discard the caller's
ObjectId and provider their own through
getObjectId()
.
-
getObjectId
ObjectId getObjectId()
Get the ObjectId of the current object. Never null.- Returns:
- the ObjectId of the current object. Never null.
-
open
ObjectLoader open() throws IOException
Obtain a loader to read the object. This method can only be invoked once per result Due to race conditions with a concurrent modification of the underlying object database, an object may be unavailable when this method is invoked, even though next returned successfully.- Returns:
- the ObjectLoader to read this object. Never null.
- Throws:
MissingObjectException
- the object does not exist. If the implementation is retaining the application's objectsgetCurrent()
will be the current object that is missing. There may be more results still available, so the caller should continue invoking next to examine another result.IOException
- the object store cannot be accessed.
-
-