LuciferYang commented on code in PR #38651:
URL: https://github.com/apache/spark/pull/38651#discussion_r1023747463


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsSnapshotsStoreImpl.scala:
##########
@@ -57,10 +60,22 @@ import org.apache.spark.util.ThreadUtils
  * The subscriber notification callback is guaranteed to be called from a 
single thread at a time.
  */
 private[spark] class ExecutorPodsSnapshotsStoreImpl(
+    conf: SparkConf,
     subscribersExecutor: ScheduledExecutorService,
     clock: Clock = new SystemClock)
   extends ExecutorPodsSnapshotsStore with Logging {
 
+  private[spark] def this(
+      subscribersExecutor: ScheduledExecutorService) = {
+    this(new SparkConf, subscribersExecutor, new SystemClock)
+  }
+
+  private[spark] def this(
+      subscribersExecutor: ScheduledExecutorService,
+      clock: Clock) = {
+    this(new SparkConf, subscribersExecutor, clock)
+  }

Review Comment:
   > I can not merge these two constructers into one,
   > 
   > ```
   >   private[spark] def this(
   >       subscribersExecutor: ScheduledExecutorService,
   >       clock: Clock = new SystemClock) = {
   >     this(new SparkConf, subscribersExecutor, clock)
   >   }
   > ```
   > 
   > it fails compilation
   > 
   > ```
   > [error] 
/Users/chengpan/Projects/apache-spark/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala:106:64:
 type mismatch;
   > [error]  found   : org.apache.spark.SparkConf
   > [error]  required: java.util.concurrent.ScheduledExecutorService
   > [error]     val snapshotsStore = new 
ExecutorPodsSnapshotsStoreImpl(sc.conf, subscribersExecutor)
   > [error]
   > ``
   > ```
   
   Need remove the default value of `SystemClock` from primary constructor if 
you want to merge them to one



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to