public ZiplinesSearchResultSource(CDXFormat format) {
this.format = format;
}
public void init() throws IOException {
chunkMap = new HashMap<String, BlockLocation>();
FlatFile ff = new FlatFile(chunkMapPath);
CloseableIterator<String> lines = ff.getSequentialIterator();
while(lines.hasNext()) {
String line = lines.next();
String[] parts = line.split("\\s");
if(parts.length < 2) {
LOGGER.severe("Bad line(" + line +") in (" +
chunkMapPath + ")");
throw new IOException("Bad line(" + line +") in (" +
chunkMapPath + ")");
}
String locations[] = new String[parts.length - 1];
for(int i = 1; i < parts.length; i++) {
locations[i-1] = parts[i];
}
BlockLocation bl = new BlockLocation(parts[0], locations);
chunkMap.put(parts[0],bl);
}
lines.close();
chunkIndex = new FlatFile(chunkIndexPath);
}