Tabnine Logo
org.eclipse.jgit.storage.dht
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.madgag/org.eclipse.jgit.storage.dht

int findOffset(RepositoryKey repo, AnyObjectId objId) {
  if (key.getRepositoryId() == repo.asInt() && index != null)
    return index.findOffset(objId);
  return -1;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
public void walkAdviceBeginCommits(RevWalk rw, Collection<RevCommit> roots)
    throws IOException {
  endPrefetch();
  // Don't assign the prefetcher right away. Delay until its
  // configured as push might invoke our own methods that may
  // try to call back into the active prefetcher.
  //
  Prefetcher p = prefetch(OBJ_COMMIT, readerOptions.getWalkCommitsPrefetchRatio());
  p.push(this, roots);
  prefetcher = p;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

PackChunk getChunk(ChunkKey key) throws DhtException {
  PackChunk chunk = recentChunks.get(key);
  if (chunk != null)
    return chunk;
  chunk = load(key);
  if (chunk != null)
    return chunk;
  throw new DhtMissingChunkException(key);
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

DhtReader(DhtObjDatabase objdb) {
  this.repository = objdb.getRepository();
  this.repo = objdb.getRepository().getRepositoryKey();
  this.db = objdb.getDatabase();
  this.readerOptions = objdb.getReaderOptions();
  this.inserterOptions = objdb.getInserterOptions();
  this.stats = new Statistics();
  this.recentInfo = new RecentInfoCache(getOptions());
  this.recentChunks = new RecentChunks(this);
  this.deltaBaseCache = new DeltaBaseCache(this);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkKey findChunk(AnyObjectId objId) throws DhtException {
  if (objId instanceof RefDataUtil.IdWithChunk)
    return ((RefDataUtil.IdWithChunk) objId).getChunkKey();
  ChunkKey key = repository.getRefDatabase().findChunk(objId);
  if (key != null)
    return key;
  ChunkAndOffset r = recentChunks.find(repo, objId);
  if (r != null)
    return r.chunk.getChunkKey();
  for (ObjectInfo link : find(objId))
    return link.getChunkKey();
  return 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

@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

private ChunkFormatter openChunk(int typeCode) throws DhtException {
  if (typeCode == 0)
    throw new DhtException("Invalid internal typeCode 0");
  ChunkFormatter w = openChunks[typeCode];
  if (w == null) {
    w = new ChunkFormatter(repo, options);
    w.setSource(GitStore.ChunkInfo.Source.RECEIVE);
    w.setObjectType(typeCode);
    openChunks[typeCode] = w;
  }
  return w;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

DeltaBaseCache(DhtReader reader) {
  stats = reader.getStatistics();
  DhtReaderOptions options = reader.getOptions();
  maxByteCount = options.getDeltaBaseCacheLimit();
  table = new Slot[options.getDeltaBaseCacheSize()];
}
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: org.eclipse.jgit/org.eclipse.jgit.storage.dht

@Override
protected void onEndWholeObject(PackedObjectInfo info) throws IOException {
  boolean fragmented = currFragments != null;
  endOneObject();
  DhtInfo oe = (DhtInfo) info;
  oe.chunkPtr = currChunkPtr;
  oe.packedSize = currPackedSize;
  oe.inflatedSize = currInflatedSize;
  oe.setType(currType);
  if (fragmented)
    oe.setFragmented();
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

/**
 * @param repo
 * @param name
 * @return the key
 */
public static RefKey create(RepositoryKey repo, String name) {
  return new RefKey(repo.asInt(), name);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

/**
 * @param repo
 * @param chunk
 * @return the key
 */
public static ChunkKey create(RepositoryKey repo, ObjectId chunk) {
  return new ChunkKey(repo.asInt(), chunk);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
@SuppressWarnings("unchecked")
public R build() throws IllegalArgumentException, DhtException,
    RepositoryNotFoundException {
  return (R) new DhtRepository(setup());
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

boolean has(RepositoryKey repo, AnyObjectId objId) {
  for (Node n = lruHead; n != null; n = n.next) {
    int pos = n.chunk.findOffset(repo, objId);
    if (0 <= pos) {
      hit(n);
      stats.recentChunks_Hits++;
      return true;
    }
  }
  return false;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public byte[] asBytes() {
  byte[] r = new byte[8];
  format32(r, 0, asInt());
  return r;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

DhtReader(DhtObjDatabase objdb) {
  this.repository = objdb.getRepository();
  this.repo = objdb.getRepository().getRepositoryKey();
  this.db = objdb.getDatabase();
  this.readerOptions = objdb.getReaderOptions();
  this.inserterOptions = objdb.getInserterOptions();
  this.stats = new Statistics();
  this.recentInfo = new RecentInfoCache(getOptions());
  this.recentChunks = new RecentChunks(this);
  this.deltaBaseCache = new DeltaBaseCache(this);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

@Override
public void walkAdviceBeginCommits(RevWalk rw, Collection<RevCommit> roots)
    throws IOException {
  endPrefetch();
  // Don't assign the prefetcher right away. Delay until its
  // configured as push might invoke our own methods that may
  // try to call back into the active prefetcher.
  //
  Prefetcher p = prefetch(OBJ_COMMIT, readerOptions.getWalkCommitsPrefetchRatio());
  p.push(this, roots);
  prefetcher = p;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

int findOffset(RepositoryKey repo, AnyObjectId objId) {
  if (key.getRepositoryId() == repo.asInt() && index != null)
    return index.findOffset(objId);
  return -1;
}
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);
}
org.eclipse.jgit.storage.dht

Most used classes

  • AsyncCallback
    Receives notification when an asynchronous operation has finished. Many storage provider interface o
  • BatchObjectLookup
  • CachedPackKey
    Unique identifier of a CachedPackInfo in the DHT.
  • ChunkFormatter$BaseChunkInfo
  • ChunkFormatter$StoredObject
  • ChunkIndex$Offset1,
  • ChunkIndex$Offset2,
  • ChunkIndex$Offset3,
  • ChunkIndex$Offset4,
  • ChunkIndex,
  • ChunkInfo,
  • ChunkKey,
  • ChunkMetaUtil,
  • DeltaBaseCache$Entry,
  • DeltaBaseCache$Slot,
  • DeltaBaseCache,
  • DhtCachedPack,
  • DhtConfig,
  • DhtException$TODO
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