*/
private void read(ActionCollector collector) throws IOException {
if (!dir.fileExists(REDO_LOG)) {
return;
}
InputStream in = new IndexInputStream(dir.openInput(REDO_LOG));
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line;
while ((line = reader.readLine()) != null) {
try {
collector.collect(MultiIndex.Action.fromString(line));
} catch (IllegalArgumentException e) {
log.warn("Malformed redo entry: " + e.getMessage());
}
}
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
log.warn("Exception while closing redo log: " + e.toString());
}
}
}