public class RepoSequence
extends java.lang.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,
Project.NameKey projectName,
java.lang.String name,
RepoSequence.Seed seed,
int batchSize) |
Modifier and Type | Method and Description |
---|---|
int |
next() |
com.google.common.collect.ImmutableList<java.lang.Integer> |
next(int count) |
void |
set(int val) |
static org.eclipse.jgit.transport.ReceiveCommand |
storeNew(org.eclipse.jgit.lib.ObjectInserter ins,
java.lang.String name,
int val) |
public RepoSequence(GitRepositoryManager repoManager, Project.NameKey projectName, java.lang.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<java.lang.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
public static org.eclipse.jgit.transport.ReceiveCommand storeNew(org.eclipse.jgit.lib.ObjectInserter ins, java.lang.String name, int val) throws java.io.IOException
java.io.IOException