|
@ -3,8 +3,8 @@ package wdclient |
|
|
import ( |
|
|
import ( |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/pb" |
|
|
"github.com/chrislusf/seaweedfs/weed/pb" |
|
|
"pack.ag/tftp" |
|
|
|
|
|
"io" |
|
|
"io" |
|
|
|
|
|
"pack.ag/tftp" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
// VolumeTcpClient put/get/delete file chunks directly on volume servers without replication
|
|
|
// 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 |
|
|
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)) |
|
|
err = udpClient.Put(fileUrl, fileReader, int64(fileSize)) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
glog.Errorf("udp put %s: %v", fileUrl, err) |
|
|
glog.Errorf("udp put %s: %v", fileUrl, err) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
// println("sent", fileUrl)
|
|
|
|
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |