You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

adaptersummarylogic.go 1.1 kB

12345678910111213141516171819202122232425262728293031323334353637
  1. package hpc
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type AdapterSummaryLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewAdapterSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdapterSummaryLogic {
  14. return &AdapterSummaryLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *AdapterSummaryLogic) AdapterSummary(req *types.HpcAdapterSummaryReq) (resp *types.HpcAdapterSummaryResp, err error) {
  21. var hpcAdapterSummary []types.HPCAdapterSummary
  22. l.svcCtx.DbEngin.Raw("SELECT ta.NAME AS adapter_name,count( DISTINCT label ) as stack_count,count( DISTINCT tc.id ) as cluster_count,count( DISTINCT th.id) as task_count FROM t_adapter ta LEFT JOIN t_cluster tc ON ta.id = tc.adapter_id LEFT JOIN task_hpc th ON ta.id = th.adapter_id WHERE ta.type = 2 GROUP BY ta.id").Scan(&hpcAdapterSummary)
  23. resp = &types.HpcAdapterSummaryResp{
  24. Code: 200,
  25. Msg: "success",
  26. Data: hpcAdapterSummary,
  27. }
  28. return resp, nil
  29. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.