Skip to content

Commit

Permalink
fix ci check error
Browse files Browse the repository at this point in the history
  • Loading branch information
xwm1992 committed May 31, 2024
1 parent 0b9f6d0 commit bfafbfb
Show file tree
Hide file tree
Showing 140 changed files with 944 additions and 1,045 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ allprojects {

checkstyleMain.exclude('**/org/apache/eventmesh/client/grpc/protos**')
.exclude('**/org/apache/eventmesh/common/protocol/grpc/cloudevents**')
.exclude('**/org/apache/eventmesh/common/protocol/grpc/protos/**')
.exclude('**/org/apache/eventmesh/common/protocol/grpc/proto**')
.exclude('**/org/apache/eventmesh/common/protocol/grpc/adminserver/**')
.exclude('**/org/apache/eventmesh/connector/openfunction/client/EventMeshGrpcService**')
.exclude('**/org/apache/eventmesh/connector/openfunction/client/CallbackServiceGrpc**')
.exclude('**/org/apache/eventmesh/connector/jdbc/antlr**')
Expand Down Expand Up @@ -405,7 +406,7 @@ tasks.register('checkDeniedLicense') {
"BSD-4-Clause", "BSD-4-Clause-UC", "NPL-1.0", "NPL-1.1", "JSON"
]
// Update exemptions according to https://github.com/apache/eventmesh/issues/4842
def allowedArtifacts = ["amqp-client", "stax-api", "javassist", "ST4", "xsdlib"]
def allowedArtifacts = ["amqp-client", "stax-api", "javassist", "ST4", "xsdlib", "jsqlparser"]

def licenseFile = file('tools/dist-license/LICENSE')
def lines = licenseFile.readLines()
Expand Down
2 changes: 1 addition & 1 deletion eventmesh-admin-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {

// https://mvnrepository.com/artifact/com.alibaba/druid-spring-boot-starter
implementation "com.alibaba:druid-spring-boot-starter"
runtimeOnly 'com.mysql:mysql-connector-j'
compileOnly 'com.mysql:mysql-connector-j'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

import org.apache.commons.lang3.StringUtils;

import javax.annotation.PostConstruct;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

import lombok.extern.slf4j.Slf4j;

@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,12 @@ public class AdminGrpcServer extends AdminServiceGrpc.AdminServiceImplBase {

private Payload process(Payload value) {
if (value == null || StringUtils.isBlank(value.getMetadata().getType())) {
return PayloadUtil.from(FailResponse.build(ErrorCode.BAD_REQUEST, "bad request: type not " +
"exists"));
return PayloadUtil.from(FailResponse.build(ErrorCode.BAD_REQUEST, "bad request: type not exists"));
}
try {
BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse> handler =
handlerFactory.getHandler(value.getMetadata().getType());
BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse> handler = handlerFactory.getHandler(value.getMetadata().getType());
if (handler == null) {
return PayloadUtil.from(FailResponse.build(BaseRemoteResponse.UNKNOWN,
"not match any request handler"));
return PayloadUtil.from(FailResponse.build(BaseRemoteResponse.UNKNOWN, "not match any request handler"));
}
BaseRemoteResponse response = handler.handlerRequest((BaseRemoteRequest) PayloadUtil.parse(value), value.getMetadata());
if (response == null || response instanceof EmptyAckResponse) {
Expand All @@ -66,8 +63,7 @@ private Payload process(Payload value) {
} catch (Exception e) {
log.warn("process payload {} fail", value.getMetadata().getType(), e);
if (e instanceof AdminServerRuntimeException) {
return PayloadUtil.from(FailResponse.build(((AdminServerRuntimeException) e).getCode(),
e.getMessage()));
return PayloadUtil.from(FailResponse.build(((AdminServerRuntimeException) e).getCode(), e.getMessage()));
}
return PayloadUtil.from(FailResponse.build(ErrorCode.INTERNAL_ERR, "admin server internal err"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.eventmesh.admin.server.web;

import org.apache.eventmesh.admin.server.ComponentLifeCycle;

import org.apache.eventmesh.common.remote.payload.PayloadFactory;

import javax.annotation.PostConstruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.Data;

/**
* @TableName event_mesh_data_source
* event_mesh_data_source
*/
@TableName(value = "event_mesh_data_source")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.Data;

/**
* @TableName event_mesh_job_info
* event_mesh_job_info
*/
@TableName(value = "event_mesh_job_info")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.Data;

/**
* @TableName event_mesh_mysql_position
* event_mesh_mysql_position
*/
@TableName(value = "event_mesh_mysql_position")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.Data;

/**
* @TableName event_mesh_position_reporter_history
* event_mesh_position_reporter_history
*/
@TableName(value = "event_mesh_position_reporter_history")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.Data;

/**
* @TableName event_mesh_runtime_heartbeat
* event_mesh_runtime_heartbeat
*/
@TableName(value = "event_mesh_runtime_heartbeat")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.Data;

/**
* @TableName event_mesh_runtime_history
* event_mesh_runtime_history
*/
@TableName(value = "event_mesh_runtime_history")
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

/**
*
* for table `event_mesh_data_source】的数据库操作Service
* @createDate 2024-05-09 15:52:49
* for table 'event_mesh_data_source' db operation
* 2024-05-09 15:52:49
*/
public interface EventMeshDataSourceService extends IService<EventMeshDataSource> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void onApplicationEvent(ContextRefreshedEvent event) {
continue;
}

Class tClass = (Class) ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments()[0];
handlers.putIfAbsent(tClass.getSimpleName(), requestHandler);
Class c = (Class) ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments()[0];
handlers.putIfAbsent(c.getSimpleName(), requestHandler);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* for table 'event_mesh_runtime_heartbeat' db operation
* 2024-05-14 17:15:03
* for table 'event_mesh_runtime_heartbeat' db operation 2024-05-14 17:15:03
*/
@Service
@Slf4j
Expand All @@ -51,8 +50,8 @@ public boolean saveOrUpdateByRuntimeAddress(EventMeshRuntimeHeartbeat entity) {
return heartbeatService.save(entity);
} else {
if (Long.parseLong(old.getReportTime()) >= Long.parseLong(entity.getReportTime())) {
log.info("update heartbeat record ignore, current report time late than db, job " +
"[{}], remote [{}]", entity.getJobID(), entity.getRuntimeAddr());
log.info("update heartbeat record ignore, current report time late than db, job [{}], remote [{}]", entity.getJobID(),
entity.getRuntimeAddr());
return true;
}
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@

import org.apache.commons.lang3.StringUtils;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.core.type.TypeReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@

import static org.apache.eventmesh.common.Constants.HTTP;

import org.apache.commons.collections4.CollectionUtils;

import org.apache.eventmesh.common.Constants;
import org.apache.eventmesh.common.utils.IPUtils;

import org.assertj.core.util.Strings;
import org.apache.commons.collections4.CollectionUtils;

import java.util.Collections;
import java.util.List;

import org.assertj.core.util.Strings;

import lombok.Data;
import lombok.NoArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import org.apache.commons.lang3.StringUtils;

import org.assertj.core.util.Strings;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -31,6 +29,8 @@
import java.util.Objects;
import java.util.Properties;

import org.assertj.core.util.Strings;

import lombok.Getter;

public class ConfigService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class PropertiesFileLoad implements FileLoad {
private final Convert convert = new Convert();

@SuppressWarnings("unchecked")
@Override
public <T> T getConfig(ConfigInfo configInfo) throws IOException {
final Properties properties = new Properties();
if (StringUtils.isNotBlank(configInfo.getResourceUrl())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SinkConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class KafkaSinkConfig extends SinkConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SourceConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class KafkaSourceConfig extends SourceConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SinkConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class PulsarSinkConfig extends SinkConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SourceConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class PulsarSourceConfig extends SourceConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CanalSinkConfig extends SinkConfig {

private Integer poolSize = 5; // sink thread size for single channel

private SyncMode syncMode; // sync mode:column/row
private SyncMode syncMode; // sync mode: field/row

private Boolean skipException = false; // skip sink process exception

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ public class CanalSourceConfig extends SourceConfig {

private Boolean enableRemedy = false; // enable remedy

// private RemedyAlgorithm remedyAlgorithm; // remedyAlgorithm

private SyncMode syncMode; // sync mode:column/row
private SyncMode syncMode; // sync mode: field/row

private SyncConsistency syncConsistency; // sync consistency

Expand All @@ -71,7 +69,8 @@ public class CanalSourceConfig extends SourceConfig {

private String systemMarkTableColumn; // Column name of the bidirectional synchronization mark

private String systemMarkTableInfo; // nfo information of the bidirectional synchronization mark, similar to BI_SYNC
private String systemMarkTableInfo;
// nfo information of the bidirectional synchronization mark, similar to BI_SYNC

private String systemBufferTable; // sync buffer table

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SinkConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class MongodbSinkConfig extends SinkConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SourceConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class MongodbSourceConfig extends SourceConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SinkConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class RedisSinkConfig extends SinkConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SourceConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class RedisSourceConfig extends SourceConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.eventmesh.common.config.connector.SourceConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class S3SourceConfig extends SourceConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

public enum SyncConsistency {
/**
* 基于当前介质最新数据
* based with media
*/
MEDIA("M"),
/**
* 基于当前的store记录的数据
* based with store
*/
STORE("S"),
/**
* 基于当前的变更value,最终一致性
* Based on the current change value, eventual consistency
*/
BASE("B");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
package org.apache.eventmesh.common.remote.job;

public enum SyncMode {
/** 行记录 */
/**
* row
*/
ROW("R"),
/** 字段记录 */
/**
* field
*/
FIELD("F");

private String value;

SyncMode(String value){
SyncMode(String value) {
this.value = value;
}

Expand Down
Loading

0 comments on commit bfafbfb

Please sign in to comment.