mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
this performs poorly and unstable
This commit is contained in:
parent
56953b207d
commit
22ef015cff
|
@ -41,6 +41,7 @@ func (vs *VolumeServer) ServeTFTP(r tftp.ReadRequest) {
|
|||
func (vs *VolumeServer) ReceiveTFTP(w tftp.WriteRequest) {
|
||||
|
||||
filename := w.Name()
|
||||
println("+ ", filename)
|
||||
|
||||
// Get the file size
|
||||
size, err := w.Size()
|
||||
|
@ -75,4 +76,6 @@ func (vs *VolumeServer) ReceiveTFTP(w tftp.WriteRequest) {
|
|||
return
|
||||
}
|
||||
|
||||
println("- ", filename)
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ package wdclient
|
|||
import (
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||
"pack.ag/tftp"
|
||||
"io"
|
||||
"pack.ag/tftp"
|
||||
)
|
||||
|
||||
// VolumeTcpClient put/get/delete file chunks directly on volume servers without replication
|
||||
|
@ -23,15 +23,24 @@ func (c *VolumeUdpClient) PutFileChunk(volumeServerAddress string, fileId string
|
|||
return parseErr
|
||||
}
|
||||
|
||||
udpClient, _ := tftp.NewClient()
|
||||
udpClient, _ := tftp.NewClient(
|
||||
tftp.ClientMode(tftp.ModeOctet),
|
||||
tftp.ClientBlocksize(9000),
|
||||
tftp.ClientWindowsize(16),
|
||||
tftp.ClientTimeout(1),
|
||||
tftp.ClientTransferSize(true),
|
||||
tftp.ClientRetransmit(3),
|
||||
)
|
||||
|
||||
fileUrl := "tftp://"+udpAddress+"/"+fileId
|
||||
fileUrl := "tftp://" + udpAddress + "/" + fileId
|
||||
|
||||
// println("put", fileUrl, "...")
|
||||
err = udpClient.Put(fileUrl, fileReader, int64(fileSize))
|
||||
if err != nil {
|
||||
glog.Errorf("udp put %s: %v", fileUrl, err)
|
||||
return
|
||||
}
|
||||
// println("sent", fileUrl)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue