Codota Logo
DhtCachedPack
Code IndexAdd Codota to your IDE (free)

How to use
DhtCachedPack
in
org.eclipse.jgit.storage.dht

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public void copyPackAsIs(PackOutputStream out, CachedPack pack,
    boolean validate) throws IOException {
  ((DhtCachedPack) pack).copyAsIs(out, validate, this);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep) {
  DhtObjectRepresentation objrep = (DhtObjectRepresentation) rep;
  if (keySet == null)
    init();
  return keySet.contains(objrep.getChunkKey());
}
origin: com.madgag/org.eclipse.jgit.storage.dht

void copyAsIs(PackOutputStream out, boolean validate, DhtReader ctx)
    throws IOException {
  if (keyList == null)
    init();
  // Clear the recent chunks because all of the reader's
  // chunk limit should be made available for prefetch.
  int cacheLimit = ctx.getOptions().getChunkLimit();
  ctx.getRecentChunks().setMaxBytes(0);
  try {
    Prefetcher p = new Prefetcher(ctx, 0, cacheLimit);
    p.push(Arrays.asList(keyList));
    copyPack(out, p, validate);
  } finally {
    ctx.getRecentChunks().setMaxBytes(cacheLimit);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public Collection<CachedPack> getCachedPacks() throws IOException {
  if (cachedPacks == null) {
    Collection<CachedPackInfo> info;
    Collection<CachedPack> packs;
    try {
      info = db.repository().getCachedPacks(repo);
    } catch (TimeoutException e) {
      throw new DhtTimeoutException(e);
    }
    packs = new ArrayList<CachedPack>(info.size());
    for (CachedPackInfo i : info)
      packs.add(new DhtCachedPack(i));
    cachedPacks = packs;
  }
  return cachedPacks;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

throw new DhtException(MessageFormat.format(DhtText
    .get().wrongChunkPositionInCachedPack,
    rowKey(), base.getChunkKey(),
    "[not written]", key, Long.valueOf(exp)));
throw new DhtException(MessageFormat.format(DhtText
    .get().wrongChunkPositionInCachedPack,
    rowKey(), base.getChunkKey(),
    act, key, Long.valueOf(exp)));
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

void copyAsIs(PackOutputStream out, boolean validate, DhtReader ctx)
    throws IOException {
  if (keyList == null)
    init();
  // Clear the recent chunks because all of the reader's
  // chunk limit should be made available for prefetch.
  int cacheLimit = ctx.getOptions().getChunkLimit();
  ctx.getRecentChunks().setMaxBytes(0);
  try {
    Prefetcher p = new Prefetcher(ctx, 0, cacheLimit);
    p.push(Arrays.asList(keyList));
    copyPack(out, p, validate);
  } finally {
    ctx.getRecentChunks().setMaxBytes(cacheLimit);
  }
}
origin: com.madgag/org.eclipse.jgit.storage.dht

public Collection<CachedPack> getCachedPacks() throws IOException {
  if (cachedPacks == null) {
    Collection<CachedPackInfo> info;
    Collection<CachedPack> packs;
    try {
      info = db.repository().getCachedPacks(repo);
    } catch (TimeoutException e) {
      throw new DhtTimeoutException(e);
    }
    packs = new ArrayList<CachedPack>(info.size());
    for (CachedPackInfo i : info)
      packs.add(new DhtCachedPack(i));
    cachedPacks = packs;
  }
  return cachedPacks;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

throw new DhtException(MessageFormat.format(DhtText
    .get().wrongChunkPositionInCachedPack,
    rowKey(), base.getChunkKey(),
    "[not written]", key, Long.valueOf(exp)));
throw new DhtException(MessageFormat.format(DhtText
    .get().wrongChunkPositionInCachedPack,
    rowKey(), base.getChunkKey(),
    act, key, Long.valueOf(exp)));
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep) {
  DhtObjectRepresentation objrep = (DhtObjectRepresentation) rep;
  if (keySet == null)
    init();
  return keySet.contains(objrep.getChunkKey());
}
origin: com.madgag/org.eclipse.jgit.storage.dht

public void copyPackAsIs(PackOutputStream out, CachedPack pack,
    boolean validate) throws IOException {
  ((DhtCachedPack) pack).copyAsIs(out, validate, this);
}
org.eclipse.jgit.storage.dhtDhtCachedPack

Javadoc

A cached pack stored by the DHT.

Most used methods

  • <init>
  • copyAsIs
  • copyPack
  • init
  • rowKey

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getExternalFilesDir (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
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