|
17 | 17 | package org.apache.gluten.config
|
18 | 18 |
|
19 | 19 | import org.apache.spark.internal.Logging
|
20 |
| -import org.apache.spark.network.util.{ByteUnit, JavaUtils} |
21 |
| -import org.apache.spark.sql.internal.{SQLConf, SQLConfProvider} |
| 20 | +import org.apache.spark.network.util.ByteUnit |
| 21 | +import org.apache.spark.sql.internal.{GlutenConfigUtil, SQLConf, SQLConfProvider} |
22 | 22 |
|
23 | 23 | import com.google.common.collect.ImmutableList
|
24 | 24 | import org.apache.hadoop.security.UserGroupInformation
|
@@ -447,7 +447,7 @@ object GlutenConfig {
|
447 | 447 | */
|
448 | 448 | def getNativeSessionConf(
|
449 | 449 | backendName: String,
|
450 |
| - conf: scala.collection.Map[String, String]): util.Map[String, String] = { |
| 450 | + conf: Map[String, String]): util.Map[String, String] = { |
451 | 451 | val nativeConfMap = new util.HashMap[String, String]()
|
452 | 452 | val keys = Set(
|
453 | 453 | DEBUG_ENABLED.key,
|
@@ -505,31 +505,17 @@ object GlutenConfig {
|
505 | 505 | (SPARK_SHUFFLE_SPILL_COMPRESS, SPARK_SHUFFLE_SPILL_COMPRESS_DEFAULT.toString)
|
506 | 506 | )
|
507 | 507 | keyWithDefault.forEach(e => nativeConfMap.put(e._1, conf.getOrElse(e._1, e._2)))
|
508 |
| - |
509 |
| - conf |
510 |
| - .get(SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE) |
511 |
| - .foreach( |
512 |
| - v => |
513 |
| - nativeConfMap |
514 |
| - .put( |
515 |
| - SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE, |
516 |
| - JavaUtils.byteStringAs(v, ByteUnit.BYTE).toString)) |
517 |
| - conf |
518 |
| - .get(SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE) |
519 |
| - .foreach( |
520 |
| - v => |
521 |
| - nativeConfMap |
522 |
| - .put( |
523 |
| - SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE, |
524 |
| - JavaUtils.byteStringAs(v, ByteUnit.BYTE).toString)) |
525 |
| - conf |
526 |
| - .get(SPARK_SHUFFLE_FILE_BUFFER) |
527 |
| - .foreach( |
528 |
| - v => |
529 |
| - nativeConfMap |
530 |
| - .put( |
531 |
| - SPARK_SHUFFLE_FILE_BUFFER, |
532 |
| - (JavaUtils.byteStringAs(v, ByteUnit.KiB) * 1024).toString)) |
| 508 | + GlutenConfigUtil.mapByteConfValue( |
| 509 | + conf, |
| 510 | + SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE, |
| 511 | + ByteUnit.BYTE)( |
| 512 | + v => nativeConfMap.put(SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE, v.toString)) |
| 513 | + GlutenConfigUtil.mapByteConfValue( |
| 514 | + conf, |
| 515 | + SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE, |
| 516 | + ByteUnit.BYTE)(v => nativeConfMap.put(SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE, v.toString)) |
| 517 | + GlutenConfigUtil.mapByteConfValue(conf, SPARK_SHUFFLE_FILE_BUFFER, ByteUnit.KiB)( |
| 518 | + v => nativeConfMap.put(SPARK_SHUFFLE_FILE_BUFFER, (v * 1024).toString)) |
533 | 519 |
|
534 | 520 | conf
|
535 | 521 | .get(LEGACY_TIME_PARSER_POLICY.key)
|
|
0 commit comments