Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

pack-priv Class PackBitmapIndexV1

extends BasePackBitmapIndex
Class Inheritance
Imports
java.io.DataInput, .IOException, .InputStream, java.text.MessageFormat, java.util.ArrayList, .Arrays, .List, java.util.concurrent.ExecutionException, .ExecutorService, .Executors, .Future, .ThreadFactory, java.util.concurrent.atomic.AtomicInteger, org.eclipse.jgit.annotations.Nullable, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.AnyObjectId, .Constants, .ObjectId, .ObjectIdOwnerMap, org.eclipse.jgit.util.IO, .NB, com.googlecode.javaewah.EWAHCompressedBitmap

Support for the pack bitmap index v1 format.
See Also
PackBitmapIndex

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PackBitmapIndexV1.IdxPositionBitmap

Temporary holder of object position in pack index and other metadata for StoredBitmap.

Field Summary

Modifier and TypeField and Description
private final ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap>
private final EWAHCompressedBitmap
private final EWAHCompressedBitmap
private static final ExecutorService
pack-priv static final byte[]
private static final int
pack-priv static final int
private byte[]
private final PackIndex
private final PackReverseIndex
private final EWAHCompressedBitmap
private final EWAHCompressedBitmap

Constructor Summary

AccessConstructor and Description
pack-priv
PackBitmapIndexV1(final InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex)

pack-priv
PackBitmapIndexV1(final InputStream fd, PackBitmapIndex.SupplierWithIOException<PackIndex> packIndexSupplier, PackBitmapIndex.SupplierWithIOException<PackReverseIndex> reverseIndexSupplier, boolean loadParallelRevIndex)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
findPosition(AnyObjectId
the id for which the bitmap position will be found.
objectId
)

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.findPosition.

Finds the position in the bitmap of the object.

public int
getBitmapCount()

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getBitmapCount.

Returns the number of bitmaps in this bitmap index.

public ObjectId
getObject(int
the offset in the bitmap which corresponds to an object of interest. This position is the same as the order of the object in the PackFile.
position
)

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getObject.

Get the object at the bitmap position.

public int
getObjectCount()

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getObjectCount.

Obtain the total number of objects described by this index.

public byte[]
getPackChecksum()

Overrides default org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getPackChecksum.

Footer checksum applied on the bottom of the pack file.

pack-priv PackIndex
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public EWAHCompressedBitmap
ofObjectType(EWAHCompressedBitmap
the object bitmap.
bitmap
,
int
the Git type.
type
)

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.ofObjectType.

Returns a bitmap containing positions for objects that have the given Git type.

private static EWAHCompressedBitmap
readBitmap(DataInput dataInput)

Inherited from org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex:
getBaseBitmapCountgetBaseBitmapSizeInBytesgetBitmapgetBitmapsgetXorBitmapCountgetXorBitmapSizeInBytes

Field Detail

bitmapsback to summary
private final ObjectIdOwnerMap<BasePackBitmapIndex.StoredBitmap> bitmaps

Hides org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.bitmaps.

blobsback to summary
private final EWAHCompressedBitmap blobs
commitsback to summary
private final EWAHCompressedBitmap commits
executorback to summary
private static final ExecutorService executor
MAGICback to summary
pack-priv static final byte[] MAGIC
MAX_XOR_OFFSETback to summary
private static final int MAX_XOR_OFFSET
OPT_FULLback to summary
pack-priv static final int OPT_FULL
packChecksumback to summary
private byte[] packChecksum
packIndexback to summary
private final PackIndex packIndex
reverseIndexback to summary
private final PackReverseIndex reverseIndex
tagsback to summary
private final EWAHCompressedBitmap tags
treesback to summary
private final EWAHCompressedBitmap trees

Constructor Detail

PackBitmapIndexV1back to summary
pack-priv PackBitmapIndexV1(final InputStream fd, PackIndex packIndex, PackReverseIndex reverseIndex) throws IOException
PackBitmapIndexV1back to summary
pack-priv PackBitmapIndexV1(final InputStream fd, PackBitmapIndex.SupplierWithIOException<PackIndex> packIndexSupplier, PackBitmapIndex.SupplierWithIOException<PackReverseIndex> reverseIndexSupplier, boolean loadParallelRevIndex) throws IOException

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
findPositionback to summary
public int findPosition(AnyObjectId objectId)

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.findPosition.

