Skip to content

Commit f67d582

Browse files
committed
Remove some unused code
1 parent 4c5677a commit f67d582

2 files changed

Lines changed: 1 addition & 59 deletions

File tree

resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/KubernetesSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,5 +290,5 @@ private[spark] object KubernetesSuite {
290290
// val CONTAINER_LOCAL_DOWNLOADED_PAGE_RANK_DATA_FILE =
291291
// s"$CONTAINER_LOCAL_FILE_DOWNLOAD_PATH/pagerank_data.txt"
292292

293-
case object ShuffleNotReadyException extends Exception
293+
// case object ShuffleNotReadyException extends Exception
294294
}

resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/Utils.scala

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -27,62 +27,4 @@ object Utils extends Logging {
2727
val resource = createResource
2828
try f.apply(resource) finally resource.close()
2929
}
30-
31-
def tryWithSafeFinally[T](block: => T)(finallyBlock: => Unit): T = {
32-
var originalThrowable: Throwable = null
33-
try {
34-
block
35-
} catch {
36-
case t: Throwable =>
37-
// Purposefully not using NonFatal, because even fatal exceptions
38-
// we don't want to have our finallyBlock suppress
39-
originalThrowable = t
40-
throw originalThrowable
41-
} finally {
42-
try {
43-
finallyBlock
44-
} catch {
45-
case t: Throwable =>
46-
if (originalThrowable != null) {
47-
originalThrowable.addSuppressed(t)
48-
logWarning(s"Suppressing exception in finally: " + t.getMessage, t)
49-
throw originalThrowable
50-
} else {
51-
throw t
52-
}
53-
}
54-
}
55-
}
56-
57-
def checkAndGetK8sMasterUrl(rawMasterURL: String): String = {
58-
require(rawMasterURL.startsWith("k8s://"),
59-
"Kubernetes master URL must start with k8s://.")
60-
val masterWithoutK8sPrefix = rawMasterURL.substring("k8s://".length)
61-
62-
// To handle master URLs, e.g., k8s://host:port.
63-
if (!masterWithoutK8sPrefix.contains("://")) {
64-
val resolvedURL = s"https://$masterWithoutK8sPrefix"
65-
logInfo("No scheme specified for kubernetes master URL, so defaulting to https. Resolved " +
66-
s"URL is $resolvedURL.")
67-
return s"k8s://$resolvedURL"
68-
}
69-
70-
val masterScheme = new URI(masterWithoutK8sPrefix).getScheme
71-
val resolvedURL = masterScheme.toLowerCase match {
72-
case "https" =>
73-
masterWithoutK8sPrefix
74-
case "http" =>
75-
logWarning("Kubernetes master URL uses HTTP instead of HTTPS.")
76-
masterWithoutK8sPrefix
77-
case null =>
78-
val resolvedURL = s"https://$masterWithoutK8sPrefix"
79-
logInfo("No scheme specified for kubernetes master URL, so defaulting to https. Resolved " +
80-
s"URL is $resolvedURL.")
81-
resolvedURL
82-
case _ =>
83-
throw new IllegalArgumentException("Invalid Kubernetes master scheme: " + masterScheme)
84-
}
85-
86-
s"k8s://$resolvedURL"
87-
}
8830
}

0 commit comments

Comments
 (0)