Codota Logo
ChunkInfo
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

public void put(RepositoryKey repo, ChunkInfo info, WriteBuffer buffer)
    throws DhtException {
  table.put(repo.asBytes(),
      colChunkInfo.append(info.getChunkKey().asBytes()),
      info.getData().toByteArray());
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkInfo oldInfo = infoByKey.get(key);
GitStore.ChunkInfo.Builder info
  = GitStore.ChunkInfo.newBuilder(oldInfo.getData());
ChunkInfo newInfo = new ChunkInfo(key, info.build());
infoByKey.put(key, newInfo);
db.repository().put(repo, newInfo, dbWriteBuffer);
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ChunkKey getChunkKey() {
  return getChunkInfo().getChunkKey();
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

chunkInfo = new ChunkInfo(key, info.build());
return getChunkKey();
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ChunkInfo oldInfo = infoByKey.get(key);
GitStore.ChunkInfo.Builder info
  = GitStore.ChunkInfo.newBuilder(oldInfo.getData());
ChunkInfo newInfo = new ChunkInfo(key, info.build());
infoByKey.put(key, newInfo);
db.repository().put(repo, newInfo, dbWriteBuffer);
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkKey getChunkKey() {
  return getChunkInfo().getChunkKey();
}
origin: com.madgag/org.eclipse.jgit.storage.dht

chunkInfo = new ChunkInfo(key, info.build());
return getChunkKey();
origin: com.madgag/org.eclipse.jgit.storage.dht

public void put(RepositoryKey repo, ChunkInfo info, WriteBuffer buffer)
    throws DhtException {
  table.put(repo.asBytes(),
      colChunkInfo.append(info.getChunkKey().asBytes()),
      info.getData().toByteArray());
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

ChunkInfo oldInfo = infoByKey.get(key);
GitStore.ChunkInfo.Builder b =
  GitStore.ChunkInfo.newBuilder(oldInfo.getData());
b.setCachedPackKey(cachedPackKey.asString());
ChunkInfo newInfo = new ChunkInfo(key, b.build());
infoByKey.put(key, newInfo);
if (newInfo.getData().getIsFragment())
  db.repository().put(repo, newInfo, dbWriteBuffer);
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private boolean longOfsDelta(ChunkFormatter w, long infSize, long basePtr) {
  final int type = typeOf(basePtr);
  final List<ChunkKey> infoList = chunkByOrder[type];
  final int baseIdx = chunkIdx(basePtr);
  final ChunkInfo baseInfo = infoByKey.get(infoList.get(baseIdx));
  // Go backwards to the start of the base's chunk.
  long relativeChunkStart = 0;
  for (int i = infoList.size() - 1; baseIdx <= i; i--) {
    GitStore.ChunkInfo info = infoByKey.get(infoList.get(i)).getData();
    int packSize = info.getChunkSize() - ChunkFormatter.TRAILER_SIZE;
    relativeChunkStart += packSize;
  }
  // Offset to the base goes back to start of our chunk, then start of
  // the base chunk, but slide forward the distance of the base within
  // its own chunk.
  //
  long ofs = w.position() + relativeChunkStart - offsetOf(basePtr);
  if (w.ofsDelta(infSize, ofs)) {
    w.useBaseChunk(relativeChunkStart, baseInfo.getChunkKey());
    return true;
  }
  return false;
}
origin: com.madgag/org.eclipse.jgit.storage.dht

ChunkInfo oldInfo = infoByKey.get(key);
GitStore.ChunkInfo.Builder b =
  GitStore.ChunkInfo.newBuilder(oldInfo.getData());
b.setCachedPackKey(cachedPackKey.asString());
ChunkInfo newInfo = new ChunkInfo(key, b.build());
infoByKey.put(key, newInfo);
if (newInfo.getData().getIsFragment())
  db.repository().put(repo, newInfo, dbWriteBuffer);
origin: com.madgag/org.eclipse.jgit.storage.dht

private boolean longOfsDelta(ChunkFormatter w, long infSize, long basePtr) {
  final int type = typeOf(basePtr);
  final List<ChunkKey> infoList = chunkByOrder[type];
  final int baseIdx = chunkIdx(basePtr);
  final ChunkInfo baseInfo = infoByKey.get(infoList.get(baseIdx));
  // Go backwards to the start of the base's chunk.
  long relativeChunkStart = 0;
  for (int i = infoList.size() - 1; baseIdx <= i; i--) {
    GitStore.ChunkInfo info = infoByKey.get(infoList.get(i)).getData();
    int packSize = info.getChunkSize() - ChunkFormatter.TRAILER_SIZE;
    relativeChunkStart += packSize;
  }
  // Offset to the base goes back to start of our chunk, then start of
  // the base chunk, but slide forward the distance of the base within
  // its own chunk.
  //
  long ofs = w.position() + relativeChunkStart - offsetOf(basePtr);
  if (w.ofsDelta(infSize, ofs)) {
    w.useBaseChunk(relativeChunkStart, baseInfo.getChunkKey());
    return true;
  }
  return false;
}
origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

private void addChunkList(CachedPackInfo.Builder info,
    MessageDigest version, List<ChunkKey> list) {
  if (list == null)
    return;
  long bytesTotal = info.getBytesTotal();
  long objectsTotal = info.getObjectsTotal();
  long objectsDelta = info.getObjectsDelta();
  byte[] buf = new byte[Constants.OBJECT_ID_LENGTH];
  for (ChunkKey key : list) {
    ChunkInfo chunkInfo = infoByKey.get(key);
    GitStore.ChunkInfo c = chunkInfo.getData();
    int len = c.getChunkSize() - ChunkFormatter.TRAILER_SIZE;
    bytesTotal += len;
    objectsTotal += c.getObjectCounts().getTotal();
    objectsDelta += c.getObjectCounts().getOfsDelta();
    objectsDelta += c.getObjectCounts().getRefDelta();
    info.getChunkListBuilder().addChunkKey(
        chunkInfo.getChunkKey().asString());
    chunkInfo.getChunkKey().getChunkHash().copyRawTo(buf, 0);
    version.update(buf);
  }
  info.setBytesTotal(bytesTotal);
  info.setObjectsTotal(objectsTotal);
  info.setObjectsDelta(objectsDelta);
}
origin: com.madgag/org.eclipse.jgit.storage.dht

private void addChunkList(CachedPackInfo.Builder info,
    MessageDigest version, List<ChunkKey> list) {
  if (list == null)
    return;
  long bytesTotal = info.getBytesTotal();
  long objectsTotal = info.getObjectsTotal();
  long objectsDelta = info.getObjectsDelta();
  byte[] buf = new byte[Constants.OBJECT_ID_LENGTH];
  for (ChunkKey key : list) {
    ChunkInfo chunkInfo = infoByKey.get(key);
    GitStore.ChunkInfo c = chunkInfo.getData();
    int len = c.getChunkSize() - ChunkFormatter.TRAILER_SIZE;
    bytesTotal += len;
    objectsTotal += c.getObjectCounts().getTotal();
    objectsDelta += c.getObjectCounts().getOfsDelta();
    objectsDelta += c.getObjectCounts().getRefDelta();
    info.getChunkListBuilder().addChunkKey(
        chunkInfo.getChunkKey().asString());
    chunkInfo.getChunkKey().getChunkHash().copyRawTo(buf, 0);
    version.update(buf);
  }
  info.setBytesTotal(bytesTotal);
  info.setObjectsTotal(objectsTotal);
  info.setObjectsDelta(objectsDelta);
}
org.eclipse.jgit.storage.dhtChunkInfo

Javadoc

Summary information about a chunk owned by a repository.

Most used methods

  • <init>
    Wrap a ChunkInfo message.
  • getChunkKey
  • getData

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • startActivity (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Kernel (java.awt.image)
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Notification (javax.management)
  • BoxLayout (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