Browse Source

新增数据绑定筛选参数

feature_wq
JeshuaRen 9 months ago
parent
commit
bb9903e5dd
6 changed files with 25 additions and 12 deletions
  1. +1
    -1
      pkgs/bitmap/bitmap.go
  2. +1
    -1
      pkgs/ioswitch/dag/node.go
  3. +5
    -5
      pkgs/ioswitch/dag/var.go
  4. +13
    -0
      sdks/pcmscheduler/models.go
  5. +1
    -1
      utils/io2/chunked_split.go
  6. +4
    -4
      utils/serder/serder_test.go

+ 1
- 1
pkgs/bitmap/bitmap.go View File

@@ -23,7 +23,7 @@ func (b *Bitmap64) Weight() int {
cnt := 0
for v > 0 {
cnt++
v &= (v - 1)
v &= v - 1
}
return cnt
}

+ 1
- 1
pkgs/ioswitch/dag/node.go View File

@@ -98,7 +98,7 @@ func (s *VarSlots[T]) Clear(val *T) {
}

func (s *VarSlots[T]) RemoveAt(idx int) {
(*s) = lo2.RemoveAt(*s, idx)
*s = lo2.RemoveAt(*s, idx)
}

func (s *VarSlots[T]) RemoveRange(start int, cnt int) {


+ 5
- 5
pkgs/ioswitch/dag/var.go View File

@@ -87,28 +87,28 @@ func (s *DstList) Get(idx int) Node {
}

func (s *DstList) Add(n Node) int {
(*s) = append((*s), n)
*s = append(*s, n)
return len(*s) - 1
}

func (s *DstList) Remove(n Node) {
for i, e := range *s {
if e == n {
(*s) = lo2.RemoveAt((*s), i)
*s = lo2.RemoveAt(*s, i)
return
}
}
}

func (s *DstList) RemoveAt(idx int) {
lo2.RemoveAt((*s), idx)
lo2.RemoveAt(*s, idx)
}

func (s *DstList) Resize(size int) {
if s.Len() < size {
(*s) = append((*s), make([]Node, size-s.Len())...)
*s = append(*s, make([]Node, size-s.Len())...)
} else if s.Len() > size {
(*s) = (*s)[:size]
*s = (*s)[:size]
}
}



+ 13
- 0
sdks/pcmscheduler/models.go View File

@@ -44,6 +44,9 @@ const (

PreferencePriority = "preference"
SpecifyClusterPriority = "specify"

FailedStatus = "failed"
SuccessStatus = "success"
)

type TaskID int64
@@ -253,6 +256,11 @@ type BiasPriority struct {
Options []string `json:"options"`
}

type TaskMessage struct {
Status string `json:"status"`
Message string `json:"message"`
}

type UploadParams struct {
DataType string `json:"dataType"`
UploadInfo UploadInfo `json:"uploadInfo"`
@@ -406,6 +414,11 @@ type ClusterImage struct {
CardType string `json:"cardType"`
}

type QueryBindingFilters struct {
Status string `json:"status"`
Name string `json:"name"`
}

type QueryBindingDataParam interface {
Noop()
}


+ 1
- 1
utils/io2/chunked_split.go View File

@@ -32,7 +32,7 @@ func ChunkedSplit(stream io.Reader, chunkSize int, streamCount int, opts ...Chun
loop:
for {
for i := 0; i < streamCount; i++ {
var rd int = 0
var rd = 0
if !eof {
var err error
rd, err = io.ReadFull(stream, buf)


+ 4
- 4
utils/serder/serder_test.go View File

@@ -591,7 +591,7 @@ func Test_ObjectToJSON2(t *testing.T) {
union := types.NewTypeUnion[Base](&St1{}, St2{})
UseTypeUnionExternallyTagged(&union)

var val []Base = []Base{
var val = []Base{
&St1{Val: "asd", Type: "St1"},
St2{Val: 123, Type: "St2"},
}
@@ -607,7 +607,7 @@ func Test_ObjectToJSON2(t *testing.T) {
union := types.NewTypeUnion[Base](&St1{}, St2{})
UseTypeUnionInternallyTagged(&union, "Type")

var val []Base = []Base{
var val = []Base{
&St1{Val: "asd", Type: "St1"},
St2{Val: 123, Type: "St2"},
}
@@ -623,7 +623,7 @@ func Test_ObjectToJSON2(t *testing.T) {
union := types.NewTypeUnion[Base](&St1{}, St2{})
UseTypeUnionExternallyTagged(&union)

var val []Base = []Base{
var val = []Base{
nil,
}
data, err := ObjectToJSONEx(val)
@@ -638,7 +638,7 @@ func Test_ObjectToJSON2(t *testing.T) {
union := types.NewTypeUnion[Base](&St1{}, St2{})
UseTypeUnionInternallyTagged(&union, "Type")

var val []Base = []Base{
var val = []Base{
nil,
}
data, err := ObjectToJSONEx(val)


Loading…
Cancel
Save