congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.eclipse.jgit.internal.storage.dfs
Code IndexAdd Tabnine to your IDE (free)

How to use org.eclipse.jgit.internal.storage.dfs

Best Java code snippets using org.eclipse.jgit.internal.storage.dfs (Showing top 20 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

void copyPackAsIs(PackOutputStream out, DfsReader ctx)
    throws IOException {
  // If the length hasn't been determined yet, pin to set it.
  if (length == -1) {
    ctx.pin(this, 0);
    ctx.unpin();
  }
  if (cache.shouldCopyThroughCache(length))
    copyPackThroughCache(out, ctx);
  else
    copyPackBypassCache(out, ctx);
}
origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
public BatchRefUpdate newBatchUpdate() {
  DfsObjDatabase odb = getRepository().getObjectDatabase();
  return new ReftableBatchRefUpdate(this, odb);
}
origin: org.eclipse.jgit/org.eclipse.jgit

private void flushBlock() throws IOException {
  out.write(currBuf, 0, currPtr);
  byte[] buf;
  if (currPtr == currBuf.length)
    buf = currBuf;
  else
    buf = copyOf(currBuf, 0, currPtr);
  cache.put(new DfsBlock(packKey, currPos, buf));
  currPos += currPtr;
  currPtr = 0;
  currBuf = null;
}
origin: org.eclipse.jgit/org.eclipse.jgit

private byte[] insertBuffer(long len) {
  byte[] buf = buffer();
  if (len <= buf.length)
    return buf;
  if (len < db.getReaderOptions().getStreamFileThreshold()) {
    try {
      return new byte[(int) len];
    } catch (OutOfMemoryError noMem) {
      return buf;
    }
  }
  return buf;
}
origin: org.eclipse.jgit/org.eclipse.jgit

private long beginObject(int type, long len) throws IOException {
  if (packOut == null)
    beginPack();
  long offset = packOut.getCount();
  packOut.beginObject(type, len);
  return offset;
}
origin: org.eclipse.jgit/org.eclipse.jgit

@Override
boolean exists() throws IOException {
  DfsObjDatabase odb = getRepository().getObjectDatabase();
  return odb.getReftables().length > 0;
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Initialize a new DfsReader
 *
 * @param db
 *            parent DfsObjDatabase.
 */
protected DfsReader(DfsObjDatabase db) {
  this.db = db;
  this.streamFileThreshold = db.getReaderOptions().getStreamFileThreshold();
}
origin: org.eclipse.jgit/org.eclipse.jgit

private int objectsBefore() {
  int cnt = 0;
  for (DfsPackFile p : packsBefore)
    cnt += p.getPackDescription().getObjectCount();
  return cnt;
}
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Initialize a DFS repository.
 *
 * @param builder
 *            description of the repository.
 */
protected DfsRepository(DfsRepositoryBuilder builder) {
  super(builder);
  this.config = new DfsConfig();
  this.description = builder.getRepositoryDescription();
}
origin: org.eclipse.jgit/org.eclipse.jgit

InMemoryRepository(Builder builder) {
  super(builder);
  objdb = new MemObjDatabase(this);
  refdb = new MemRefDatabase();
}
origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
public RefRename newRename(String fromName, String toName)
    throws IOException {
  RefUpdate src = newUpdate(fromName, true);
  RefUpdate dst = newUpdate(toName, true);
  return new DfsRefRename(src, dst);
}
origin: org.eclipse.jgit/org.eclipse.jgit

DfsBlock quickCopy(DfsPackFile p, long pos, long cnt)
    throws IOException {
  pin(p, pos);
  if (block.contains(p.key, pos + (cnt - 1)))
    return block;
  return null;
}
origin: org.eclipse.jgit/org.eclipse.jgit

private <T> T scan(HashEntry n, DfsStreamKey key, long position) {
  Ref<T> r = scanRef(n, key, position);
  return r != null ? r.get() : null;
}
origin: org.eclipse.jgit/org.eclipse.jgit

  private void writePackIndex() throws IOException {
    List<PackedObjectInfo> list = getSortedObjectList(null /* by ObjectId */);
    packIndex = objins.writePackIndex(packDsc, packHash, list);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

private boolean hasImpl(PackList packList, AnyObjectId objectId)
    throws IOException {
  for (DfsPackFile pack : packList.packs) {
    if (pack == last || skipGarbagePack(pack))
      continue;
    if (pack.hasObject(this, objectId)) {
      last = pack;
      return true;
    }
  }
  return false;
}
origin: org.eclipse.jgit/org.eclipse.jgit

@SuppressWarnings("unchecked")
private <T> Ref<T> scanRef(HashEntry n, DfsStreamKey key, long position) {
  for (; n != null; n = n.next) {
    Ref<T> r = n.ref;
    if (r.position == position && r.key.equals(key))
      return r.get() != null ? r : null;
  }
  return null;
}
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  public void flush() {
    memPack.put(ext, getData());
  }
};
origin: org.eclipse.jgit/org.eclipse.jgit

private void initOutDesc(DfsObjDatabase objdb) throws IOException {
  if (outDesc == null) {
    outDesc = objdb.newPack(COMPACT, estimatePackSize());
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

void pin(BlockBasedFile file, long position) throws IOException {
  if (block == null || !block.contains(file.key, position)) {
    // If memory is low, we may need what is in our window field to
    // be cleaned up by the GC during the get for the next window.
    // So we always clear it, even though we are just going to set
    // it again.
    block = null;
    block = file.getOrLoadBlock(position, this);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

@Override
public long size() throws IOException {
  long n = file.length;
  if (n < 0) {
    n = open().size();
    file.length = n;
  }
  return n;
}
org.eclipse.jgit.internal.storage.dfs

Most used classes

  • DfsRepositoryDescription
    A description of a Git repository on a DFS.
  • DfsGarbageCollector
    Repack and garbage collect a repository.
  • InMemoryRepository
    Git repository stored entirely in the local process memory. This implementation builds on the DFS re
  • DfsRepository
    A Git repository on a DFS.
  • BeforeDfsPackIndexLoadedEvent
    Describes the DfsPackFile just before its index is loaded. Currently, DfsPackFile directly dispatche
  • DeltaBaseCache$Entry,
  • DeltaBaseCache,
  • DfsBlock,
  • DfsBlockCache$HashEntry,
  • DfsBlockCache$Ref,
  • DfsBlockCache,
  • DfsBlockCacheConfig,
  • DfsCachedPack,
  • DfsConfig,
  • DfsInserter$PackStream,
  • DfsInserter$ReadBackStream,
  • DfsInserter$Reader,
  • DfsInserter$StreamLoader,
  • DfsInserter
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now