LuciferYang commented on code in PR #38220:
URL: https://github.com/apache/spark/pull/38220#discussion_r993173731
##########
common/network-common/src/main/java/org/apache/spark/network/util/DBProvider.java:
##########
@@ -57,8 +64,29 @@ public static DB initDB(DBBackend dbBackend, File file)
throws IOException {
case ROCKSDB: return new RocksDB(RocksDBProvider.initRocksDB(file));
default:
throw new IllegalArgumentException("Unsupported DBBackend: " +
dbBackend);
+ }
+ }
+ return null;
+ }
+
+ public static void migrate(
+ DBBackend fromDbBackend,
+ File fromFile,
+ DBBackend toDbBackend,
+ File toFile,
+ StoreVersion version,
+ ObjectMapper mapper) throws IOException {
+ LOGGER.warn("Migrate DBBackend from {}({}) to {}({})",
+ fromDbBackend.name(), fromFile.getCanonicalPath(),
+ toDbBackend.name(), toFile.getCanonicalPath());
+ DB fromDb = initDB(fromDbBackend, fromFile, version, mapper);
Review Comment:
Should close the `fromDb` and `toDb` after used
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]