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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 45 additions & 45 deletions chunjun-connectors/chunjun-connector-starrocks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,42 @@
<artifactId>chunjun-connector-starrocks</artifactId>
<name>ChunJun : Connectors : StarRocks</name>


<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<arrow.version>5.0.0</arrow.version>
</properties>

<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this version same as other connector?

</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate dependencies are depended on the project, and we have other json-processed dependencies, like Gson, in the root pom.

<version>1.2.79</version>
</dependency>

<dependency>
<groupId>com.starrocks</groupId>
<artifactId>flink-connector-starrocks</artifactId>
<version>1.1.13_flink-1.12</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-api-java</artifactId>
</exclusion>
<exclusion>
<artifactId>flink-clients_2.11</artifactId>
<groupId>org.apache.flink</groupId>
</exclusion>
<exclusion>
<artifactId>flink-table-api-java-bridge_2.11</artifactId>
<groupId>org.apache.flink</groupId>
</exclusion>
<exclusion>
<artifactId>flink-table-api-scala-bridge_2.11</artifactId>
<groupId>org.apache.flink</groupId>
</exclusion>
<exclusion>
<artifactId>flink-table-api-scala_2.11</artifactId>
<groupId>org.apache.flink</groupId>
</exclusion>
<exclusion>
<artifactId>flink-table-planner-blink_2.11</artifactId>
<groupId>org.apache.flink</groupId>
</exclusion>
<exclusion>
<artifactId>flink-table-planner_2.11</artifactId>
<groupId>org.apache.flink</groupId>
</exclusion>
</exclusions>
<artifactId>starrocks-thrift-sdk</artifactId>
<version>1.0.1</version>
</dependency>

<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
<version>${arrow.version}</version>
</dependency>

<dependency>
<groupId>com.dtstack.chunjun</groupId>
<artifactId>chunjun-connector-mysql</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<version>${arrow.version}</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -96,6 +82,20 @@
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>com.dtstack.chunjun.connector.starrocks.shaded.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.arrow</pattern>
<shadedPattern>com.dtstack.chunjun.connector.starrocks.shaded.org.apache.arrow</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.flatbuffers</pattern>
<shadedPattern>com.dtstack.chunjun.connector.starrocks.shaded.com.google.flatbuffers</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* 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 com.dtstack.chunjun.connector.starrocks.conf;

import com.dtstack.chunjun.connector.starrocks.options.ConstantValue;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/** @author liuliu 2022/7/12 */
public class LoadConf implements Serializable {

private static final Long serialVersionUID = 1L;

/** Timeout duration of the HTTP connection when checking the connectivity with StarRocks */
private Integer httpCheckTimeoutMs = ConstantValue.HTTP_CHECK_TIMEOUT_DEFAULT;

private Integer queueOfferTimeoutMs = ConstantValue.QUEUE_OFFER_TIMEOUT_DEFAULT;

private Integer queuePollTimeoutMs = ConstantValue.QUEUE_POLL_TIMEOUT_DEFAULT;

private Long batchMaxSize = ConstantValue.SINK_BATCH_MAX_BYTES_DEFAULT;

private Long batchMaxRows = ConstantValue.SINK_BATCH_MAX_ROWS_DEFAULT;

private Map<String, String> headProperties = new HashMap<>();

public Integer getHttpCheckTimeoutMs() {
return httpCheckTimeoutMs;
}

public void setHttpCheckTimeoutMs(Integer httpCheckTimeoutMs) {
this.httpCheckTimeoutMs = httpCheckTimeoutMs;
}

public Integer getQueueOfferTimeoutMs() {
return queueOfferTimeoutMs;
}

public void setQueueOfferTimeoutMs(Integer queueOfferTimeoutMs) {
this.queueOfferTimeoutMs = queueOfferTimeoutMs;
}

public Integer getQueuePollTimeoutMs() {
return queuePollTimeoutMs;
}

public void setQueuePollTimeoutMs(Integer queuePollTimeoutMs) {
this.queuePollTimeoutMs = queuePollTimeoutMs;
}

public Long getBatchMaxSize() {
return batchMaxSize;
}

public void setBatchMaxSize(Long batchMaxSize) {
this.batchMaxSize = batchMaxSize;
}

public Long getBatchMaxRows() {
return batchMaxRows;
}

public void setBatchMaxRows(Long batchMaxRows) {
this.batchMaxRows = batchMaxRows;
}

public Map<String, String> getHeadProperties() {
return headProperties;
}

public void setHeadProperties(Map<String, String> headProperties) {
this.headProperties = headProperties;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* 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 com.dtstack.chunjun.connector.starrocks.conf;

import java.util.Map;

/** @author liuliu 2022/7/12 */
public class LoadConfBuilder {
private final LoadConf loadConf;

public LoadConfBuilder() {
this.loadConf = new LoadConf();
}

public LoadConf build() {
return this.loadConf;
}

public LoadConfBuilder setBatchMaxSize(Long batchMaxSize) {
loadConf.setBatchMaxSize(batchMaxSize);
return this;
}

public LoadConfBuilder setBatchMaxRows(Long batMaxRows) {
loadConf.setBatchMaxRows(batMaxRows);
return this;
}

public LoadConfBuilder setHttpCheckTimeoutMs(int httpCheckTimeout) {
loadConf.setHttpCheckTimeoutMs(httpCheckTimeout);
return this;
}

public LoadConfBuilder setQueueOfferTimeoutMs(int queueOfferTimeoutMs) {
loadConf.setQueueOfferTimeoutMs(queueOfferTimeoutMs);
return this;
}

public LoadConfBuilder setQueuePollTimeoutMs(int queuePollTimeoutMs) {
loadConf.setQueuePollTimeoutMs(queuePollTimeoutMs);
return this;
}

public LoadConfBuilder setHeadProperties(Map<String, String> loadProperties) {
loadConf.setHeadProperties(loadProperties);
return this;
}
}
Loading