}
PackReverseIndex getReverseIdx(DfsReader ctx) throws IOException {
DfsBlockCache.Ref<PackReverseIndex> revref = reverseIndex;
if (revref != null) {
PackReverseIndex revidx = revref.get();
if (revidx != null)
return revidx;
}
synchronized (initLock) {
revref = reverseIndex;
if (revref != null) {
PackReverseIndex revidx = revref.get();
if (revidx != null)
return revidx;
}
PackIndex idx = idx(ctx);
PackReverseIndex revidx = new PackReverseIndex(idx);
int sz = (int) Math.min(
idx.getObjectCount() * 8, Integer.MAX_VALUE);
reverseIndex = cache.put(key, POS_REVERSE_INDEX, sz, revidx);
return revidx;
}