org.eclipse.jgit.storage.dht.spi
Interface RepositoryTable

All Known Implementing Classes:
CacheRepositoryTable

public interface RepositoryTable

Tracks high-level information about all known repositories.


Method Summary
 java.util.Collection<GitStore.CachedPackInfo> getCachedPacks(RepositoryKey repo)
          Get the cached packs, if any.
 RepositoryKey nextKey()
          Generate a new unique RepositoryKey.
 void put(RepositoryKey repo, ChunkInfo info, WriteBuffer buffer)
          Record the existence of a chunk.
 void put(RepositoryKey repo, GitStore.CachedPackInfo info, WriteBuffer buffer)
          Record the existence of a cached pack.
 void remove(RepositoryKey repo, CachedPackKey key, WriteBuffer buffer)
          Remove the existence of a cached pack.
 void remove(RepositoryKey repo, ChunkKey chunk, WriteBuffer buffer)
          Remove the information about a chunk.
 

Method Detail

nextKey

RepositoryKey nextKey()
                      throws DhtException
Generate a new unique RepositoryKey.

Returns:
a new unique key.
Throws:
DhtException - keys cannot be generated at this time.

put

void put(RepositoryKey repo,
         ChunkInfo info,
         WriteBuffer buffer)
         throws DhtException
Record the existence of a chunk.

Parameters:
repo - repository owning the chunk.
info - information about the chunk.
buffer - buffer to enqueue the put onto.
Throws:
DhtException - if the buffer flushed and an enqueued operation failed.

remove

void remove(RepositoryKey repo,
            ChunkKey chunk,
            WriteBuffer buffer)
            throws DhtException
Remove the information about a chunk.

Parameters:
repo - repository owning the chunk.
chunk - the chunk that needs to be deleted.
buffer - buffer to enqueue the remove onto.
Throws:
DhtException - if the buffer flushed and an enqueued operation failed.

getCachedPacks

java.util.Collection<GitStore.CachedPackInfo> getCachedPacks(RepositoryKey repo)
                                                             throws DhtException,
                                                                    java.util.concurrent.TimeoutException
Get the cached packs, if any.

Parameters:
repo - repository owning the packs.
Returns:
cached pack descriptions.
Throws:
DhtException
java.util.concurrent.TimeoutException

put

void put(RepositoryKey repo,
         GitStore.CachedPackInfo info,
         WriteBuffer buffer)
         throws DhtException
Record the existence of a cached pack.

Parameters:
repo - repository owning the pack.
info - information about the pack.
buffer - buffer to enqueue the put onto.
Throws:
DhtException - if the buffer flushed and an enqueued operation failed.

remove

void remove(RepositoryKey repo,
            CachedPackKey key,
            WriteBuffer buffer)
            throws DhtException
Remove the existence of a cached pack.

Parameters:
repo - repository owning the pack.
key - information about the pack.
buffer - buffer to enqueue the put onto.
Throws:
DhtException - if the buffer flushed and an enqueued operation failed.


Copyright © 2011. All Rights Reserved.