private void ensurePoolOpen()

in adb3client/src/main/java/com/alibaba/cloud/analyticdb/adb3client/AdbClient.java [146:179]


	private void ensurePoolOpen() throws AdbClientException {
		if (pool == null) {
			synchronized (this) {
				if (pool == null) {
					ExecutionPool temp = new ExecutionPool("embedded-" + config.getAppName(), config, false);
					// 当useFixedFe为true 则不赋值新的collector,调用这个函数仅仅为了把pool标记为started.
					ActionCollector tempCollector = temp.register(this, config);
					if (!this.useFixedFe) {
						collector = tempCollector;
					}
					pool = temp;
					isEmbeddedPool = true;
				}
			}
		}
		if (!pool.isRunning()) {
			throw new AdbClientException(ExceptionCode.ALREADY_CLOSE,
					"already close at " + pool.getCloseReasonStack().l, pool.getCloseReasonStack().r);
		}
		if (useFixedFe && fixedPool == null) {
			synchronized (this) {
				if (fixedPool == null) {
					ExecutionPool temp = new ExecutionPool("embedded-fixed-" + config.getAppName(), config, true);
					// 当useFixedFe为true时, 只会使用这个fixedPool注册的collector.
					//collector = temp.register(this, config);
					fixedPool = temp;
					isEmbeddedFixedPool = true;
				}
			}
		}
		if (useFixedFe && !fixedPool.isRunning()) {
			throw new AdbClientException(ExceptionCode.ALREADY_CLOSE, "already close");
		}
	}