refactor(web): 优化部署打包方案
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import {createRoot} from 'react-dom/client'
|
import {createRoot} from 'react-dom/client'
|
||||||
import {createBrowserRouter, RouterProvider} from 'react-router'
|
import {createHashRouter, RouterProvider} from 'react-router'
|
||||||
|
|
||||||
import './components/Registry.ts'
|
import './components/Registry.ts'
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ import Version from './pages/Version.tsx'
|
|||||||
import Yarn from './pages/Yarn.tsx'
|
import Yarn from './pages/Yarn.tsx'
|
||||||
import YarnCluster from './pages/YarnCluster.tsx'
|
import YarnCluster from './pages/YarnCluster.tsx'
|
||||||
|
|
||||||
const routes = createBrowserRouter([
|
const routes = createHashRouter([
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
Component: App,
|
Component: App,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const versionDetailDialog = (variable: string, target: string) => {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
url: `${commonInfo.baseUrl}/overview/version_detail`,
|
url: `${commonInfo.baseUrl}/overview/version_detail`,
|
||||||
data: {
|
data: {
|
||||||
target: `${target}`,
|
target: target,
|
||||||
version: '${version}',
|
version: '${version}',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -272,65 +272,78 @@ const Overview: React.FC = () => {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
{type: 'divider'},
|
{type: 'divider'},
|
||||||
'<span class="italic text-gray-500 my-2">表数量 (重点表数量, 普通表数量)</span>',
|
|
||||||
{
|
{
|
||||||
type: 'service',
|
type: 'crud',
|
||||||
|
title: '同步表数量',
|
||||||
api: `${commonInfo.baseUrl}/overview`,
|
api: `${commonInfo.baseUrl}/overview`,
|
||||||
|
...crudCommonOptions(),
|
||||||
interval: 60000,
|
interval: 60000,
|
||||||
silentPolling: true,
|
columns: [
|
||||||
body: [
|
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
name: 'type',
|
||||||
tpl: '逻辑表:<span class="font-bold mr-1 font-mono">${PADSTART(table_count, 4)} (<span class="text-primary">${PADSTART(table_focus_count, 4)}</span>, ${PADSTART(table_count - table_focus_count, 4)})</span>',
|
label: '表类型',
|
||||||
},
|
},
|
||||||
'<br>',
|
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
name: 'total',
|
||||||
tpl: '湖底表:<span class="font-bold mr-1 font-mono">${PADSTART(hudi_count, 4)} (<span class="text-primary">${PADSTART(hudi_focus_count, 4)}</span>, ${PADSTART(hudi_count - hudi_focus_count, 4)})</span>',
|
label: '总表数',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
'<br>',
|
|
||||||
{
|
{
|
||||||
|
name: 'focus',
|
||||||
|
label: '重点表',
|
||||||
|
className: 'text-danger font-bold',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '普通表',
|
||||||
type: 'tpl',
|
type: 'tpl',
|
||||||
tpl: '嗨福表:<span class="font-bold mr-1 font-mono">${PADSTART(hive_count, 4)} (<span class="text-primary">${PADSTART(hive_focus_count, 4)}</span>, ${PADSTART(hive_count - hive_focus_count, 4)})</span>',
|
tpl: '${total - focus}',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{type: 'divider'},
|
|
||||||
{
|
{
|
||||||
type: 'service',
|
type: 'crud',
|
||||||
|
title: '同步表数量',
|
||||||
api: `${commonInfo.baseUrl}/overview/sync_running_status`,
|
api: `${commonInfo.baseUrl}/overview/sync_running_status`,
|
||||||
|
...crudCommonOptions(),
|
||||||
interval: 10000,
|
interval: 10000,
|
||||||
silentPolling: true,
|
columns: [
|
||||||
body: [
|
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
name: 'type',
|
||||||
tpl: '任务数<span class="font-bold m-2 font-mono">${totalJob}</span>',
|
label: '类型',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
className: 'mx-2',
|
name: 'total',
|
||||||
type: 'tpl',
|
label: '任务数',
|
||||||
tpl: '运行中<span class="font-bold m-2 font-mono">${PADSTART(runningJob, 3)}</span>',
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
name: 'running',
|
||||||
tpl: '已停止<span class="font-bold m-2 font-mono text-danger">${PADSTART(unRunningJob, 3)}</span>',
|
label: '运行中',
|
||||||
},
|
width: 100,
|
||||||
tableDetailDialog('unRunningJob', 'unRunningJobList'),
|
align: 'center',
|
||||||
'<br/>',
|
|
||||||
{
|
|
||||||
type: 'tpl',
|
|
||||||
tpl: '总表数<span class="font-bold m-2 font-mono">${totalTable}</span>',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
className: 'mx-2',
|
name: 'stopped',
|
||||||
type: 'tpl',
|
label: '已停止',
|
||||||
tpl: '运行中<span class="font-bold m-2 font-mono">${PADSTART(runningTable, 3)}</span>',
|
className: 'text-danger font-bold',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
type: 'operation',
|
||||||
tpl: '已停止<span class="font-bold m-2 font-mono text-danger">${PADSTART(unRunningTable, 3)}</span>',
|
label: '操作',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
|
buttons: [
|
||||||
|
tableDetailDialog('stopped', 'list'),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
tableDetailDialog('unRunningTable', 'unRunningTableList'),
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{type: 'divider'},
|
{type: 'divider'},
|
||||||
@@ -360,61 +373,74 @@ const Overview: React.FC = () => {
|
|||||||
interval: 10000,
|
interval: 10000,
|
||||||
silentPolling: true,
|
silentPolling: true,
|
||||||
body: [
|
body: [
|
||||||
'版本:',
|
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
type: 'table',
|
||||||
className: 'font-bold',
|
title: '跨天情况 (${version})',
|
||||||
tpl: '${version}',
|
source: '${items}',
|
||||||
},
|
...crudCommonOptions(),
|
||||||
'<br/>',
|
headerToolbar: [
|
||||||
'<span class="italic text-gray-500 my-2">未接收, 未跨天</span>',
|
'${version}'
|
||||||
'<br/>',
|
],
|
||||||
'重点表:',
|
columns: [
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
name: 'type',
|
||||||
tpl: '<span class="font-bold font-mono">${PADSTART(unReceive.focus, 3)}</span>',
|
label: '类型',
|
||||||
},
|
},
|
||||||
versionDetailDialog('unReceive.focus', 'unReceive_focus'),
|
|
||||||
',',
|
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
name: 'unReceive',
|
||||||
tpl: '<span class="font-bold font-mono">${PADSTART(unSchedule.focus, 3)}</span>',
|
label: '未接收',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
},
|
},
|
||||||
versionDetailDialog('unSchedule.focus', 'unScheduled_focus'),
|
|
||||||
'<br/>',
|
|
||||||
'普通表:',
|
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
type: 'operation',
|
||||||
tpl: '<span class="font-bold font-mono">${PADSTART(unReceive.normal, 3)}</span>',
|
label: '操作',
|
||||||
},
|
width: 100,
|
||||||
versionDetailDialog('unReceive.normal', 'unReceive_normal'),
|
align: 'center',
|
||||||
',',
|
buttons: [
|
||||||
{
|
versionDetailDialog('unReceive', 'unReceive_${key}'),
|
||||||
type: 'tpl',
|
|
||||||
tpl: '<span class="font-bold font-mono">${PADSTART(unSchedule.normal, 3)}</span>',
|
|
||||||
},
|
|
||||||
versionDetailDialog('unSchedule.normal', 'unScheduled_normal'),
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{type: 'divider'},
|
|
||||||
{
|
{
|
||||||
type: 'service',
|
name: 'unScheduled',
|
||||||
|
label: '未跨天',
|
||||||
|
className: 'text-danger font-bold',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'operation',
|
||||||
|
label: '操作',
|
||||||
|
width: 100,
|
||||||
|
align: 'center',
|
||||||
|
buttons: [
|
||||||
|
versionDetailDialog('unScheduled', 'unScheduled_${key}'),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'crud',
|
||||||
|
title: '调度策略',
|
||||||
api: `${commonInfo.baseUrl}/overview/schedule_jobs`,
|
api: `${commonInfo.baseUrl}/overview/schedule_jobs`,
|
||||||
|
...crudCommonOptions(),
|
||||||
interval: 60000,
|
interval: 60000,
|
||||||
silentPolling: true,
|
loadDataOnce: true,
|
||||||
body: [
|
columns: [
|
||||||
'调度策略',
|
|
||||||
{
|
{
|
||||||
type: 'each',
|
name: 'trigger',
|
||||||
name: 'items',
|
label: 'Cron表达式',
|
||||||
items: {
|
className: 'font-mono',
|
||||||
type: 'tpl',
|
width: 300,
|
||||||
tpl: '<div class="font-mono"><span class="font-bold">${trigger}</span> <span class="text-gray-500">(${job})</span></div>',
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'job',
|
||||||
|
label: '策略描述',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{type: 'divider'},
|
|
||||||
{
|
{
|
||||||
type: 'crud',
|
type: 'crud',
|
||||||
title: '监控指标运行进度',
|
title: '监控指标运行进度',
|
||||||
@@ -426,13 +452,13 @@ const Overview: React.FC = () => {
|
|||||||
{
|
{
|
||||||
name: 'name',
|
name: 'name',
|
||||||
label: '名称',
|
label: '名称',
|
||||||
width: 120,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'running',
|
name: 'running',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
type: 'mapping',
|
type: 'mapping',
|
||||||
width: 50,
|
width: 70,
|
||||||
map: {
|
map: {
|
||||||
'true': '运行中',
|
'true': '运行中',
|
||||||
'false': '未运行',
|
'false': '未运行',
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import {defineConfig} from 'vite'
|
|
||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
|
import {defineConfig, UserConfig} from 'vite'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig(({mode}) => {
|
||||||
|
let config: UserConfig = {
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
}
|
||||||
|
if (mode === 'production') {
|
||||||
|
config.base = '/hudi_services/service_web'
|
||||||
|
}
|
||||||
|
return config
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,6 +28,29 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-web-dist</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/client/dist</directory>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
|||||||
@@ -8,27 +8,26 @@ import com.lanyuanxiaoyao.service.configuration.ExecutorProvider;
|
|||||||
import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias;
|
import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.monitor.MetricsProgress;
|
import com.lanyuanxiaoyao.service.configuration.entity.monitor.MetricsProgress;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnApplication;
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnApplication;
|
||||||
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnQueue;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
|
||||||
import com.lanyuanxiaoyao.service.configuration.entity.zookeeper.ZookeeperNode;
|
import com.lanyuanxiaoyao.service.configuration.entity.zookeeper.ZookeeperNode;
|
||||||
import com.lanyuanxiaoyao.service.forest.service.InfoService;
|
import com.lanyuanxiaoyao.service.forest.service.*;
|
||||||
import com.lanyuanxiaoyao.service.forest.service.MonitorService;
|
|
||||||
import com.lanyuanxiaoyao.service.forest.service.QueueService;
|
|
||||||
import com.lanyuanxiaoyao.service.forest.service.ScheduleService;
|
|
||||||
import com.lanyuanxiaoyao.service.forest.service.YarnService;
|
|
||||||
import com.lanyuanxiaoyao.service.forest.service.ZookeeperService;
|
|
||||||
import com.lanyuanxiaoyao.service.web.controller.base.AmisCrudResponse;
|
import com.lanyuanxiaoyao.service.web.controller.base.AmisCrudResponse;
|
||||||
import com.lanyuanxiaoyao.service.web.controller.base.AmisMapResponse;
|
import com.lanyuanxiaoyao.service.web.controller.base.AmisMapResponse;
|
||||||
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
|
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
|
||||||
import com.lanyuanxiaoyao.service.web.controller.base.BaseController;
|
import com.lanyuanxiaoyao.service.web.controller.base.BaseController;
|
||||||
import com.lanyuanxiaoyao.service.web.entity.JobIdAndAliasVO;
|
import com.lanyuanxiaoyao.service.web.entity.JobIdAndAliasVO;
|
||||||
import com.lanyuanxiaoyao.service.web.entity.ScheduleTimeVO;
|
import com.lanyuanxiaoyao.service.web.entity.ScheduleTimeVO;
|
||||||
|
import com.lanyuanxiaoyao.service.web.entity.overview.TableCountVO;
|
||||||
|
import com.lanyuanxiaoyao.service.web.entity.overview.TaskCountVO;
|
||||||
|
import com.lanyuanxiaoyao.service.web.entity.overview.VersionCountVO;
|
||||||
|
import com.lanyuanxiaoyao.service.web.entity.overview.YarnCountVO;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import org.eclipse.collections.api.factory.Lists;
|
import org.eclipse.collections.api.factory.Lists;
|
||||||
import org.eclipse.collections.api.factory.Maps;
|
|
||||||
import org.eclipse.collections.api.list.ImmutableList;
|
import org.eclipse.collections.api.list.ImmutableList;
|
||||||
import org.eclipse.collections.api.list.MutableList;
|
import org.eclipse.collections.api.list.MutableList;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -67,7 +66,7 @@ public class OverviewController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("")
|
@GetMapping("")
|
||||||
public AmisMapResponse overview() throws ExecutionException, InterruptedException {
|
public AmisCrudResponse overview() throws ExecutionException, InterruptedException {
|
||||||
CompletableFuture<Long> tableCountFuture = CompletableFuture.supplyAsync(infoService::tableCount, ExecutorProvider.EXECUTORS);
|
CompletableFuture<Long> tableCountFuture = CompletableFuture.supplyAsync(infoService::tableCount, ExecutorProvider.EXECUTORS);
|
||||||
CompletableFuture<Long> tableFocusCountFuture = CompletableFuture.supplyAsync(infoService::tableFocusCount, ExecutorProvider.EXECUTORS);
|
CompletableFuture<Long> tableFocusCountFuture = CompletableFuture.supplyAsync(infoService::tableFocusCount, ExecutorProvider.EXECUTORS);
|
||||||
CompletableFuture<Long> hudiCountFuture = CompletableFuture.supplyAsync(infoService::hudiCount, ExecutorProvider.EXECUTORS);
|
CompletableFuture<Long> hudiCountFuture = CompletableFuture.supplyAsync(infoService::hudiCount, ExecutorProvider.EXECUTORS);
|
||||||
@@ -82,13 +81,12 @@ public class OverviewController extends BaseController {
|
|||||||
hiveCountFuture,
|
hiveCountFuture,
|
||||||
hiveFocusCountFuture
|
hiveFocusCountFuture
|
||||||
).get();
|
).get();
|
||||||
return AmisResponse.responseMapData()
|
ImmutableList<TableCountVO> list = Lists.immutable.of(
|
||||||
.setData("table_count", tableCountFuture.get())
|
new TableCountVO("逻辑表", tableCountFuture.get(), tableFocusCountFuture.get()),
|
||||||
.setData("table_focus_count", tableFocusCountFuture.get())
|
new TableCountVO("湖底表", hudiCountFuture.get(), hudiFocusCountFuture.get()),
|
||||||
.setData("hudi_count", hudiCountFuture.get())
|
new TableCountVO("嗨福表", hiveCountFuture.get(), hiveFocusCountFuture.get())
|
||||||
.setData("hudi_focus_count", hudiFocusCountFuture.get())
|
);
|
||||||
.setData("hive_count", hiveCountFuture.get())
|
return AmisResponse.responseCrudData(list);
|
||||||
.setData("hive_focus_count", hiveFocusCountFuture.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("yarn-job")
|
@GetMapping("yarn-job")
|
||||||
@@ -99,7 +97,6 @@ public class OverviewController extends BaseController {
|
|||||||
.setData("name", cluster)
|
.setData("name", cluster)
|
||||||
.setData("total", applications.size())
|
.setData("total", applications.size())
|
||||||
.setData("running", applications.count(app -> StrUtil.equals(app.getState(), "RUNNING")))
|
.setData("running", applications.count(app -> StrUtil.equals(app.getState(), "RUNNING")))
|
||||||
.setData("running", applications.count(app -> StrUtil.equals(app.getState(), "RUNNING")))
|
|
||||||
.setData("scheduling", applications.count(app -> StrUtil.equals(app.getState(), "ACCEPTED")))
|
.setData("scheduling", applications.count(app -> StrUtil.equals(app.getState(), "ACCEPTED")))
|
||||||
.setData("failure", applications.count(app -> StrUtil.equals(app.getState(), "FAILED")));
|
.setData("failure", applications.count(app -> StrUtil.equals(app.getState(), "FAILED")));
|
||||||
}
|
}
|
||||||
@@ -131,10 +128,13 @@ public class OverviewController extends BaseController {
|
|||||||
CompletableFuture<Long> unScheduledNormalTableCount = CompletableFuture.supplyAsync(() -> infoService.unScheduledNormalTableCount(version), ExecutorProvider.EXECUTORS);
|
CompletableFuture<Long> unScheduledNormalTableCount = CompletableFuture.supplyAsync(() -> infoService.unScheduledNormalTableCount(version), ExecutorProvider.EXECUTORS);
|
||||||
CompletableFuture<Long> unScheduledFocusTableCount = CompletableFuture.supplyAsync(() -> infoService.unScheduledFocusTableCount(version), ExecutorProvider.EXECUTORS);
|
CompletableFuture<Long> unScheduledFocusTableCount = CompletableFuture.supplyAsync(() -> infoService.unScheduledFocusTableCount(version), ExecutorProvider.EXECUTORS);
|
||||||
CompletableFuture.allOf(unReceiveNormalTableCount, unReceiveFocusCount, unScheduledNormalTableCount, unScheduledFocusTableCount).get();
|
CompletableFuture.allOf(unReceiveNormalTableCount, unReceiveFocusCount, unScheduledNormalTableCount, unScheduledFocusTableCount).get();
|
||||||
|
ImmutableList<VersionCountVO> list = Lists.immutable.of(
|
||||||
|
new VersionCountVO("focus", "重点表", unReceiveFocusCount.get(), unScheduledFocusTableCount.get()),
|
||||||
|
new VersionCountVO("normal", "普通表", unReceiveNormalTableCount.get(), unScheduledNormalTableCount.get())
|
||||||
|
);
|
||||||
return AmisResponse.responseMapData()
|
return AmisResponse.responseMapData()
|
||||||
.setData("version", version)
|
.setData("version", version)
|
||||||
.setData("unReceive", Maps.immutable.of("normal", unReceiveNormalTableCount.get(), "focus", unReceiveFocusCount.get()))
|
.setData("items", list);
|
||||||
.setData("unSchedule", Maps.immutable.of("normal", unScheduledNormalTableCount.get(), "focus", unScheduledFocusTableCount.get()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("version_detail")
|
@GetMapping("version_detail")
|
||||||
@@ -175,7 +175,7 @@ public class OverviewController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("sync_running_status")
|
@GetMapping("sync_running_status")
|
||||||
public AmisMapResponse syncRunningStatus() {
|
public AmisCrudResponse syncRunningStatus() {
|
||||||
ImmutableList<String> locks = zookeeperService.getChildren(NameHelper.ZK_SYNC_RUNNING_LOCK_PATH).collect(ZookeeperNode::getPath);
|
ImmutableList<String> locks = zookeeperService.getChildren(NameHelper.ZK_SYNC_RUNNING_LOCK_PATH).collect(ZookeeperNode::getPath);
|
||||||
MutableList<JobIdAndAlias> runningJob = Lists.mutable.<JobIdAndAlias>empty().asSynchronized();
|
MutableList<JobIdAndAlias> runningJob = Lists.mutable.<JobIdAndAlias>empty().asSynchronized();
|
||||||
MutableList<JobIdAndAlias> unRunningJob = Lists.mutable.<JobIdAndAlias>empty().asSynchronized();
|
MutableList<JobIdAndAlias> unRunningJob = Lists.mutable.<JobIdAndAlias>empty().asSynchronized();
|
||||||
@@ -203,17 +203,11 @@ public class OverviewController extends BaseController {
|
|||||||
unRunningTable.add(ia);
|
unRunningTable.add(ia);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return AmisResponse.responseMapData()
|
ImmutableList<TaskCountVO> list = Lists.immutable.of(
|
||||||
.setData("totalJob", ids.size())
|
new TaskCountVO("同步任务数", ids.size(), runningJob.size(), unRunningJob.size(), unRunningJob.toImmutable()),
|
||||||
.setData("runningJob", runningJob.size())
|
new TaskCountVO("同步表数", idAliases.size(), runningTable.size(), unRunningTable.size(), unRunningTable.toImmutable())
|
||||||
.setData("runningJobList", runningJob)
|
);
|
||||||
.setData("unRunningJob", unRunningJob.size())
|
return AmisResponse.responseCrudData(list);
|
||||||
.setData("unRunningJobList", unRunningJob)
|
|
||||||
.setData("totalTable", idAliases.size())
|
|
||||||
.setData("runningTable", runningTable.size())
|
|
||||||
.setData("runningTableList", runningTable)
|
|
||||||
.setData("unRunningTable", unRunningTable.size())
|
|
||||||
.setData("unRunningTableList", unRunningTable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("monitor_progress")
|
@GetMapping("monitor_progress")
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.lanyuanxiaoyao.service.web.entity.overview;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lanyuanxiaoyao
|
||||||
|
* @version 20250509
|
||||||
|
*/
|
||||||
|
public class TableCountVO {
|
||||||
|
private final String type;
|
||||||
|
private final Long total;
|
||||||
|
private final Long focus;
|
||||||
|
|
||||||
|
public TableCountVO(String type, Long total, Long focus) {
|
||||||
|
this.type = type;
|
||||||
|
this.total = total;
|
||||||
|
this.focus = focus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFocus() {
|
||||||
|
return focus;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TableCountVO{" +
|
||||||
|
"type='" + type + '\'' +
|
||||||
|
", total=" + total +
|
||||||
|
", focus=" + focus +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.lanyuanxiaoyao.service.web.entity.overview;
|
||||||
|
|
||||||
|
import com.lanyuanxiaoyao.service.configuration.entity.info.JobIdAndAlias;
|
||||||
|
import org.eclipse.collections.api.list.ImmutableList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lanyuanxiaoyao
|
||||||
|
* @version 20250509
|
||||||
|
*/
|
||||||
|
public class TaskCountVO {
|
||||||
|
private final String type;
|
||||||
|
private final Integer total;
|
||||||
|
private final Integer running;
|
||||||
|
private final Integer stopped;
|
||||||
|
private final ImmutableList<JobIdAndAlias> list;
|
||||||
|
|
||||||
|
public TaskCountVO(String type, Integer total, Integer running, Integer stopped, ImmutableList<JobIdAndAlias> list) {
|
||||||
|
this.type = type;
|
||||||
|
this.total = total;
|
||||||
|
this.running = running;
|
||||||
|
this.stopped = stopped;
|
||||||
|
this.list = list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRunning() {
|
||||||
|
return running;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStopped() {
|
||||||
|
return stopped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImmutableList<JobIdAndAlias> getList() {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TaskCountVO{" +
|
||||||
|
"type='" + type + '\'' +
|
||||||
|
", total=" + total +
|
||||||
|
", running=" + running +
|
||||||
|
", stopped=" + stopped +
|
||||||
|
", list=" + list +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.lanyuanxiaoyao.service.web.entity.overview;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lanyuanxiaoyao
|
||||||
|
* @version 20250509
|
||||||
|
*/
|
||||||
|
public class VersionCountVO {
|
||||||
|
private final String key;
|
||||||
|
private final String type;
|
||||||
|
private final Long unReceive;
|
||||||
|
private final Long unScheduled;
|
||||||
|
|
||||||
|
public VersionCountVO(String key, String type, Long unReceive, Long unScheduled) {
|
||||||
|
this.key = key;
|
||||||
|
this.type = type;
|
||||||
|
this.unReceive = unReceive;
|
||||||
|
this.unScheduled = unScheduled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUnReceive() {
|
||||||
|
return unReceive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUnScheduled() {
|
||||||
|
return unScheduled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "VersionCountVO{" +
|
||||||
|
"key='" + key + '\'' +
|
||||||
|
", type='" + type + '\'' +
|
||||||
|
", unReceive=" + unReceive +
|
||||||
|
", unScheduled=" + unScheduled +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.lanyuanxiaoyao.service.web.entity.overview;
|
||||||
|
|
||||||
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnQueue;
|
||||||
|
import com.lanyuanxiaoyao.service.configuration.entity.yarn.YarnRootQueue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lanyuanxiaoyao
|
||||||
|
* @version 20250509
|
||||||
|
*/
|
||||||
|
public class YarnCountVO {
|
||||||
|
private final String cluster;
|
||||||
|
private final Integer total;
|
||||||
|
private final Integer running;
|
||||||
|
private final Integer scheduling;
|
||||||
|
private final Integer failure;
|
||||||
|
private final YarnRootQueue root;
|
||||||
|
private final YarnQueue target;
|
||||||
|
private final Integer queue;
|
||||||
|
|
||||||
|
public YarnCountVO(String cluster, Integer total, Integer running, Integer scheduling, Integer failure, YarnRootQueue root, YarnQueue target, Integer queue) {
|
||||||
|
this.cluster = cluster;
|
||||||
|
this.total = total;
|
||||||
|
this.running = running;
|
||||||
|
this.scheduling = scheduling;
|
||||||
|
this.failure = failure;
|
||||||
|
this.root = root;
|
||||||
|
this.target = target;
|
||||||
|
this.queue = queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCluster() {
|
||||||
|
return cluster;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRunning() {
|
||||||
|
return running;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getScheduling() {
|
||||||
|
return scheduling;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getFailure() {
|
||||||
|
return failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
public YarnRootQueue getRoot() {
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
public YarnQueue getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getQueue() {
|
||||||
|
return queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "YarnCountVO{" +
|
||||||
|
"cluster='" + cluster + '\'' +
|
||||||
|
", total=" + total +
|
||||||
|
", running=" + running +
|
||||||
|
", scheduling=" + scheduling +
|
||||||
|
", failure=" + failure +
|
||||||
|
", root=" + root +
|
||||||
|
", target=" + target +
|
||||||
|
", queue=" + queue +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user