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.

syncclusterloadlogic.go 920 B

1234567891011121314151617181920212223242526272829303132333435
  1. package core
  2. import (
  3. "context"
  4. "github.com/zeromicro/go-zero/core/logx"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  7. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/tracker"
  8. tool "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils"
  9. )
  10. type SyncClusterLoadLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewSyncClusterLoadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SyncClusterLoadLogic {
  16. return &SyncClusterLoadLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *SyncClusterLoadLogic) SyncClusterLoad(req *types.SyncClusterLoadReq) error {
  23. if nil != req.ClusterLoadRecords {
  24. for _, record := range req.ClusterLoadRecords {
  25. var param tracker.ClusterLoadRecord
  26. tool.Convert(record, &param)
  27. tracker.SyncClusterLoad(param)
  28. }
  29. }
  30. return nil
  31. }

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.