Codota Logo
RefDataUtil$IdWithChunk.getChunkKey
Code IndexAdd Codota to your IDE (free)

How to use
getChunkKey
method
in
org.eclipse.jgit.storage.dht.RefDataUtil$IdWithChunk

Best Java code snippets using org.eclipse.jgit.storage.dht.RefDataUtil$IdWithChunk.getChunkKey (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private Iterable<T> lookInCache(Iterable<T> objects) {
  RecentInfoCache infoCache = reader.getRecentInfoCache();
  List<T> missing = null;
  for (T obj : objects) {
    if (needChunkOnly && obj instanceof RefDataUtil.IdWithChunk) {
      push(obj, ((RefDataUtil.IdWithChunk) obj).getChunkKey());
      continue;
    }
    List<ObjectInfo> info = infoCache.get(obj);
    if (info != null && !info.isEmpty()) {
      push(obj, info.get(0));
    } else {
      if (missing == null) {
        if (objects instanceof List<?>)
          missing = new ArrayList<T>(((List<?>) objects).size());
        else
          missing = new ArrayList<T>();
      }
      missing.add(obj);
    }
  }
  if (missing != null)
    return missing;
  return Collections.emptyList();
}
origin: com.madgag/org.eclipse.jgit.storage.dht

private Iterable<T> lookInCache(Iterable<T> objects) {
  RecentInfoCache infoCache = reader.getRecentInfoCache();
  List<T> missing = null;
  for (T obj : objects) {
    if (needChunkOnly && obj instanceof RefDataUtil.IdWithChunk) {
      push(obj, ((RefDataUtil.IdWithChunk) obj).getChunkKey());
      continue;
    }
    List<ObjectInfo> info = infoCache.get(obj);
    if (info != null && !info.isEmpty()) {
      push(obj, info.get(0));
    } else {
      if (missing == null) {
        if (objects instanceof List<?>)
          missing = new ArrayList<T>(((List<?>) objects).size());
        else
          missing = new ArrayList<T>();
      }
      missing.add(obj);
    }
  }
  if (missing != null)
    return missing;
  return Collections.emptyList();
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkKey findChunk(AnyObjectId id) {
  RefCache c = cache.get();
  if (c != null) {
    IdWithChunk i = c.hints.get(id);
    if (i != null)
      return i.getChunkKey();
  }
  return null;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkKey findChunk(AnyObjectId objId) throws DhtException {
  if (objId instanceof RefDataUtil.IdWithChunk)
    return ((RefDataUtil.IdWithChunk) objId).getChunkKey();
  ChunkKey key = repository.getRefDatabase().findChunk(objId);
  if (key != null)
    return key;
  ChunkAndOffset r = recentChunks.find(repo, objId);
  if (r != null)
    return r.chunk.getChunkKey();
  for (ObjectInfo link : find(objId))
    return link.getChunkKey();
  return null;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ChunkKey findChunk(AnyObjectId objId) throws DhtException {
  if (objId instanceof RefDataUtil.IdWithChunk)
    return ((RefDataUtil.IdWithChunk) objId).getChunkKey();
  ChunkKey key = repository.getRefDatabase().findChunk(objId);
  if (key != null)
    return key;
  ChunkAndOffset r = recentChunks.find(repo, objId);
  if (r != null)
    return r.chunk.getChunkKey();
  for (ObjectInfo link : find(objId))
    return link.getChunkKey();
  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: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ChunkKey findChunk(AnyObjectId id) {
  RefCache c = cache.get();
  if (c != null) {
    IdWithChunk i = c.hints.get(id);
    if (i != null)
      return i.getChunkKey();
  }
  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

  key = ((RefDataUtil.IdWithChunk) objId).getChunkKey();
else
  key = repository.getRefDatabase().findChunk(objId);
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

  key = ((RefDataUtil.IdWithChunk) objId).getChunkKey();
else
  key = repository.getRefDatabase().findChunk(objId);
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.dhtRefDataUtil$IdWithChunkgetChunkKey

Popular methods of RefDataUtil$IdWithChunk

  • <init>
  • name

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
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