This is an automated email from the ASF dual-hosted git repository.

jackxu2011 pushed a commit to branch dev-1.4.0
in repository https://gitbox.apache.org/repos/asf/linkis.git


The following commit(s) were added to refs/heads/dev-1.4.0 by this push:
     new 91e648b71 Translate engineconn-plugins-openlookeng service classes 
from Scala to Java (#4474)
91e648b71 is described below

commit 91e648b7183addedd5a2856b371aec474139893f
Author: ChengJie1053 <[email protected]>
AuthorDate: Thu Apr 20 21:15:22 2023 +0800

    Translate engineconn-plugins-openlookeng service classes from Scala to Java 
(#4474)
---
 .../openlookeng/OpenLooKengECPlugin.java           | 85 ++++++++++++++++++++++
 .../openlookeng/OpenLooKengECPlugin.scala          | 80 --------------------
 2 files changed, 85 insertions(+), 80 deletions(-)

diff --git 
a/linkis-engineconn-plugins/openlookeng/src/main/java/org/apache/linkis/engineplugin/openlookeng/OpenLooKengECPlugin.java
 
b/linkis-engineconn-plugins/openlookeng/src/main/java/org/apache/linkis/engineplugin/openlookeng/OpenLooKengECPlugin.java
new file mode 100644
index 000000000..259fc5a46
--- /dev/null
+++ 
b/linkis-engineconn-plugins/openlookeng/src/main/java/org/apache/linkis/engineplugin/openlookeng/OpenLooKengECPlugin.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.engineplugin.openlookeng;
+
+import 
org.apache.linkis.engineplugin.openlookeng.builder.OpenLooKengProcessECLaunchBuilder;
+import 
org.apache.linkis.engineplugin.openlookeng.factory.OpenLooKengEngineConnFactory;
+import org.apache.linkis.manager.engineplugin.common.EngineConnPlugin;
+import 
org.apache.linkis.manager.engineplugin.common.creation.EngineConnFactory;
+import 
org.apache.linkis.manager.engineplugin.common.launch.EngineConnLaunchBuilder;
+import 
org.apache.linkis.manager.engineplugin.common.resource.EngineResourceFactory;
+import 
org.apache.linkis.manager.engineplugin.common.resource.GenericEngineResourceFactory;
+import org.apache.linkis.manager.label.entity.Label;
+import org.apache.linkis.manager.label.entity.engine.EngineType;
+import org.apache.linkis.manager.label.utils.EngineTypeLabelCreator;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class OpenLooKengECPlugin implements EngineConnPlugin {
+
+  private final Object resourceLocker = new Object();
+  private final Object engineFactoryLocker = new Object();
+
+  private EngineResourceFactory engineResourceFactory;
+  private EngineConnFactory engineFactory;
+
+  private final List<Label<?>> defaultLabels = new ArrayList<>();
+
+  @Override
+  public void init(Map<String, Object> params) {
+    Label<?> engineTypeLabel =
+        
EngineTypeLabelCreator.createEngineTypeLabel(EngineType.OPENLOOKENG().toString());
+    this.defaultLabels.add(engineTypeLabel);
+  }
+
+  @Override
+  public EngineResourceFactory getEngineResourceFactory() {
+    if (engineResourceFactory == null) {
+      synchronized (resourceLocker) {
+        if (engineResourceFactory == null) {
+          engineResourceFactory = new GenericEngineResourceFactory();
+        }
+      }
+    }
+    return engineResourceFactory;
+  }
+
+  @Override
+  public EngineConnLaunchBuilder getEngineConnLaunchBuilder() {
+    return new OpenLooKengProcessECLaunchBuilder();
+  }
+
+  @Override
+  public EngineConnFactory getEngineConnFactory() {
+    if (engineFactory == null) {
+      synchronized (engineFactoryLocker) {
+        if (engineFactory == null) {
+          engineFactory = new OpenLooKengEngineConnFactory();
+        }
+      }
+    }
+    return engineFactory;
+  }
+
+  @Override
+  public List<Label<?>> getDefaultLabels() {
+    return this.defaultLabels;
+  }
+}
diff --git 
a/linkis-engineconn-plugins/openlookeng/src/main/scala/org/apache/linkis/engineplugin/openlookeng/OpenLooKengECPlugin.scala
 
b/linkis-engineconn-plugins/openlookeng/src/main/scala/org/apache/linkis/engineplugin/openlookeng/OpenLooKengECPlugin.scala
deleted file mode 100644
index dc3197bd7..000000000
--- 
a/linkis-engineconn-plugins/openlookeng/src/main/scala/org/apache/linkis/engineplugin/openlookeng/OpenLooKengECPlugin.scala
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.linkis.engineplugin.openlookeng
-
-import 
org.apache.linkis.engineplugin.openlookeng.builder.OpenLooKengProcessECLaunchBuilder
-import 
org.apache.linkis.engineplugin.openlookeng.factory.OpenLooKengEngineConnFactory
-import org.apache.linkis.manager.engineplugin.common.EngineConnPlugin
-import org.apache.linkis.manager.engineplugin.common.creation.EngineConnFactory
-import 
org.apache.linkis.manager.engineplugin.common.launch.EngineConnLaunchBuilder
-import org.apache.linkis.manager.engineplugin.common.resource.{
-  EngineResourceFactory,
-  GenericEngineResourceFactory
-}
-import org.apache.linkis.manager.label.entity.Label
-import org.apache.linkis.manager.label.entity.engine.EngineType
-import org.apache.linkis.manager.label.utils.EngineTypeLabelCreator
-
-import java.util
-import java.util.List
-
-class OpenLooKengECPlugin extends EngineConnPlugin {
-
-  private val resourceLocker = new Object()
-
-  private val engineLaunchBuilderLocker = new Object()
-
-  private val engineFactoryLocker = new Object()
-
-  private var engineResourceFactory: EngineResourceFactory = _
-
-  private var engineLaunchBuilder: EngineConnLaunchBuilder = _
-
-  private var engineFactory: EngineConnFactory = _
-
-  private val defaultLabels: List[Label[_]] = new util.ArrayList[Label[_]]()
-
-  override def init(params: util.Map[String, AnyRef]): Unit = {
-    val engineTypeLabel =
-      
EngineTypeLabelCreator.createEngineTypeLabel(EngineType.OPENLOOKENG.toString)
-    this.defaultLabels.add(engineTypeLabel)
-  }
-
-  override def getEngineResourceFactory: EngineResourceFactory = {
-    if (null == engineResourceFactory) resourceLocker synchronized {
-      engineResourceFactory = new GenericEngineResourceFactory
-    }
-    engineResourceFactory
-  }
-
-  override def getEngineConnLaunchBuilder: EngineConnLaunchBuilder = {
-    new OpenLooKengProcessECLaunchBuilder
-  }
-
-  override def getEngineConnFactory: EngineConnFactory = {
-    if (null == engineFactory) engineFactoryLocker synchronized {
-      engineFactory = new OpenLooKengEngineConnFactory
-    }
-    engineFactory
-  }
-
-  override def getDefaultLabels: util.List[Label[_]] = {
-    this.defaultLabels
-  }
-
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to