Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package org.apache.spark.benchmark

import java.io.{File, FileOutputStream, OutputStream}

import org.apache.spark.internal.config.Tests.IS_TESTING

/**
* A base class for generate benchmark results to a file.
* For JDK9+, JDK major version number is added to the file names to distinguish the results.
Expand All @@ -42,6 +44,10 @@ abstract class BenchmarkBase {
}

def main(args: Array[String]): Unit = {
// turning this on so the behavior between running benchmark via `spark-submit` or SBT will
// be consistent, also allow users to turn on/off certain behavior such as
// `spark.sql.codegen.factoryMode`
System.setProperty(IS_TESTING.key, "true")
val regenerateBenchmarkFiles: Boolean = System.getenv("SPARK_GENERATE_BENCHMARK_FILES") == "1"
if (regenerateBenchmarkFiles) {
val version = System.getProperty("java.version").split("\\D+")(0).toInt
Expand Down