Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ public static DB initLevelDB(File dbFile, StoreVersion version, ObjectMapper map
}
}
// if there is a version mismatch, we throw an exception, which means the service is unusable
checkVersion(tmpDb, version, mapper);
try {
checkVersion(tmpDb, version, mapper);
} catch (IOException ioe) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static void checkVersion(DB db, StoreVersion newversion, ObjectMapper mapper) throws
IOException {

For LevelDB, it will only throw IOException.

tmpDb.close();
throw ioe;
}
}
return tmpDb;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ public static RocksDB initRockDB(File dbFile, StoreVersion version, ObjectMapper
// is unusable
checkVersion(tmpDb, version, mapper);
} catch (RocksDBException e) {
tmpDb.close();
throw new IOException(e.getMessage(), e);
} catch (IOException ioe) {
tmpDb.close();
throw ioe;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static void checkVersion(RocksDB db, StoreVersion newversion, ObjectMapper mapper) throws
IOException, RocksDBException {

For RocksDB, it may throw either RocksDBException or IOException

}
}
return tmpDb;
Expand Down