org.eclipse.jgit.internal.storage.pack.PackWriter .
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
each object as they are written to the output stream.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private DeltaCache. | cachedDelta
If present, deflated delta instruction stream for this object. |
| private static final int | |
| private static final int | |
| private ObjectId | deltaBase
Other object being packed that this will delta against. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | flags
Bit field, from bit 0 to bit 31:
|
| private static final int | |
| private static final int | |
| private int | pathHash
Hash of the object's tree path. |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | ObjectToPack(AnyObjectId
object id of object for packing src, int real type code of the object, not its in-pack type. type)Construct for the specified object id. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | |
| pack-priv final void | |
| protected final void | clearExtendedFlag(int
the bits to clear, must be between 0x0 and 0xf. flag)Clear an extended flag bit. |
| protected void | |
| pack-priv final boolean | |
| pack-priv final int | |
| pack-priv final int | |
| public final ObjectToPack | Returns: delta base object to pack if object is going to be packed in delta representation and delta is specified as object to pack; null otherwise - if going to be packed as a whole object or delta base is specified only as id.Get delta base object to pack if object is going to be packed in delta representation and delta is specified as object to pack |
| public final ObjectId | Returns: delta base object id if object is going to be packed in delta representation; null otherwise - if going to be packed as a whole object.Get delta base object id if object is going to be packed in delta representation |
| pack-priv final int | |
| protected final int | Returns: the extended flags on this object, in the range [0x0, 0xf].Get the extended flags on this object, in the range [0x0, 0xf]. |
| pack-priv final int | |
| pack-priv final int | |
| public final int | |
| pack-priv final int | |
| public final boolean | Returns: true if object is going to be written as delta; false otherwise.Whether object is going to be written as delta |
| pack-priv final boolean | |
| pack-priv final boolean | |
| protected final boolean | Returns: true if any of the bits matching the mask are non-zero.the flag mask to test, must be between 0x0 and 0xf. flag)Determine if a particular extended flag bit has been set. |
| public final boolean | Returns: true if an existing representation was selected to be reused as-is into the pack stream.Whether an existing representation was selected to be reused as-is into the pack stream. |
| public final boolean | Returns: true if object is already written; false otherwise.Check if object is already written in a pack. |
| pack-priv final void | |
| pack-priv final DeltaCache. | |
| public void | select(StoredObjectRepresentation
the object representation. ref)Remember a specific representation for reuse at a later time. |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | setDeltaBase(ObjectId
delta base object or null if object should be packed as a
whole object. deltaBase)Set delta base for the object. |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| protected final void | |
| protected final void | setExtendedFlags(int
additional flag bits to store in the flags field. Due to space
constraints only values [0x0, 0xf] are permitted. extFlags)Set the extended flags used by the subclass. |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final void | |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| pack-priv final boolean |
| ATTEMPT_DELTA_MASK | back to summary |
|---|---|
| private static final int ATTEMPT_DELTA_MASK | |
| cachedDelta | back to summary |
|---|---|
| private DeltaCache. If present, deflated delta instruction stream for this object. | |
| DELTA_ATTEMPTED | back to summary |
|---|---|
| private static final int DELTA_ATTEMPTED | |
| DELTA_SHIFT | back to summary |
|---|---|
| private static final int DELTA_SHIFT | |
| deltaBase | back to summary |
|---|---|
| private ObjectId deltaBase Other object being packed that this will delta against. | |
| DO_NOT_DELTA | back to summary |
|---|---|
| private static final int DO_NOT_DELTA | |
| EDGE | back to summary |
|---|---|
| private static final int EDGE | |
| EXT_MASK | back to summary |
|---|---|
| private static final int EXT_MASK | |
| EXT_SHIFT | back to summary |
|---|---|
| private static final int EXT_SHIFT | |
| flags | back to summary |
|---|---|
| private int flags Bit field, from bit 0 to bit 31:
| |
| NON_DELTA_MASK | back to summary |
|---|---|
| private static final int NON_DELTA_MASK | |
| NON_EXT_MASK | back to summary |
|---|---|
| private static final int NON_EXT_MASK | |
| pathHash | back to summary |
|---|---|
| private int pathHash Hash of the object's tree path. | |
| REUSE_AS_IS | back to summary |
|---|---|
| private static final int REUSE_AS_IS | |
| TYPE_SHIFT | back to summary |
|---|---|
| private static final int TYPE_SHIFT | |
| ObjectToPack | back to summary |
|---|---|
| public ObjectToPack(AnyObjectId src, int type) Construct for the specified object id.
| |
| clearChainLength | back to summary |
|---|---|
| pack-priv final void clearChainLength() | |
| clearDeltaBase | back to summary |
|---|---|
| pack-priv final void clearDeltaBase() | |
| clearExtendedFlag | back to summary |
|---|---|
| protected final void clearExtendedFlag(int flag) Clear an extended flag bit. This implementation is more efficient than getting the extended flags, removing the bit, and setting them all back.
| |
| clearReuseAsIs | back to summary |
|---|---|
| protected void clearReuseAsIs() Forget the reuse information previously stored.
Implementations may subclass this method, but they must also invoke the
super version with | |
| doNotAttemptDelta | back to summary |
|---|---|
| pack-priv final boolean doNotAttemptDelta() | |
| getCachedSize | back to summary |
|---|---|
| pack-priv final int getCachedSize() | |
| getChainLength | back to summary |
|---|---|
| pack-priv final int getChainLength() | |
| getDeltaBase | back to summary |
|---|---|
| public final ObjectToPack getDeltaBase() Get delta base object to pack if object is going to be packed in delta representation and delta is specified as object to pack
| |
| getDeltaBaseId | back to summary |
|---|---|
| public final ObjectId getDeltaBaseId() Get delta base object id if object is going to be packed in delta representation
| |
| getDeltaDepth | back to summary |
|---|---|
| pack-priv final int getDeltaDepth() | |
| getExtendedFlags | back to summary |
|---|---|
| protected final int getExtendedFlags() Get the extended flags on this object, in the range [0x0, 0xf].
| |
| getFormat | back to summary |
|---|---|
| pack-priv final int getFormat() | |
| getPathHash | back to summary |
|---|---|
| pack-priv final int getPathHash() | |
| getType | back to summary |
|---|---|
| public final int getType() Overrides org. Doc from org. Get the object type.
| |
| getWeight | back to summary |
|---|---|
| pack-priv final int getWeight() | |
| isDeltaRepresentation | back to summary |
|---|---|
| public final boolean isDeltaRepresentation() Whether object is going to be written as delta
| |
| isDoNotDelta | back to summary |
|---|---|
| pack-priv final boolean isDoNotDelta() | |
| isEdge | back to summary |
|---|---|
| pack-priv final boolean isEdge() | |
| isExtendedFlag | back to summary |
|---|---|
| protected final boolean isExtendedFlag(int flag) Determine if a particular extended flag bit has been set.
This implementation may be faster than calling
| |
| isReuseAsIs | back to summary |
|---|---|
| public final boolean isReuseAsIs() Whether an existing representation was selected to be reused as-is into the pack stream.
| |
| isWritten | back to summary |
|---|---|
| public final boolean isWritten() Check if object is already written in a pack. This information is used to achieve delta-base precedence in a pack file.
| |
| markWantWrite | back to summary |
|---|---|
| pack-priv final void markWantWrite() | |
| popCachedDelta | back to summary |
|---|---|
| pack-priv final DeltaCache. | |
| select | back to summary |
|---|---|
| public void select(StoredObjectRepresentation ref) Remember a specific representation for reuse at a later time.
Implementers should remember the representation chosen, so it can be
reused at a later time.
| |
| setCachedDelta | back to summary |
|---|---|
| pack-priv final void setCachedDelta(DeltaCache. | |
| setCachedSize | back to summary |
|---|---|
| pack-priv final void setCachedSize(int sz) | |
| setChainLength | back to summary |
|---|---|
| pack-priv final void setChainLength(int len) | |
| setDeltaAttempted | back to summary |
|---|---|
| pack-priv final void setDeltaAttempted(boolean deltaAttempted) | |
| setDeltaBase | back to summary |
|---|---|
| pack-priv final void setDeltaBase(ObjectId deltaBase) Set delta base for the object. Delta base set by this method is used
by
| |
| setDeltaDepth | back to summary |
|---|---|
| pack-priv final void setDeltaDepth(int d) | |
| setDoNotDelta | back to summary |
|---|---|
| pack-priv final void setDoNotDelta() | |
| setEdge | back to summary |
|---|---|
| pack-priv final void setEdge() | |
| setExtendedFlag | back to summary |
|---|---|
| protected final void setExtendedFlag(int flag) Set an extended flag bit. This implementation is more efficient than getting the extended flags, adding the bit, and setting them all back.
| |
| setExtendedFlags | back to summary |
|---|---|
| protected final void setExtendedFlags(int extFlags) Set the extended flags used by the subclass. Subclass implementations may store up to 4 bits of information inside of the internal flags field already used by the base ObjectToPack instance.
| |
| setPathHash | back to summary |
|---|---|
| pack-priv final void setPathHash(int hc) | |
| setReuseAsIs | back to summary |
|---|---|
| pack-priv final void setReuseAsIs() | |
| setWeight | back to summary |
|---|---|
| pack-priv final void setWeight(int weight) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| wantWrite | back to summary |
|---|---|
| pack-priv final boolean wantWrite() | |