| @@ -334,7 +334,8 @@ func (t *StorageLoadPackage) getMinReadingObjectSolution(sortedNodes []*download | |||||
| for _, n := range sortedNodes { | for _, n := range sortedNodes { | ||||
| if n.ObjectPinned && float64(k)*n.Distance < dist { | if n.ObjectPinned && float64(k)*n.Distance < dist { | ||||
| dist = float64(k) * n.Distance | dist = float64(k) * n.Distance | ||||
| downloadNode = &n.Node | |||||
| node := n.Node | |||||
| downloadNode = &node | |||||
| } | } | ||||
| } | } | ||||
| @@ -349,7 +349,8 @@ func (iter *DownloadObjectIterator) getMinReadingObjectSolution(sortedNodes []*D | |||||
| for _, n := range sortedNodes { | for _, n := range sortedNodes { | ||||
| if n.ObjectPinned && float64(k)*n.Distance < dist { | if n.ObjectPinned && float64(k)*n.Distance < dist { | ||||
| dist = float64(k) * n.Distance | dist = float64(k) * n.Distance | ||||
| downloadNode = &n.Node | |||||
| node := n.Node | |||||
| downloadNode = &node | |||||
| } | } | ||||
| } | } | ||||
| @@ -95,7 +95,8 @@ func (s *LRCStripIterator) Close() { | |||||
| func (s *LRCStripIterator) downloading() { | func (s *LRCStripIterator) downloading() { | ||||
| var froms []ioswitchlrc.From | var froms []ioswitchlrc.From | ||||
| for _, b := range s.blocks { | 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{ | toExec, hd := ioswitchlrc.NewToDriverWithRange(-1, exec.Range{ | ||||
| @@ -112,7 +112,8 @@ func (s *StripIterator) Close() { | |||||
| func (s *StripIterator) downloading() { | func (s *StripIterator) downloading() { | ||||
| ft := ioswitch2.NewFromTo() | ft := ioswitch2.NewFromTo() | ||||
| for _, b := range s.blocks { | 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{ | toExec, hd := ioswitch2.NewToDriverWithRange(-1, exec.Range{ | ||||
| @@ -559,13 +559,13 @@ func (p *DefaultParser) generateClone(ctx *ParseContext) { | |||||
| continue | continue | ||||
| } | } | ||||
| t := ctx.DAG.NewCloneStream() | |||||
| *t.Env() = *node.Env() | |||||
| c := ctx.DAG.NewCloneStream() | |||||
| *c.Env() = *node.Env() | |||||
| for _, to := range out.To().RawArray() { | for _, to := range out.To().RawArray() { | ||||
| t.NewOutput().Connect(to.Node, to.SlotIndex) | |||||
| c.NewOutput().Connect(to.Node, to.SlotIndex) | |||||
| } | } | ||||
| out.To().Resize(0) | out.To().Resize(0) | ||||
| t.SetInput(out) | |||||
| c.SetInput(out) | |||||
| } | } | ||||
| for _, out := range node.OutputValues().RawArray() { | for _, out := range node.OutputValues().RawArray() { | ||||
| @@ -717,7 +717,8 @@ func (t *CheckPackageRedundancy) ecToEC(obj stgmod.ObjectDetail, srcRed *cdssdk. | |||||
| ft := ioswitch2.NewFromTo() | ft := ioswitch2.NewFromTo() | ||||
| for _, block := range chosenBlocks { | 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 { | for _, block := range chosenBlocks { | ||||
| fmt.Printf("b: %v\n", block.Index) | 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)) | |||||
| } | } | ||||
| // 输出只需要自己要保存的那一块 | // 输出只需要自己要保存的那一块 | ||||