Codota Logo
DhtReader.getChunk
Code IndexAdd Codota to your IDE (free)

How to use
getChunk
method
in
org.eclipse.jgit.storage.dht.DhtReader

Best Java code snippets using org.eclipse.jgit.storage.dht.DhtReader.getChunk (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public ObjectStream openStream() throws MissingObjectException, IOException {
  PackChunk pc = firstChunk;
  if (pc != null)
    firstChunk = null;
  else
    pc = ctx.getChunk(ChunkKey.fromString(meta.getFragment(0)));
  InputStream in = new ChunkInputStream(meta, ctx, pos, pc);
  in = new BufferedInputStream(new InflaterInputStream(in), 8192);
  return new ObjectStream.Filter(type, sz, in);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public ObjectStream openStream() throws MissingObjectException, IOException {
  PackChunk pc = firstChunk;
  if (pc != null)
    firstChunk = null;
  else
    pc = ctx.getChunk(ChunkKey.fromString(meta.getFragment(0)));
  InputStream in = new ChunkInputStream(meta, ctx, pos, pc);
  in = new BufferedInputStream(new InflaterInputStream(in), 8192);
  return new ObjectStream.Filter(type, sz, in);
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public ObjectLoader open(AnyObjectId objId, int typeHint)
    throws MissingObjectException, IncorrectObjectTypeException,
    IOException {
  ObjectLoader ldr = recentChunks.open(repo, objId, typeHint);
  if (ldr != null)
    return ldr;
  ChunkAndOffset p = getChunk(objId, typeHint, false);
  ldr = PackChunk.read(p.chunk, p.offset, this, typeHint);
  recentChunk(p.chunk);
  return ldr;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public ObjectLoader open(AnyObjectId objId, int typeHint)
    throws MissingObjectException, IncorrectObjectTypeException,
    IOException {
  ObjectLoader ldr = recentChunks.open(repo, objId, typeHint);
  if (ldr != null)
    return ldr;
  ChunkAndOffset p = getChunk(objId, typeHint, false);
  ldr = PackChunk.read(p.chunk, p.offset, this, typeHint);
  recentChunk(p.chunk);
  return ldr;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public int read(byte[] dstbuf, int dstptr, int dstlen)
    throws IOException {
  if (0 == dstlen)
    return 0;
  int n = pc.read(ptr, dstbuf, dstptr, dstlen);
  if (n == 0) {
    if (fragment == meta.getFragmentCount())
      return -1;
    pc = ctx.getChunk(ChunkKey.fromString(
        meta.getFragment(++fragment)));
    ptr = 0;
    n = pc.read(ptr, dstbuf, dstptr, dstlen);
    if (n == 0)
      return -1;
  }
  ptr += n;
  return n;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public int read(byte[] dstbuf, int dstptr, int dstlen)
    throws IOException {
  if (0 == dstlen)
    return 0;
  int n = pc.read(ptr, dstbuf, dstptr, dstlen);
  if (n == 0) {
    if (fragment == meta.getFragmentCount())
      return -1;
    pc = ctx.getChunk(ChunkKey.fromString(
        meta.getFragment(++fragment)));
    ptr = 0;
    n = pc.read(ptr, dstbuf, dstptr, dstlen);
    if (n == 0)
      return -1;
  }
  ptr += n;
  return n;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

if (meta.getFragmentCount() <= nextChunk)
  break;
pc = reader.getChunk(ChunkKey.fromString(
    meta.getFragment(nextChunk++)));
if (meta.getFragmentCount() == nextChunk)
origin: com.madgag/org.eclipse.jgit.storage.dht

if (meta.getFragmentCount() <= nextChunk)
  break;
pc = reader.getChunk(ChunkKey.fromString(
    meta.getFragment(nextChunk++)));
if (meta.getFragmentCount() == nextChunk)
origin: com.madgag/org.eclipse.jgit.storage.dht

public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp,
    boolean validate) throws IOException,
    StoredObjectRepresentationNotAvailableException {
  DhtObjectToPack obj = (DhtObjectToPack) otp;
  try {
    PackChunk chunk = recentChunks.get(obj.chunk);
    if (chunk == null) {
      chunk = prefetcher.get(obj.chunk);
      if (chunk == null) {
        // This should never happen during packing, it implies
        // the fetch plan was incorrect. Unfortunately that can
        // occur if objects need to be recompressed on the fly.
        //
        stats.access(obj.chunk).cntCopyObjectAsIs_PrefetchMiss++;
        chunk = getChunk(obj.chunk);
      }
      if (!chunk.isFragment())
        recentChunk(chunk);
    }
    chunk.copyObjectAsIs(out, obj, validate, this);
  } catch (DhtMissingChunkException missingChunk) {
    stats.access(missingChunk.getChunkKey()).cntCopyObjectAsIs_InvalidChunk++;
    throw new StoredObjectRepresentationNotAvailableException(otp);
  }
}
origin: com.madgag/org.eclipse.jgit.storage.dht

int cnt = meta.getFragmentCount();
for (int fragId = 1; fragId < cnt; fragId++) {
  PackChunk pc = ctx.getChunk(ChunkKey.fromString(
      meta.getFragment(fragId)));
  pc.copyEntireChunkAsIs(out, obj, validate);
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

int cnt = meta.getFragmentCount();
for (int fragId = 1; fragId < cnt; fragId++) {
  PackChunk pc = ctx.getChunk(ChunkKey.fromString(
      meta.getFragment(fragId)));
  pc.copyEntireChunkAsIs(out, obj, validate);
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public void copyObjectAsIs(PackOutputStream out, ObjectToPack otp,
    boolean validate) throws IOException,
    StoredObjectRepresentationNotAvailableException {
  DhtObjectToPack obj = (DhtObjectToPack) otp;
  try {
    PackChunk chunk = recentChunks.get(obj.chunk);
    if (chunk == null) {
      chunk = prefetcher.get(obj.chunk);
      if (chunk == null) {
        // This should never happen during packing, it implies
        // the fetch plan was incorrect. Unfortunately that can
        // occur if objects need to be recompressed on the fly.
        //
        stats.access(obj.chunk).cntCopyObjectAsIs_PrefetchMiss++;
        chunk = getChunk(obj.chunk);
      }
      if (!chunk.isFragment())
        recentChunk(chunk);
    }
    chunk.copyObjectAsIs(out, obj, validate, this);
  } catch (DhtMissingChunkException missingChunk) {
    stats.access(missingChunk.getChunkKey()).cntCopyObjectAsIs_InvalidChunk++;
    throw new StoredObjectRepresentationNotAvailableException(otp);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

    pc = ctx.getChunk(baseChunkKey);
  pos = basePosInChunk;
  continue SEARCH;
  if (base < 0) {
    DhtReader.ChunkAndOffset n;
    n = ctx.getChunk(id, typeHint, recent);
    nc = n.chunk;
    base = n.offset;
  pc = ctx.getChunk(delta.deltaChunk);
pos = delta.deltaPos;
origin: com.madgag/org.eclipse.jgit.storage.dht

    pc = ctx.getChunk(baseChunkKey);
  pos = basePosInChunk;
  continue SEARCH;
  if (base < 0) {
    DhtReader.ChunkAndOffset n;
    n = ctx.getChunk(id, typeHint, recent);
    nc = n.chunk;
    base = n.offset;
  pc = ctx.getChunk(delta.deltaChunk);
pos = delta.deltaPos;
org.eclipse.jgit.storage.dhtDhtReadergetChunk

Popular methods of DhtReader

  • <init>
  • endPrefetch
  • find
  • findChunk
  • getChunkGently
  • getDatabase
  • getDeltaBaseCache
  • getInserterOptions
  • getOptions
  • getRecentChunks
  • getRecentInfoCache
  • getRepositoryKey
  • getRecentInfoCache,
  • getRepositoryKey,
  • getStatistics,
  • inflater,
  • load,
  • missing,
  • prefetch,
  • recentChunk

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • orElseThrow (Optional)
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
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