Codota Logo
PackChunk.findOffset
Code IndexAdd Codota to your IDE (free)

How to use
findOffset
method
in
org.eclipse.jgit.storage.dht.PackChunk

Best Java code snippets using org.eclipse.jgit.storage.dht.PackChunk.findOffset (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: com.madgag/org.eclipse.jgit.storage.dht

boolean contains(RepositoryKey repo, AnyObjectId objId) {
  return 0 <= findOffset(repo, objId);
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

boolean contains(RepositoryKey repo, AnyObjectId objId) {
  return 0 <= findOffset(repo, objId);
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

boolean has(RepositoryKey repo, AnyObjectId objId) {
  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 true;
    }
  }
  return false;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

boolean has(RepositoryKey repo, AnyObjectId objId) {
  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 true;
    }
  }
  return false;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

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;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

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;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkAndOffset find(RepositoryKey repo, AnyObjectId objId) {
  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;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ChunkAndOffset find(RepositoryKey repo, AnyObjectId objId) {
  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;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ObjectLoader open(RepositoryKey repo, AnyObjectId objId, int typeHint)
    throws IOException {
  if (objId instanceof IdWithChunk) {
    PackChunk chunk = get(((IdWithChunk) objId).getChunkKey());
    if (chunk != null) {
      int pos = chunk.findOffset(repo, objId);
      if (0 <= pos)
        return PackChunk.read(chunk, pos, reader, typeHint);
    }
    // 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 PackChunk.read(n.chunk, pos, reader, typeHint);
    }
  }
  return null;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ObjectLoader open(RepositoryKey repo, AnyObjectId objId, int typeHint)
    throws IOException {
  if (objId instanceof IdWithChunk) {
    PackChunk chunk = get(((IdWithChunk) objId).getChunkKey());
    if (chunk != null) {
      int pos = chunk.findOffset(repo, objId);
      if (0 <= pos)
        return PackChunk.read(chunk, pos, reader, typeHint);
    }
    // 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 PackChunk.read(n.chunk, pos, reader, typeHint);
    }
  }
  return null;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public ObjectLoader open() throws IOException {
  ChunkKey chunkKey = current.chunkKey;
  // Objects returned by the queue are clustered by chunk. This object
  // is either in the current chunk, or are the next chunk ready on the
  // prefetcher. Anything else is a programming error.
  //
  PackChunk chunk;
  if (currChunk != null && chunkKey.equals(currChunk.getChunkKey()))
    chunk = currChunk;
  else {
    chunk = prefetcher.get(chunkKey);
    if (chunk == null)
      throw new DhtMissingChunkException(chunkKey);
    currChunk = chunk;
    reader.recentChunk(chunk);
  }
  if (current.info != null) {
    int ptr = current.info.getOffset();
    int type = current.info.getType();
    return PackChunk.read(chunk, ptr, reader, type);
  } else {
    int ptr = chunk.findOffset(repo, current.object);
    if (ptr < 0)
      throw DhtReader.missing(current.object, ObjectReader.OBJ_ANY);
    return PackChunk.read(chunk, ptr, reader, ObjectReader.OBJ_ANY);
  }
}
origin: com.madgag/org.eclipse.jgit.storage.dht

public ObjectLoader open() throws IOException {
  ChunkKey chunkKey = current.chunkKey;
  // Objects returned by the queue are clustered by chunk. This object
  // is either in the current chunk, or are the next chunk ready on the
  // prefetcher. Anything else is a programming error.
  //
  PackChunk chunk;
  if (currChunk != null && chunkKey.equals(currChunk.getChunkKey()))
    chunk = currChunk;
  else {
    chunk = prefetcher.get(chunkKey);
    if (chunk == null)
      throw new DhtMissingChunkException(chunkKey);
    currChunk = chunk;
    reader.recentChunk(chunk);
  }
  if (current.info != null) {
    int ptr = current.info.getOffset();
    int type = current.info.getType();
    return PackChunk.read(chunk, ptr, reader, type);
  } else {
    int ptr = chunk.findOffset(repo, current.object);
    if (ptr < 0)
      throw DhtReader.missing(current.object, ObjectReader.OBJ_ANY);
    return PackChunk.read(chunk, ptr, reader, ObjectReader.OBJ_ANY);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

PackChunk chunk = load(key);
if (chunk != null && chunk.hasIndex()) {
  int pos = chunk.findOffset(repo, objId);
  if (0 <= pos)
    return new ChunkAndOffset(chunk, pos);
origin: com.madgag/org.eclipse.jgit.storage.dht

PackChunk chunk = load(key);
if (chunk != null && chunk.hasIndex()) {
  int pos = chunk.findOffset(repo, objId);
  if (0 <= pos)
    return new ChunkAndOffset(chunk, pos);
org.eclipse.jgit.storage.dhtPackChunkfindOffset

Popular methods of PackChunk

  • <init>
  • checkCycle
  • copyEntireChunkAsIs
  • copyObjectAsIs
  • getChunkKey
  • getMeta
  • getTotalSize
  • hasIndex
  • inflate
  • inflateFragment
  • inflateOne
  • isFragment
  • inflateOne,
  • isFragment,
  • isValid,
  • newResult,
  • read,
  • read1,
  • readObjectTypeAndSize

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now