Examples of StoredBitmap


Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

    return new Iterator<Entry>() {
      private Entry entry;

      public boolean hasNext() {
        while (entry == null && it.hasNext()) {
          StoredBitmap sb = it.next();
          if (newPackIndex.findPosition(sb) != -1)
            entry = new Entry(sb, sb.getFlags());
        }
        return entry != null;
      }

      public Entry next() {
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

  public EWAHCompressedBitmap getBitmap(AnyObjectId objectId) {
    EWAHCompressedBitmap bitmap = newPackIndex.getBitmap(objectId);
    if (bitmap != null || oldPackIndex == null)
      return bitmap;

    StoredBitmap stored = convertedBitmaps.get(objectId);
    if (stored != null)
      return stored.getBitmap();

    StoredBitmap oldBitmap = oldPackIndex.getBitmaps().get(objectId);
    if (oldBitmap == null)
      return null;

    if (newPackIndex.findPosition(objectId) == -1)
      return null;

    inflated.clear();
    for (IntIterator i = oldBitmap.getBitmap().intIterator(); i.hasNext();)
      inflated.set(prevToNewMapping[i.next()]);
    bitmap = inflated.toEWAHCompressedBitmap();
    convertedBitmaps.add(
        new StoredBitmap(objectId, bitmap, null, oldBitmap.getFlags()));
    return bitmap;
  }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

public class StoredBitmapTest {

  @Test
  public void testGetBitmapWithoutXor() {
    EWAHCompressedBitmap b = bitmapOf(100);
    StoredBitmap sb = newStoredBitmap(bitmapOf(100));
    assertEquals(b, sb.getBitmap());
  }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

    assertEquals(b, sb.getBitmap());
  }

  @Test
  public void testGetBitmapWithOneXor() {
    StoredBitmap sb = newStoredBitmap(bitmapOf(100), bitmapOf(100, 101));
    assertEquals(bitmapOf(101), sb.getBitmap());
  }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

    assertEquals(bitmapOf(101), sb.getBitmap());
  }

  @Test
  public void testGetBitmapWithThreeXor() {
    StoredBitmap sb = newStoredBitmap(
        bitmapOf(100),
        bitmapOf(90, 101),
        bitmapOf(100, 101),
        bitmapOf(50));
    assertEquals(bitmapOf(50, 90), sb.getBitmap());
    assertEquals(bitmapOf(50, 90), sb.getBitmap());
  }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

    assertEquals(bitmapOf(50, 90), sb.getBitmap());
  }

  private static final StoredBitmap newStoredBitmap(
      EWAHCompressedBitmap... bitmaps) {
    StoredBitmap sb = null;
    for (EWAHCompressedBitmap bitmap : bitmaps)
      sb = new StoredBitmap(ObjectId.zeroId(), bitmap, sb, 0);
    return sb;
  }
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

    return new Iterator<Entry>() {
      private Entry entry;

      public boolean hasNext() {
        while (entry == null && it.hasNext()) {
          StoredBitmap sb = it.next();
          if (newPackIndex.findPosition(sb) != -1)
            entry = new Entry(sb, sb.getFlags());
        }
        return entry != null;
      }

      public Entry next() {
View Full Code Here

Examples of org.eclipse.jgit.internal.storage.file.BasePackBitmapIndex.StoredBitmap

  public EWAHCompressedBitmap getBitmap(AnyObjectId objectId) {
    EWAHCompressedBitmap bitmap = newPackIndex.getBitmap(objectId);
    if (bitmap != null || oldPackIndex == null)
      return bitmap;

    StoredBitmap stored = convertedBitmaps.get(objectId);
    if (stored != null)
      return stored.getBitmap();

    StoredBitmap oldBitmap = oldPackIndex.getBitmaps().get(objectId);
    if (oldBitmap == null)
      return null;

    if (newPackIndex.findPosition(objectId) == -1)
      return null;

    inflated.clear();
    for (IntIterator i = oldBitmap.getBitmap().intIterator(); i.hasNext();)
      inflated.set(prevToNewMapping[i.next()]);
    bitmap = inflated.toEWAHCompressedBitmap();
    convertedBitmaps.add(
        new StoredBitmap(objectId, bitmap, null, oldBitmap.getFlags()));
    return bitmap;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.