cache: allow partial caches to load

This commit is contained in:
Max Weber
2020-12-01 14:42:33 -07:00
committed by Adam
parent 059edd77ca
commit d9b90e6c2d

View File

@@ -112,6 +112,11 @@ public class DiskStorage implements Storage
public byte[] readIndex(int indexId) throws IOException
{
IndexEntry entry = index255.read(indexId);
if (entry == null)
{
return null;
}
byte[] indexData = data.read(index255.getIndexFileId(), entry.getId(), entry.getSector(), entry.getLength());
return indexData;
}
@@ -121,6 +126,11 @@ public class DiskStorage implements Storage
logger.trace("Loading index {}", index.getId());
byte[] indexData = readIndex(index.getId());
if (indexData == null)
{
return;
}
Container res = Container.decompress(indexData, null);
byte[] data = res.data;