Codota Logo
RecentChunks.hit
Code IndexAdd Codota to your IDE (free)

How to use
hit
method
in
org.eclipse.jgit.storage.dht.RecentChunks

Best Java code snippets using org.eclipse.jgit.storage.dht.RecentChunks.hit (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

PackChunk get(ChunkKey key) {
  Node n = byKey.get(key);
  if (n != null) {
    hit(n);
    stats.recentChunks_Hits++;
    return n.chunk;
  }
  stats.recentChunks_Miss++;
  return null;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

PackChunk get(ChunkKey key) {
  Node n = byKey.get(key);
  if (n != null) {
    hit(n);
    stats.recentChunks_Hits++;
    return n.chunk;
  }
  stats.recentChunks_Miss++;
  return null;
}
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: com.madgag/org.eclipse.jgit.storage.dht

void put(PackChunk chunk) {
  Node n = byKey.get(chunk.getChunkKey());
  if (n != null && n.chunk == chunk) {
    hit(n);
    return;
  }
  curBytes += chunk.getTotalSize();
  prune();
  n = new Node();
  n.chunk = chunk;
  byKey.put(chunk.getChunkKey(), n);
  first(n);
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

void put(PackChunk chunk) {
  Node n = byKey.get(chunk.getChunkKey());
  if (n != null && n.chunk == chunk) {
    hit(n);
    return;
  }
  curBytes += chunk.getTotalSize();
  prune();
  n = new Node();
  n.chunk = chunk;
  byKey.put(chunk.getChunkKey(), n);
  first(n);
}
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: 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: 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: 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;
}
org.eclipse.jgit.storage.dhtRecentChunkshit

Popular methods of RecentChunks

  • <init>
  • clear
  • find
  • first
  • get
  • has
  • open
  • prune
  • put
  • remove
  • setMaxBytes
  • setMaxBytes

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • putExtra (Intent)
  • Kernel (java.awt.image)
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JComboBox (javax.swing)
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