Class IndexLoader
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.file.tar.index.IndexLoader
-
public class IndexLoader extends Object
Load and validate the index of a TAR file.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Index
loadIndex(ReaderAtEnd reader)
Load and validate the index.static IndexLoader
newIndexLoader(int blockSize)
Create a newIndexLoader
for the specified block size.
-
-
-
Method Detail
-
newIndexLoader
public static IndexLoader newIndexLoader(int blockSize)
Create a newIndexLoader
for the specified block size. The block size is used to validate different data items in the index.- Parameters:
blockSize
- The block size. It must be strictly positive.- Returns:
- An instance of
IndexLoader
.
-
loadIndex
public Index loadIndex(ReaderAtEnd reader) throws IOException, InvalidIndexException
Load and validate the index. The index is loaded by looking backwards at a TAR file. This method relies on an instance ofReaderAtEnd
which is positioned at the end of the index in the TAR file.- Parameters:
reader
- an instance ofReaderAtEnd
.- Returns:
- An instance of
Index
. - Throws:
IOException
- If an I/O error occurs while reading the index.InvalidIndexException
- If a validation error occurs while checking the index.
-
-