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

All Known Implementing Classes:
CacheRepositoryIndexTable

public interface RepositoryIndexTable

Maps a repository name from a URL, to the internal RepositoryKey.

The internal identifier is used for all data storage, as its part of the row keys for each data row that makes up the repository. By using an internal key, repositories can be efficiently renamed in O(1) time, without changing existing data rows.


Method Summary
 RepositoryKey get(RepositoryName name)
          Find a repository by name.
 void putUnique(RepositoryName name, RepositoryKey key)
          Atomically record the association of name to identifier.
 void remove(RepositoryName name, RepositoryKey key)
          Remove the association of a name to an identifier.
 

Method Detail

get

RepositoryKey get(RepositoryName name)
                  throws DhtException,
                         java.util.concurrent.TimeoutException
Find a repository by name.

Parameters:
name - name of the repository, from the URL.
Returns:
the internal key; null if not found.
Throws:
DhtException
java.util.concurrent.TimeoutException

putUnique

void putUnique(RepositoryName name,
               RepositoryKey key)
               throws DhtException,
                      java.util.concurrent.TimeoutException
Atomically record the association of name to identifier.

This method must use some sort of transaction system to ensure the name either points at key when complete, or fails fast with an exception if the name is used by a different key. This may require running some sort of lock management service in parallel to the database.

Parameters:
name - name of the repository.
key - internal key used to find the repository's data.
Throws:
DhtException
java.util.concurrent.TimeoutException

remove

void remove(RepositoryName name,
            RepositoryKey key)
            throws DhtException,
                   java.util.concurrent.TimeoutException
Remove the association of a name to an identifier.

This method must use some sort of transaction system to ensure the name is removed only if it currently references key. This may require running some sort of lock management service in parallel to the database.

Parameters:
name - name of the repository.
key - internal key defining the repository.
Throws:
DhtException
java.util.concurrent.TimeoutException


Copyright © 2011. All Rights Reserved.