Package org.eclipse.jgit.storage.dht.DhtReader

Examples of org.eclipse.jgit.storage.dht.DhtReader.ChunkAndOffset


    int time = -1;
    PackChunk chunk = null;

    for (RevCommit cmit : roots) {
      if (time < cmit.getCommitTime()) {
        ChunkAndOffset p = ctx.getChunkGently(cmit);
        if (p != null && p.chunk.getMeta() != null) {
          time = cmit.getCommitTime();
          chunk = p.chunk;
        }
      }
View Full Code Here


  synchronized ChunkAndOffset find(RepositoryKey repo, AnyObjectId objId) {
    for (PackChunk c : ready.values()) {
      int p = c.findOffset(repo, objId);
      if (0 <= p)
        return new ChunkAndOffset(useReadyChunk(c.getChunkKey()), p);
    }
    return null;
  }
View Full Code Here

    if (objId instanceof IdWithChunk) {
      PackChunk chunk = get(((IdWithChunk) objId).getChunkKey());
      if (chunk != null) {
        int pos = chunk.findOffset(repo, objId);
        if (0 <= pos)
          return new ChunkAndOffset(chunk, pos);
      }

      // IdWithChunk is only a hint, and can be wrong. Locally
      // searching is faster than looking in the Database.
    }

    for (Node n = lruHead; n != null; n = n.next) {
      int pos = n.chunk.findOffset(repo, objId);
      if (0 <= pos) {
        hit(n);
        stats.recentChunks_Hits++;
        return new ChunkAndOffset(n.chunk, pos);
      }
    }

    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.dht.DhtReader.ChunkAndOffset

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.