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

public Class PackBitmapIndexRemapper

extends Object
implements PackBitmapIndex, Iterable<PackBitmapIndexRemapper.Entry>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable, org.eclipse.jgit.internal.storage.file.PackBitmapIndex
Imports
java.util.Collections, .Iterator, .NoSuchElementException, org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap, org.eclipse.jgit.lib.AnyObjectId, .BitmapIndex, .ObjectId, com.googlecode.javaewah.EWAHCompressedBitmap, .IntIterator

A PackBitmapIndex that remaps the bitmaps in the previous index to the positions in the new pack index. Note, unlike typical PackBitmapIndex implementations this implementation is not thread safe, as it is intended to be used with a PackBitmapIndexBuilder, which is also not thread safe.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PackBitmapIndexRemapper.Entry

An entry in the old PackBitmapIndex.

Field Summary

Modifier and TypeField and Description
private final BitSet
pack-priv final PackBitmapIndex
private final BasePackBitmapIndex
private final int[]

Constructor Summary

AccessConstructor and Description
private
private

Method Summary

Modifier and TypeMethod and Description
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
getBaseBitmapCount()

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

Returns the number of bitmaps in this bitmap index ready to use, not XOR'ed against other entries.

public long
getBaseBitmapSizeInBytes()

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

Current size in bytes of all base bitmaps in the index.

public EWAHCompressedBitmap
getBitmap(AnyObjectId
the id for which the bitmap will be found.
objectId
)

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

Returns the previously constructed bitmap for 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 int
getXorBitmapCount()

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

Returns the number of bitmaps in this bitmap index XOR'ed against other entries.

public long
getXorBitmapSizeInBytes()

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

Current size in bytes of all XOR'ed bitmaps in the index.

public Iterator<PackBitmapIndexRemapper.Entry>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public static PackBitmapIndexRemapper

Returns:

a bitmap index that attempts to do the mapping between the two.
newPackBitmapIndex
(BitmapIndex
the bitmap index with the old mapping.
prevBitmapIndex
,
PackBitmapIndex
the bitmap index with the new mapping.
newIndex
)

A PackBitmapIndex that maps the positions in the prevBitmapIndex to the ones in the newIndex.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inflatedback to summary
private final BitSet inflated
newPackIndexback to summary
pack-priv final PackBitmapIndex newPackIndex
oldPackIndexback to summary
private final BasePackBitmapIndex oldPackIndex
prevToNewMappingback to summary
private final int[] prevToNewMapping

Constructor Detail

PackBitmapIndexRemapperback to summary
private PackBitmapIndexRemapper(PackBitmapIndex newPackIndex)
PackBitmapIndexRemapperback to summary
private PackBitmapIndexRemapper(BasePackBitmapIndex oldPackIndex, PackBitmapIndex newPackIndex)

Method Detail

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
getBaseBitmapCountback to summary
public int getBaseBitmapCount()

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

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

Returns the number of bitmaps in this bitmap index ready to use, not XOR'ed against other entries.

Returns:int

the number of bitmaps in this bitmap index ready to use.

Annotations
@Override
getBaseBitmapSizeInBytesback to summary
public long getBaseBitmapSizeInBytes()

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

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

Current size in bytes of all base bitmaps in the index. Resolving xors for bitmaps can affect this size.

Returns:long

Current size (in bytes) of all base bitmaps in this index.

Annotations
@Override
getBitmapback to summary
public EWAHCompressedBitmap getBitmap(AnyObjectId objectId)

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

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

Returns the previously constructed bitmap for the object.

Parameters
objectId:AnyObjectId

the id for which the bitmap will be found.

Returns:EWAHCompressedBitmap

the bitmap or null 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
getXorBitmapCountback to summary
public int getXorBitmapCount()

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

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

Returns the number of bitmaps in this bitmap index XOR'ed against other entries.

Returns:int

the number of bitmaps in this bitmap index represented as XOR masks.

Annotations
@Override
getXorBitmapSizeInBytesback to summary
public long getXorBitmapSizeInBytes()

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

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

Current size in bytes of all XOR'ed bitmaps in the index. Resolving xors for bitmaps can affect this size.

Returns:long

Current size (in bytes) of all xor bitmaps in this index.

Annotations
@Override
iteratorback to summary
public Iterator<PackBitmapIndexRemapper.Entry> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<PackBitmapIndexRemapper.Entry>

an Iterator.

Annotations
@Override
newPackBitmapIndexback to summary
public static PackBitmapIndexRemapper newPackBitmapIndex(BitmapIndex prevBitmapIndex, PackBitmapIndex newIndex)

A PackBitmapIndex that maps the positions in the prevBitmapIndex to the ones in the newIndex.

Parameters
prevBitmapIndex:BitmapIndex

the bitmap index with the old mapping.

newIndex:PackBitmapIndex

the bitmap index with the new mapping.

Returns:PackBitmapIndexRemapper

a bitmap index that attempts to do the mapping between the two.

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
org.eclipse.jgit.internal.storage.file back to summary

public final Class PackBitmapIndexRemapper.Entry

extends ObjectId
Class Inheritance

An entry in the old PackBitmapIndex.

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
Entry(AnyObjectId src, int flags)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the flags associated with the bitmap.
getFlags
()

Get flags

Inherited from org.eclipse.jgit.lib.ObjectId:
equalsfromRawfromRawfromRawfromRawfromRawfromStringfromStringisIdtoObjectIdtoStringzeroId

Field Detail

flagsback to summary
private final int flags

Constructor Detail

Entryback to summary
pack-priv Entry(AnyObjectId src, int flags)

Method Detail

getFlagsback to summary
public int getFlags()

Get flags

Returns:int

the flags associated with the bitmap.