3333import com .qlangtech .tis .datax .TimeFormat ;
3434import com .qlangtech .tis .datax .job .DataXJobWorker ;
3535import com .qlangtech .tis .datax .job .ILaunchingOrchestrate ;
36- import com .qlangtech .tis .datax .job .ITISPowerJob ;
3736import com .qlangtech .tis .datax .job .JobOrchestrateException ;
3837import com .qlangtech .tis .datax .job .JobResName ;
3938import com .qlangtech .tis .datax .job .JobResName .OwnerJobExec ;
4039import com .qlangtech .tis .datax .job .PowerjobOrchestrateException ;
4140import com .qlangtech .tis .datax .job .SSERunnable ;
4241import com .qlangtech .tis .datax .job .ServiceResName ;
4342import com .qlangtech .tis .extension .TISExtension ;
44- import com .qlangtech .tis .fullbuild .IFullBuildContext ;
4543import com .qlangtech .tis .fullbuild .indexbuild .RunningStatus ;
46- import com .qlangtech .tis .lang .ErrorValue ;
4744import com .qlangtech .tis .lang .TisException ;
48- import com .qlangtech .tis .lang .TisException .ErrorCode ;
4945import com .qlangtech .tis .plugin .IEndTypeGetter ;
5046import com .qlangtech .tis .plugin .annotation .FormField ;
5147import com .qlangtech .tis .plugin .annotation .FormFieldType ;
106102 * @create: 2021-04-23 18:16
107103 **/
108104@ Public
109- public class K8SDataXJobWorker extends DataXJobWorker implements ITISPowerJob , ILaunchingOrchestrate {
105+ public class K8SDataXJobWorker extends DataXJobWorker implements ILaunchingOrchestrate {
110106
111107 private static final Logger logger = LoggerFactory .getLogger (K8SDataXJobWorker .class );
112108
@@ -235,10 +231,10 @@ private static ServiceResName<K8SDataXJobWorker> getPowerJobServerService() {
235231
236232 public static final JobResName [] powerJobRes //
237233 = new JobResName []{
238- // K8S_DATAX_POWERJOB_MYSQL,
239- K8S_DATAX_POWERJOB_SERVER
240- // , K8S_DATAX_POWERJOB_REGISTER_ACCOUNT
241- //, K8S_DATAX_POWERJOB_WORKER
234+ // K8S_DATAX_POWERJOB_MYSQL,
235+ K8S_DATAX_POWERJOB_SERVER
236+ // , K8S_DATAX_POWERJOB_REGISTER_ACCOUNT
237+ //, K8S_DATAX_POWERJOB_WORKER
242238 };
243239
244240
@@ -263,17 +259,17 @@ private static ServiceResName<K8SDataXJobWorker> getPowerJobServerService() {
263259 private transient CoreV1Api apiClient ;
264260
265261
266- public String getPowerJobMasterGateway () {
267- try {
268- final String linkHost = this .serverPortExport
269- .getClusterHost (this .getK8SApi (), this .getImage (), powerJobServiceResAndOwnerGetter .get ());
270- return linkHost ;
271- } catch (ServiceNotDefinedException e ) {
272- //
273- throw throwPowerJobClusterLossOfContactException (Optional .of (e ));
274- // throw new RuntimeException(e);
275- }
276- }
262+ // public String getPowerJobMasterGateway() {
263+ // try {
264+ // final String linkHost = this.serverPortExport
265+ // .getClusterHost(this.getK8SApi(), this.getImage(), powerJobServiceResAndOwnerGetter.get());
266+ // return linkHost;
267+ // } catch (ServiceNotDefinedException e) {
268+ // //
269+ // throw throwPowerJobClusterLossOfContactException(Optional.of(e));
270+ // // throw new RuntimeException(e);
271+ // }
272+ // }
277273
278274 public CoreV1Api getK8SApi () {
279275 if (this .apiClient == null ) {
@@ -289,21 +285,21 @@ public CoreV1Api getK8SApi() {
289285 // public static String getDefaultZookeeperAddress() {
290286// return processDefaultHost(Config.getZKHost());
291287// }
292- private transient TISPowerJobClient powerJobClient ;
293-
294- @ Override
295- public TISPowerJobClient getPowerJobClient () {
296- if (powerJobClient == null ) {
297- try {
298- powerJobClient = TISPowerJobClient .create (
299- this .serverPortExport .getClusterHost (this .getK8SApi (), this .getK8SImage (), powerJobServiceResAndOwnerGetter .get ())
300- , this .appName , this .password );
301- } catch (ServiceNotDefinedException e ) {
302- throw throwPowerJobClusterLossOfContactException (Optional .of (e ));
303- }
304- }
305- return powerJobClient ;
306- }
288+ // private transient TISPowerJobClient powerJobClient;
289+ //
290+ // @Override
291+ // public TISPowerJobClient getPowerJobClient() {
292+ // if (powerJobClient == null) {
293+ // try {
294+ // powerJobClient = TISPowerJobClient.create(
295+ // this.serverPortExport.getClusterHost(this.getK8SApi(), this.getK8SImage(), powerJobServiceResAndOwnerGetter.get())
296+ // , this.appName, this.password);
297+ // } catch (ServiceNotDefinedException e) {
298+ // throw throwPowerJobClusterLossOfContactException(Optional.of(e));
299+ // }
300+ // }
301+ // return powerJobClient;
302+ // }
307303
308304 @ Override
309305 public Map <String , Object > getPayloadInfo () {
@@ -316,8 +312,8 @@ public Map<String, Object> getPayloadInfo() {
316312 // throwPowerJobClusterLossOfContactException();
317313 return payloads ;
318314 } catch (ServiceNotDefinedException e ) {
319- // throw new RuntimeException(e);
320- throw throwPowerJobClusterLossOfContactException (Optional .of (e ));
315+ throw new RuntimeException (e );
316+ // throw throwPowerJobClusterLossOfContactException(Optional.of(e));
321317 }
322318 }
323319
@@ -590,8 +586,8 @@ public List<RcDeployment> getRCDeployments() {
590586 K8SController k8SController = getK8SController ();
591587 RcDeployment powerjobServer = k8SController .getRCDeployment (K8S_DATAX_POWERJOB_SERVER );
592588 if (powerjobServer == null ) {
593- // throw TisException.create("the powerJob has been loss of communication");
594- throw throwPowerJobClusterLossOfContactException (Optional .empty ());
589+ throw TisException .create ("the powerJob has been loss of communication" );
590+ // throw throwPowerJobClusterLossOfContactException(Optional.empty());
595591 }
596592 powerjobServer .setReplicaScalable (false );
597593
@@ -612,12 +608,12 @@ public List<RcDeployment> getRCDeployments() {
612608 // return getK8SController().getRCDeployment(DataXJobWorker.K8S_DATAX_INSTANCE_NAME);
613609 }
614610
615- private static TisException throwPowerJobClusterLossOfContactException (Optional <ServiceNotDefinedException > e ) {
616- return TisException .create (
617- ErrorValue .create (ErrorCode .POWER_JOB_CLUSTER_LOSS_OF_CONTACT
618- , IFullBuildContext .KEY_TARGET_NAME , TargetResName .K8S_DATAX_INSTANCE_NAME .getName ())
619- , e .map ((except ) -> except .getMessage ()).orElse ("the powerJob has been loss of communication" ));
620- }
611+ // private static TisException throwPowerJobClusterLossOfContactException(Optional<ServiceNotDefinedException> e) {
612+ // return TisException.create(
613+ // ErrorValue.create(ErrorCode.POWER_JOB_CLUSTER_LOSS_OF_CONTACT
614+ // , IFullBuildContext.KEY_TARGET_NAME, TargetResName.K8S_DATAX_INSTANCE_NAME.getName())
615+ // , e.map((except) -> except.getMessage()).orElse("the powerJob has been loss of communication"));
616+ // }
621617
622618 @ Override
623619 public WatchPodLog listPodAndWatchLog (String podName , ILogListener listener ) {
@@ -750,8 +746,6 @@ public final PowerJobK8SImage getPowerJobImage() {
750746// protected K8SDataXPowerJobWorker getPowerJobWorker() {
751747// return K8SUtils.getK8SDataXPowerJobWorker();
752748// }
753-
754-
755749 public NamespacedEventCallCriteria launchPowerjobServer () throws ApiException , PowerjobOrchestrateException {
756750 SSERunnable sse = SSERunnable .getLocal ();
757751
@@ -804,7 +798,7 @@ public NamespacedEventCallCriteria launchPowerjobServer() throws ApiException, P
804798// }
805799 // --spring.datasource.core.jdbc-url=
806800 // --oms.transporter.active.protocols=http
807- // envVar.setValue(" --oms.mongodb.enable=false " + coreJbdcParams);
801+ // envVar.setValue(" --oms.mongodb.enable=false " + coreJbdcParams);
808802 envs .add (envVar );
809803
810804
0 commit comments