public class BitmapIndexImpl implements BitmapIndex {
private static final int EXTRA_BITS = 10 * 1024;
- private final PackBitmapIndex packIndex;
+ final PackBitmapIndex packIndex;
- private final MutableBitmapIndex mutableIndex;
+ final MutableBitmapIndex mutableIndex;
- private final int indexObjectCount;
+ final int indexObjectCount;
/**
* Creates a BitmapIndex that is back by Compressed bitmaps.
return new CompressedBitmapBuilder();
}
- private int findPosition(AnyObjectId objectId) {
+ int findPosition(AnyObjectId objectId) {
int position = packIndex.findPosition(objectId);
if (position < 0) {
position = mutableIndex.findPosition(objectId);
return position;
}
- private int addObject(AnyObjectId objectId, int type) {
+ int addObject(AnyObjectId objectId, int type) {
int position = findPosition(objectId);
if (position < 0) {
position = mutableIndex.addObject(objectId, type);
private BitSet toRemove;
- private ComboBitset() {
+ ComboBitset() {
this(new EWAHCompressedBitmap());
}
- private ComboBitset(EWAHCompressedBitmap bitmap) {
+ ComboBitset(EWAHCompressedBitmap bitmap) {
this.inflatingBitmap = new InflatingBitSet(bitmap);
}
return true;
}
- private BitmapIndexImpl getBitmapIndex() {
+ BitmapIndexImpl getBitmapIndex() {
return BitmapIndexImpl.this;
}
}
final class CompressedBitmap implements Bitmap {
- private final EWAHCompressedBitmap bitmap;
+ final EWAHCompressedBitmap bitmap;
- private CompressedBitmap(EWAHCompressedBitmap bitmap) {
+ CompressedBitmap(EWAHCompressedBitmap bitmap) {
this.bitmap = bitmap;
}
return bitmap;
}
- private BitmapIndexImpl getPackBitmapIndex() {
+ BitmapIndexImpl getPackBitmapIndex() {
return BitmapIndexImpl.this;
}
}
}
private static final class MutableEntry extends ObjectIdOwnerMap.Entry {
- private final int type;
+ final int type;
- private final int position;
+ final int position;
MutableEntry(AnyObjectId objectId, int type, int position) {
super(objectId);
}
}
- private boolean isSameCompressedBitmap(Bitmap other) {
+ boolean isSameCompressedBitmap(Bitmap other) {
if (other instanceof CompressedBitmap) {
CompressedBitmap b = (CompressedBitmap) other;
return this == b.getPackBitmapIndex();
return false;
}
- private boolean isSameCompressedBitmapBuilder(Bitmap other) {
+ boolean isSameCompressedBitmapBuilder(Bitmap other) {
if (other instanceof CompressedBitmapBuilder) {
CompressedBitmapBuilder b = (CompressedBitmapBuilder) other;
return this == b.getBitmapIndex();
return false;
}
- private static final EWAHCompressedBitmap ones(int sizeInBits) {
+ static final EWAHCompressedBitmap ones(int sizeInBits) {
EWAHCompressedBitmap mask = new EWAHCompressedBitmap();
mask.addStreamOfEmptyWords(
true, sizeInBits / EWAHCompressedBitmap.wordinbits);
class DeltaBaseCache {
private static final int CACHE_SZ = 1024;
- private static final SoftReference<Entry> DEAD;
+ static final SoftReference<Entry> DEAD;
private static int hash(final long position) {
return (((int) position) << 22) >>> 22;
private boolean haveLck;
- private FileOutputStream os;
+ FileOutputStream os;
private boolean needSnapshot;
- private boolean fsync;
+ boolean fsync;
private FileSnapshot commitSnapshot;
private final EWAHCompressedBitmap blobs;
private final EWAHCompressedBitmap tags;
private final BlockList<PositionEntry> byOffset;
- private final BlockList<StoredBitmap>
+ final BlockList<StoredBitmap>
byAddOrder = new BlockList<StoredBitmap>();
- private final ObjectIdOwnerMap<PositionEntry>
+ final ObjectIdOwnerMap<PositionEntry>
positionEntries = new ObjectIdOwnerMap<PositionEntry>();
/**
private final int xorOffset;
private final int flags;
- private StoredEntry(long objectId, EWAHCompressedBitmap bitmap,
+ StoredEntry(long objectId, EWAHCompressedBitmap bitmap,
int xorOffset, int flags) {
this.objectId = objectId;
this.bitmap = bitmap;
}
private static final class PositionEntry extends ObjectIdOwnerMap.Entry {
- private final int namePosition;
+ final int namePosition;
- private int offsetPosition;
+ int offsetPosition;
- private PositionEntry(AnyObjectId objectId, int namePosition) {
+ PositionEntry(AnyObjectId objectId, int namePosition) {
super(objectId);
this.namePosition = namePosition;
}
implements Iterable<PackBitmapIndexRemapper.Entry> {
private final BasePackBitmapIndex oldPackIndex;
- private final PackBitmapIndex newPackIndex;
+ final PackBitmapIndex newPackIndex;
private final ObjectIdOwnerMap<StoredBitmap> convertedBitmaps;
private final BitSet inflated;
private final int[] prevToNewMapping;
public final class Entry extends ObjectId {
private final int flags;
- private Entry(AnyObjectId src, int flags) {
+ Entry(AnyObjectId src, int flags) {
super(src);
this.flags = flags;
}
private int activeCopyRawData;
- private int packLastModified;
+ int packLastModified;
private volatile boolean invalid;
private final long[] idxHeader;
- private byte[][] idxdata;
+ byte[][] idxdata;
private long objectCnt;
}
private class IndexV1Iterator extends EntriesIterator {
- private int levelOne;
+ int levelOne;
- private int levelTwo;
+ int levelTwo;
@Override
protected MutableEntry initEntry() {
private final long[] fanoutTable;
/** 256 arrays of contiguous object names. */
- private int[][] names;
+ int[][] names;
/** 256 arrays of the 32 bit offset data, matching {@link #names}. */
- private byte[][] offset32;
+ byte[][] offset32;
/** 256 arrays of the CRC-32 of objects, matching {@link #names}. */
private byte[][] crc32;
/** 64 bit offset table. */
- private byte[] offset64;
+ byte[] offset64;
PackIndexV2(final InputStream fd) throws IOException {
final byte[] fanoutRaw = new byte[4 * FANOUT];
}
private class EntriesIteratorV2 extends EntriesIterator {
- private int levelOne;
+ int levelOne;
- private int levelTwo;
+ int levelTwo;
@Override
protected MutableEntry initEntry() {
private final File gitDir;
- private final File refsDir;
+ final File refsDir;
private final ReflogWriter logWriter;
private final AtomicReference<RefList<LooseRef>> looseRefs = new AtomicReference<RefList<LooseRef>>();
/** Immutable sorted list of packed references. */
- private final AtomicReference<PackedRefList> packedRefs = new AtomicReference<PackedRefList>();
+ final AtomicReference<PackedRefList> packedRefs = new AtomicReference<PackedRefList>();
/**
* Number of modifications made to this database.
return n;
}
- private LooseRef scanRef(LooseRef ref, String name) throws IOException {
+ LooseRef scanRef(LooseRef ref, String name) throws IOException {
final File path = fileFor(name);
FileSnapshot currentSnapshot = null;
}
}
- private static void checkValidEndOfStream(InputStream in, Inflater inf,
+ static void checkValidEndOfStream(InputStream in, Inflater inf,
AnyObjectId id, final byte[] buf) throws IOException,
CorruptObjectException {
for (;;) {
}
}
- private static boolean isStandardFormat(final byte[] hdr) {
+ static boolean isStandardFormat(final byte[] hdr) {
/*
* We must determine if the buffer contains the standard
* zlib-deflated stream or the experimental format based
return (fb & 0x8f) == 0x08 && (((fb << 8) | hdr[1] & 0xff) % 31) == 0;
}
- private static InputStream inflate(final InputStream in, final long size,
+ static InputStream inflate(final InputStream in, final long size,
final ObjectId id) {
final Inflater inf = InflaterCache.get();
return new InflaterInputStream(in, inf) {
return new InflaterInputStream(in, inf, BUFFER_SIZE);
}
- private static BufferedInputStream buffer(InputStream in) {
+ static BufferedInputStream buffer(InputStream in) {
return new BufferedInputStream(in, BUFFER_SIZE);
}
- private static int readSome(InputStream in, final byte[] hdr, int off,
+ static int readSome(InputStream in, final byte[] hdr, int off,
int cnt) throws IOException {
int avail = 0;
while (0 < cnt) {
private final FileObjectDatabase source;
- private LargeObject(int type, long size, File path, AnyObjectId id,
+ LargeObject(int type, long size, File path, AnyObjectId id,
FileObjectDatabase db) {
this.type = type;
this.size = size;
final int endIndex;
private long totalWeight;
- private long bytesPerUnit;
+ long bytesPerUnit;
Block(int threads, PackConfig config, ObjectReader reader,
DeltaCache dc, ThreadSafeProgressMonitor pm,
}
private final Block block;
- private final LinkedList<Slice> slices;
+ final LinkedList<Slice> slices;
private ObjectReader or;
private DeltaWindow dw;
}
@SuppressWarnings("unchecked")
- private BlockList<ObjectToPack> objectsLists[] = new BlockList[OBJ_TAG + 1];
+ BlockList<ObjectToPack> objectsLists[] = new BlockList[OBJ_TAG + 1];
{
objectsLists[OBJ_COMMIT] = new BlockList<ObjectToPack>();
objectsLists[OBJ_TREE] = new BlockList<ObjectToPack>();
/** {@link #reader} recast to the reuse interface, if it supports it. */
private final ObjectReuseAsIs reuseSupport;
- private final PackConfig config;
+ final PackConfig config;
private final PackStatistics.Accumulator stats;
final List<BitmapBuilderEntry> tipCommitBitmaps;
final Iterable<BitmapCommit> reusedCommits;
- private final RevCommit[] commitsByOldest;
- private final int commitStartPos;
+ final RevCommit[] commitsByOldest;
+ final int commitStartPos;
CommitSelectionHelper(Set<? extends ObjectId> peeledWant,
RevCommit[] commitsByOldest, int commitStartPos,