Doc from org.eclipse.jgit.internal.storage.file.PackBitmapIndex.findPosition.

Finds the position in the bitmap of the object.

Parameters
objectId:AnyObjectId

the id for which the bitmap position will be found.

Returns:int

the bitmap id or -1 if the object was not found.

Annotations
@Override
getBitmapCountback to summary
public int getBitmapCount()

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getBitmapCount.

Doc from org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getBitmapCount.

Returns the number of bitmaps in this bitmap index.

Returns:int

the number of bitmaps in this bitmap index.

Annotations
@Override
getObjectback to summary
public ObjectId getObject(int position) throws IllegalArgumentException

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getObject.

Doc from org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getObject.

Get the object at the bitmap position.

Parameters
position:int

the offset in the bitmap which corresponds to an object of interest. This position is the same as the order of the object in the PackFile.

Returns:ObjectId

the ObjectId.

Annotations
@Override
Exceptions
IllegalArgumentException:
when the item is not found.
getObjectCountback to summary
public int getObjectCount()

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getObjectCount.

Doc from org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getObjectCount.

Obtain the total number of objects described by this index. getObjectCount() - 1 is the largest bit that will be set in a bitmap.

Returns:int

number of objects in this index, and likewise in the associated pack that this index was generated from.

Annotations
@Override
getPackChecksumback to summary
public byte[] getPackChecksum()

Overrides default org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getPackChecksum.

Doc from org.eclipse.jgit.internal.storage.file.PackBitmapIndex.getPackChecksum.

Footer checksum applied on the bottom of the pack file.

Returns:byte[]

checksum as a byte array

Annotations
@Override
getPackIndexback to summary
pack-priv PackIndex getPackIndex()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
ofObjectTypeback to summary
public EWAHCompressedBitmap ofObjectType(EWAHCompressedBitmap bitmap, int type)

Implements org.eclipse.jgit.internal.storage.file.PackBitmapIndex.ofObjectType.

Doc from org.eclipse.jgit.internal.storage.file.PackBitmapIndex.ofObjectType.

Returns a bitmap containing positions for objects that have the given Git type.

Parameters
bitmap:EWAHCompressedBitmap

the object bitmap.

type:int

the Git type.

Returns:EWAHCompressedBitmap

the object bitmap with only objects of the Git type.

Annotations
@Override
readBitmapback to summary
private static EWAHCompressedBitmap readBitmap(DataInput dataInput) throws IOException
org.eclipse.jgit.internal.storage.file back to summary

private final Class PackBitmapIndexV1.IdxPositionBitmap

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.internal.storage.file.PackBitmapIndexV1.IdxPositionBitmap

Temporary holder of object position in pack index and other metadata for StoredBitmap.

Field Summary

Modifier and TypeField and Description
pack-priv EWAHCompressedBitmap
pack-priv int
pack-priv int
pack-priv BasePackBitmapIndex.StoredBitmap
pack-priv PackBitmapIndexV1.IdxPositionBitmap

Constructor Summary

AccessConstructor and Description
pack-priv
IdxPositionBitmap(int nthObjectId, PackBitmapIndexV1.IdxPositionBitmap xorIdxPositionBitmap, EWAHCompressedBitmap bitmap, int flags)

Method Summary

Modifier and TypeMethod and Description
pack-priv BasePackBitmapIndex.StoredBitmap
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bitmapback to summary
pack-priv EWAHCompressedBitmap bitmap
flagsback to summary
pack-priv int flags
nthObjectIdback to summary
pack-priv int nthObjectId
sbback to summary
pack-priv BasePackBitmapIndex.StoredBitmap sb
xorIdxPositionBitmapback to summary
pack-priv PackBitmapIndexV1.IdxPositionBitmap xorIdxPositionBitmap

Constructor Detail

IdxPositionBitmapback to summary
pack-priv IdxPositionBitmap(int nthObjectId, PackBitmapIndexV1.IdxPositionBitmap xorIdxPositionBitmap, EWAHCompressedBitmap bitmap, int flags)

Method Detail

getXorStoredBitmapback to summary
pack-priv BasePackBitmapIndex.StoredBitmap getXorStoredBitmap()