Browse Source

Fix javadoc in org.eclipse.jgit storage/pack package

Change-Id: Id1b7d392e1bb36079edaf16450e73a044a318e7e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
783dbf1b03
  1. 17
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/CachedPack.java
  2. 23
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaEncoder.java
  3. 16
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java
  4. 1
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
  5. 56
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectReuseAsIs.java
  6. 43
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
  7. 29
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackExt.java
  8. 27
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java
  9. 157
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java
  10. 14
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/StoredObjectRepresentation.java

17
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/CachedPack.java

@ -45,13 +45,17 @@ package org.eclipse.jgit.internal.storage.pack;
import java.io.IOException; import java.io.IOException;
/** Describes a pack file {@link ObjectReuseAsIs} can append onto a stream. */ /**
* Describes a pack file
* {@link org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs} can append
* onto a stream.
*/
public abstract class CachedPack { public abstract class CachedPack {
/** /**
* Get the number of objects in this pack. * Get the number of objects in this pack.
* *
* @return the total object count for the pack. * @return the total object count for the pack.
* @throws IOException * @throws java.io.IOException
* if the object count cannot be read. * if the object count cannot be read.
*/ */
public abstract long getObjectCount() throws IOException; public abstract long getObjectCount() throws IOException;
@ -70,7 +74,7 @@ public abstract class CachedPack {
* *
* @return the number of deltas; 0 if the number is not known or there are * @return the number of deltas; 0 if the number is not known or there are
* no deltas. * no deltas.
* @throws IOException * @throws java.io.IOException
* if the delta count cannot be read. * if the delta count cannot be read.
*/ */
public long getDeltaCount() throws IOException { public long getDeltaCount() throws IOException {
@ -88,15 +92,16 @@ public abstract class CachedPack {
* only and using its internal state to decide if this object is within this * only and using its internal state to decide if this object is within this
* pack. Implementors should ensure a representation from this cached pack * pack. Implementors should ensure a representation from this cached pack
* is tested as part of * is tested as part of
* {@link ObjectReuseAsIs#selectObjectRepresentation(PackWriter, org.eclipse.jgit.lib.ProgressMonitor, Iterable)} * {@link org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs#selectObjectRepresentation(PackWriter, org.eclipse.jgit.lib.ProgressMonitor, Iterable)}
* , ensuring this method would eventually return true if the object would * , ensuring this method would eventually return true if the object would
* be included by this cached pack. * be included by this cached pack.
* *
* @param obj * @param obj
* the object being packed. Can be used as an ObjectId. * the object being packed. Can be used as an ObjectId.
* @param rep * @param rep
* representation from the {@link ObjectReuseAsIs} instance that * representation from the
* originally supplied this CachedPack. * {@link org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs}
* instance that originally supplied this CachedPack.
* @return true if this pack contains this object. * @return true if this pack contains this object.
*/ */
public abstract boolean hasObject(ObjectToPack obj, public abstract boolean hasObject(ObjectToPack obj,

23
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaEncoder.java

@ -48,7 +48,10 @@ import java.io.OutputStream;
import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Constants;
/** Encodes an instruction stream for {@link BinaryDelta}. */ /**
* Encodes an instruction stream for
* {@link org.eclipse.jgit.internal.storage.pack.BinaryDelta}.
*/
public class DeltaEncoder { public class DeltaEncoder {
/** /**
* Maximum number of bytes to be copied in pack v2 format. * Maximum number of bytes to be copied in pack v2 format.
@ -91,7 +94,7 @@ public class DeltaEncoder {
* @param resultSize * @param resultSize
* size of the resulting object, after applying this instruction * size of the resulting object, after applying this instruction
* stream to the base object, in bytes. * stream to the base object, in bytes.
* @throws IOException * @throws java.io.IOException
* the output buffer cannot store the instruction stream's * the output buffer cannot store the instruction stream's
* header with the size fields. * header with the size fields.
*/ */
@ -114,7 +117,7 @@ public class DeltaEncoder {
* maximum number of bytes to write to the out buffer declaring * maximum number of bytes to write to the out buffer declaring
* the stream is over limit and should be discarded. May be 0 to * the stream is over limit and should be discarded. May be 0 to
* specify an infinite limit. * specify an infinite limit.
* @throws IOException * @throws java.io.IOException
* the output buffer cannot store the instruction stream's * the output buffer cannot store the instruction stream's
* header with the size fields. * header with the size fields.
*/ */
@ -138,7 +141,11 @@ public class DeltaEncoder {
out.write(buf, 0, p); out.write(buf, 0, p);
} }
/** @return current size of the delta stream, in bytes. */ /**
* Get current size of the delta stream, in bytes.
*
* @return current size of the delta stream, in bytes.
*/
public int getSize() { public int getSize() {
return size; return size;
} }
@ -150,7 +157,7 @@ public class DeltaEncoder {
* the string to insert. * the string to insert.
* @return true if the insert fits within the limit; false if the insert * @return true if the insert fits within the limit; false if the insert
* would cause the instruction stream to exceed the limit. * would cause the instruction stream to exceed the limit.
* @throws IOException * @throws java.io.IOException
* the instruction buffer can't store the instructions. * the instruction buffer can't store the instructions.
*/ */
public boolean insert(String text) throws IOException { public boolean insert(String text) throws IOException {
@ -164,7 +171,7 @@ public class DeltaEncoder {
* the binary to insert. * the binary to insert.
* @return true if the insert fits within the limit; false if the insert * @return true if the insert fits within the limit; false if the insert
* would cause the instruction stream to exceed the limit. * would cause the instruction stream to exceed the limit.
* @throws IOException * @throws java.io.IOException
* the instruction buffer can't store the instructions. * the instruction buffer can't store the instructions.
*/ */
public boolean insert(byte[] text) throws IOException { public boolean insert(byte[] text) throws IOException {
@ -182,7 +189,7 @@ public class DeltaEncoder {
* number of bytes to insert. * number of bytes to insert.
* @return true if the insert fits within the limit; false if the insert * @return true if the insert fits within the limit; false if the insert
* would cause the instruction stream to exceed the limit. * would cause the instruction stream to exceed the limit.
* @throws IOException * @throws java.io.IOException
* the instruction buffer can't store the instructions. * the instruction buffer can't store the instructions.
*/ */
public boolean insert(byte[] text, int off, int cnt) public boolean insert(byte[] text, int off, int cnt)
@ -217,7 +224,7 @@ public class DeltaEncoder {
* number of bytes to copy. * number of bytes to copy.
* @return true if the copy fits within the limit; false if the copy * @return true if the copy fits within the limit; false if the copy
* would cause the instruction stream to exceed the limit. * would cause the instruction stream to exceed the limit.
* @throws IOException * @throws java.io.IOException
* the instruction buffer cannot store the instructions. * the instruction buffer cannot store the instructions.
*/ */
public boolean copy(long offset, int cnt) throws IOException { public boolean copy(long offset, int cnt) throws IOException {

16
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndex.java

@ -51,8 +51,9 @@ import java.io.OutputStream;
* <p> * <p>
* The index can be passed a result buffer, and output an instruction sequence * The index can be passed a result buffer, and output an instruction sequence
* that transforms the source buffer used by the index into the result buffer. * that transforms the source buffer used by the index into the result buffer.
* The instruction sequence can be executed by {@link BinaryDelta} to recreate * The instruction sequence can be executed by
* the result buffer. * {@link org.eclipse.jgit.internal.storage.pack.BinaryDelta} to recreate the
* result buffer.
* <p> * <p>
* An index stores the entire contents of the source buffer, but also a table of * An index stores the entire contents of the source buffer, but also a table of
* block identities mapped to locations where the block appears in the source * block identities mapped to locations where the block appears in the source
@ -191,7 +192,11 @@ public class DeltaIndex {
} }
} }
/** @return size of the source buffer this index has scanned. */ /**
* Get size of the source buffer this index has scanned.
*
* @return size of the source buffer this index has scanned.
*/
public long getSourceSize() { public long getSourceSize() {
return src.length; return src.length;
} }
@ -244,7 +249,7 @@ public class DeltaIndex {
* the desired result buffer. The generated instructions will * the desired result buffer. The generated instructions will
* recreate this buffer when applied to the source buffer stored * recreate this buffer when applied to the source buffer stored
* within this index. * within this index.
* @throws IOException * @throws java.io.IOException
* the output stream refused to write the instructions. * the output stream refused to write the instructions.
*/ */
public void encode(OutputStream out, byte[] res) throws IOException { public void encode(OutputStream out, byte[] res) throws IOException {
@ -274,7 +279,7 @@ public class DeltaIndex {
* @return true if the delta is smaller than deltaSizeLimit; false if the * @return true if the delta is smaller than deltaSizeLimit; false if the
* encoder aborted because the encoded delta instructions would be * encoder aborted because the encoded delta instructions would be
* longer than deltaSizeLimit bytes. * longer than deltaSizeLimit bytes.
* @throws IOException * @throws java.io.IOException
* the output stream refused to write the instructions. * the output stream refused to write the instructions.
*/ */
public boolean encode(OutputStream out, byte[] res, int deltaSizeLimit) public boolean encode(OutputStream out, byte[] res, int deltaSizeLimit)
@ -421,6 +426,7 @@ public class DeltaIndex {
return start - resPtr; return start - resPtr;
} }
/** {@inheritDoc} */
@Override @Override
@SuppressWarnings("nls") @SuppressWarnings("nls")
public String toString() { public String toString() {

1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java

@ -292,6 +292,7 @@ final class DeltaTask implements Callable<Object> {
slices.add(s); slices.add(s);
} }
/** {@inheritDoc} */
@Override @Override
public Object call() throws Exception { public Object call() throws Exception {
or = block.templateReader.newReader(); or = block.templateReader.newReader();

56
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectReuseAsIs.java

@ -51,26 +51,27 @@ import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException; import org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException;
import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.BitmapIndex.BitmapBuilder; import org.eclipse.jgit.lib.BitmapIndex.BitmapBuilder;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.ProgressMonitor; import org.eclipse.jgit.lib.ProgressMonitor;
/** /**
* Extension of {@link ObjectReader} that supports reusing objects in packs. * Extension of {@link org.eclipse.jgit.lib.ObjectReader} that supports reusing
* objects in packs.
* <p> * <p>
* {@code ObjectReader} implementations may also optionally implement this * {@code ObjectReader} implementations may also optionally implement this
* interface to support {@link PackWriter} with a means of copying an object * interface to support
* that is already in pack encoding format directly into the output stream, * {@link org.eclipse.jgit.internal.storage.pack.PackWriter} with a means of
* without incurring decompression and recompression overheads. * copying an object that is already in pack encoding format directly into the
* output stream, without incurring decompression and recompression overheads.
*/ */
public interface ObjectReuseAsIs { public interface ObjectReuseAsIs {
/** /**
* Allocate a new {@code PackWriter} state structure for an object. * Allocate a new {@code PackWriter} state structure for an object.
* <p> * <p>
* {@link PackWriter} allocates these objects to keep track of the * {@link org.eclipse.jgit.internal.storage.pack.PackWriter} allocates these
* per-object state, and how to load the objects efficiently into the * objects to keep track of the per-object state, and how to load the
* generated stream. Implementers may subclass this type with additional * objects efficiently into the generated stream. Implementers may subclass
* object state, such as to remember what file and offset contains the * this type with additional object state, such as to remember what file and
* object's pack encoded data. * offset contains the object's pack encoded data.
* *
* @param objectId * @param objectId
* the id of the object that will be packed. * the id of the object that will be packed.
@ -85,15 +86,16 @@ public interface ObjectReuseAsIs {
* <p> * <p>
* Implementations should iterate through all available representations of * Implementations should iterate through all available representations of
* an object, and pass them in turn to the PackWriter though * an object, and pass them in turn to the PackWriter though
* {@link PackWriter#select(ObjectToPack, StoredObjectRepresentation)} so * {@link org.eclipse.jgit.internal.storage.pack.PackWriter#select(ObjectToPack, StoredObjectRepresentation)}
* the writer can select the most suitable representation to reuse into the * so the writer can select the most suitable representation to reuse into
* output stream. * the output stream.
* <p> * <p>
* If the implementation returns CachedPack from {@link #getCachedPacksAndUpdate(BitmapBuilder)} * If the implementation returns CachedPack from
* it must consider the representation of any object that is stored in any * {@link #getCachedPacksAndUpdate(BitmapBuilder)} it must consider the
* of the offered CachedPacks. PackWriter relies on this behavior to prune * representation of any object that is stored in any of the offered
* duplicate objects out of the pack stream when it selects a CachedPack and * CachedPacks. PackWriter relies on this behavior to prune duplicate
* the object was also reached through the thin-pack enumeration. * objects out of the pack stream when it selects a CachedPack and the
* object was also reached through the thin-pack enumeration.
* <p> * <p>
* The implementation may choose to consider multiple objects at once on * The implementation may choose to consider multiple objects at once on
* concurrent threads, but must evaluate all representations of an object * concurrent threads, but must evaluate all representations of an object
@ -106,10 +108,10 @@ public interface ObjectReuseAsIs {
* once for each item in the iteration when selection is done. * once for each item in the iteration when selection is done.
* @param objects * @param objects
* the objects that are being packed. * the objects that are being packed.
* @throws MissingObjectException * @throws org.eclipse.jgit.errors.MissingObjectException
* there is no representation available for the object, as it is * there is no representation available for the object, as it is
* no longer in the repository. Packing will abort. * no longer in the repository. Packing will abort.
* @throws IOException * @throws java.io.IOException
* the repository cannot be accessed. Packing will abort. * the repository cannot be accessed. Packing will abort.
*/ */
public void selectObjectRepresentation(PackWriter packer, public void selectObjectRepresentation(PackWriter packer,
@ -136,7 +138,9 @@ public interface ObjectReuseAsIs {
* format to reach a delta base that is later in the stream. It may also * format to reach a delta base that is later in the stream. It may also
* reduce data locality for the reader, slowing down data access. * reduce data locality for the reader, slowing down data access.
* *
* Invoking {@link PackOutputStream#writeObject(ObjectToPack)} will cause * Invoking
* {@link org.eclipse.jgit.internal.storage.pack.PackOutputStream#writeObject(ObjectToPack)}
* will cause
* {@link #copyObjectAsIs(PackOutputStream, ObjectToPack, boolean)} to be * {@link #copyObjectAsIs(PackOutputStream, ObjectToPack, boolean)} to be
* invoked recursively on {@code this} if the current object is scheduled * invoked recursively on {@code this} if the current object is scheduled
* for reuse. * for reuse.
@ -147,7 +151,7 @@ public interface ObjectReuseAsIs {
* the list of objects to write. Objects should be written in * the list of objects to write. Objects should be written in
* approximately this order. Implementors may resort the list * approximately this order. Implementors may resort the list
* elements in-place during writing if desired. * elements in-place during writing if desired.
* @throws IOException * @throws java.io.IOException
* the stream cannot be written to, or one or more required * the stream cannot be written to, or one or more required
* objects cannot be accessed from the object database. * objects cannot be accessed from the object database.
*/ */
@ -186,13 +190,13 @@ public interface ObjectReuseAsIs {
* corrupt before being reused. If false, validation may be * corrupt before being reused. If false, validation may be
* skipped as it will be performed elsewhere in the processing * skipped as it will be performed elsewhere in the processing
* pipeline. * pipeline.
* @throws StoredObjectRepresentationNotAvailableException * @throws org.eclipse.jgit.errors.StoredObjectRepresentationNotAvailableException
* the previously selected representation is no longer * the previously selected representation is no longer
* available. If thrown before {@code out.writeHeader} the pack * available. If thrown before {@code out.writeHeader} the pack
* writer will try to find another representation, and write * writer will try to find another representation, and write
* that one instead. If throw after {@code out.writeHeader}, * that one instead. If throw after {@code out.writeHeader},
* packing will abort. * packing will abort.
* @throws IOException * @throws java.io.IOException
* the stream's write method threw an exception. Packing will * the stream's write method threw an exception. Packing will
* abort. * abort.
*/ */
@ -209,7 +213,7 @@ public interface ObjectReuseAsIs {
* stream to append the pack onto. * stream to append the pack onto.
* @param pack * @param pack
* the cached pack to send. * the cached pack to send.
* @throws IOException * @throws java.io.IOException
* the pack cannot be read, or stream did not accept a write. * the pack cannot be read, or stream did not accept a write.
*/ */
public abstract void copyPackAsIs(PackOutputStream out, CachedPack pack) public abstract void copyPackAsIs(PackOutputStream out, CachedPack pack)
@ -225,7 +229,7 @@ public interface ObjectReuseAsIs {
* @param needBitmap * @param needBitmap
* the bitmap that contains all of the objects the client wants. * the bitmap that contains all of the objects the client wants.
* @return the available cached packs. * @return the available cached packs.
* @throws IOException * @throws java.io.IOException
* the cached packs cannot be listed from the repository. * the cached packs cannot be listed from the repository.
* Callers may choose to ignore this and continue as-if there * Callers may choose to ignore this and continue as-if there
* were no cached packs. * were no cached packs.

43
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java

@ -50,7 +50,8 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.transport.PackedObjectInfo; import org.eclipse.jgit.transport.PackedObjectInfo;
/** /**
* Per-object state used by {@link PackWriter}. * Per-object state used by
* {@link org.eclipse.jgit.internal.storage.pack.PackWriter}.
* <p> * <p>
* {@code PackWriter} uses this class to track the things it needs to include in * {@code PackWriter} uses this class to track the things it needs to include in
* the newly generated pack file, and how to efficiently obtain the raw data for * the newly generated pack file, and how to efficiently obtain the raw data for
@ -108,19 +109,25 @@ public class ObjectToPack extends PackedObjectInfo {
} }
/** /**
* Get delta base object id if object is going to be packed in delta
* representation
*
* @return delta base object id if object is going to be packed in delta * @return delta base object id if object is going to be packed in delta
* representation; null otherwise - if going to be packed as a * representation; null otherwise - if going to be packed as a whole
* whole object. * object.
*/ */
public final ObjectId getDeltaBaseId() { public final ObjectId getDeltaBaseId() {
return deltaBase; return deltaBase;
} }
/** /**
* Get delta base object to pack if object is going to be packed in delta
* representation and delta is specified as object to pack
*
* @return delta base object to pack if object is going to be packed in * @return delta base object to pack if object is going to be packed in
* delta representation and delta is specified as object to * delta representation and delta is specified as object to pack;
* pack; null otherwise - if going to be packed as a whole * null otherwise - if going to be packed as a whole object or delta
* object or delta base is specified only as id. * base is specified only as id.
*/ */
public final ObjectToPack getDeltaBase() { public final ObjectToPack getDeltaBase() {
if (deltaBase instanceof ObjectToPack) if (deltaBase instanceof ObjectToPack)
@ -164,8 +171,9 @@ public class ObjectToPack extends PackedObjectInfo {
} }
/** /**
* @return true if object is going to be written as delta; false * Whether object is going to be written as delta
* otherwise. *
* @return true if object is going to be written as delta; false otherwise.
*/ */
public final boolean isDeltaRepresentation() { public final boolean isDeltaRepresentation() {
return deltaBase != null; return deltaBase != null;
@ -181,7 +189,7 @@ public class ObjectToPack extends PackedObjectInfo {
return 1 < getOffset(); // markWantWrite sets 1. return 1 < getOffset(); // markWantWrite sets 1.
} }
/** @return the type of this object. */ /** {@inheritDoc} */
@Override @Override
public final int getType() { public final int getType() {
return (flags >> TYPE_SHIFT) & 0x7; return (flags >> TYPE_SHIFT) & 0x7;
@ -216,6 +224,9 @@ public class ObjectToPack extends PackedObjectInfo {
} }
/** /**
* Whether an existing representation was selected to be reused as-is into
* the pack stream.
*
* @return true if an existing representation was selected to be reused * @return true if an existing representation was selected to be reused
* as-is into the pack stream. * as-is into the pack stream.
*/ */
@ -266,7 +277,11 @@ public class ObjectToPack extends PackedObjectInfo {
flags &= ~DELTA_ATTEMPTED; flags &= ~DELTA_ATTEMPTED;
} }
/** @return the extended flags on this object, in the range [0x0, 0xf]. */ /**
* Get the extended flags on this object, in the range [0x0, 0xf].
*
* @return the extended flags on this object, in the range [0x0, 0xf].
*/
protected final int getExtendedFlags() { protected final int getExtendedFlags() {
return (flags >>> EXT_SHIFT) & EXT_MASK; return (flags >>> EXT_SHIFT) & EXT_MASK;
} }
@ -363,9 +378,10 @@ public class ObjectToPack extends PackedObjectInfo {
* Remember a specific representation for reuse at a later time. * Remember a specific representation for reuse at a later time.
* <p> * <p>
* Implementers should remember the representation chosen, so it can be * Implementers should remember the representation chosen, so it can be
* reused at a later time. {@link PackWriter} may invoke this method * reused at a later time.
* multiple times for the same object, each time saving the current best * {@link org.eclipse.jgit.internal.storage.pack.PackWriter} may invoke this
* representation found. * method multiple times for the same object, each time saving the current
* best representation found.
* *
* @param ref * @param ref
* the object representation. * the object representation.
@ -374,6 +390,7 @@ public class ObjectToPack extends PackedObjectInfo {
// Empty by default. // Empty by default.
} }
/** {@inheritDoc} */
@SuppressWarnings("nls") @SuppressWarnings("nls")
@Override @Override
public String toString() { public String toString() {

29
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackExt.java

@ -43,7 +43,9 @@
package org.eclipse.jgit.internal.storage.pack; package org.eclipse.jgit.internal.storage.pack;
/** A pack file extension. */ /**
* A pack file extension.
*/
public class PackExt { public class PackExt {
private static volatile PackExt[] VALUES = new PackExt[] {}; private static volatile PackExt[] VALUES = new PackExt[] {};
@ -62,7 +64,11 @@ public class PackExt {
/** A reftable file. */ /** A reftable file. */
public static final PackExt REFTABLE = newPackExt("ref"); //$NON-NLS-1$ public static final PackExt REFTABLE = newPackExt("ref"); //$NON-NLS-1$
/** @return all of the PackExt values. */ /**
* Get all of the PackExt values.
*
* @return all of the PackExt values.
*/
public static PackExt[] values() { public static PackExt[] values() {
return VALUES; return VALUES;
} }
@ -102,21 +108,34 @@ public class PackExt {
this.pos = pos; this.pos = pos;
} }
/** @return the file extension. */ /**
* Get the file extension.
*
* @return the file extension.
*/
public String getExtension() { public String getExtension() {
return ext; return ext;
} }
/** @return the position of the extension in the values array. */ /**
* Get the position of the extension in the values array.
*
* @return the position of the extension in the values array.
*/
public int getPosition() { public int getPosition() {
return pos; return pos;
} }
/** @return the bit mask of the extension e.g {@code 1 << getPosition()}. */ /**
* Get the bit mask of the extension e.g {@code 1 << getPosition()}.
*
* @return the bit mask of the extension e.g {@code 1 << getPosition()}.
*/
public int getBit() { public int getBit() {
return 1 << getPosition(); return 1 << getPosition();
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return String.format("PackExt[%s, bit=0x%s]", getExtension(), //$NON-NLS-1$ return String.format("PackExt[%s, bit=0x%s]", getExtension(), //$NON-NLS-1$

27
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackOutputStream.java

@ -57,7 +57,10 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ProgressMonitor; import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.util.NB; import org.eclipse.jgit.util.NB;
/** Custom output stream to support {@link PackWriter}. */ /**
* Custom output stream to support
* {@link org.eclipse.jgit.internal.storage.pack.PackWriter}.
*/
public final class PackOutputStream extends OutputStream { public final class PackOutputStream extends OutputStream {
private static final int BYTES_TO_WRITE_BEFORE_CANCEL_CHECK = 128 * 1024; private static final int BYTES_TO_WRITE_BEFORE_CANCEL_CHECK = 128 * 1024;
@ -84,7 +87,8 @@ public final class PackOutputStream extends OutputStream {
* <p> * <p>
* This constructor is exposed to support debugging the JGit library only. * This constructor is exposed to support debugging the JGit library only.
* Application or storage level code should not create a PackOutputStream, * Application or storage level code should not create a PackOutputStream,
* instead use {@link PackWriter}, and let the writer create the stream. * instead use {@link org.eclipse.jgit.internal.storage.pack.PackWriter},
* and let the writer create the stream.
* *
* @param writeMonitor * @param writeMonitor
* monitor to update on object output progress. * monitor to update on object output progress.
@ -101,6 +105,7 @@ public final class PackOutputStream extends OutputStream {
this.checkCancelAt = BYTES_TO_WRITE_BEFORE_CANCEL_CHECK; this.checkCancelAt = BYTES_TO_WRITE_BEFORE_CANCEL_CHECK;
} }
/** {@inheritDoc} */
@Override @Override
public final void write(final int b) throws IOException { public final void write(final int b) throws IOException {
count++; count++;
@ -108,6 +113,7 @@ public final class PackOutputStream extends OutputStream {
md.update((byte) b); md.update((byte) b);
} }
/** {@inheritDoc} */
@Override @Override
public final void write(final byte[] b, int off, int len) public final void write(final byte[] b, int off, int len)
throws IOException { throws IOException {
@ -131,6 +137,7 @@ public final class PackOutputStream extends OutputStream {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void flush() throws IOException { public void flush() throws IOException {
out.flush(); out.flush();
@ -154,7 +161,7 @@ public final class PackOutputStream extends OutputStream {
* *
* @param otp * @param otp
* the object to write. * the object to write.
* @throws IOException * @throws java.io.IOException
* the object cannot be read from the object reader, or the * the object cannot be read from the object reader, or the
* output stream is no longer accepting output. Caller must * output stream is no longer accepting output. Caller must
* examine the type of exception and possibly its message to * examine the type of exception and possibly its message to
@ -177,7 +184,7 @@ public final class PackOutputStream extends OutputStream {
* in whole object format, this is the same as the object size. * in whole object format, this is the same as the object size.
* For an object that is in a delta format, this is the size of * For an object that is in a delta format, this is the size of
* the inflated delta instruction stream. * the inflated delta instruction stream.
* @throws IOException * @throws java.io.IOException
* the underlying stream refused to accept the header. * the underlying stream refused to accept the header.
*/ */
public final void writeHeader(ObjectToPack otp, long rawLength) public final void writeHeader(ObjectToPack otp, long rawLength)
@ -224,7 +231,11 @@ public final class PackOutputStream extends OutputStream {
return n; return n;
} }
/** @return a temporary buffer writers can use to copy data with. */ /**
* Get a temporary buffer writers can use to copy data with.
*
* @return a temporary buffer writers can use to copy data with.
*/
public final byte[] getCopyBuffer() { public final byte[] getCopyBuffer() {
return copyBuffer; return copyBuffer;
} }
@ -233,7 +244,11 @@ public final class PackOutputStream extends OutputStream {
writeMonitor.update(1); writeMonitor.update(1);
} }
/** @return total number of bytes written since stream start. */ /**
* Get total number of bytes written since stream start.
*
* @return total number of bytes written since stream start.
*/
public final long length() { public final long length() {
return count; return count;
} }

157
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java

@ -135,8 +135,8 @@ import org.eclipse.jgit.util.TemporaryBuffer;
* <li>(usually) by providing sets of interesting and uninteresting objects in * <li>(usually) by providing sets of interesting and uninteresting objects in
* repository - all interesting objects and their ancestors except uninteresting * repository - all interesting objects and their ancestors except uninteresting
* objects and their ancestors will be included in pack, or</li> * objects and their ancestors will be included in pack, or</li>
* <li>by providing iterator of {@link RevObject} specifying exact list and * <li>by providing iterator of {@link org.eclipse.jgit.revwalk.RevObject}
* order of objects in pack</li> * specifying exact list and order of objects in pack</li>
* </ul> * </ul>
* <p> * <p>
* Typical usage consists of creating an instance, configuring options, * Typical usage consists of creating an instance, configuring options,
@ -149,10 +149,11 @@ import org.eclipse.jgit.util.TemporaryBuffer;
* followed by {@link #writeBitmapIndex(OutputStream)}. * followed by {@link #writeBitmapIndex(OutputStream)}.
* </p> * </p>
* <p> * <p>
* Class provide set of configurable options and {@link ProgressMonitor} * Class provide set of configurable options and
* support, as operations may take a long time for big repositories. Deltas * {@link org.eclipse.jgit.lib.ProgressMonitor} support, as operations may take
* searching algorithm is <b>NOT IMPLEMENTED</b> yet - this implementation * a long time for big repositories. Deltas searching algorithm is <b>NOT
* relies only on deltas and objects reuse. * IMPLEMENTED</b> yet - this implementation relies only on deltas and objects
* reuse.
* </p> * </p>
* <p> * <p>
* This class is not thread safe. It is intended to be used in one thread as a * This class is not thread safe. It is intended to be used in one thread as a
@ -210,7 +211,11 @@ public class PackWriter implements AutoCloseable {
} }
}; };
/** @return all allocated, non-released PackWriters instances. */ /**
* Get all allocated, non-released PackWriters instances.
*
* @return all allocated, non-released PackWriters instances.
*/
public static Iterable<PackWriter> getInstances() { public static Iterable<PackWriter> getInstances() {
return instancesIterable; return instancesIterable;
} }
@ -374,7 +379,6 @@ public class PackWriter implements AutoCloseable {
* *
* @param callback * @param callback
* the callback to set * the callback to set
*
* @return this object for chaining. * @return this object for chaining.
*/ */
public PackWriter setObjectCountCallback(ObjectCountCallback callback) { public PackWriter setObjectCountCallback(ObjectCountCallback callback) {
@ -466,12 +470,19 @@ public class PackWriter implements AutoCloseable {
reuseValidate = validate; reuseValidate = validate;
} }
/** @return true if this writer is producing a thin pack. */ /**
* Whether this writer is producing a thin pack.
*
* @return true if this writer is producing a thin pack.
*/
public boolean isThin() { public boolean isThin() {
return thin; return thin;
} }
/** /**
* Whether writer may pack objects with delta base object not within set of
* objects to pack
*
* @param packthin * @param packthin
* a boolean indicating whether writer may pack objects with * a boolean indicating whether writer may pack objects with
* delta base object not within set of objects to pack, but * delta base object not within set of objects to pack, but
@ -483,16 +494,23 @@ public class PackWriter implements AutoCloseable {
thin = packthin; thin = packthin;
} }
/** @return true to reuse cached packs. If true index creation isn't available. */ /**
* Whether to reuse cached packs.
*
* @return {@code true} to reuse cached packs. If true index creation isn't
* available.
*/
public boolean isUseCachedPacks() { public boolean isUseCachedPacks() {
return useCachedPacks; return useCachedPacks;
} }
/** /**
* Whether to use cached packs
*
* @param useCached * @param useCached
* if set to true and a cached pack is present, it will be * if set to {@code true} and a cached pack is present, it will
* appended onto the end of a thin-pack, reducing the amount of * be appended onto the end of a thin-pack, reducing the amount
* working set space and CPU used by PackWriter. Enabling this * of working set space and CPU used by PackWriter. Enabling this
* feature prevents PackWriter from creating an index for the * feature prevents PackWriter from creating an index for the
* newly created pack, so its only suitable for writing to a * newly created pack, so its only suitable for writing to a
* network client, where the client will make the index. * network client, where the client will make the index.
@ -501,12 +519,18 @@ public class PackWriter implements AutoCloseable {
useCachedPacks = useCached; useCachedPacks = useCached;
} }
/** @return true to use bitmaps for ObjectWalks, if available. */ /**
* Whether to use bitmaps
*
* @return {@code true} to use bitmaps for ObjectWalks, if available.
*/
public boolean isUseBitmaps() { public boolean isUseBitmaps() {
return useBitmaps; return useBitmaps;
} }
/** /**
* Whether to use bitmaps
*
* @param useBitmaps * @param useBitmaps
* if set to true, bitmaps will be used when preparing a pack. * if set to true, bitmaps will be used when preparing a pack.
*/ */
@ -514,23 +538,33 @@ public class PackWriter implements AutoCloseable {
this.useBitmaps = useBitmaps; this.useBitmaps = useBitmaps;
} }
/** @return true if the index file cannot be created by this PackWriter. */ /**
* Whether the index file cannot be created by this PackWriter.
*
* @return {@code true} if the index file cannot be created by this
* PackWriter.
*/
public boolean isIndexDisabled() { public boolean isIndexDisabled() {
return indexDisabled || !cachedPacks.isEmpty(); return indexDisabled || !cachedPacks.isEmpty();
} }
/** /**
* Whether to disable creation of the index file.
*
* @param noIndex * @param noIndex
* true to disable creation of the index file. * {@code true} to disable creation of the index file.
*/ */
public void setIndexDisabled(boolean noIndex) { public void setIndexDisabled(boolean noIndex) {
this.indexDisabled = noIndex; this.indexDisabled = noIndex;
} }
/** /**
* @return true to ignore objects that are uninteresting and also not found * Whether to ignore missing uninteresting objects
* on local disk; false to throw a {@link MissingObjectException} *
* out of {@link #preparePack(ProgressMonitor, Set, Set)} if an * @return {@code true} to ignore objects that are uninteresting and also
* not found on local disk; false to throw a
* {@link org.eclipse.jgit.errors.MissingObjectException} out of
* {@link #preparePack(ProgressMonitor, Set, Set)} if an
* uninteresting object is not in the source repository. By default, * uninteresting object is not in the source repository. By default,
* true, permitting gracefully ignoring of uninteresting objects. * true, permitting gracefully ignoring of uninteresting objects.
*/ */
@ -539,11 +573,13 @@ public class PackWriter implements AutoCloseable {
} }
/** /**
* Whether writer should ignore non existing uninteresting objects
*
* @param ignore * @param ignore
* true if writer should ignore non existing uninteresting * {@code true} if writer should ignore non existing
* objects during construction set of objects to pack; false * uninteresting objects during construction set of objects to
* otherwise - non existing uninteresting objects may cause * pack; false otherwise - non existing uninteresting objects may
* {@link MissingObjectException} * cause {@link org.eclipse.jgit.errors.MissingObjectException}
*/ */
public void setIgnoreMissingUninteresting(final boolean ignore) { public void setIgnoreMissingUninteresting(final boolean ignore) {
ignoreMissingUninteresting = ignore; ignoreMissingUninteresting = ignore;
@ -586,7 +622,7 @@ public class PackWriter implements AutoCloseable {
* Returns objects number in a pack file that was created by this writer. * Returns objects number in a pack file that was created by this writer.
* *
* @return number of objects in pack. * @return number of objects in pack.
* @throws IOException * @throws java.io.IOException
* a cached pack cannot supply its object count. * a cached pack cannot supply its object count.
*/ */
public long getObjectCount() throws IOException { public long getObjectCount() throws IOException {
@ -613,7 +649,7 @@ public class PackWriter implements AutoCloseable {
* been invoked and completed successfully. * been invoked and completed successfully.
* *
* @return set of objects in pack. * @return set of objects in pack.
* @throws IOException * @throws java.io.IOException
* a cached pack cannot supply its object ids. * a cached pack cannot supply its object ids.
*/ */
public ObjectIdOwnerMap<ObjectIdOwnerMap.Entry> getObjectSet() public ObjectIdOwnerMap<ObjectIdOwnerMap.Entry> getObjectSet()
@ -672,12 +708,14 @@ public class PackWriter implements AutoCloseable {
* @param objectsSource * @param objectsSource
* iterator of object to store in a pack; order of objects within * iterator of object to store in a pack; order of objects within
* each type is important, ordering by type is not needed; * each type is important, ordering by type is not needed;
* allowed types for objects are {@link Constants#OBJ_COMMIT}, * allowed types for objects are
* {@link Constants#OBJ_TREE}, {@link Constants#OBJ_BLOB} and * {@link org.eclipse.jgit.lib.Constants#OBJ_COMMIT},
* {@link Constants#OBJ_TAG}; objects returned by iterator may be * {@link org.eclipse.jgit.lib.Constants#OBJ_TREE},
* later reused by caller as object id and type are internally * {@link org.eclipse.jgit.lib.Constants#OBJ_BLOB} and
* copied in each iteration. * {@link org.eclipse.jgit.lib.Constants#OBJ_TAG}; objects
* @throws IOException * returned by iterator may be later reused by caller as object
* id and type are internally copied in each iteration.
* @throws java.io.IOException
* when some I/O problem occur during reading objects. * when some I/O problem occur during reading objects.
*/ */
public void preparePack(@NonNull Iterator<RevObject> objectsSource) public void preparePack(@NonNull Iterator<RevObject> objectsSource)
@ -693,10 +731,10 @@ public class PackWriter implements AutoCloseable {
* Basing on these 2 sets, another set of objects to put in a pack file is * Basing on these 2 sets, another set of objects to put in a pack file is
* created: this set consists of all objects reachable (ancestors) from * created: this set consists of all objects reachable (ancestors) from
* interesting objects, except uninteresting objects and their ancestors. * interesting objects, except uninteresting objects and their ancestors.
* This method uses class {@link ObjectWalk} extensively to find out that * This method uses class {@link org.eclipse.jgit.revwalk.ObjectWalk}
* appropriate set of output objects and their optimal order in output pack. * extensively to find out that appropriate set of output objects and their
* Order is consistent with general git in-pack rules: sort by object type, * optimal order in output pack. Order is consistent with general git
* recency, path and delta-base first. * in-pack rules: sort by object type, recency, path and delta-base first.
* </p> * </p>
* *
* @param countingMonitor * @param countingMonitor
@ -709,7 +747,7 @@ public class PackWriter implements AutoCloseable {
* points of graph traversal). Pass {@link #NONE} if all objects * points of graph traversal). Pass {@link #NONE} if all objects
* reachable from {@code want} are desired, such as when serving * reachable from {@code want} are desired, such as when serving
* a clone. * a clone.
* @throws IOException * @throws java.io.IOException
* when some I/O problem occur during reading objects. * when some I/O problem occur during reading objects.
*/ */
public void preparePack(ProgressMonitor countingMonitor, public void preparePack(ProgressMonitor countingMonitor,
@ -744,7 +782,7 @@ public class PackWriter implements AutoCloseable {
* {@code shallow} commits and earlier generations will be * {@code shallow} commits and earlier generations will be
* included in the pack if requested by {@code want}. Must not be * included in the pack if requested by {@code want}. Must not be
* {@code null}. * {@code null}.
* @throws IOException * @throws java.io.IOException
* an I/O problem occurred while reading objects. * an I/O problem occurred while reading objects.
*/ */
public void preparePack(ProgressMonitor countingMonitor, public void preparePack(ProgressMonitor countingMonitor,
@ -783,7 +821,7 @@ public class PackWriter implements AutoCloseable {
* @param noBitmaps * @param noBitmaps
* collection of objects to be excluded from bitmap commit * collection of objects to be excluded from bitmap commit
* selection. * selection.
* @throws IOException * @throws java.io.IOException
* an I/O problem occurred while reading objects. * an I/O problem occurred while reading objects.
*/ */
public void preparePack(ProgressMonitor countingMonitor, public void preparePack(ProgressMonitor countingMonitor,
@ -808,10 +846,10 @@ public class PackWriter implements AutoCloseable {
* Basing on these 2 sets, another set of objects to put in a pack file is * Basing on these 2 sets, another set of objects to put in a pack file is
* created: this set consists of all objects reachable (ancestors) from * created: this set consists of all objects reachable (ancestors) from
* interesting objects, except uninteresting objects and their ancestors. * interesting objects, except uninteresting objects and their ancestors.
* This method uses class {@link ObjectWalk} extensively to find out that * This method uses class {@link org.eclipse.jgit.revwalk.ObjectWalk}
* appropriate set of output objects and their optimal order in output pack. * extensively to find out that appropriate set of output objects and their
* Order is consistent with general git in-pack rules: sort by object type, * optimal order in output pack. Order is consistent with general git
* recency, path and delta-base first. * in-pack rules: sort by object type, recency, path and delta-base first.
* </p> * </p>
* *
* @param countingMonitor * @param countingMonitor
@ -829,7 +867,7 @@ public class PackWriter implements AutoCloseable {
* @param noBitmaps * @param noBitmaps
* collection of objects to be excluded from bitmap commit * collection of objects to be excluded from bitmap commit
* selection. * selection.
* @throws IOException * @throws java.io.IOException
* when some I/O problem occur during reading objects. * when some I/O problem occur during reading objects.
*/ */
public void preparePack(ProgressMonitor countingMonitor, public void preparePack(ProgressMonitor countingMonitor,
@ -853,7 +891,7 @@ public class PackWriter implements AutoCloseable {
* @param id * @param id
* the object to test the existence of. * the object to test the existence of.
* @return true if the object will appear in the output pack file. * @return true if the object will appear in the output pack file.
* @throws IOException * @throws java.io.IOException
* a cached pack cannot be examined. * a cached pack cannot be examined.
*/ */
public boolean willInclude(final AnyObjectId id) throws IOException { public boolean willInclude(final AnyObjectId id) throws IOException {
@ -920,7 +958,7 @@ public class PackWriter implements AutoCloseable {
* @param indexStream * @param indexStream
* output for the index data. Caller is responsible for closing * output for the index data. Caller is responsible for closing
* this stream. * this stream.
* @throws IOException * @throws java.io.IOException
* the index data could not be written to the supplied stream. * the index data could not be written to the supplied stream.
*/ */
public void writeIndex(final OutputStream indexStream) throws IOException { public void writeIndex(final OutputStream indexStream) throws IOException {
@ -942,7 +980,7 @@ public class PackWriter implements AutoCloseable {
* @param bitmapIndexStream * @param bitmapIndexStream
* output for the bitmap index data. Caller is responsible for * output for the bitmap index data. Caller is responsible for
* closing this stream. * closing this stream.
* @throws IOException * @throws java.io.IOException
* the index data could not be written to the supplied stream. * the index data could not be written to the supplied stream.
*/ */
public void writeBitmapIndex(final OutputStream bitmapIndexStream) public void writeBitmapIndex(final OutputStream bitmapIndexStream)
@ -1027,13 +1065,13 @@ public class PackWriter implements AutoCloseable {
* @param packStream * @param packStream
* output stream of pack data. The stream should be buffered by * output stream of pack data. The stream should be buffered by
* the caller. The caller is responsible for closing the stream. * the caller. The caller is responsible for closing the stream.
* @throws IOException * @throws java.io.IOException
* an error occurred reading a local object's data to include in * an error occurred reading a local object's data to include in
* the pack, or writing compressed object data to the output * the pack, or writing compressed object data to the output
* stream. * stream.
* @throws WriteAbortedException * @throws WriteAbortedException
* the write operation is aborted by {@link ObjectCountCallback} * the write operation is aborted by
* . * {@link org.eclipse.jgit.transport.ObjectCountCallback} .
*/ */
public void writePack(ProgressMonitor compressMonitor, public void writePack(ProgressMonitor compressMonitor,
ProgressMonitor writeMonitor, OutputStream packStream) ProgressMonitor writeMonitor, OutputStream packStream)
@ -1122,6 +1160,9 @@ public class PackWriter implements AutoCloseable {
} }
/** /**
* Get statistics of what this PackWriter did in order to create the final
* pack stream.
*
* @return description of what this PackWriter did in order to create the * @return description of what this PackWriter did in order to create the
* final pack stream. This should only be invoked after the calls to * final pack stream. This should only be invoked after the calls to
* create the pack/index/bitmap have completed. * create the pack/index/bitmap have completed.
@ -1130,12 +1171,18 @@ public class PackWriter implements AutoCloseable {
return new PackStatistics(stats); return new PackStatistics(stats);
} }
/** @return snapshot of the current state of this PackWriter. */ /**
* Get snapshot of the current state of this PackWriter.
*
* @return snapshot of the current state of this PackWriter.
*/
public State getState() { public State getState() {
return state.snapshot(); return state.snapshot();
} }
/** /**
* {@inheritDoc}
* <p>
* Release all resources used by this writer. * Release all resources used by this writer.
*/ */
@Override @Override
@ -1972,7 +2019,7 @@ public class PackWriter implements AutoCloseable {
* *
* @param object * @param object
* the object to add. * the object to add.
* @throws IncorrectObjectTypeException * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object is an unsupported type. * the object is an unsupported type.
*/ */
public void addObject(final RevObject object) public void addObject(final RevObject object)
@ -2014,9 +2061,9 @@ public class PackWriter implements AutoCloseable {
/** /**
* Select an object representation for this writer. * Select an object representation for this writer.
* <p> * <p>
* An {@link ObjectReader} implementation should invoke this method once for * An {@link org.eclipse.jgit.lib.ObjectReader} implementation should invoke
* each representation available for an object, to allow the writer to find * this method once for each representation available for an object, to
* the most suitable one for the output. * allow the writer to find the most suitable one for the output.
* *
* @param otp * @param otp
* the object being packed. * the object being packed.
@ -2097,7 +2144,7 @@ public class PackWriter implements AutoCloseable {
* @param pm * @param pm
* progress monitor to report bitmap building work. * progress monitor to report bitmap building work.
* @return whether a bitmap index may be written. * @return whether a bitmap index may be written.
* @throws IOException * @throws java.io.IOException
* when some I/O problem occur during reading objects. * when some I/O problem occur during reading objects.
*/ */
public boolean prepareBitmapIndex(ProgressMonitor pm) throws IOException { public boolean prepareBitmapIndex(ProgressMonitor pm) throws IOException {

14
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/StoredObjectRepresentation.java

@ -46,7 +46,9 @@ package org.eclipse.jgit.internal.storage.pack;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
/** /**
* An object representation {@link PackWriter} can consider for packing. * An object representation
* {@link org.eclipse.jgit.internal.storage.pack.PackWriter} can consider for
* packing.
*/ */
public class StoredObjectRepresentation { public class StoredObjectRepresentation {
/** Special unknown value for {@link #getWeight()}. */ /** Special unknown value for {@link #getWeight()}. */
@ -62,6 +64,8 @@ public class StoredObjectRepresentation {
public static final int FORMAT_OTHER = 2; public static final int FORMAT_OTHER = 2;
/** /**
* Get relative size of this object's packed form.
*
* @return relative size of this object's packed form. The special value * @return relative size of this object's packed form. The special value
* {@link #WEIGHT_UNKNOWN} can be returned to indicate the * {@link #WEIGHT_UNKNOWN} can be returned to indicate the
* implementation doesn't know, or cannot supply the weight up * implementation doesn't know, or cannot supply the weight up
@ -72,6 +76,8 @@ public class StoredObjectRepresentation {
} }
/** /**
* Get the storage format type
*
* @return the storage format type, which must be one of * @return the storage format type, which must be one of
* {@link #PACK_DELTA}, {@link #PACK_WHOLE}, or * {@link #PACK_DELTA}, {@link #PACK_WHOLE}, or
* {@link #FORMAT_OTHER}. * {@link #FORMAT_OTHER}.
@ -81,6 +87,9 @@ public class StoredObjectRepresentation {
} }
/** /**
* Get identity of the object this delta applies to in order to recover the
* original object content.
*
* @return identity of the object this delta applies to in order to recover * @return identity of the object this delta applies to in order to recover
* the original object content. This method should only be called if * the original object content. This method should only be called if
* {@link #getFormat()} returned {@link #PACK_DELTA}. * {@link #getFormat()} returned {@link #PACK_DELTA}.
@ -90,6 +99,9 @@ public class StoredObjectRepresentation {
} }
/** /**
* Whether the current representation of the object has had delta
* compression attempted on it.
*
* @return whether the current representation of the object has had delta * @return whether the current representation of the object has had delta
* compression attempted on it. * compression attempted on it.
*/ */

Loading…
Cancel
Save