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

[Feature][scaleph-ui-react] add gravitino web #738

Merged
merged 6 commits into from
Jun 20, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

import cn.sliew.scaleph.api.annotation.Logging;
import cn.sliew.scaleph.common.exception.ScalephException;
import cn.sliew.scaleph.dag.xflow.dnd.DndDTO;
import cn.sliew.scaleph.system.model.ResponseVO;
import cn.sliew.scaleph.workspace.flink.cdc.service.FlinkCDCDagService;
import cn.sliew.scaleph.workspace.flink.cdc.service.WsArtifactFlinkCDCService;
import cn.sliew.scaleph.workspace.flink.cdc.service.dto.WsArtifactFlinkCDCDTO;
import cn.sliew.scaleph.workspace.flink.cdc.service.param.*;
Expand All @@ -44,8 +42,6 @@
@RequestMapping(path = "/api/artifact/flink/cdc")
public class WsArtifactFlinkCDCController {

@Autowired
private FlinkCDCDagService flinkCDCDagService;
@Autowired
private WsArtifactFlinkCDCService wsArtifactFlinkCDCService;

Expand Down Expand Up @@ -97,14 +93,6 @@ public ResponseEntity<ResponseVO> update(@Validated @RequestBody WsArtifactFlink
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
}

@Logging
@PostMapping("graph")
@Operation(summary = "修改 flink cdc graph", description = "修改 flink cdc graph")
public ResponseEntity<ResponseVO> updateGraph(@RequestBody @Valid WsArtifactFlinkCDCGraphParam param) {
wsArtifactFlinkCDCService.updateGraph(param);
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
}

@Logging
@DeleteMapping("{id}")
@Operation(summary = "删除 fink cdc", description = "删除 fink cdc")
Expand All @@ -129,14 +117,6 @@ public ResponseEntity<ResponseVO> deleteArtifact(@PathVariable("artifactId") Lon
return new ResponseEntity<>(ResponseVO.success(), HttpStatus.OK);
}

@Logging
@GetMapping("/dag/dnd")
@Operation(summary = "查询DAG节点元信息", description = "后端统一返回节点信息")
public ResponseEntity<ResponseVO<List<DndDTO>>> loadNodeMeta() {
List<DndDTO> dnds = flinkCDCDagService.getDnds();
return new ResponseEntity<>(ResponseVO.success(dnds), HttpStatus.OK);
}

@Logging
@GetMapping("{id}/preview")
@Operation(summary = "预览 flink cdc 配置", description = "预览 flink cdc 配置")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,29 @@ public class WsArtifactFlinkCDC extends BaseDO {
@TableField("flink_cdc_version")
private FlinkCDCVersion flinkCDCVersion;

@TableField("dag_id")
private Long dagId;
@TableField("parallelism")
private Integer parallelism;

@TableField("local_time_zone")
private String localTimeZone;

@TableField("from_ds_id")
private Long fromDsId;

@TableField("from_ds_config")
private String fromDsConfig;

@TableField("to_ds_id")
private Long toDsId;

@TableField("to_ds_config")
private String toDsConfig;

@TableField("transform")
private String transform;

@TableField("route")
private String route;

@TableField("`current`")
private YesOrNo current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@
<result column="artifact_id" property="artifactId"/>
<result column="flink_version" property="flinkVersion"/>
<result column="flink_cdc_version" property="flinkCDCVersion"/>
<result column="dag_id" property="dagId"/>
<result column="parallelism" property="parallelism"/>
<result column="local_time_zone" property="localTimeZone"/>
<result column="from_ds_id" property="fromDsId"/>
<result column="from_ds_config" property="fromDsConfig"/>
<result column="to_ds_id" property="toDsId"/>
<result column="to_ds_config" property="toDsConfig"/>
<result column="transform" property="transform"/>
<result column="route" property="route"/>
<result column="current" property="current"/>
<association column="artifact_id" property="artifact"
select="cn.sliew.scaleph.dao.mapper.master.ws.WsArtifactMapper.selectById"/>
Expand All @@ -37,7 +44,9 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, creator, create_time, editor, update_time,
artifact_id, flink_version, flink_cdc_version, dag_id, `current`
artifact_id, flink_version, flink_cdc_version,
parallelism, local_time_zone, from_ds_id, from_ds_config,
to_ds_id, to_ds_config, `transform`, route, `current`
</sql>

<select id="list" resultMap="FlinkArtifactCDCMap">
Expand Down
2 changes: 2 additions & 0 deletions scaleph-datasource/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
<dependency>
<groupId>com.datastrato.gravitino</groupId>
<artifactId>client-java-runtime</artifactId>
<!-- <optional>true</optional>-->
</dependency>
<dependency>
<groupId>com.datastrato.gravitino</groupId>
<artifactId>client-java</artifactId>
<!-- <optional>true</optional>-->
</dependency>
</dependencies>

Expand Down
10 changes: 9 additions & 1 deletion scaleph-ui-react/src/pages/Metadata/Gravitino/Catalog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ const MetadataGravitinoCatalogWeb: React.FC = () => {
const access = useAccess();

return (
<PageContainer title={false}>待开发</PageContainer>
<PageContainer title={false}>
<iframe
src={"http://localhost:8090"}
width="100%"
style={{
height:"75vh"
}}
/>
</PageContainer>
);
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public interface WsArtifactFlinkCDCService {

int update(WsArtifactFlinkCDCUpdateParam param);

void updateGraph(WsArtifactFlinkCDCGraphParam param);

int delete(Long id) throws ScalephException;

int deleteBatch(List<Long> ids) throws ScalephException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package cn.sliew.scaleph.workspace.flink.cdc.service.convert;

import cn.sliew.milky.common.util.JacksonUtil;
import cn.sliew.scaleph.common.convert.BaseConvert;
import cn.sliew.scaleph.dao.entity.master.ws.WsArtifactFlinkCDC;
import cn.sliew.scaleph.workspace.flink.cdc.service.dto.WsArtifactFlinkCDCDTO;
Expand All @@ -26,6 +27,7 @@
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface WsArtifactFlinkCDCConvert extends BaseConvert<WsArtifactFlinkCDC, WsArtifactFlinkCDCDTO> {
Expand All @@ -37,6 +39,18 @@ default WsArtifactFlinkCDC toDo(WsArtifactFlinkCDCDTO dto) {
BeanUtils.copyProperties(dto, entity);
entity.setArtifact(WsArtifactConvert.INSTANCE.toDo(dto.getArtifact()));
entity.setArtifactId(dto.getArtifact().getId());
if (dto.getFromDsConfig() != null) {
entity.setFromDsConfig(dto.getFromDsConfig().toString());
}
if (dto.getToDsConfig() != null) {
entity.setToDsConfig(dto.getToDsConfig().toString());
}
if (dto.getTransform() != null) {
entity.setTransform(dto.getTransform().toString());
}
if (dto.getRoute() != null) {
entity.setRoute(dto.getRoute().toString());
}
return entity;
}

Expand All @@ -45,6 +59,18 @@ default WsArtifactFlinkCDCDTO toDto(WsArtifactFlinkCDC entity) {
WsArtifactFlinkCDCDTO dto = new WsArtifactFlinkCDCDTO();
BeanUtils.copyProperties(entity, dto);
dto.setArtifact(WsArtifactConvert.INSTANCE.toDto(entity.getArtifact()));
if (StringUtils.hasText(entity.getFromDsConfig())) {
dto.setFromDsConfig(JacksonUtil.toJsonNode(entity.getFromDsConfig()));
}
if (StringUtils.hasText(entity.getToDsConfig())) {
dto.setToDsConfig(JacksonUtil.toJsonNode(entity.getToDsConfig()));
}
if (StringUtils.hasText(entity.getTransform())) {
dto.setTransform(JacksonUtil.toJsonNode(entity.getTransform()));
}
if (StringUtils.hasText(entity.getRoute())) {
dto.setRoute(JacksonUtil.toJsonNode(entity.getRoute()));
}
return dto;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import cn.sliew.scaleph.common.dict.common.YesOrNo;
import cn.sliew.scaleph.common.dict.flink.FlinkVersion;
import cn.sliew.scaleph.common.dict.flink.cdc.FlinkCDCVersion;
import cn.sliew.scaleph.dag.service.dto.DagConfigComplexDTO;
import cn.sliew.scaleph.workspace.project.service.dto.WsArtifactDTO;
import cn.sliew.scaleph.system.model.BaseDTO;
import cn.sliew.scaleph.workspace.project.service.dto.WsArtifactDTO;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

Expand All @@ -40,11 +40,29 @@ public class WsArtifactFlinkCDCDTO extends BaseDTO {
@Schema(description = "flink cdc 版本")
private FlinkCDCVersion flinkCDCVersion;

@Schema(description = "dag id")
private Long dagId;
@Schema(description = "全局并行度")
private Integer parallelism;

@Schema(description = "时区")
private String localTimeZone;

@Schema(description = "来源-数据源id")
private Long fromDsId;

@Schema(description = "来源-数据源配置")
private JsonNode fromDsConfig;

@Schema(description = "去向-数据源id")
private Long toDsId;

@Schema(description = "去向-数据源配置")
private JsonNode toDsConfig;

@Schema(description = "transform")
private JsonNode transform;

@Schema(description = "dag")
private DagConfigComplexDTO dag;
@Schema(description = "route")
private JsonNode route;

@Schema(description = "`current`")
private YesOrNo current;
Expand Down
Loading
Loading