|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.storage.dht.spi.cache.CacheObjectIndexTable
public class CacheObjectIndexTable
Cache wrapper around ObjectIndexTable.
Constructor Summary | |
---|---|
CacheObjectIndexTable(ObjectIndexTable dbTable,
CacheDatabase cacheDatabase)
Initialize a new wrapper. |
Method Summary | |
---|---|
void |
add(ObjectIndexKey objId,
ObjectInfo info,
WriteBuffer buffer)
Record the fact that objId can be found by info . |
void |
get(Context options,
java.util.Set<ObjectIndexKey> objects,
AsyncCallback<java.util.Map<ObjectIndexKey,java.util.Collection<ObjectInfo>>> callback)
Asynchronously locate one or more objects in the repository. |
void |
remove(ObjectIndexKey objId,
ChunkKey chunk,
WriteBuffer buffer)
Remove a single chunk from an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheObjectIndexTable(ObjectIndexTable dbTable, CacheDatabase cacheDatabase)
dbTable
- the underlying database's corresponding table.cacheDatabase
- the cache database.Method Detail |
---|
public void get(Context options, java.util.Set<ObjectIndexKey> objects, AsyncCallback<java.util.Map<ObjectIndexKey,java.util.Collection<ObjectInfo>>> callback)
ObjectIndexTable
Callers are responsible for breaking up very large collections of objects into smaller units, based on the reader's batch size option. 1,000 to 10,000 is a reasonable range for the reader to batch on.
get
in interface ObjectIndexTable
options
- options to control reading.objects
- set of object names to locate the chunks of.callback
- receives the results when ready.public void add(ObjectIndexKey objId, ObjectInfo info, WriteBuffer buffer) throws DhtException
ObjectIndexTable
objId
can be found by info
.
If there is already data for objId
in the table, this method
should add the new chunk onto the existing data list.
This method should use batched asynchronous puts as much as possible. Initial imports of an existing repository may require millions of add operations to this table, one for each object being imported.
add
in interface ObjectIndexTable
objId
- the unique ObjectId.info
- a chunk that is known to store objId
.buffer
- buffer to enqueue the put onto.
DhtException
- if the buffer flushed and an enqueued operation failed.public void remove(ObjectIndexKey objId, ChunkKey chunk, WriteBuffer buffer) throws DhtException
ObjectIndexTable
If this is the last remaining chunk for the object, the object should
also be removed from the table. Removal can be deferred, or can occur
immediately. That is, get()
may return the object with an empty
collection, but to prevent unlimited disk usage the database should
eventually remove the object.
remove
in interface ObjectIndexTable
objId
- the unique ObjectId.chunk
- the chunk that needs to be removed from this object.buffer
- buffer to enqueue the remove onto.
DhtException
- if the buffer flushed and an enqueued operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |