public SchedulerxWorker schedulerxWorker()

in spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/SchedulerxConfigurations.java [73:147]


		public SchedulerxWorker schedulerxWorker() {
			SchedulerxWorker schedulerxWorker = new SchedulerxWorker();
			schedulerxWorker.setDomainName(properties.getDomainName());
			schedulerxWorker.setGroupId(properties.getGroupId());
			schedulerxWorker.setEnableBatchWork(properties.isEnableBatchWork());
			schedulerxWorker.setDisableSites(properties.getDisableSites());
			schedulerxWorker.setEnableSites(properties.getEnableSites());
			schedulerxWorker.setDisableUnits(properties.getDisableUnits());
			schedulerxWorker.setEnableUnits(properties.getEnableUnits());
			schedulerxWorker.setAppKey(properties.getAppKey());
			schedulerxWorker.setAliyunAccessKey(properties.getAliyunAccessKey());
			schedulerxWorker.setAliyunSecretKey(properties.getAliyunSecretKey());
			schedulerxWorker.setNamespace(properties.getNamespace());
			schedulerxWorker.setHost(properties.getHost());
			schedulerxWorker.setPort(properties.getPort());
			schedulerxWorker.setEndpoint(properties.getEndpoint());
			schedulerxWorker.setNamespaceSource(properties.getNamespaceSource());
			schedulerxWorker.setMaxTaskBodySize(properties.getMaxTaskBodySize());
			schedulerxWorker.setBlockAppStart(properties.isBlockAppStart());
			schedulerxWorker.setSTSAccessKey(properties.getStsAccessKey());
			schedulerxWorker.setSTSSecretKey(properties.getStsSecretKey());
			schedulerxWorker.setSTSSecretToken(properties.getStsToken());
			schedulerxWorker.setSlsCollectorEnable(properties.isSlsCollectorEnable());
			schedulerxWorker.setShareContainerPool(properties.isShareContainerPool());
			schedulerxWorker.setThreadPoolMode(properties.getThreadPoolMode());
			schedulerxWorker.setLabel(properties.getLabel());
			schedulerxWorker.setLabelPath(properties.getLabelPath());
			if (properties.isShareContainerPool() || WorkerConstants.THREAD_POOL_MODE_ALL.equals(properties.getThreadPoolMode())) {
				schedulerxWorker.setSharePoolSize(properties.getSharePoolSize());
				schedulerxWorker.setSharePoolQueueSize(properties.getSharePoolQueueSize());
			}
			if (StringUtils.isNotEmpty(properties.getEndpointPort())) {
				schedulerxWorker.setEndpointPort(Integer.parseInt(properties.getEndpointPort()));
			}
			schedulerxWorker.setEnableCgroupMetrics(properties.isEnableCgroupMetrics());
			if (properties.isEnableCgroupMetrics()) {
				schedulerxWorker.setCgroupPathPrefix(properties.getCgroupPathPrefix());
			}
			if (StringUtils.isNotEmpty(properties.getNamespaceSource())) {
				schedulerxWorker.setNamespaceSource(properties.getNamespaceSource());
			}
			schedulerxWorker.setAkkaRemotingAutoRecover(properties.isAkkaRemotingAutoRecover());
			schedulerxWorker.setEnableHeartbeatLog(properties.isEnableHeartbeatLog());
			schedulerxWorker.setMapMasterStatusCheckInterval(properties.getMapMasterStatusCheckInterval());
			schedulerxWorker.setEnableSecondDelayCycleIntervalMs(properties.isEnableSecondDelayCycleIntervalMs());
			schedulerxWorker.setEnableMapMasterFailover(properties.isEnableMapMasterFailover());
			schedulerxWorker.setEnableSecondDelayStandaloneDispatch(properties.isEnableSecondDelayStandaloneDispatch());
			schedulerxWorker.setPageSize(properties.getPageSize());
			schedulerxWorker.setGraceShutdownMode(properties.getGraceShutdownMode());
			if (properties.getGraceShutdownTimeout() > 0) {
				schedulerxWorker.setGraceShutdownTimeout(properties.getGraceShutdownTimeout());
			}
			schedulerxWorker.setBroadcastDispatchThreadNum(properties.getBroadcastDispatchThreadNum());
			schedulerxWorker.setBroadcastDispatchThreadEnable(properties.isBroadcastDispatchThreadEnable());
			schedulerxWorker.setBroadcastMasterExecEnable(properties.isBroadcastMasterExecEnable());
			schedulerxWorker.setBroadcastDispatchRetryTimes(properties.getBroadcastDispatchRetryTimes());
			schedulerxWorker.setProcessorPoolSize(properties.getProcessorPoolSize());
			schedulerxWorker.setMapMasterDispatchRandom(properties.isMapMasterDispatchRandom());
			schedulerxWorker.setMapMasterRouterStrategy(properties.getMapMasterRouterStrategy());
			if (StringUtils.isNotEmpty(properties.getH2DatabaseUser())) {
				schedulerxWorker.setH2DatabaseUser(properties.getH2DatabaseUser());
			}
			if (StringUtils.isNotEmpty(properties.getH2DatabasePassword())) {
				schedulerxWorker.setH2DatabasePassword(properties.getH2DatabasePassword());
			}
			schedulerxWorker.setHttpServerEnable(properties.getHttpServerEnable());
			schedulerxWorker.setHttpServerPort(properties.getHttpServerPort());
			if (properties.getMaxMapDiskPercent() != null) {
				schedulerxWorker.setMaxMapDiskPercent(properties.getMaxMapDiskPercent());
			}

			ConfigUtil.getWorkerConfig().setProperty(WorkerConstants.WORKER_STARTER_MODE,
					WORKER_STARTER_SPRING_CLOUD);
			return schedulerxWorker;
		}