public class RepoSequence extends Object
The current sequence number is stored as UTF-8 text in a blob pointed to
by a ref in the refs/sequences/*
namespace. Multiple processes can
share the same sequence by incrementing the counter using normal git ref
updates. To amortize the cost of these ref updates, processes can increment
the counter by a larger number and hand out numbers from that range in memory
until they run out. This means concurrent processes will hand out somewhat
non-monotonic numbers.
Modifier and Type | Class and Description |
---|---|
static interface |
RepoSequence.Seed |
Constructor and Description |
---|
RepoSequence(GitRepositoryManager repoManager,
com.google.gerrit.reviewdb.client.Project.NameKey projectName,
String name,
RepoSequence.Seed seed,
int batchSize) |
public RepoSequence(GitRepositoryManager repoManager, com.google.gerrit.reviewdb.client.Project.NameKey projectName, String name, RepoSequence.Seed seed, int batchSize)
public int next() throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public com.google.common.collect.ImmutableList<Integer> next(int count) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
public void set(int val) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException