Skip to content

Commit 10e0237

Browse files
committed
address comment
1 parent 10d1a97 commit 10e0237

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

core/src/main/scala/org/apache/spark/internal/config/Tests.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
package org.apache.spark.internal.config
1919

2020
private[spark] object Tests {
21+
22+
val TEST_USE_COMPRESSED_OOPS_KEY = "spark.test.useCompressedOops"
23+
2124
val TEST_MEMORY = ConfigBuilder("spark.testing.memory")
2225
.longConf
2326
.createWithDefault(Runtime.getRuntime.maxMemory)
@@ -31,10 +34,6 @@ private[spark] object Tests {
3134
.booleanConf
3235
.createOptional
3336

34-
val TEST_USE_COMPRESSED_OOPS = ConfigBuilder("spark.test.useCompressedOops")
35-
.booleanConf
36-
.createOptional
37-
3837
val TEST_NO_STAGE_RETRY = ConfigBuilder("spark.test.noStageRetry")
3938
.booleanConf
4039
.createWithDefault(false)

core/src/main/scala/org/apache/spark/util/SizeEstimator.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import com.google.common.collect.MapMaker
2828

2929
import org.apache.spark.annotation.DeveloperApi
3030
import org.apache.spark.internal.Logging
31-
import org.apache.spark.internal.config.Tests.TEST_USE_COMPRESSED_OOPS
31+
import org.apache.spark.internal.config.Tests.TEST_USE_COMPRESSED_OOPS_KEY
3232
import org.apache.spark.util.collection.OpenHashSet
3333

3434
/**
@@ -127,8 +127,8 @@ object SizeEstimator extends Logging {
127127
private def getIsCompressedOops: Boolean = {
128128
// This is only used by tests to override the detection of compressed oops. The test
129129
// actually uses a system property instead of a SparkConf, so we'll stick with that.
130-
if (System.getProperty(TEST_USE_COMPRESSED_OOPS.key) != null) {
131-
return System.getProperty(TEST_USE_COMPRESSED_OOPS.key).toBoolean
130+
if (System.getProperty(TEST_USE_COMPRESSED_OOPS_KEY) != null) {
131+
return System.getProperty(TEST_USE_COMPRESSED_OOPS_KEY).toBoolean
132132
}
133133

134134
// java.vm.info provides compressed ref info for IBM JDKs

core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE
120120
.set("spark.memory.fraction", "1")
121121
.set("spark.memory.storageFraction", "1")
122122
.set("spark.kryoserializer.buffer", "1m")
123-
.set(TEST_USE_COMPRESSED_OOPS, true)
124123
.set("spark.storage.unrollFraction", "0.4")
125124
.set("spark.storage.unrollMemoryThreshold", "512")
126125

core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class MemoryStoreSuite
4040
with ResetSystemProperties {
4141

4242
var conf: SparkConf = new SparkConf(false)
43-
.set(TEST_USE_COMPRESSED_OOPS, true)
4443
.set("spark.storage.unrollFraction", "0.4")
4544
.set("spark.storage.unrollMemoryThreshold", "512")
4645

core/src/test/scala/org/apache/spark/util/SizeEstimatorSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import scala.collection.mutable.ArrayBuffer
2222
import org.scalatest.{BeforeAndAfterEach, PrivateMethodTester}
2323

2424
import org.apache.spark.SparkFunSuite
25-
import org.apache.spark.internal.config.Tests.TEST_USE_COMPRESSED_OOPS
25+
import org.apache.spark.internal.config.Tests.TEST_USE_COMPRESSED_OOPS_KEY
2626

2727
class DummyClass1 {}
2828

@@ -77,7 +77,7 @@ class SizeEstimatorSuite
7777
// Set the arch to 64-bit and compressedOops to true to get a deterministic test-case
7878
super.beforeEach()
7979
System.setProperty("os.arch", "amd64")
80-
System.setProperty(TEST_USE_COMPRESSED_OOPS.key, "true")
80+
System.setProperty(TEST_USE_COMPRESSED_OOPS_KEY, "true")
8181
}
8282

8383
override def afterEach(): Unit = {
@@ -193,7 +193,7 @@ class SizeEstimatorSuite
193193
// (Sun vs IBM). Use a DummyString class to make tests deterministic.
194194
test("64-bit arch with no compressed oops") {
195195
System.setProperty("os.arch", "amd64")
196-
System.setProperty(TEST_USE_COMPRESSED_OOPS.key, "false")
196+
System.setProperty(TEST_USE_COMPRESSED_OOPS_KEY, "false")
197197
val initialize = PrivateMethod[Unit]('initialize)
198198
SizeEstimator invokePrivate initialize()
199199

0 commit comments

Comments
 (0)