Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
110 changes: 110 additions & 0 deletions linkis-engineconn-plugins/doris/pom.xml
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-doris</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>

<!-- doris -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.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 linkis-engineconn-plugins/doris/src/main/assembly/distribution.xml
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-doris</id>
<formats>
<format>dir</format>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>doris</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/${doris.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/${doris.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/${doris.version}</outputDirectory>
</fileSet>

</fileSets>

</assembly>

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.doris;

import org.apache.linkis.engineplugin.doris.builder.DorisProcessEngineConnLaunchBuilder;
import org.apache.linkis.engineplugin.doris.factory.DorisEngineConnFactory;
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 DorisEngineConnPlugin 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 DorisProcessEngineConnLaunchBuilder();
}

@Override
public EngineConnFactory getEngineConnFactory() {
if (null == engineFactory) {
synchronized (engineFactoryLocker) {
engineFactory = new DorisEngineConnFactory();
}
}
return engineFactory;
}

@Override
public List<Label<?>> getDefaultLabels() {
return defaultLabels;
}
}
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.doris.builder;

import org.apache.linkis.manager.engineplugin.common.launch.process.JavaProcessEngineConnLaunchBuilder;

public class DorisProcessEngineConnLaunchBuilder extends JavaProcessEngineConnLaunchBuilder {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* 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.doris.conf;

import org.apache.linkis.common.conf.CommonVars;

public class DorisConfiguration {

public static final CommonVars<Integer> ENGINE_CONCURRENT_LIMIT =
CommonVars.apply("linkis.engineconn.concurrent.limit", 100);

public static final CommonVars<Integer> ENGINE_DEFAULT_LIMIT =
CommonVars.apply("linkis.ec.doris.default.limit", 5000);

public static final CommonVars<String> DORIS_COLUMN_SEPARATOR =
CommonVars.apply("linkis.ec.doris.column.separator", ",");

public static final CommonVars<String> DORIS_LINE_DELIMITER =
CommonVars.apply("linkis.ec.doris.line.delimiter", "\\n");

public static final CommonVars<String> DORIS_STREAM_LOAD_FILE_PATH =
CommonVars.apply(
"linkis.ec.doris.stream.load.file.path",
"",
"A file path, for example: /test/test.csv, currently supports csv、json、parquet、orc format");

public static final CommonVars<String> DORIS_COLUMNS =
CommonVars.apply("linkis.ec.doris.columns", "");

public static final CommonVars<String> DORIS_LABEL =
CommonVars.apply("linkis.ec.doris.label", "");

public static final CommonVars<String> DORIS_CONF =
CommonVars.apply(
"linkis.ec.doris.conf",
"",
"The doris parameter, separated by commas, for example: timeout:600,label:123");

public static final CommonVars<String> DORIS_HOST =
CommonVars.apply("linkis.ec.doris.host", "127.0.0.1");

public static final CommonVars<Integer> DORIS_HTTP_PORT =
CommonVars.apply("linkis.ec.doris.http.port", 8030);

public static final CommonVars<Integer> DORIS_JDBC_PORT =
CommonVars.apply("linkis.ec.doris.jdcb.port", 9030);

public static final CommonVars<String> DORIS_DATABASE =
CommonVars.apply("linkis.ec.doris.database", "");

public static final CommonVars<String> DORIS_TABLE =
CommonVars.apply("linkis.ec.doris.table", "");

public static final CommonVars<String> DORIS_USER_NAME =
CommonVars.apply("linkis.ec.doris.username", "root");

public static final CommonVars<String> DORIS_PASSWORD =
CommonVars.apply("linkis.ec.doris.password", "");

public static final CommonVars<String> DORIS_DATASOURCE =
CommonVars.apply("linkis.ec.doris.datasource", "");

public static final CommonVars<String> DORIS_DATASOURCE_SYSTEM_QUERY_PARAM =
CommonVars.apply("linkis.ec.doris.datasource.systemQueryParam", "");

public static final CommonVars<Boolean> DORIS_RECONNECT_ENABLED =
CommonVars.apply("linkis.ec.doris.2pc.enabled", false, "two phase commit Whether to enable");

public static final CommonVars<Boolean> DORIS_STRIP_OUTER_ARRAY =
CommonVars.apply(
"linkis.ec.doris.strip.outer.array",
true,
"true indicates that the json data starts with an array object and flattens the array object, the default value is true, Refer to doris for strip_outer_array");
}
Loading
Loading