Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.PackIndex


  }

  private PackIndex idx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackIndex> idxref = index;
    if (idxref != null) {
      PackIndex idx = idxref.get();
      if (idx != null)
        return idx;
    }

    if (invalid)
      throw new PackInvalidException(getPackName());

    synchronized (initLock) {
      idxref = index;
      if (idxref != null) {
        PackIndex idx = idxref.get();
        if (idx != null)
          return idx;
      }

      PackIndex idx;
      try {
        ReadableChannel rc = ctx.db.openPackIndex(packDesc);
        try {
          InputStream in = Channels.newInputStream(rc);
          int wantSize = 8192;
View Full Code Here


    packOut.close();
    packOut = null;

    sortObjectsById();

    PackIndex index = writePackIndex(packDsc, packHash, objectList);
    db.commitPack(Collections.singletonList(packDsc), null);
    rollback = false;

    DfsPackFile p = cache.getOrCreate(packDsc, packKey);
    if (index != null)
View Full Code Here

    // If there are less than 58,000 objects, the entire index fits in under
    // 2 MiB. Callers will probably need the index immediately, so buffer
    // the index in process and load from the buffer.
    TemporaryBuffer.Heap buf = null;
    PackIndex packIndex = null;
    if (list.size() <= 58000) {
      buf = new TemporaryBuffer.Heap(2 << 20);
      index(buf, packHash, list);
      packIndex = PackIndex.read(buf.openInputStream());
    }
View Full Code Here

  }

  private PackIndex idx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackIndex> idxref = index;
    if (idxref != null) {
      PackIndex idx = idxref.get();
      if (idx != null)
        return idx;
    }

    if (invalid)
      throw new PackInvalidException(getPackName());

    Repository.getGlobalListenerList()
        .dispatch(new BeforeDfsPackIndexLoadedEvent(this));

    synchronized (initLock) {
      idxref = index;
      if (idxref != null) {
        PackIndex idx = idxref.get();
        if (idx != null)
          return idx;
      }

      PackIndex idx;
      try {
        ReadableChannel rc = ctx.db.openPackIndex(packDesc);
        try {
          InputStream in = Channels.newInputStream(rc);
          int wantSize = 8192;
View Full Code Here

  }

  private PackIndex idx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackIndex> idxref = index;
    if (idxref != null) {
      PackIndex idx = idxref.get();
      if (idx != null)
        return idx;
    }

    if (invalid)
      throw new PackInvalidException(getPackName());

    synchronized (initLock) {
      idxref = index;
      if (idxref != null) {
        PackIndex idx = idxref.get();
        if (idx != null)
          return idx;
      }

      PackIndex idx;
      try {
        ReadableChannel rc = ctx.db.openPackIndex(packDesc);
        try {
          InputStream in = Channels.newInputStream(rc);
          int wantSize = 8192;
View Full Code Here

    PackWriter pw = newPackWriter();
    try {
      RevWalk pool = new RevWalk(ctx);
      for (DfsPackFile oldPack : packsBefore) {
        PackIndex oldIdx = oldPack.getPackIndex(ctx);
        pm.beginTask("Finding garbage", (int) oldIdx.getObjectCount());
        for (PackIndex.MutableEntry ent : oldIdx) {
          pm.update(1);
          ObjectId id = ent.toObjectId();
          if (pool.lookupOrNull(id) != null || anyIndexHas(newIdx, id))
            continue;
View Full Code Here

    packOut.close();
    packOut = null;

    sortObjectsById();

    PackIndex index = writePackIndex(packDsc, packHash, objectList);
    db.commitPack(Collections.singletonList(packDsc), null);
    rollback = false;

    DfsPackFile p = cache.getOrCreate(packDsc, packKey);
    if (index != null)
View Full Code Here

    // If there are less than 58,000 objects, the entire index fits in under
    // 2 MiB. Callers will probably need the index immediately, so buffer
    // the index in process and load from the buffer.
    TemporaryBuffer.Heap buf = null;
    PackIndex packIndex = null;
    if (list.size() <= 58000) {
      buf = new TemporaryBuffer.Heap(2 << 20);
      index(buf, packHash, list);
      packIndex = PackIndex.read(buf.openInputStream());
    }
View Full Code Here

  }

  private PackIndex idx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackIndex> idxref = index;
    if (idxref != null) {
      PackIndex idx = idxref.get();
      if (idx != null)
        return idx;
    }

    if (invalid)
      throw new PackInvalidException(getPackName());

    synchronized (initLock) {
      idxref = index;
      if (idxref != null) {
        PackIndex idx = idxref.get();
        if (idx != null)
          return idx;
      }

      PackIndex idx;
      try {
        ReadableChannel rc = ctx.db.openPackIndex(packDesc);
        try {
          InputStream in = Channels.newInputStream(rc);
          int wantSize = 8192;
View Full Code Here

  }

  private PackIndex idx(DfsReader ctx) throws IOException {
    DfsBlockCache.Ref<PackIndex> idxref = index;
    if (idxref != null) {
      PackIndex idx = idxref.get();
      if (idx != null)
        return idx;
    }

    if (invalid)
      throw new PackInvalidException(getPackName());

    Repository.getGlobalListenerList()
        .dispatch(new BeforeDfsPackIndexLoadedEvent(this));

    synchronized (initLock) {
      idxref = index;
      if (idxref != null) {
        PackIndex idx = idxref.get();
        if (idx != null)
          return idx;
      }

      PackIndex idx;
      try {
        ReadableChannel rc = ctx.db.openFile(packDesc, INDEX);
        try {
          InputStream in = Channels.newInputStream(rc);
          int wantSize = 8192;
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.PackIndex

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.