Skip to content

Commit

Permalink
upgrade version to 3.7.2 and fix bug #221
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed May 8, 2023
1 parent fbc172f commit d8a6718
Show file tree
Hide file tree
Showing 32 changed files with 186 additions and 150 deletions.
2 changes: 1 addition & 1 deletion datax-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion maven-tpi-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<!--https://maven.apache.org/maven-ci-friendly.html-->
<version>3.7.1</version>
<version>3.7.2</version>
<packaging>pom</packaging>
<name>tis</name>
<url>http://maven.apache.org</url>
Expand Down Expand Up @@ -88,7 +88,7 @@
<!-- <module>tis-scala-compiler-dependencies</module>-->

<module>maven-tpi-plugin</module>
<module>tis-datax-executor</module>
<!-- <module>tis-datax-executor</module>-->
<!-- <module>tis-zeppelin</module>-->


Expand Down
4 changes: 2 additions & 2 deletions setversion.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mvn versions:set -DnewVersion=3.7.1 -DprocessDependencies=true -DgenerateBackupPoms=false
mvn versions:set -DnewVersion=3.7.2 -DprocessDependencies=true -DgenerateBackupPoms=false

mvn compile deploy -pl datax-config,maven-tpi-plugin,tis-plugin -am -Dmaven.test.skip=true -DaltDeploymentRepository=base::default::http://localhost:8080/release
#mvn compile deploy -pl datax-config,maven-tpi-plugin,tis-plugin -am -Dmaven.test.skip=true -DaltDeploymentRepository=base::default::http://localhost:8080/release
2 changes: 1 addition & 1 deletion tis-assemble/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,26 @@
**/
public class Test {
public static void main(String[] args) throws Exception {
Future<?> f = TisServlet.executeService.submit(() -> {


while (true) {
try {

System.out.println("i am here");
Thread.sleep(5000l);
} catch (InterruptedException e) {
e.printStackTrace();
}

}
});

Thread.sleep(1000l);
f.cancel(true);
System.out.println("all over");

Thread.sleep(90000l);
System.out.println( Integer.MIN_VALUE);
// Future<?> f = TisServlet.executeService.submit(() -> {
//
//
// while (true) {
// try {
//
// System.out.println("i am here");
// Thread.sleep(5000l);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
//
// }
// });
//
// Thread.sleep(1000l);
// f.cancel(true);
// System.out.println("all over");
//
// Thread.sleep(90000l);
}
}
2 changes: 1 addition & 1 deletion tis-base-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>tis</artifactId>
<groupId>com.qlangtech.tis</groupId>
<version>3.7.1</version>
<version>3.7.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion tis-builder-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tis-common-dao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>tis</artifactId>
<groupId>com.qlangtech.tis</groupId>
<version>3.7.1</version>
<version>3.7.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion tis-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>com.qlangtech.tis</groupId>
Expand Down
2 changes: 1 addition & 1 deletion tis-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tis-dag/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>tis</artifactId>
<groupId>com.qlangtech.tis</groupId>
<version>3.7.1</version>
<version>3.7.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion tis-datax-executor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion tis-hadoop-rpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tis-logback-flume-parent</artifactId>
<groupId>com.qlangtech.tis</groupId>
<version>3.7.1</version>
<version>3.7.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion tis-logback-flume-parent/logback-flume-appender/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis-logback-flume-parent</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion tis-logback-flume-parent/logback-flume-server-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>tis-logback-flume-parent</artifactId>
<groupId>com.qlangtech.tis</groupId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion tis-logback-flume-parent/logback-flume-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis-logback-flume-parent</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion tis-logback-flume-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tis-manage-pojo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tis-plugin-sezpoz/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>tis</artifactId>
<groupId>com.qlangtech.tis</groupId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion tis-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.qlangtech.tis</groupId>
<artifactId>tis</artifactId>
<version>3.7.1</version>
<version>3.7.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/**
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.qlangtech.tis.plugin.datax;

import com.qlangtech.tis.datax.IDataxProcessor;
import com.qlangtech.tis.plugin.ds.CMeta;
import com.qlangtech.tis.plugin.ds.DataSourceMeta;
import org.apache.commons.lang.StringUtils;

import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

/**
* @author: 百岁(baisui@qlangtech.com)
* @create: 2023-05-07 12:35
**/
public abstract class AbstractCreateTableSqlBuilder {

protected final IDataxProcessor.TableMap tableMapper;

protected final List<CreateTableSqlBuilder.ColWrapper> pks;
public int maxColNameLength;
protected final String escapeChar;

public AbstractCreateTableSqlBuilder(IDataxProcessor.TableMap tableMapper, DataSourceMeta dsMeta) {
this.tableMapper = tableMapper;

this.pks = this.getCols().stream()
.filter((c) -> c.isPk())
.map((c) -> createColWrapper(c))
.collect(Collectors.toList());

maxColNameLength = 0;
for (CMeta col : this.getCols()) {
int m = StringUtils.length(col.getName());
if (m > maxColNameLength) {
maxColNameLength = m;
}
}
maxColNameLength += 4;
if (supportColEscapeChar()) {
Optional<String> escape = dsMeta.getEscapeChar();
if (!escape.isPresent()) {
throw new IllegalArgumentException("must contain escapeChar for DB entity");
}
this.escapeChar = escape.get();
} else {
this.escapeChar = StringUtils.EMPTY;
}
}

public abstract CreateTableSqlBuilder.CreateDDL build();


protected CreateTableSqlBuilder.CreateTableName getCreateTableName() {
return new CreateTableSqlBuilder.CreateTableName(tableMapper.getTo(), this);
}

protected String wrapWithEscape(String val) {
return this.escapeChar + val + this.escapeChar;
}

protected boolean supportColEscapeChar() {
return true;
}

protected List<CMeta> getCols() {
return this.tableMapper.getSourceCols();
}

protected abstract CreateTableSqlBuilder.ColWrapper createColWrapper(CMeta c);//{


public static class CreateDDL {
private final StringBuffer script;
private final AbstractCreateTableSqlBuilder builder;

public CreateDDL(StringBuffer script, AbstractCreateTableSqlBuilder builder) {
this.script = script;
this.builder = builder;
}

public StringBuffer getDDLScript() {
return this.script;
}

public String getSelectAllScript() {
return "SELECT " + builder.getCols().stream()
.map((c) -> builder.wrapWithEscape(c.getName()))
.collect(Collectors.joining(","))
+ " FROM " + (builder.getCreateTableName().getEntityName());
}
}


}
Loading

0 comments on commit d8a6718

Please sign in to comment.