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

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

Best Java code snippets using org.eclipse.jgit.storage.dht.RecentChunks.setMaxBytes (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: 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 endPrefetch() {
  recentChunks.setMaxBytes(getOptions().getChunkLimit());
  prefetcher = null;
}
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: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private void endPrefetch() {
  recentChunks.setMaxBytes(getOptions().getChunkLimit());
  prefetcher = null;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public void release() {
  reader.getRecentChunks().setMaxBytes(reader.getOptions().getChunkLimit());
  prefetcher = null;
  currChunk = null;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public void release() {
  reader.getRecentChunks().setMaxBytes(reader.getOptions().getChunkLimit());
  prefetcher = null;
  currChunk = null;
}
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: 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

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.dhtRecentChunkssetMaxBytes

Popular methods of RecentChunks

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

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