|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ObjectIndexTable
Associates an ObjectId
to the ChunkKey
its stored in.
This table provides a global index listing every single object within the repository, and which chunks the object can be found it. Readers use this table to find an object when they are forced to start from a bare SHA-1 that was input by a user, or supplied over the network from a client.
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. |
Method Detail |
---|
void get(Context options, java.util.Set<ObjectIndexKey> objects, AsyncCallback<java.util.Map<ObjectIndexKey,java.util.Collection<ObjectInfo>>> callback)
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.
options
- options to control reading.objects
- set of object names to locate the chunks of.callback
- receives the results when ready.void add(ObjectIndexKey objId, ObjectInfo info, WriteBuffer buffer) throws DhtException
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.
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.void remove(ObjectIndexKey objId, ChunkKey chunk, WriteBuffer buffer) throws DhtException
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.
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 |