in spark-operator/src/main/java/org/apache/spark/k8s/operator/SparkOperator.java [79:103]
public SparkOperator() {
this.metricsSystem = MetricsSystemFactory.createMetricsSystem();
this.client =
KubernetesClientFactory.buildKubernetesClient(getClientInterceptors(metricsSystem));
this.appSubmissionWorker = new SparkAppSubmissionWorker();
this.clusterSubmissionWorker = new SparkClusterSubmissionWorker();
this.sparkAppStatusRecorder = new SparkAppStatusRecorder(getAppStatusListener());
this.sparkClusterStatusRecorder = new SparkClusterStatusRecorder(getClusterStatusListener());
this.registeredSparkControllers = new HashSet<>();
this.watchedNamespaces = getWatchedNamespaces();
this.sparkApplicationSentinelManager = new SentinelManager<>();
this.sparkClusterSentinelManager = new SentinelManager<>();
this.registeredOperators = new ArrayList<>();
this.registeredOperators.add(registerSparkOperator());
if (SparkOperatorConf.DYNAMIC_CONFIG_ENABLED.getValue()) {
this.registeredOperators.add(registerSparkOperatorConfMonitor());
}
this.metricsResourcesSingleThreadPool = Executors.newSingleThreadExecutor();
this.probeService =
new ProbeService(
registeredOperators,
Arrays.asList(sparkApplicationSentinelManager, sparkClusterSentinelManager),
null);
this.metricsService = new MetricsService(metricsSystem, metricsResourcesSingleThreadPool);
}