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); }
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); }
public Builder mergeFrom(org.eclipse.jgit.generated.storage.dht.proto.GitStore.CachedPackInfo other) { if (other == org.eclipse.jgit.generated.storage.dht.proto.GitStore.CachedPackInfo.getDefaultInstance()) return this; if (other.hasName()) { setName(other.getName()); } if (other.hasVersion()) { setVersion(other.getVersion()); } if (other.hasObjectsTotal()) { setObjectsTotal(other.getObjectsTotal()); } if (other.hasObjectsDelta()) { setObjectsDelta(other.getObjectsDelta()); } if (other.hasBytesTotal()) { setBytesTotal(other.getBytesTotal()); } if (other.hasTipList()) { mergeTipList(other.getTipList()); } if (other.hasChunkList()) { mergeChunkList(other.getChunkList()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.eclipse.jgit.generated.storage.dht.proto.GitStore.CachedPackInfo other) { if (other == org.eclipse.jgit.generated.storage.dht.proto.GitStore.CachedPackInfo.getDefaultInstance()) return this; if (other.hasName()) { setName(other.getName()); } if (other.hasVersion()) { setVersion(other.getVersion()); } if (other.hasObjectsTotal()) { setObjectsTotal(other.getObjectsTotal()); } if (other.hasObjectsDelta()) { setObjectsDelta(other.getObjectsDelta()); } if (other.hasBytesTotal()) { setBytesTotal(other.getBytesTotal()); } if (other.hasTipList()) { mergeTipList(other.getTipList()); } if (other.hasChunkList()) { mergeChunkList(other.getChunkList()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }