Skip to content

Commit

Permalink
Merge pull request #51 from aliyun/feature/release-v1.1.9-8
Browse files Browse the repository at this point in the history
release 1.1.9-8
  • Loading branch information
Garfier authored Jan 9, 2025
2 parents 1c4b338 + 446f043 commit 72c47a0
Show file tree
Hide file tree
Showing 264 changed files with 13,571 additions and 1,479 deletions.
169 changes: 0 additions & 169 deletions client/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion client/client-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.aliyun.dataworks</groupId>
<artifactId>client</artifactId>
<version>1.1.9-2</version>
<version>1.1.9-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
7 changes: 4 additions & 3 deletions client/client-common/src/main/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<file>${LOG_FILE}</file>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
<charset>UTF-8</charset>
</encoder>
</appender>

Expand Down Expand Up @@ -64,7 +64,7 @@
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
<charset>UTF-8</charset>
</encoder>
</appender>

Expand All @@ -77,6 +77,7 @@
</logger>

<root level="INFO">
<appender-ref ref="${APPENDER_REF}"/>
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ private static Map<AppType, Map<String, AppMeta>> loadApps(String conf, AppType.
appMeta.setName(appName);
appMeta.setType(appType);
log.info("register command app type: {}, name: {}, class: {}", appType, appName, appMeta.getAppClass());
CommandAppFactory.register(appType, appName, (Class<? extends CommandApp>)Class.forName(appMeta.getAppClass()));
} catch (ClassNotFoundException e) {
log.info("register command app failed, appType: {}, appName: {}, class: {}, error: ", appType, appName, appMeta.getAppClass(), e);
CommandAppFactory.register(appType, appName, appMeta.getAppClass());
} catch (Exception e) {
throw new RuntimeException(e);
}
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
*/
@Slf4j
public class CommandAppFactory {
private static final Map<AppType, Map<String, Class<? extends CommandApp>>> commandApps = new HashMap<>();
private static final Map<AppType, Map<String, String>> commandApps = new HashMap<>();

public static void register(AppType appType, String appName, Class<? extends CommandApp> readerAppClz) {
Map<String, Class<? extends CommandApp>> apps = commandApps.computeIfAbsent(appType, type -> new HashMap<>());
public static void register(AppType appType, String appName, String readerAppClz) {
Map<String, String> apps = commandApps.computeIfAbsent(appType, type -> new HashMap<>());
if (apps.containsKey(appName)) {
return;
}
Expand All @@ -42,19 +42,21 @@ public static void register(AppType appType, String appName, Class<? extends Com
}

@SuppressWarnings("unchecked")
public static <T extends CommandApp> T create(AppType appType, String appName) throws InstantiationException, IllegalAccessException {
public static <T extends CommandApp> T create(AppType appType, String appName) throws InstantiationException,
IllegalAccessException, ClassNotFoundException {
if (!commandApps.containsKey(appType)) {
throw new RuntimeException("unregistered app type: " + appType);
}

Map<String, Class<? extends CommandApp>> apps = commandApps.get(appType);
Map<String, String> apps = commandApps.get(appType);
if (!apps.containsKey(appName)) {
log.error("appName: {} not found in apps: {}", appName, apps);
throw new RuntimeException("unregistered app name: " + appName);
}

Class<? extends CommandApp> clz = apps.get(appName);
return (T)clz.newInstance();
String clz = apps.get(appName);
Class clazz = Class.forName(clz);
return (T) clazz.newInstance();
}

public static Map<AppType, List<String>> getApps() {
Expand Down
2 changes: 1 addition & 1 deletion client/client-spark-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.aliyun.dataworks</groupId>
<artifactId>client</artifactId>
<version>1.1.9-2</version>
<version>1.1.9-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion client/client-toolkits/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.aliyun.dataworks</groupId>
<artifactId>client</artifactId>
<version>1.1.9-2</version>
<version>1.1.9-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion client/migrationx/migrationx-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>migrationx</artifactId>
<groupId>com.aliyun.dataworks</groupId>
<version>1.1.9-2</version>
<version>1.1.9-8</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.SocketException;

/**
* @author 聿剑
Expand Down Expand Up @@ -66,7 +62,7 @@ public boolean isRetry(Exception e) {
}

public String executeAndGet(HttpRequestBase httpRequestBase) throws Exception {
return executeAndGet(httpRequestBase, 3, 1000);
return executeAndGet(httpRequestBase, 1, 1000);
}

public String executeAndGet(HttpRequestBase httpRequestBase, boolean retry) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class DolphinMetricsCollector implements MetricsCollector {
private String transformerType;
private Date startTime;

private Consumer<Metrics> defaultMetricsConsumer = metrics -> metricsLogger.warn("{}", GSON.toJson(metrics));
private Consumer<Metrics> defaultMetricsConsumer = metrics -> metricsLogger.info("{}", GSON.toJson(metrics));

public DolphinMetricsCollector() {
startTime = new Date();
Expand Down Expand Up @@ -172,7 +172,7 @@ private Metrics findMetrics(Metrics tmp) {

@Override
public void finishCollector() {
finishCollector((summary) -> summaryLogger.warn("{}", PrettyGson.toJson(summary)));
finishCollector((summary) -> summaryLogger.info("{}", PrettyGson.toJson(summary)));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@

package com.aliyun.migrationx.common.utils;

import org.dozer.DozerBeanMapper;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.beanutils.PropertyUtils;
import org.dozer.DozerBeanMapper;
/**
* Desc:
*
Expand All @@ -33,4 +38,45 @@ public static <T> T deepCopy(Object obj, Class<T> clazz) {
private BeanUtils() {

}

public static void copyProperties(Object src, Object dest) {
try {
org.apache.commons.beanutils.BeanUtils.copyProperties(dest, src);
} catch (Exception e) {
throw new RuntimeException(e);
}
}

public static void copyProperties(Object src, Object dest, String... ignoreProperties) {
try {
copyPropertiesWithIgnore(dest, src, ignoreProperties);
} catch (Exception e) {
throw new RuntimeException(e);
}
}

private static void copyPropertiesWithIgnore(Object dest, Object orig, String... ignoreProperties)
throws IllegalAccessException, InvocationTargetException {
List<String> ignoreList = (ignoreProperties != null) ? Arrays.asList(ignoreProperties) : null;

PropertyDescriptor[] origDescriptors = PropertyUtils.getPropertyDescriptors(orig);
for (PropertyDescriptor origDescriptor : origDescriptors) {
String name = origDescriptor.getName();
if ("class".equals(name)) {
continue; // Ignore the "class" property
}
if (ignoreList != null && ignoreList.contains(name)) {
continue; // Ignore specified properties
}

if (PropertyUtils.isReadable(orig, name) && PropertyUtils.isWriteable(dest, name)) {
try {
Object value = PropertyUtils.getSimpleProperty(orig, name);
org.apache.commons.beanutils.BeanUtils.setProperty(dest, name, value);
} catch (NoSuchMethodException e) {
// Ignore if the setter method does not exist in the destination bean
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ public static void init(Config config) {
* '*' for all
*/
private List<String> filterTasks = new ArrayList<>();

/**
* workflow base path
*/
private String basePath;
}
Loading

0 comments on commit 72c47a0

Please sign in to comment.