Group erasure shares before sending them to storage nodes (#210)
This commit is contained in:
parent
80c0a0ed2b
commit
34629e5b80
@ -4,6 +4,7 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
@ -76,10 +77,13 @@ func (client *Client) Put(ctx context.Context, id PieceID, data io.Reader, ttl t
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
_, err = io.Copy(writer, data)
|
bufw := bufio.NewWriterSize(writer, 32*1024)
|
||||||
|
_, err = io.Copy(bufw, data)
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
return bufw.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
// Get begins downloading a Piece from a piece store Server
|
// Get begins downloading a Piece from a piece store Server
|
||||||
func (client *Client) Get(ctx context.Context, id PieceID, size int64) (ranger.RangeCloser, error) {
|
func (client *Client) Get(ctx context.Context, id PieceID, size int64) (ranger.RangeCloser, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user