Class RepoSequence


  • public class RepoSequence
    extends Object
    Class for managing an incrementing sequence backed by a git repository.

    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.