Search in sources :

Example 1 with FlinkJobDeploymentDetails

use of com.qlangtech.tis.coredefine.module.action.impl.FlinkJobDeploymentDetails in project tis by qlangtech.

the class CoreAction method getIndexIncrStatus.

public static IndexIncrStatus getIndexIncrStatus(BasicModule module, boolean getRcConfigInCache) throws Exception {
    IndexIncrStatus incrStatus = doGetDataXReaderWriterDesc(module.getCollectionName());
    // 是否可以取缓存中的deployment信息,在刚删除pod重启之后需要取全新的deployment信息不能缓存
    IPluginStore<IncrStreamFactory> store = getIncrStreamFactoryStore(module);
    if (store.getPlugin() == null) {
        incrStatus.setK8sPluginInitialized(false);
        return incrStatus;
    }
    incrStatus.setK8sPluginInitialized(true);
    IndexStreamCodeGenerator indexStreamCodeGenerator = getIndexStreamCodeGenerator(module);
    StreamCodeContext streamCodeContext = new StreamCodeContext(module.getCollectionName(), indexStreamCodeGenerator.incrScriptTimestamp);
    incrStatus.setIncrScriptCreated(streamCodeContext.isIncrScriptDirCreated());
    TISK8sDelegate k8s = TISK8sDelegate.getK8SDelegate(module.getCollectionName());
    IDeploymentDetail rcConfig = k8s.getRcConfig(getRcConfigInCache);
    incrStatus.setK8sReplicationControllerCreated(rcConfig != null);
    if (rcConfig != null) {
        rcConfig.accept(new IDeploymentDetail.IDeploymentDetailVisitor() {

            @Override
            public void visit(RcDeployment rcDeployment) {
                incrStatus.setRcDeployment(rcDeployment);
            }

            @Override
            public void visit(FlinkJobDeploymentDetails details) {
                incrStatus.setFlinkJobDetail(details);
            }
        });
        // JobType.RemoteCallResult<IndexJobRunningStatus> callResult
        // = JobType.QueryIndexJobRunningStatus.assembIncrControlWithResult(
        // getAssembleNodeAddress(module.getSolrZkClient()),
        // module.getCollectionName(), Collections.emptyList(), IndexJobRunningStatus.class);
        // if (callResult.success) {
        incrStatus.setIncrProcess(null);
    // }
    }
    return incrStatus;
}
Also used : RcDeployment(com.qlangtech.tis.coredefine.module.action.impl.RcDeployment) FlinkJobDeploymentDetails(com.qlangtech.tis.coredefine.module.action.impl.FlinkJobDeploymentDetails) IndexStreamCodeGenerator(com.qlangtech.tis.compiler.streamcode.IndexStreamCodeGenerator) StreamCodeContext(com.qlangtech.tis.sql.parser.stream.generate.StreamCodeContext) IncrStreamFactory(com.qlangtech.tis.plugin.incr.IncrStreamFactory)

Aggregations

IndexStreamCodeGenerator (com.qlangtech.tis.compiler.streamcode.IndexStreamCodeGenerator)1 FlinkJobDeploymentDetails (com.qlangtech.tis.coredefine.module.action.impl.FlinkJobDeploymentDetails)1 RcDeployment (com.qlangtech.tis.coredefine.module.action.impl.RcDeployment)1 IncrStreamFactory (com.qlangtech.tis.plugin.incr.IncrStreamFactory)1 StreamCodeContext (com.qlangtech.tis.sql.parser.stream.generate.StreamCodeContext)1