Codota Logo
Prefetcher.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.eclipse.jgit.storage.dht.Prefetcher
constructor

Best Java code snippets using org.eclipse.jgit.storage.dht.Prefetcher.<init> (Showing top 6 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: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private Prefetcher prefetch(final int type, final int ratio) {
  int limit = readerOptions.getChunkLimit();
  int prefetchLimit = (int) (limit * (ratio / 100.0));
  recentChunks.setMaxBytes(limit - prefetchLimit);
  return new Prefetcher(this, type, prefetchLimit);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

private Prefetcher prefetch(final int type, final int ratio) {
  int limit = readerOptions.getChunkLimit();
  int prefetchLimit = (int) (limit * (ratio / 100.0));
  recentChunks.setMaxBytes(limit - prefetchLimit);
  return new Prefetcher(this, type, prefetchLimit);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

  private void init() throws IOException {
    ObjectWithInfo<T> c;

    while ((c = nextObjectWithInfo()) != null) {
      ChunkKey chunkKey = c.chunkKey;
      Collection<ObjectWithInfo<T>> list = byChunk.get(chunkKey);
      if (list == null) {
        list = new ArrayList<ObjectWithInfo<T>>();
        byChunk.put(chunkKey, list);

        if (prefetcher == null) {
          int limit = reader.getOptions().getChunkLimit();
          int ratio = reader.getOptions().getOpenQueuePrefetchRatio();
          int prefetchLimit = (int) (limit * (ratio / 100.0));
          reader.getRecentChunks().setMaxBytes(limit - prefetchLimit);
          prefetcher = new Prefetcher(reader, 0, prefetchLimit);
        }
        prefetcher.push(chunkKey);
      }
      list.add(c);
    }

    chunkItr = byChunk.values().iterator();
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

  private void init() throws IOException {
    ObjectWithInfo<T> c;

    while ((c = nextObjectWithInfo()) != null) {
      ChunkKey chunkKey = c.chunkKey;
      Collection<ObjectWithInfo<T>> list = byChunk.get(chunkKey);
      if (list == null) {
        list = new ArrayList<ObjectWithInfo<T>>();
        byChunk.put(chunkKey, list);

        if (prefetcher == null) {
          int limit = reader.getOptions().getChunkLimit();
          int ratio = reader.getOptions().getOpenQueuePrefetchRatio();
          int prefetchLimit = (int) (limit * (ratio / 100.0));
          reader.getRecentChunks().setMaxBytes(limit - prefetchLimit);
          prefetcher = new Prefetcher(reader, 0, prefetchLimit);
        }
        prefetcher.push(chunkKey);
      }
      list.add(c);
    }

    chunkItr = byChunk.values().iterator();
  }
}
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

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);
  }
}
org.eclipse.jgit.storage.dhtPrefetcher<init>

Popular methods of Prefetcher

  • chunk
  • chunkIsReady
  • find
  • forceStartGet
  • get
  • isType
  • maybeStartGet
  • onError
  • onPartialResult
  • push
  • useReadyChunk
  • useReadyChunk

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
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