mridulm commented on code in PR #36200:
URL: https://github.com/apache/spark/pull/36200#discussion_r956250795
##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockResolver.java:
##########
@@ -124,7 +125,15 @@ public ShuffleIndexInformation load(String filePath)
throws IOException {
.weigher((Weigher<String, ShuffleIndexInformation>)
(filePath, indexInfo) -> indexInfo.getRetainedMemorySize())
.build(indexCacheLoader);
- db = LevelDBProvider.initLevelDB(this.registeredExecutorFile,
CURRENT_VERSION, mapper);
+ DBBackend dbBackend = null;
+ if (registeredExecutorFile != null) {
+ String dbBackendName =
+ conf.get(Constants.SHUFFLE_SERVICE_DB_BACKEND,
DBBackend.LEVELDB.name());
+ dbBackend = DBBackend.byName(dbBackendName);
+ logger.info("Configured {} as {} and actually used value {}",
+ Constants.SHUFFLE_SERVICE_DB_BACKEND, dbBackendName, dbBackend);
+ }
+ db = DBProvider.initDB(dbBackend, this.registeredExecutorFile,
CURRENT_VERSION, mapper);
Review Comment:
`DBProvider.initDB` handles `null` `registeredExecutorFile` as input.
Given `db` is a `final` variable, it is better to update it at a single
place, and not across `if/else`
--
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]