-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add nebula engine to linkis (#4903)
* Add nebula engine to linkis * Reuse nebula session * Code optimization and remove wds prefix
- Loading branch information
1 parent
8f149e1
commit 4ecb22e
Showing
21 changed files
with
1,067 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ 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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>linkis-engineplugin-nebula</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-engineconn-plugin-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-computation-engineconn</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-storage</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-rpc</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.linkis</groupId> | ||
<artifactId>linkis-common</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- nebula --> | ||
<dependency> | ||
<groupId>com.vesoft</groupId> | ||
<artifactId>client</artifactId> | ||
<version>${nebula.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<inherited>false</inherited> | ||
<configuration> | ||
<skipAssembly>false</skipAssembly> | ||
<finalName>out</finalName> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<attach>false</attach> | ||
<descriptors> | ||
<descriptor>src/main/assembly/distribution.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
<phase>package</phase> | ||
<configuration> | ||
<descriptors> | ||
<descriptor>src/main/assembly/distribution.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
71 changes: 71 additions & 0 deletions
71
linkis-engineconn-plugins/nebula/src/main/assembly/distribution.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ 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. | ||
--> | ||
|
||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 https://maven.apache.org/xsd/assembly-2.1.1.xsd"> | ||
<id>linkis-engineplugin-nebula</id> | ||
<formats> | ||
<format>dir</format> | ||
<format>zip</format> | ||
</formats> | ||
<includeBaseDirectory>true</includeBaseDirectory> | ||
<baseDirectory>nebula</baseDirectory> | ||
|
||
<dependencySets> | ||
<dependencySet> | ||
<!-- Enable access to all projects in the current multimodule build! <useAllReactorProjects>true</useAllReactorProjects> --> | ||
<!-- Now, select which projects to include in this module-set. --> | ||
<outputDirectory>/dist/${nebula.version}/lib</outputDirectory> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<useTransitiveDependencies>true</useTransitiveDependencies> | ||
<unpack>false</unpack> | ||
<useStrictFiltering>false</useStrictFiltering> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
|
||
</dependencySet> | ||
</dependencySets> | ||
|
||
<fileSets> | ||
|
||
<fileSet> | ||
<directory>${basedir}/src/main/resources</directory> | ||
<includes> | ||
<include>linkis-engineconn.properties</include> | ||
<include>log4j2.xml</include> | ||
</includes> | ||
<fileMode>0777</fileMode> | ||
<outputDirectory>dist/${nebula.version}/conf</outputDirectory> | ||
<lineEnding>unix</lineEnding> | ||
</fileSet> | ||
|
||
<fileSet> | ||
<directory>${basedir}/target</directory> | ||
<includes> | ||
<include>*.jar</include> | ||
</includes> | ||
<excludes> | ||
<exclude>*doc.jar</exclude> | ||
</excludes> | ||
<fileMode>0777</fileMode> | ||
<outputDirectory>plugin/${nebula.version}</outputDirectory> | ||
</fileSet> | ||
|
||
</fileSets> | ||
|
||
</assembly> | ||
|
72 changes: 72 additions & 0 deletions
72
...ns/nebula/src/main/java/org/apache/linkis/engineplugin/nebula/NebulaEngineConnPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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.nebula; | ||
|
||
import org.apache.linkis.engineplugin.nebula.builder.NebulaProcessEngineConnLaunchBuilder; | ||
import org.apache.linkis.engineplugin.nebula.factory.NebulaEngineConnFactory; | ||
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 java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class NebulaEngineConnPlugin implements EngineConnPlugin { | ||
private Object resourceLocker = new Object(); | ||
private Object engineFactoryLocker = new Object(); | ||
private volatile EngineResourceFactory engineResourceFactory; | ||
private volatile EngineConnFactory engineFactory; | ||
private List<Label<?>> defaultLabels = new ArrayList<>(); | ||
|
||
@Override | ||
public void init(Map<String, Object> params) {} | ||
|
||
@Override | ||
public EngineResourceFactory getEngineResourceFactory() { | ||
if (null == engineResourceFactory) { | ||
synchronized (resourceLocker) { | ||
engineResourceFactory = new GenericEngineResourceFactory(); | ||
} | ||
} | ||
return engineResourceFactory; | ||
} | ||
|
||
@Override | ||
public EngineConnLaunchBuilder getEngineConnLaunchBuilder() { | ||
return new NebulaProcessEngineConnLaunchBuilder(); | ||
} | ||
|
||
@Override | ||
public EngineConnFactory getEngineConnFactory() { | ||
if (null == engineFactory) { | ||
synchronized (engineFactoryLocker) { | ||
engineFactory = new NebulaEngineConnFactory(); | ||
} | ||
} | ||
return engineFactory; | ||
} | ||
|
||
@Override | ||
public List<Label<?>> getDefaultLabels() { | ||
return defaultLabels; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...a/org/apache/linkis/engineplugin/nebula/builder/NebulaProcessEngineConnLaunchBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* 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.nebula.builder; | ||
|
||
import org.apache.linkis.manager.engineplugin.common.launch.process.JavaProcessEngineConnLaunchBuilder; | ||
|
||
public class NebulaProcessEngineConnLaunchBuilder extends JavaProcessEngineConnLaunchBuilder {} |
Oops, something went wrong.