summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-07-30 18:12:23 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-08-20 17:41:27 -0700
commitb85af06324644e699bd2cc7e2047ae1f65f35db5 (patch)
treefc0633c6d46963dd73afed90bb4d4e97148cb1ac /org.eclipse.jgit.pgm
parentcc6210619b82dc0c7bdb014b5ccf29d6f93e5ef3 (diff)
downloadjgit-b85af06324644e699bd2cc7e2047ae1f65f35db5.tar.gz
jgit-b85af06324644e699bd2cc7e2047ae1f65f35db5.zip
Allow object reuse selection to occur in parallel
ObjectReader implementations may wish to use multiple threads in order to evaluate object reuse faster. Let the reader make that decision by passing the iteration down into the reader. Because the work is pushed into the reader, it may need to locate a given ObjectToPack given its ObjectId. This can easily occur if the reader has sent a list of ObjectIds to the object database and gets back information keyed only by ObjectId, without the ObjectToPack handle. Expose lookup using the PackWriter's own internal map, so the reader doesn't need to build a redundant copy to track the assocation of ObjectId back to ObjectToPack. Change-Id: I0c536405a55034881fb5db92a2d2a99534faed34 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
index 1718ef30f2..0e0c73831a 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
@@ -46,6 +46,7 @@ package org.eclipse.jgit.pgm.debug;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.Collections;
import java.util.zip.InflaterInputStream;
import org.eclipse.jgit.errors.MissingObjectException;
@@ -103,7 +104,8 @@ class ShowPackDelta extends TextBuiltin {
};
ByteArrayOutputStream buf = new ByteArrayOutputStream();
- asis.selectObjectRepresentation(pw, target);
+ asis.selectObjectRepresentation(pw, NullProgressMonitor.INSTANCE,
+ Collections.singleton(target));
asis.copyObjectAsIs(new PackOutputStream(NullProgressMonitor.INSTANCE,
buf, pw), target);