[jvm-packages] clean up example (#10618)

This commit is contained in:
Bobby Wang
2024-07-23 12:15:51 +08:00
committed by GitHub
parent 485d90218c
commit 003b418312
15 changed files with 58 additions and 52 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (c) 2014-2023 by Contributors
Copyright (c) 2014-2024 by Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,12 +15,13 @@
*/
package ml.dmlc.xgboost4j.java.example.flink
import java.nio.file.Paths
import org.apache.flink.api.java.ExecutionEnvironment
import org.scalatest.Inspectors._
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers._
import java.nio.file.Paths
class DistTrainWithFlinkExampleTest extends AnyFunSuite {
private val parentPath = Paths.get("../../").resolve("demo").resolve("data")

View File

@@ -15,14 +15,15 @@
*/
package ml.dmlc.xgboost4j.scala.example.flink
import java.nio.file.Paths
import scala.jdk.CollectionConverters._
import org.apache.flink.api.java.ExecutionEnvironment
import org.scalatest.Inspectors._
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers._
import java.nio.file.Paths
import scala.jdk.CollectionConverters._
class DistTrainWithFlinkSuite extends AnyFunSuite {
private val parentPath = Paths.get("../../").resolve("demo").resolve("data")
private val data = parentPath.resolve("veterans_lung_cancer.csv")

View File

@@ -1,5 +1,5 @@
/*
Copyright (c) 2014-2023 by Contributors
Copyright (c) 2014-2024 by Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,16 +15,18 @@
*/
package ml.dmlc.xgboost4j.scala.example.spark
import java.io.File
import java.nio.file.{Files, StandardOpenOption}
import scala.jdk.CollectionConverters._
import scala.util.{Random, Try}
import org.apache.spark.sql.SparkSession
import org.scalatest.BeforeAndAfterAll
import org.scalatest.funsuite.AnyFunSuite
import org.slf4j.LoggerFactory
import java.io.File
import java.nio.file.{Files, StandardOpenOption}
import scala.jdk.CollectionConverters._
import scala.util.{Random, Try}
class SparkExamplesTest extends AnyFunSuite with BeforeAndAfterAll {
private val logger = LoggerFactory.getLogger(classOf[SparkExamplesTest])
private val random = new Random(42)
@@ -53,7 +55,7 @@ class SparkExamplesTest extends AnyFunSuite with BeforeAndAfterAll {
}
if (spark == null) {
spark = SparkSession
spark = SparkSession
.builder()
.appName("XGBoost4J-Spark Pipeline Example")
.master(s"local[${numWorkers}]")
@@ -92,7 +94,7 @@ class SparkExamplesTest extends AnyFunSuite with BeforeAndAfterAll {
e
)
true
}
}
}
private def cleanExternalCache(prefix: String): Unit = {