Browse Source

解决代码问题

gitlink
Sydonian 1 year ago
parent
commit
9315d5a93b
6 changed files with 16 additions and 10 deletions
  1. +2
    -1
      agent/internal/task/storage_load_package.go
  2. +2
    -1
      common/pkgs/downloader/iterator.go
  3. +2
    -1
      common/pkgs/downloader/lrc_strip_iterator.go
  4. +2
    -1
      common/pkgs/downloader/strip_iterator.go
  5. +4
    -4
      common/pkgs/ioswitch2/parser/parser.go
  6. +4
    -2
      scanner/internal/event/check_package_redundancy.go

+ 2
- 1
agent/internal/task/storage_load_package.go View File

@@ -334,7 +334,8 @@ func (t *StorageLoadPackage) getMinReadingObjectSolution(sortedNodes []*download
for _, n := range sortedNodes {
if n.ObjectPinned && float64(k)*n.Distance < dist {
dist = float64(k) * n.Distance
downloadNode = &n.Node
node := n.Node
downloadNode = &node
}
}



+ 2
- 1
common/pkgs/downloader/iterator.go View File

@@ -349,7 +349,8 @@ func (iter *DownloadObjectIterator) getMinReadingObjectSolution(sortedNodes []*D
for _, n := range sortedNodes {
if n.ObjectPinned && float64(k)*n.Distance < dist {
dist = float64(k) * n.Distance
downloadNode = &n.Node
node := n.Node
downloadNode = &node
}
}



+ 2
- 1
common/pkgs/downloader/lrc_strip_iterator.go View File

@@ -95,7 +95,8 @@ func (s *LRCStripIterator) Close() {
func (s *LRCStripIterator) downloading() {
var froms []ioswitchlrc.From
for _, b := range s.blocks {
froms = append(froms, ioswitchlrc.NewFromNode(b.Block.FileHash, &b.Node, b.Block.Index))
node := b.Node
froms = append(froms, ioswitchlrc.NewFromNode(b.Block.FileHash, &node, b.Block.Index))
}

toExec, hd := ioswitchlrc.NewToDriverWithRange(-1, exec.Range{


+ 2
- 1
common/pkgs/downloader/strip_iterator.go View File

@@ -112,7 +112,8 @@ func (s *StripIterator) Close() {
func (s *StripIterator) downloading() {
ft := ioswitch2.NewFromTo()
for _, b := range s.blocks {
ft.AddFrom(ioswitch2.NewFromNode(b.Block.FileHash, &b.Node, b.Block.Index))
node := b.Node
ft.AddFrom(ioswitch2.NewFromNode(b.Block.FileHash, &node, b.Block.Index))
}

toExec, hd := ioswitch2.NewToDriverWithRange(-1, exec.Range{


+ 4
- 4
common/pkgs/ioswitch2/parser/parser.go View File

@@ -559,13 +559,13 @@ func (p *DefaultParser) generateClone(ctx *ParseContext) {
continue
}

t := ctx.DAG.NewCloneStream()
*t.Env() = *node.Env()
c := ctx.DAG.NewCloneStream()
*c.Env() = *node.Env()
for _, to := range out.To().RawArray() {
t.NewOutput().Connect(to.Node, to.SlotIndex)
c.NewOutput().Connect(to.Node, to.SlotIndex)
}
out.To().Resize(0)
t.SetInput(out)
c.SetInput(out)
}

for _, out := range node.OutputValues().RawArray() {


+ 4
- 2
scanner/internal/event/check_package_redundancy.go View File

@@ -717,7 +717,8 @@ func (t *CheckPackageRedundancy) ecToEC(obj stgmod.ObjectDetail, srcRed *cdssdk.

ft := ioswitch2.NewFromTo()
for _, block := range chosenBlocks {
ft.AddFrom(ioswitch2.NewFromNode(block.FileHash, &node.Node, block.Index))
node := node.Node
ft.AddFrom(ioswitch2.NewFromNode(block.FileHash, &node, block.Index))
}

// 输出只需要自己要保存的那一块
@@ -907,7 +908,8 @@ func (t *CheckPackageRedundancy) reconstructLRC(obj stgmod.ObjectDetail, grpBloc

for _, block := range chosenBlocks {
fmt.Printf("b: %v\n", block.Index)
froms = append(froms, ioswitchlrc.NewFromNode(block.FileHash, &node.Node, block.Index))
node := node.Node
froms = append(froms, ioswitchlrc.NewFromNode(block.FileHash, &node, block.Index))
}

// 输出只需要自己要保存的那一块


Loading…
Cancel
Save