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
5 changes: 5 additions & 0 deletions chunjun-connectors/chunjun-connector-hdfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<version>1.11.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<artifactId>groovy-all</artifactId>
<groupId>org.codehaus.groovy</groupId>
<version>2.4.4</version>
</dependency>

<dependency>
<groupId>org.apache.hive</groupId>
Expand Down
126 changes: 126 additions & 0 deletions chunjun-connectors/chunjun-connector-s3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>chunjun-connectors</artifactId>
<groupId>com.dtstack.chunjun</groupId>
<version>1.12-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>chunjun-connector-s3</artifactId>
<name>ChunJun : Connectors : S3</name>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.1001</version>
<exclusions>
<exclusion>
<artifactId>commons-codec</artifactId>
<groupId>commons-codec</groupId>
</exclusion>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-databind</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
<exclusion>
<artifactId>jackson-dataformat-cbor</artifactId>
<groupId>com.fasterxml.jackson.dataformat</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
<version>2.9.10</version>
</dependency>
<dependency>
<groupId>dk.brics.automaton</groupId>
<artifactId>automaton</artifactId>
<version>1.11-8</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<excludes>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>log4j:log4j</exclude>
<exclude>ch.qos.logback:*</exclude>
</excludes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>

</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${basedir}/../../${dist.dir}/connector/s3/"
file="${basedir}/target/${project.artifactId}-${project.version}.jar"/>
<!--suppress UnresolvedMavenProperty -->
<move file="${basedir}/../../${dist.dir}/connector/s3/${project.artifactId}-${project.version}.jar"
tofile="${basedir}/../../${dist.dir}/connector/s3/${project.artifactId}.jar"/>
<delete>
<!--suppress UnresolvedMavenProperty -->
<fileset dir="${basedir}/../../${dist.dir}/connector/s3/"
includes="${project.artifactId}-*.jar"
excludes="${project.artifactId}.jar"/>
</delete>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
/*
* 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.s3.conf;

import com.dtstack.chunjun.conf.ChunJunCommonConf;

import com.amazonaws.regions.Regions;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import java.io.Serializable;
import java.util.List;

/** @author jier */
@JsonIgnoreProperties(ignoreUnknown = true)
public class S3Conf extends ChunJunCommonConf implements Serializable {

private static final long serialVersionUID = 9008329384464201903L;

private String accessKey;

private String secretKey;

private String region = Regions.CN_NORTH_1.getName();

private String endpoint;

private String bucket;

private List<String> objects;

private String object;

private char fieldDelimiter = ',';

private String writeMode = "overwrite";

private String encoding = "UTF-8";

private boolean isFirstLineHeader = false;

private long maxFileSize = 1024 * 1024L;

private String Protocol = "HTTP";

/**
* Limit the number of files obtained per request. If the number of files is greater than
* fetchSize, then read in a loop
*/
private int fetchSize = 512;

/** Use v2 or v1 api to get directory files */
private boolean useV2 = true;
/**
* Safety caution to prevent the parser from using large amounts of memory in the case where
* parsing settings like file encodings don't end up matching the actual format of a file. This
* switch can be turned off if the file format is known and tested. With the switch off, the max
* column lengths and max column count per record supported by the parser will greatly increase.
* Default is false.
*/
private boolean safetySwitch = false;

public String getAccessKey() {
return accessKey;
}

public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}

public String getSecretKey() {
return secretKey;
}

public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}

public String getRegion() {
return region;
}

public void setRegion(String region) {
this.region = region;
}

public String getBucket() {
return bucket;
}

public void setBucket(String bucket) {
this.bucket = bucket;
}

public List<String> getObjects() {
return objects;
}

public void setObjects(List<String> objects) {
this.objects = objects;
}

public char getFieldDelimiter() {
return fieldDelimiter;
}

public void setFieldDelimiter(char fieldDelimiter) {
this.fieldDelimiter = fieldDelimiter;
}

public String getEncoding() {
return encoding;
}

public void setEncoding(String encoding) {
this.encoding = encoding;
}

public String getEndpoint() {
return endpoint;
}

public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}

public boolean isFirstLineHeader() {
return isFirstLineHeader;
}

public void setIsFirstLineHeader(boolean isFirstLineHeader) {
this.isFirstLineHeader = isFirstLineHeader;
}

public String getWriteMode() {
return writeMode;
}

public void setWriteMode(String writeMode) {
this.writeMode = writeMode;
}

public long getMaxFileSize() {
return maxFileSize;
}

public void setMaxFileSize(long maxFileSize) {
this.maxFileSize = maxFileSize;
}

public String getObject() {
return object;
}

public void setObject(String object) {
this.object = object;
}

public String getProtocol() {
return Protocol;
}

public void setProtocol(String protocol) {
Protocol = protocol;
}

public int getFetchSize() {
return fetchSize;
}

public void setFetchSize(int fetchSize) {
this.fetchSize = fetchSize;
}

public boolean isUseV2() {
return useV2;
}

public boolean isSafetySwitch() {
return safetySwitch;
}

public void setSafetySwitch(boolean safetySwitch) {
this.safetySwitch = safetySwitch;
}

public void setUseV2(boolean useV2) {
this.useV2 = useV2;
}
}
Loading