use of com.qlangtech.tis.coredefine.module.action.TargetResName in project plugins by qlangtech.
the class TISFlinkCDCStart method main.
public static void main(String[] args) throws Exception {
if (args.length != 1) {
throw new IllegalArgumentException("args length must be 1,now is:" + args.length);
}
String dataxName = args[0];
// -classpath /Users/mozhenghua/j2ee_solution/project/plugins/tis-incr/tis-flink-dependency/target/tis-flink-dependency/WEB-INF/lib/*:/Users/mozhenghua/j2ee_solution/project/plugins/tis-incr/tis-flink-cdc-plugin/target/tis-flink-cdc-plugin/WEB-INF/lib/*:/Users/mozhenghua/j2ee_solution/project/plugins/tis-incr/tis-elasticsearch7-sink-plugin/target/tis-elasticsearch7-sink-plugin/WEB-INF/lib/*:/Users/mozhenghua/j2ee_solution/project/plugins/tis-incr/tis-realtime-flink/target/tis-realtime-flink/WEB-INF/lib/*:/Users/mozhenghua/j2ee_solution/project/plugins/tis-incr/tis-realtime-flink-launch/target/tis-realtime-flink-launch.jar:/Users/mozhenghua/j2ee_solution/project/plugins/tis-incr/tis-realtime-flink-launch/target/dependency/*:/Users/mozhenghua/j2ee_solution/project/plugins/tis-datax/tis-datax-elasticsearch-plugin/target/tis-datax-elasticsearch-plugin/WEB-INF/lib/*:
// CenterResource.setNotFetchFromCenterRepository();
// Thread.currentThread().setContextClassLoader(TIS.get().pluginManager.uberClassLoader);
// IPluginContext pluginContext = IPluginContext.namedContext(dataxName);
//
//
// List<IncrStreamFactory> streamFactories = HeteroEnum.INCR_STREAM_CONFIG.getPlugins(pluginContext, null);
// IRCController incrController = null;
// for (IncrStreamFactory factory : streamFactories) {
// incrController = factory.getIncrSync();
// }
// Objects.requireNonNull(incrController, "stream app:" + dataxName + " incrController can not not be null");
IncrStreamFactory incrStreamFactory = HeteroEnum.getIncrStreamFactory(dataxName);
BasicFlinkSourceHandle tableStreamHandle = createFlinkSourceHandle(dataxName);
tableStreamHandle.setStreamFactory(incrStreamFactory);
deploy(new TargetResName(dataxName), tableStreamHandle, null, -1);
}
use of com.qlangtech.tis.coredefine.module.action.TargetResName in project plugins by qlangtech.
the class FlinkK8SClusterManager method listPodAndWatchLog.
@Override
public WatchPodLog listPodAndWatchLog(String podName, ILogListener listener) {
K8sImage k8sImage = this.getK8SImage();
ApiClient apiClient = k8sImage.createApiClient();
return K8SController.listPodAndWatchLog(apiClient, k8sImage, "flink-main-container", new TargetResName(this.clusterId), podName, listener);
}
use of com.qlangtech.tis.coredefine.module.action.TargetResName in project plugins by qlangtech.
the class FlinkK8SClusterManager method getRCDeployment.
@Override
public RcDeployment getRCDeployment() {
RcDeployment deployment = new RcDeployment();
K8sImage k8sImage = this.getK8SImage();
ApiClient apiClient = k8sImage.createApiClient();
AppsV1Api appsApi = new AppsV1Api(apiClient);
CoreV1Api coreApi = new CoreV1Api(apiClient);
// String name, String namespace, String pretty, Boolean exact, Boolean export
try {
V1Deployment deploy = appsApi.readNamespacedDeployment(this.clusterId, k8sImage.getNamespace(), "true", null, null);
K8SController.fillSpecInfo(deployment, deploy.getSpec().getReplicas(), deploy.getSpec().getTemplate());
V1DeploymentStatus status = deploy.getStatus();
RcDeployment.ReplicationControllerStatus deploymentStatus = new RcDeployment.ReplicationControllerStatus();
deploymentStatus.setAvailableReplicas(status.getAvailableReplicas());
deploymentStatus.setFullyLabeledReplicas(0);
deploymentStatus.setObservedGeneration(status.getObservedGeneration());
deploymentStatus.setReadyReplicas(status.getReadyReplicas());
deploymentStatus.setReplicas(status.getReplicas());
deployment.setStatus(deploymentStatus);
K8SController.fillCreateTimestamp(deployment, deploy.getMetadata());
K8SController.fillPods(coreApi, k8sImage, deployment, new TargetResName(this.clusterId));
} catch (ApiException e) {
throw K8sExceptionUtils.convert(this.clusterId, e);
}
return deployment;
}
use of com.qlangtech.tis.coredefine.module.action.TargetResName in project plugins by qlangtech.
the class TestK8sIncrSync method testGetRCDeployment.
public void testGetRCDeployment() {
IRCController incrSync = TestDefaultIncrK8sConfig.getIncrSync();
IDeploymentDetail rcDeployment = incrSync.getRCDeployment(new TargetResName(TestDefaultIncrK8sConfig.totalpay));
assertNotNull(rcDeployment);
}
use of com.qlangtech.tis.coredefine.module.action.TargetResName in project plugins by qlangtech.
the class TestDefaultIncrK8sConfig method testCreateIncrDeployment.
public void testCreateIncrDeployment() throws Exception {
IRCController incr = incrFactory.getIncrSync();
assertNotNull(incr);
assertFalse(s4totalpay + " shall have not deploy incr instance in k8s", incr.getRCDeployment(new TargetResName(s4totalpay)) != null);
RcDeployment incrSpec = new RcDeployment();
incrSpec.setCpuLimit(Specification.parse("1"));
incrSpec.setCpuRequest(Specification.parse("500m"));
incrSpec.setMemoryLimit(Specification.parse("1G"));
incrSpec.setMemoryRequest(Specification.parse("500M"));
incrSpec.setReplicaCount(1);
long timestamp = 20190820171040l;
try {
incr.deploy(new TargetResName(s4totalpay), incrSpec, timestamp);
} catch (Exception e) {
throw e;
}
}
Aggregations