zhztheplayer commented on code in PR #8143:
URL: https://github.com/apache/incubator-gluten/pull/8143#discussion_r1872796726
##########
gluten-arrow/src/main/java/org/apache/gluten/init/NativeBackendInitializer.java:
##########
@@ -17,22 +17,33 @@
package org.apache.gluten.init;
import org.apache.gluten.GlutenConfig;
-import org.apache.gluten.backend.Backend;
import org.apache.gluten.utils.ConfigUtil;
import org.apache.spark.util.SparkShutdownManagerUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import scala.runtime.BoxedUnit;
// Initialize native backend before calling any native methods from Java side.
public final class NativeBackendInitializer {
private static final Logger LOG =
LoggerFactory.getLogger(NativeBackendInitializer.class);
- private static final AtomicBoolean initialized = new AtomicBoolean(false);
+ private static final Map<String, NativeBackendInitializer> instances = new
ConcurrentHashMap<>();
Review Comment:
This change is not tended actually. It's just because the module
`gluten-arrow` can no longer get a precise backend name because it's decoupled
with `gluten-substrait` so it may see multiple backends loaded. There is
another option to move this class to `backends-velox` so no such change is
needed.
--
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]