Package org.eclipse.jgit.internal.storage.file

Examples of org.eclipse.jgit.internal.storage.file.PackReverseIndex


    for (DfsPackFile pack : db.getPacks()) {
      List<DfsObjectToPack> tmp = findAllFromPack(pack, objects);
      if (tmp.isEmpty())
        continue;
      Collections.sort(tmp, OFFSET_SORT);
      PackReverseIndex rev = pack.getReverseIdx(this);
      DfsObjectRepresentation rep = new DfsObjectRepresentation(pack);
      for (DfsObjectToPack otp : tmp) {
        pack.representation(rep, otp.getOffset(), this, rev);
        otp.setOffset(0);
        packer.select(otp, rep);
View Full Code Here


    for (DfsPackFile src : srcPacks) {
      List<ObjectIdWithOffset> want = toInclude(src, ctx);
      if (want.isEmpty())
        continue;

      PackReverseIndex rev = src.getReverseIdx(ctx);
      DfsObjectRepresentation rep = new DfsObjectRepresentation(src);
      for (ObjectIdWithOffset id : want) {
        int type = src.getObjectType(ctx, id.offset);
        RevObject obj = rw.lookupAny(id, type);
        if (obj.has(added))
View Full Code Here

  }

  PackReverseIndex getReverseIdx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackReverseIndex> revref = reverseIndex;
    if (revref != null) {
      PackReverseIndex revidx = revref.get();
      if (revidx != null)
        return revidx;
    }

    synchronized (initLock) {
      revref = reverseIndex;
      if (revref != null) {
        PackReverseIndex revidx = revref.get();
        if (revidx != null)
          return revidx;
      }

      PackIndex idx = idx(ctx);
      PackReverseIndex revidx = new PackReverseIndex(idx);
      int sz = (int) Math.min(
          idx.getObjectCount() * 8, Integer.MAX_VALUE);
      reverseIndex = cache.put(key, POS_REVERSE_INDEX, sz, revidx);
      return revidx;
    }
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
    // index with both small (< 2^31) and big offsets
    idx = PackIndex.open(JGitTestUtil.getTestResourceFile(
        "pack-huge.idx"));
    reverseIdx = new PackReverseIndex(idx);
  }
View Full Code Here

    for (DfsPackFile pack : db.getPacks()) {
      List<DfsObjectToPack> tmp = findAllFromPack(pack, objects);
      if (tmp.isEmpty())
        continue;
      Collections.sort(tmp, OFFSET_SORT);
      PackReverseIndex rev = pack.getReverseIdx(this);
      DfsObjectRepresentation rep = new DfsObjectRepresentation(pack);
      for (DfsObjectToPack otp : tmp) {
        pack.representation(rep, otp.getOffset(), this, rev);
        otp.setOffset(0);
        packer.select(otp, rep);
View Full Code Here

  }

  PackReverseIndex getReverseIdx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackReverseIndex> revref = reverseIndex;
    if (revref != null) {
      PackReverseIndex revidx = revref.get();
      if (revidx != null)
        return revidx;
    }

    synchronized (initLock) {
      revref = reverseIndex;
      if (revref != null) {
        PackReverseIndex revidx = revref.get();
        if (revidx != null)
          return revidx;
      }

      PackIndex idx = idx(ctx);
      PackReverseIndex revidx = new PackReverseIndex(idx);
      int sz = (int) Math.min(
          idx.getObjectCount() * 8, Integer.MAX_VALUE);
      reverseIndex = cache.put(key, POS_REVERSE_INDEX, sz, revidx);
      return revidx;
    }
View Full Code Here

    for (DfsPackFile src : srcPacks) {
      List<ObjectIdWithOffset> want = toInclude(src, ctx);
      if (want.isEmpty())
        continue;

      PackReverseIndex rev = src.getReverseIdx(ctx);
      DfsObjectRepresentation rep = new DfsObjectRepresentation(src);
      for (ObjectIdWithOffset id : want) {
        int type = src.getObjectType(ctx, id.offset);
        RevObject obj = rw.lookupAny(id, type);
        if (obj.has(added))
View Full Code Here

    for (DfsPackFile pack : db.getPacks()) {
      List<DfsObjectToPack> tmp = findAllFromPack(pack, objects);
      if (tmp.isEmpty())
        continue;
      Collections.sort(tmp, OFFSET_SORT);
      PackReverseIndex rev = pack.getReverseIdx(this);
      DfsObjectRepresentation rep = new DfsObjectRepresentation(pack);
      for (DfsObjectToPack otp : tmp) {
        pack.representation(rep, otp.getOffset(), this, rev);
        otp.setOffset(0);
        packer.select(otp, rep);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.internal.storage.file.PackReverseIndex

Copyright © 2018 www.massapicom. 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.