Class InMemoryRepository.MemObjDatabase

    • Method Detail

      • setReadableChannelBlockSizeForTest

        public void setReadableChannelBlockSizeForTest​(int blockSize)
        Parameters:
        blockSize - force a different block size for testing.
      • listPacks

        protected List<DfsPackDescription> listPacks()
        Description copied from class: DfsObjDatabase
        List the available pack files.

        The returned list must support random access and must be mutable by the caller. It is sorted in place using the natural sorting of the returned DfsPackDescription objects.

        Specified by:
        listPacks in class DfsObjDatabase
        Returns:
        available packs. May be empty if there are no packs.
      • rollbackPack

        protected void rollbackPack​(Collection<DfsPackDescription> desc)
        Description copied from class: DfsObjDatabase
        Try to rollback a pack creation.

        JGit DFS always writes the pack first, then the index. If the pack does not yet exist, then neither does the index. A safe DFS implementation would try to remove both files to ensure they are really gone.

        A rollback does not support failures, as it only occurs when there is already a failure in progress. A DFS implementor may wish to log warnings/error messages when a rollback fails, but should not send new exceptions up the Java callstack.

        Specified by:
        rollbackPack in class DfsObjDatabase
        Parameters:
        desc - pack to delete.
      • setShallowCommits

        public void setShallowCommits​(Set<ObjectId> shallowCommits)
        Description copied from class: ObjectDatabase
        Update the shallow commits of the current repository
        Overrides:
        setShallowCommits in class ObjectDatabase
        Parameters:
        shallowCommits - the new shallow commits
      • getApproximateObjectCount

        public long getApproximateObjectCount()
        Description copied from class: ObjectDatabase
        Get a quick, rough count of objects in this repository. Ignores loose objects. Returns -1 if an exception occurs.
        Specified by:
        getApproximateObjectCount in class ObjectDatabase
        Returns:
        quick, rough count of objects in this repository, -1 if an exception occurs