Example usage for org.eclipse.jgit.internal.storage.dfs DfsPackDescription setObjectCount

List of usage examples for org.eclipse.jgit.internal.storage.dfs DfsPackDescription setObjectCount

Introduction

In this page you can find the example usage for org.eclipse.jgit.internal.storage.dfs DfsPackDescription setObjectCount.

Prototype

public DfsPackDescription setObjectCount(long cnt) 

Source Link

Document

Set number of objects in the pack.

Usage

From source file:com.benhumphreys.jgitcassandra.store.ObjStore.java

License:Apache License

/**
 * Converts a row to a DfsPackDescription
 *//*from w w  w.j  a  va  2  s .c  o m*/
private DfsPackDescription rowToPackDescription(Row row) {
    final String name = row.getString("name");
    final int source = row.getInt("source");
    final long lastModified = row.getLong("last_modified");
    final Map<String, Long> sizeMap = row.getMap("size_map", String.class, Long.class);
    final long objectCount = row.getLong("object_count");
    final long deltaCount = row.getLong("delta_count");
    final int extensions = row.getInt("extensions");
    final int indexVersion = row.getInt("index_version");

    DfsPackDescription desc = new DfsPackDescription(repoDesc, name);

    desc.setPackSource(DfsObjDatabase.PackSource.values()[source]);
    desc.setLastModified(lastModified);
    DescMapper.setFileSizeMap(desc, sizeMap);
    desc.setObjectCount(objectCount);
    desc.setDeltaCount(deltaCount);
    DescMapper.setExtsFromBits(desc, extensions);
    desc.setIndexVersion(indexVersion);

    return desc;
}