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;
}
Aggregations