Unverified Commit 383babb2 authored by Pandas886's avatar Pandas886 Committed by GitHub

[Improvement] Optimize paimon to store monitoring data, causing threads not to be released (#3547)

parent 295eb6cd
...@@ -25,11 +25,20 @@ import org.dinky.data.vo.MetricsVO; ...@@ -25,11 +25,20 @@ import org.dinky.data.vo.MetricsVO;
import org.dinky.utils.PaimonUtil; import org.dinky.utils.PaimonUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import cn.hutool.core.text.StrFormatter; import cn.hutool.core.text.StrFormatter;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
...@@ -39,38 +48,48 @@ import lombok.extern.slf4j.Slf4j; ...@@ -39,38 +48,48 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class MetricsContextHolder { public class MetricsContextHolder {
@Getter
protected static final MetricsContextHolder instance = new MetricsContextHolder(); protected static final MetricsContextHolder instance = new MetricsContextHolder();
public static MetricsContextHolder getInstances() { private final List<MetricsVO> metricsVOS = new CopyOnWriteArrayList<>();
return instance; private final AtomicLong lastDumpTime = new AtomicLong(System.currentTimeMillis());
}
/** // Create a ThreadFactory with custom naming
* Temporary cache monitoring information, mainly to prevent excessive buffering of write IO, ThreadFactory namedThreadFactory =
* when metricsVOS data reaches 1000 or the time exceeds 5 seconds new ThreadFactoryBuilder().setNameFormat("metrics-send-thread-%d").build();
*/
private final List<MetricsVO> metricsVOS = Collections.synchronizedList(new ArrayList<>());
private final Long lastDumpTime = System.currentTimeMillis(); // Create a custom ThreadPoolExecutor
ExecutorService pool = new ThreadPoolExecutor(
5, // Core pool size
10, // Maximum pool size, allows the pool to expand as needed
60L, // Keep alive time for idle threads
TimeUnit.SECONDS, // Unit of keep alive time
new LinkedBlockingQueue<Runnable>(10), // Use a larger queue to hold excess tasks
namedThreadFactory);
public void sendAsync(String key, MetricsVO o) { public void sendAsync(String key, MetricsVO o) {
CompletableFuture.runAsync(() -> { Object content = o.getContent();
Thread.currentThread().setContextClassLoader(MetricsContextHolder.class.getClassLoader()); if (content == null
metricsVOS.add(o); || (content instanceof ConcurrentHashMap && ((ConcurrentHashMap<?, ?>) content).isEmpty())) {
long duration = System.currentTimeMillis() - lastDumpTime; return; // Return early to avoid unnecessary operations
synchronized (metricsVOS) { }
if (metricsVOS.size() > 1000 || duration > 1000 * 5) { pool.execute(() -> {
PaimonUtil.write(PaimonTableConstant.DINKY_METRICS, metricsVOS, MetricsVO.class); metricsVOS.add(o);
metricsVOS.clear(); long current = System.currentTimeMillis();
} long duration = current - lastDumpTime.get();
} // Temporary cache monitoring information, mainly to prevent excessive buffering of write IO,
String topic = StrFormatter.format("{}/{}", SseTopic.METRICS.getValue(), key); // when metricsVOS data reaches 1000 or the time exceeds 15 seconds
SseSessionContextHolder.sendTopic(topic, o); if (metricsVOS.size() >= 1000 || duration >= 15000) {
}) List<MetricsVO> snapshot;
.whenComplete((v, t) -> { synchronized (this) { // Enter synchronized block only when necessary
if (t != null) { snapshot = new ArrayList<>(metricsVOS);
log.error("send metrics async error", t); metricsVOS.clear();
} lastDumpTime.set(current);
}); }
PaimonUtil.write(PaimonTableConstant.DINKY_METRICS, snapshot, MetricsVO.class);
}
String topic = StrFormatter.format("{}/{}", SseTopic.METRICS.getValue(), key);
SseSessionContextHolder.sendTopic(topic, o); // Ensure only successfully added metrics are sent
});
} }
} }
...@@ -73,7 +73,7 @@ public class JobMetricsHandler { ...@@ -73,7 +73,7 @@ public class JobMetricsHandler {
metricsVO.setHeartTime(LocalDateTime.now()); metricsVO.setHeartTime(LocalDateTime.now());
metricsVO.setModel(jobId); metricsVO.setModel(jobId);
metricsVO.setDate(TimeUtil.nowStr("yyyy-MM-dd")); metricsVO.setDate(TimeUtil.nowStr("yyyy-MM-dd"));
MetricsContextHolder.getInstances().sendAsync(metricsVO.getModel(), metricsVO); MetricsContextHolder.getInstance().sendAsync(metricsVO.getModel(), metricsVO);
} catch (Exception e) { } catch (Exception e) {
log.error("Get and save Flink metrics error", e); log.error("Get and save Flink metrics error", e);
} }
......
...@@ -49,7 +49,7 @@ public class SystemMetricsHandler { ...@@ -49,7 +49,7 @@ public class SystemMetricsHandler {
metrics.setHeartTime(now); metrics.setHeartTime(now);
metrics.setModel(MetricsType.LOCAL.getType()); metrics.setModel(MetricsType.LOCAL.getType());
metrics.setDate(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); metrics.setDate(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
MetricsContextHolder.getInstances().sendAsync(metrics.getModel(), metrics); MetricsContextHolder.getInstance().sendAsync(metrics.getModel(), metrics);
log.debug("Collecting jvm information ends."); log.debug("Collecting jvm information ends.");
} }
......
...@@ -7,7 +7,7 @@ This project uses [Ant Design Pro](https://pro.ant.design) for initialization. H ...@@ -7,7 +7,7 @@ This project uses [Ant Design Pro](https://pro.ant.design) for initialization. H
## Environment preparation ## Environment preparation
| Environment | Version | Remarks | | Environment | Version | Remarks |
|-------------|---------|---------| | ----------- | ------- | ------- |
| node | 18+ | | | node | 18+ | |
| npm | 10+ | | | npm | 10+ | |
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
## 环境准备 ## 环境准备
| 环境 | 版本 | 备注 | | 环境 | 版本 | 备注 |
|------|-----|----| | ---- | ---- | ---- |
| node | 18+ | | | node | 18+ | |
| npm | 10+ | | | npm | 10+ | |
> 自行配置相关环境变量 > 自行配置相关环境变量
......
...@@ -43,10 +43,10 @@ const DagDataNode = (props: any) => { ...@@ -43,10 +43,10 @@ const DagDataNode = (props: any) => {
ratio > 0.75 ratio > 0.75
? '#cf1322' ? '#cf1322'
: ratio > 0.5 : ratio > 0.5
? '#d46b08' ? '#d46b08'
: ratio > 0.25 : ratio > 0.25
? '#d4b106' ? '#d4b106'
: '#3f8600', : '#3f8600',
fontSize: 10 fontSize: 10
}} }}
/> />
...@@ -65,10 +65,10 @@ const DagDataNode = (props: any) => { ...@@ -65,10 +65,10 @@ const DagDataNode = (props: any) => {
ratio > 0.75 ratio > 0.75
? '#3f8600' ? '#3f8600'
: ratio > 0.5 : ratio > 0.5
? '#d4b106' ? '#d4b106'
: ratio > 0.25 : ratio > 0.25
? '#d46b08' ? '#d46b08'
: '#cf1322', : '#cf1322',
fontSize: 10 fontSize: 10
}} }}
/> />
......
...@@ -21,7 +21,7 @@ import { l } from '@/utils/intl'; ...@@ -21,7 +21,7 @@ import { l } from '@/utils/intl';
import { ProFormSelect } from '@ant-design/pro-components'; import { ProFormSelect } from '@ant-design/pro-components';
import { ProFormSelectProps } from '@ant-design/pro-form/es/components/Select'; import { ProFormSelectProps } from '@ant-design/pro-form/es/components/Select';
import { Divider, Typography } from 'antd'; import { Divider, Typography } from 'antd';
import React from "react"; import React from 'react';
const { Link } = Typography; const { Link } = Typography;
......
...@@ -17,29 +17,28 @@ ...@@ -17,29 +17,28 @@
* *
*/ */
import {ProFormSelect} from '@ant-design/pro-components'; import { ProFormSelect } from '@ant-design/pro-components';
import {ProFormSelectProps} from '@ant-design/pro-form/es/components/Select'; import { ProFormSelectProps } from '@ant-design/pro-form/es/components/Select';
import {Divider} from 'antd'; import { Divider } from 'antd';
import React from "react"; import React from 'react';
export type FlinkUdfOptionsProps = ProFormSelectProps & {}; export type FlinkUdfOptionsProps = ProFormSelectProps & {};
const FlinkUdfOptionsSelect = (props: FlinkUdfOptionsProps) => { const FlinkUdfOptionsSelect = (props: FlinkUdfOptionsProps) => {
const renderTemplateDropDown = (item: any) => { const renderTemplateDropDown = (item: any) => {
return ( return (
<> <>
<Divider style={{ margin: '8px 0' }} /> <Divider style={{ margin: '8px 0' }} />
{item} {item}
</> </>
); );
}; };
return ( return (
<ProFormSelect <ProFormSelect
{...props} {...props}
fieldProps={{ dropdownRender: (item) => renderTemplateDropDown(item), ...props.fieldProps}} fieldProps={{ dropdownRender: (item) => renderTemplateDropDown(item), ...props.fieldProps }}
/> />
); );
}; };
......
...@@ -92,54 +92,57 @@ export default class LineageDagExt extends LineageDag { ...@@ -92,54 +92,57 @@ export default class LineageDagExt extends LineageDag {
edges: result.edges edges: result.edges
}; };
setTimeout(() => { setTimeout(
let tmpEdges = result.edges; () => {
result.edges = []; let tmpEdges = result.edges;
// this.canvas.wrapper.style.visibility = 'hidden'; result.edges = [];
this.canvas.draw(result, () => { // this.canvas.wrapper.style.visibility = 'hidden';
this.canvas.relayout( this.canvas.draw(result, () => {
{ this.canvas.relayout(
edges: tmpEdges.map((item) => { {
return { edges: tmpEdges.map((item) => {
source: item.sourceNode, return {
target: item.targetNode source: item.sourceNode,
}; target: item.targetNode
}) };
}, })
true },
); true
// this.canvas.wrapper.style.visibility = 'visible'; );
this.canvas.addEdges(tmpEdges, true); // this.canvas.wrapper.style.visibility = 'visible';
this.canvas.addEdges(tmpEdges, true);
let minimap = _.get(this, 'props.config.minimap', {});
let minimap = _.get(this, 'props.config.minimap', {});
const minimapCfg = _.assign({}, minimap.config, {
events: ['system.node.click', 'system.canvas.click'] const minimapCfg = _.assign({}, minimap.config, {
}); events: ['system.node.click', 'system.canvas.click']
});
if (minimap && minimap.enable) {
this.canvas.setMinimap(true, minimapCfg); if (minimap && minimap.enable) {
} this.canvas.setMinimap(true, minimapCfg);
}
if (_.get(this, 'props.config.gridMode')) { if (_.get(this, 'props.config.gridMode')) {
this.canvas.setGridMode(true, _.assign({}, _.get(this, 'props.config.gridMode', {}))); this.canvas.setGridMode(true, _.assign({}, _.get(this, 'props.config.gridMode', {})));
} }
if (result.nodes.length !== 0) { if (result.nodes.length !== 0) {
this.canvas.focusCenterWithAnimate(); this.canvas.focusCenterWithAnimate();
this._isFirstFocus = true; this._isFirstFocus = true;
} }
this.forceUpdate(); this.forceUpdate();
this.props.onLoaded && this.props.onLoaded(this.canvas); this.props.onLoaded && this.props.onLoaded(this.canvas);
}); });
this.canvas.on('system.node.click', (data) => { this.canvas.on('system.node.click', (data) => {
let node = data.node; let node = data.node;
this.canvas.focus(node.id); this.canvas.focus(node.id);
}); });
this.canvas.on('system.canvas.click', () => { this.canvas.on('system.canvas.click', () => {
this.canvas.unfocus(); this.canvas.unfocus();
}); });
}, _.get(this.props, 'config.delayDraw', 0)); },
_.get(this.props, 'config.delayDraw', 0)
);
} }
} }
...@@ -450,8 +450,10 @@ export default { ...@@ -450,8 +450,10 @@ export default {
'pages.datastudio.label.jobConfig.addConfig.params': 'parameters', 'pages.datastudio.label.jobConfig.addConfig.params': 'parameters',
'pages.datastudio.label.jobConfig.addConfig.value': 'value', 'pages.datastudio.label.jobConfig.addConfig.value': 'value',
'pages.datastudio.label.udf': 'Udf Item', 'pages.datastudio.label.udf': 'Udf Item',
'pages.datastudio.label.udf.tip': 'Inject UDF item, Automatically add statement `create temporary function [functionName] as [className]` at the beginning of the SQL statement', 'pages.datastudio.label.udf.tip':
'pages.datastudio.label.udf.duplicate.tip': 'The class [className] selected this time already exists and duplicate injection is not allowed. Please reselect or cancel injection (delete and change line).', 'Inject UDF item, Automatically add statement `create temporary function [functionName] as [className]` at the beginning of the SQL statement',
'pages.datastudio.label.udf.duplicate.tip':
'The class [className] selected this time already exists and duplicate injection is not allowed. Please reselect or cancel injection (delete and change line).',
'pages.datastudio.label.udf.injectUdf': 'Inject UDF item', 'pages.datastudio.label.udf.injectUdf': 'Inject UDF item',
'pages.datastudio.label.udf.name': 'function name', 'pages.datastudio.label.udf.name': 'function name',
'pages.datastudio.label.udf.className': 'class name', 'pages.datastudio.label.udf.className': 'class name',
...@@ -1006,7 +1008,8 @@ export default { ...@@ -1006,7 +1008,8 @@ export default {
'Support for a single or bulk upload. Strictly prohibited from uploading company data or\n other banned files.', 'Support for a single or bulk upload. Strictly prohibited from uploading company data or\n other banned files.',
'rc.resource.filelist': 'File list', 'rc.resource.filelist': 'File list',
'rc.resource.sync': 'Sync remote files', 'rc.resource.sync': 'Sync remote files',
'rc.resource.sync.confirm': 'Please note that this operation will delete all records in the database and will affect running jobs as well as corresponding resource files referenced in UDF management, resulting in job failure. And UDF cannot be used in UDF management Please operate with caution!! Please confirm if you want to continue?', 'rc.resource.sync.confirm':
'Please note that this operation will delete all records in the database and will affect running jobs as well as corresponding resource files referenced in UDF management, resulting in job failure. And UDF cannot be used in UDF management Please operate with caution!! Please confirm if you want to continue?',
'rc.resource.copy_to_add_custom_jar': 'Copy as ADD CUSTOMJAR syntax', 'rc.resource.copy_to_add_custom_jar': 'Copy as ADD CUSTOMJAR syntax',
'rc.resource.copy_to_add_jar': 'Copy as ADD JAR syntax', 'rc.resource.copy_to_add_jar': 'Copy as ADD JAR syntax',
'rc.resource.copy_to_add_file': 'Copy as ADD FILE syntax', 'rc.resource.copy_to_add_file': 'Copy as ADD FILE syntax',
......
...@@ -429,8 +429,10 @@ export default { ...@@ -429,8 +429,10 @@ export default {
'pages.datastudio.label.jobConfig.addConfig.params': '参数', 'pages.datastudio.label.jobConfig.addConfig.params': '参数',
'pages.datastudio.label.jobConfig.addConfig.value': '值', 'pages.datastudio.label.jobConfig.addConfig.value': '值',
'pages.datastudio.label.udf': '注入UDF算子', 'pages.datastudio.label.udf': '注入UDF算子',
'pages.datastudio.label.udf.tip': '注入UDF算子, 自动在所有语句前注入`create temporary function [functionName] as [className]` 语句', 'pages.datastudio.label.udf.tip':
'pages.datastudio.label.udf.duplicate.tip': '此次选择的类[className]已经存在,不允许重复注入,请重新选择,或者取消注入(删除改行即可)。', '注入UDF算子, 自动在所有语句前注入`create temporary function [functionName] as [className]` 语句',
'pages.datastudio.label.udf.duplicate.tip':
'此次选择的类[className]已经存在,不允许重复注入,请重新选择,或者取消注入(删除改行即可)。',
'pages.datastudio.label.udf.injectUdf': '注入UDF', 'pages.datastudio.label.udf.injectUdf': '注入UDF',
'pages.datastudio.label.udf.name': '函数名称', 'pages.datastudio.label.udf.name': '函数名称',
'pages.datastudio.label.udf.className': '类名', 'pages.datastudio.label.udf.className': '类名',
...@@ -962,7 +964,8 @@ export default { ...@@ -962,7 +964,8 @@ export default {
'rc.resource.upload.tip2': '支持单个或批量上传。严禁上传公司数据或其他禁止上传的文件。', 'rc.resource.upload.tip2': '支持单个或批量上传。严禁上传公司数据或其他禁止上传的文件。',
'rc.resource.filelist': '文件列表', 'rc.resource.filelist': '文件列表',
'rc.resource.sync': '同步目录结构', 'rc.resource.sync': '同步目录结构',
'rc.resource.sync.confirm': '请注意: 该操作会删除数据库内的所有记录,且会关系到运行中的作业,以及UDF管理中引用的对应资源文件.从而导致作业运行失败。以及在 UDF管理中的 UDF 无法被使用. 请谨慎操作!! 请确认是否继续? ', 'rc.resource.sync.confirm':
'请注意: 该操作会删除数据库内的所有记录,且会关系到运行中的作业,以及UDF管理中引用的对应资源文件.从而导致作业运行失败。以及在 UDF管理中的 UDF 无法被使用. 请谨慎操作!! 请确认是否继续? ',
'rc.resource.copy_to_add_custom_jar': '复制为 ADD CUSTOMJAR 语法', 'rc.resource.copy_to_add_custom_jar': '复制为 ADD CUSTOMJAR 语法',
'rc.resource.copy_to_add_jar': '复制为 ADD JAR 语法', 'rc.resource.copy_to_add_jar': '复制为 ADD JAR 语法',
'rc.resource.copy_to_add_file': '复制为 ADD FILE 语法', 'rc.resource.copy_to_add_file': '复制为 ADD FILE 语法',
......
...@@ -325,10 +325,10 @@ const MenuList: React.FC = () => { ...@@ -325,10 +325,10 @@ const MenuList: React.FC = () => {
{sysMenuValue?.id && editOpen {sysMenuValue?.id && editOpen
? l('menu.edit') ? l('menu.edit')
: !sysMenuValue?.id && addedOpen && !isRootMenu : !sysMenuValue?.id && addedOpen && !isRootMenu
? l('right.menu.addSub') ? l('right.menu.addSub')
: !sysMenuValue?.id && addedOpen && isRootMenu : !sysMenuValue?.id && addedOpen && isRootMenu
? l('right.menu.createRoot') ? l('right.menu.createRoot')
: ''} : ''}
</> </>
); );
}; };
......
...@@ -87,11 +87,11 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => { ...@@ -87,11 +87,11 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => {
value.expireType === 2 value.expireType === 2
? parseDateStringToDate(value.expireEndTime) ? parseDateStringToDate(value.expireEndTime)
: value.expireType === 3 : value.expireType === 3
? [ ? [
parseDateStringToDate(value.expireStartTime), parseDateStringToDate(value.expireStartTime),
parseDateStringToDate(value.expireEndTime) parseDateStringToDate(value.expireEndTime)
] ]
: undefined : undefined
}); });
}, [visible, value, form, selectUserId]); }, [visible, value, form, selectUserId]);
......
...@@ -61,8 +61,8 @@ export const JobConfigInfo: React.FC<JobDetailInfoModelProps> = (props) => { ...@@ -61,8 +61,8 @@ export const JobConfigInfo: React.FC<JobDetailInfoModelProps> = (props) => {
{row?.clusterId {row?.clusterId
? l('pages.datastudio.label.history.clusterInstance') ? l('pages.datastudio.label.history.clusterInstance')
: row?.clusterConfigurationId : row?.clusterConfigurationId
? l('pages.datastudio.label.history.clusterConfig') ? l('pages.datastudio.label.history.clusterConfig')
: l('pages.datastudio.label.history.local')} : l('pages.datastudio.label.history.local')}
</ProDescriptions.Item> </ProDescriptions.Item>
<ProDescriptions.Item <ProDescriptions.Item
......
...@@ -52,8 +52,8 @@ const JobRunningModal: React.FC<JobRunningModalProps> = (props) => { ...@@ -52,8 +52,8 @@ const JobRunningModal: React.FC<JobRunningModalProps> = (props) => {
? value?.jobState === 'RUNNING' ? value?.jobState === 'RUNNING'
? 50 ? 50
: value?.jobState === 'FINISHED' : value?.jobState === 'FINISHED'
? 100 ? 100
: 0 : 0
: 0 : 0
} }
status='active' status='active'
......
...@@ -338,8 +338,8 @@ export function getRightSelectKeyFromNodeClickJobType(jobType: string): string { ...@@ -338,8 +338,8 @@ export function getRightSelectKeyFromNodeClickJobType(jobType: string): string {
return isFlinkJob(jobType) return isFlinkJob(jobType)
? RightMenuKey.JOB_CONFIG_KEY ? RightMenuKey.JOB_CONFIG_KEY
: isSql(jobType) : isSql(jobType)
? RightMenuKey.PREVIEW_CONFIG_KEY ? RightMenuKey.PREVIEW_CONFIG_KEY
: RightMenuKey.JOB_INFO_KEY; : RightMenuKey.JOB_INFO_KEY;
} }
export function getBottomSelectKeyFromNodeClickJobType(jobType: string): string { export function getBottomSelectKeyFromNodeClickJobType(jobType: string): string {
......
...@@ -197,8 +197,8 @@ const Project: React.FC = (props: connect) => { ...@@ -197,8 +197,8 @@ const Project: React.FC = (props: connect) => {
options.parentId = projectState.isCreateTask options.parentId = projectState.isCreateTask
? projectState.value.id ? projectState.value.id
: projectState.isEdit : projectState.isEdit
? projectState.value.parentId ? projectState.value.parentId
: options.parentId; : options.parentId;
} else { } else {
options.url = API_CONSTANTS.SAVE_OR_UPDATE_CATALOGUE_URL; options.url = API_CONSTANTS.SAVE_OR_UPDATE_CATALOGUE_URL;
} }
......
...@@ -36,7 +36,6 @@ export function getFlinkConfigs() { ...@@ -36,7 +36,6 @@ export function getFlinkConfigs() {
export function getFlinkUdfOptions() { export function getFlinkUdfOptions() {
return queryDataByParams(API_CONSTANTS.ALL_UDF_LIST); return queryDataByParams(API_CONSTANTS.ALL_UDF_LIST);
} }
export function querySuggestionData(params: any) { export function querySuggestionData(params: any) {
......
...@@ -99,8 +99,8 @@ const DataStudio: React.FC<connect> = (props: any) => { ...@@ -99,8 +99,8 @@ const DataStudio: React.FC<connect> = (props: any) => {
const newBottomHeight = !isProject const newBottomHeight = !isProject
? 0 ? 0
: bottomContainer.selectKey === '' : bottomContainer.selectKey === ''
? 0 ? 0
: bottomContainer.height; : bottomContainer.height;
const centerContentHeight = getClientSize().contentHeight - newBottomHeight; const centerContentHeight = getClientSize().contentHeight - newBottomHeight;
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
...@@ -127,8 +127,8 @@ const DataStudio: React.FC<connect> = (props: any) => { ...@@ -127,8 +127,8 @@ const DataStudio: React.FC<connect> = (props: any) => {
const newBottomHeight = !isProject const newBottomHeight = !isProject
? 0 ? 0
: bottomContainer.selectKey === '' : bottomContainer.selectKey === ''
? 0 ? 0
: bottomContainer.height; : bottomContainer.height;
const centerContentHeight = size.contentHeight - newBottomHeight; const centerContentHeight = size.contentHeight - newBottomHeight;
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
......
...@@ -28,7 +28,8 @@ import { ...@@ -28,7 +28,8 @@ import {
import { import {
getClusterConfigurationData, getClusterConfigurationData,
getEnvData, getEnvData,
getFlinkConfigs, getFlinkUdfOptions, getFlinkConfigs,
getFlinkUdfOptions,
getSessionData, getSessionData,
querySuggestionData querySuggestionData
} from '@/pages/DataStudio/RightContainer/JobConfig/service'; } from '@/pages/DataStudio/RightContainer/JobConfig/service';
......
...@@ -60,7 +60,7 @@ const ConfigurationModal: React.FC<ConfigurationModalProps & connect> = (props) ...@@ -60,7 +60,7 @@ const ConfigurationModal: React.FC<ConfigurationModalProps & connect> = (props)
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
dispatch({ dispatch({
type:STUDIO_MODEL_ASYNC.queryFlinkConfigOptions type: STUDIO_MODEL_ASYNC.queryFlinkConfigOptions
}); });
} }
form.setFieldsValue(value); form.setFieldsValue(value);
......
...@@ -134,14 +134,14 @@ export const renderBranchesTagColor = (item: string) => { ...@@ -134,14 +134,14 @@ export const renderBranchesTagColor = (item: string) => {
return item.includes('dev') return item.includes('dev')
? 'processing' ? 'processing'
: item.includes('test') : item.includes('test')
? 'warning' ? 'warning'
: item.includes('release') : item.includes('release')
? 'success' ? 'success'
: item.includes('master') : item.includes('master')
? 'success' ? 'success'
: item.includes('main') : item.includes('main')
? 'success' ? 'success'
: 'default'; : 'default';
}; };
/** /**
......
...@@ -48,7 +48,7 @@ import { WarningOutlined } from '@ant-design/icons'; ...@@ -48,7 +48,7 @@ import { WarningOutlined } from '@ant-design/icons';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { history } from '@umijs/max'; import { history } from '@umijs/max';
import { useAsyncEffect } from 'ahooks'; import { useAsyncEffect } from 'ahooks';
import {Button, Modal, Result} from 'antd'; import { Button, Modal, Result } from 'antd';
import { MenuInfo } from 'rc-menu/es/interface'; import { MenuInfo } from 'rc-menu/es/interface';
import React, { useCallback, useEffect, useRef, useState } from 'react'; import React, { useCallback, useEffect, useRef, useState } from 'react';
import { connect } from 'umi'; import { connect } from 'umi';
...@@ -246,7 +246,6 @@ const ResourceOverView: React.FC<connect> = (props) => { ...@@ -246,7 +246,6 @@ const ResourceOverView: React.FC<connect> = (props) => {
await refreshTree(); await refreshTree();
} }
}); });
}; };
/** /**
...@@ -398,8 +397,8 @@ const ResourceOverView: React.FC<connect> = (props) => { ...@@ -398,8 +397,8 @@ const ResourceOverView: React.FC<connect> = (props) => {
editModal === 'createFolder' editModal === 'createFolder'
? l('right.menu.createFolder') ? l('right.menu.createFolder')
: editModal === 'rename' : editModal === 'rename'
? l('right.menu.rename') ? l('right.menu.rename')
: '' : ''
} }
formValues={resourceState.value} formValues={resourceState.value}
onOk={handleModalSubmit} onOk={handleModalSubmit}
......
...@@ -47,7 +47,7 @@ export type TaskUdfConfig = { ...@@ -47,7 +47,7 @@ export type TaskUdfConfig = {
export type TaskUdfRefer = { export type TaskUdfRefer = {
name: string; name: string;
className: string; className: string;
} };
export type ConfigItem = { export type ConfigItem = {
key: string; key: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment