Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #21] Implement Connection related code #22

Merged
merged 9 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ github:
dismiss_stale_reviews: true
required_approving_review_count: 1
notifications:
commits: [email protected]
commits: [email protected]
# Send all issue emails (new, closed, comments) to issues@
issues: [email protected]
issues: [email protected]
# Send new/closed PR notifications to dev@
pullrequests_status: [email protected]
# Send individual PR comments/reviews to issues@
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

1. eventmesh-dashboard-console 业务模块的代码,调用service接口
2. eventmesh-dashboard-observe 监控模块的代码
3. eventmesh-dashboard-core 对eventmesh以及相关组件的代码,提供service实现
3. eventmesh-dashboard-core 对EventMesh Runtime, Meta以及相关组件的代码,提供service实现
4. eventmesh-dashboard-service 公用API接口,对core的抽象
5. eventmesh-dashboard-common 公共模块的代码
6. eventmesh-dashboard-view 前端代码
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
package org.apache.eventmesh.dashboard.common;

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
@SpringBootApplication
@EnableScheduling
@ComponentScan({"org.apache.eventmesh.dashboard.service", "org.apache.eventmesh.dashboard.console"})
public class EventmeshConsoleApplication {
public class EventMeshDashboardApplication {

public static void main(String[] args) {
try {
SpringApplication.run(EventmeshConsoleApplication.class, args);
log.info("{} Successfully booted.", EventmeshConsoleApplication.class.getSimpleName());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
SpringApplication.run(EventMeshDashboardApplication.class, args);
log.info("{} Successfully booted.", EventMeshDashboardApplication.class.getSimpleName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.console.entity.connection;
package org.apache.eventmesh.dashboard.console.dto;

import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;


public class ConnectionResponseEntity implements Serializable {
private static final long serialVersionUID = 1L;
public class ConnectionResponse implements Serializable {

@Schema(name = "id", description = "primary key")
private static final long serialVersionUID = -7317308457824435889L;

@Schema(name = "id", description = "primary key of table connection")
private Long id;

@Schema(name = "sourceType", defaultValue = "connector", allowableValues = {"connector", "client"})
Expand All @@ -37,6 +38,9 @@ public class ConnectionResponseEntity implements Serializable {
@Schema(name = "sourceStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
private Integer sourceStatus;

@Schema(name = "sourceConfigList", description = "source config list")
private List<ConfigEntity> sourceConfigList;

@Schema(name = "sinkType", defaultValue = "connector", allowableValues = {"connector", "client"})
private String sinkType;

Expand All @@ -46,6 +50,9 @@ public class ConnectionResponseEntity implements Serializable {
@Schema(name = "sinkStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
private Integer sinkStatus;

@Schema(name = "sinkConfigList", description = "sink config list")
private List<ConfigEntity> sinkConfigList;

private Long runtimeId;

@Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
@Schema(name = "BaseEntity", description = "Base entity")
public class BaseEntity implements Serializable {

private Long clusterPhyId;
private static final long serialVersionUID = -2697805837923579585L;

private Long clusterId;

protected Timestamp createTime;

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

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import io.swagger.v3.oas.annotations.media.Schema;

public class ClientEntity extends BaseEntity {

private static final long serialVersionUID = 1L;

private static final long serialVersionUID = 8204133370609215856L;
@Schema(name = "id", description = "primary key")
private Long id;

private String name;

private String eventmeshAddress;

private String platform;

private String language;
Expand All @@ -50,6 +49,10 @@ public class ClientEntity extends BaseEntity {
@Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
private Integer status;

private String configIds;

private String description;

private Timestamp endTime;
}
Pil0tXia marked this conversation as resolved.
Show resolved Hide resolved

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;
import java.util.Objects;

import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -32,52 +33,38 @@
@Data
public class ConnectionEntity extends BaseEntity {

private static final long serialVersionUID = 1L;

private static final long serialVersionUID = 6565578252656944905L;
@Schema(name = "id", description = "primary key")
private Long id;

/**
* The type of source. Possible values are "connector" or "client".
*/
@Schema(name = "sourceType", defaultValue = "connector", allowableValues = {"connector", "client"})
private String sourceType;

/**
* The type of source. Possible values are "connector" and "client".
*/
@Schema(name = "sourceId", description = "connectorId or clientId")
private Long sourceId;

/**
* 0: not active, 1: active
*/
@Schema(name = "sourceStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
private Integer sourceStatus;

/**
* The type of sink. Possible values are "connector" and "client".
* The type of sink. Possible values are "connector" or "client".
*/
@Schema(name = "sinkType", defaultValue = "connector", allowableValues = {"connector", "client"})
private String sinkType;

@Schema(name = "sinkId", description = "connectorId or clientId")
private Long sinkId;

/**
* 0: not active, 1: active
*/
@Schema(name = "sinkStatus", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
private Integer sinkStatus;

private Long runtimeId;

@Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:not active, 1:active")
@Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, description = "0:inactive, 1:active")
private Integer status;

@Schema(name = "topic", description = "related topic name from storage")
private String topic;

private Long groupId;

private String groupName;
private Timestamp endTime;

private String description;

Expand All @@ -92,19 +79,13 @@ public boolean equals(Object o) {
ConnectionEntity that = (ConnectionEntity) o;
return Objects.equals(sourceType, that.sourceType)
&& Objects.equals(sourceId, that.sourceId)
&& Objects.equals(sourceStatus, that.sourceStatus)

&& Objects.equals(sinkType, that.sinkType)
&& Objects.equals(sinkId, that.sinkId)
&& Objects.equals(sinkStatus, that.sinkStatus)

&& Objects.equals(runtimeId, that.runtimeId)
&& Objects.equals(status, that.status)

&& Objects.equals(topic, that.topic)
&& Objects.equals(groupId, that.groupId)
&& Objects.equals(groupName, that.groupName)

&& Objects.equals(description, that.description);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,25 @@

public class ConnectorEntity extends BaseEntity {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -8226303660232951326L;

@Schema(name = "id", description = "primary key")
private Long id;

private Long connectClusterId;
private String name;

private String connectorName;
private String className;

private String connectorClassName;
private String type;

private String connectorType;
private String status;

private String state;

private String topics;

private Integer taskCount;
private Integer podState;

/**
* csv format config id list.<br>
* Example value: 1,2,7<br>
* This field is updated when the configuration is modified via the web API, but is not used during the configuration retrieval process.
*/
private String configIds;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 org.apache.eventmesh.dashboard.console.entity.health;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

@Data
@Schema(name = "HealthCheckResultEntity", description = "Health check result entity")
public class HealthCheckResultEntity extends BaseEntity {

private static final long serialVersionUID = -7350585209577598040L;
@Schema(name = "id", description = "primary key")
private Long id;

@Schema(description = "Dimension of Health Check;0:Unknown, 1:Cluster, 2:Runtime, 3:Topic, 4:Group", defaultValue = "0", allowableValues = {"0",
"1", "2", "3", "4"})
private Integer dimension;
Copy link
Member

Choose a reason for hiding this comment

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

"Dimension" is an abstract word. How about "serviceType"?

It will be better to use Enum as class type here. The same as the ConnectorEntity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think ServiceType means?
How about just call it checkType?


private String configName;

private String resName;

Pil0tXia marked this conversation as resolved.
Show resolved Hide resolved
private Integer passed;

public HealthCheckResultEntity() {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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 org.apache.eventmesh.dashboard.console.entity.meta;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

@Data
public class MetaEntity extends BaseEntity {

private static final long serialVersionUID = 7176263169716424469L;

/**
* Primary key
*/
@Schema(name = "id", description = "Primary key")
private Long id;

private String name;

private String type;

private String version;

private Long clusterId;

private String host;

private Integer port;

private String role;

private String username;

private String params;

private Integer status;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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 org.apache.eventmesh.dashboard.console.enums;

public enum KubernetesPodStatus {
PENDING(0, "pending"),
RUNNING(1, "running"),
SUCCEEDED(2, "succeeded"),
FAILED(3, "failed"),
UNKNOWN(4, "unknown");
Pil0tXia marked this conversation as resolved.
Show resolved Hide resolved

KubernetesPodStatus(Integer number, String status) {
}
Pil0tXia marked this conversation as resolved.
Show resolved Hide resolved
}
Loading
Loading