Skip to content

Commit

Permalink
[VL] Minor follow-ups for #6942 (#7129)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer authored Sep 6, 2024
1 parent d285b7a commit 7ffac75
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion backends-velox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<resources>
<resource>
<directory>${cpp.releases.dir}</directory>
<targetPath>org/apache/gluten/${platform}/${arch}</targetPath>
<targetPath>${platform}/${arch}</targetPath>
</resource>
<resource>
<directory>${resource.dir}</directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class VeloxListenerApi extends ListenerApi with Logging {
JniLibLoader.loadFromPath(libPath, false)
} else {
val baseLibName = conf.get(GlutenConfig.GLUTEN_LIB_NAME, "gluten")
loader.load(s"$baseLibPackage/${System.mapLibraryName(baseLibName)}", false)
loader.load(s"$baseLibPackage/${System.mapLibraryName(VeloxBackend.BACKEND_NAME)}", false)
loader.load(s"$platformLibDir/${System.mapLibraryName(baseLibName)}", false)
loader.load(s"$platformLibDir/${System.mapLibraryName(VeloxBackend.BACKEND_NAME)}", false)
}

// Initial native backend with configurations.
Expand All @@ -152,18 +152,6 @@ class VeloxListenerApi extends ListenerApi with Logging {
GlutenRowSplitter.setInstance(new VeloxRowSplitter())
}

private lazy val baseLibPackage: String = {
val osName = System.getProperty("os.name") match {
case n if n.contains("Linux") => "linux"
case n if n.contains("Mac") => "darwin"
case _ =>
// Default to linux
"linux"
}
val arch = System.getProperty("os.arch")
s"org/apache/gluten/$osName/$arch"
}

private def shutdown(): Unit = {
// TODO shutdown implementation in velox to release resources
}
Expand All @@ -174,6 +162,17 @@ object VeloxListenerApi {
// As spark conf may change when active Spark session is recreated.
private val driverInitialized: AtomicBoolean = new AtomicBoolean(false)
private val executorInitialized: AtomicBoolean = new AtomicBoolean(false)
private val platformLibDir: String = {
val osName = System.getProperty("os.name") match {
case n if n.contains("Linux") => "linux"
case n if n.contains("Mac") => "darwin"
case _ =>
// Default to linux
"linux"
}
val arch = System.getProperty("os.arch")
s"$osName/$arch"
}

private def inLocalMode(conf: SparkConf): Boolean = {
SparkResourceUtil.isLocalMaster(conf)
Expand Down
14 changes: 7 additions & 7 deletions package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<dependencies>
<dependency>
<groupId>org.apache.gluten</groupId>
<artifactId>gluten-delta</artifactId>
<artifactId>gluten-delta</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down Expand Up @@ -196,12 +196,12 @@
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/DEPENDENCIES</exclude>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
<exclude>LICENSE.txt</exclude>
<exclude>NOTICE.txt</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/DEPENDENCIES</exclude>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
<exclude>LICENSE.txt</exclude>
<exclude>NOTICE.txt</exclude>
</excludes>
</filter>
</filters>
Expand Down

0 comments on commit 7ffac75

Please sign in to comment.