diff options
author | jackdt@google.com <jackdt@google.com> | 2024-04-01 10:46:15 -0700 |
---|---|---|
committer | jackdt@google.com <jackdt@google.com> | 2024-04-02 12:00:33 -0700 |
commit | c111261158c6adabe3be9d7b4d9c54340f700bdb (patch) | |
tree | 54b71ccb8492742f5c993158efa1d73937a7eb78 /org.eclipse.jgit | |
parent | 33cacadbcef111c34a6f6927fcb8212fb07d6522 (diff) | |
download | jgit-c111261158c6adabe3be9d7b4d9c54340f700bdb.tar.gz jgit-c111261158c6adabe3be9d7b4d9c54340f700bdb.zip |
DfsPackFile: Make the loader classes used to construct bitmaps public.
This is necessary to swap out implementations of the PackBitmapIndex
with custom implementations.
Change-Id: Ia6f951bbc901446c255fa2902fab05d7ed974111
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java index 9095ce2542..5cc2a57aba 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java @@ -70,7 +70,10 @@ public final class DfsPackFile extends BlockBasedFile { private static final long REF_POSITION = 0; - private static final PackBitmapIndexLoader DEFAULT_BITMAP_LOADER = new StreamPackBitmapIndexLoader(); + /** + * Loader for the default file-based {@link PackBitmapIndex} implementation. + */ + public static final PackBitmapIndexLoader DEFAULT_BITMAP_LOADER = new StreamPackBitmapIndexLoader(); /** Index mapping {@link ObjectId} to position within the pack stream. */ private volatile PackIndex index; @@ -1382,12 +1385,22 @@ public final class DfsPackFile extends BlockBasedFile { * The bytes can be 0, if the implementation doesn't do any initial * loading. */ - class LoadResult { - final PackBitmapIndex bitmapIndex; - - final long bytesRead; - - LoadResult(PackBitmapIndex packBitmapIndex, long bytesRead) { + public class LoadResult { + /** The loaded {@link PackBitmapIndex}. */ + public final PackBitmapIndex bitmapIndex; + + /** The bytes read upon initial load (may be 0). */ + public final long bytesRead; + + /** + * Constructs the LoadResult. + * + * @param packBitmapIndex + * the loaded index. + * @param bytesRead + * the bytes read upon loading. + */ + public LoadResult(PackBitmapIndex packBitmapIndex, long bytesRead) { this.bitmapIndex = packBitmapIndex; this.bytesRead = bytesRead; } |