Skip to content

Commit c9791e5

Browse files
committed
-fir perf source pipeline call
1 parent 678b014 commit c9791e5

File tree

4 files changed

+16
-34
lines changed

4 files changed

+16
-34
lines changed

args.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type validatedParameters struct {
8888
filesPerPipeline int
8989
useExactMatch bool
9090
numberOfHandlesPerFile int
91-
numberOfIlesInBatch int
91+
numberOfFilesInBatch int
9292
blobSource blobParams
9393
blobTarget blobParams
9494
perfSourceDefinitions []sources.SourceDefinition
@@ -277,7 +277,7 @@ func (p *paramParserValidator) pvgBatchLimits() error {
277277
if p.args.numberOfFilesInBatch < 1 {
278278
return fmt.Errorf("Invalid value for option -x, the value must be greater than 1")
279279
}
280-
p.params.numberOfIlesInBatch = p.args.numberOfFilesInBatch
280+
p.params.numberOfFilesInBatch = p.args.numberOfFilesInBatch
281281
return nil
282282
}
283283
func (p *paramParserValidator) pvgHTTPTimeOut() error {

blobporter.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ import (
55
"fmt"
66
"log"
77
"math"
8+
_ "net/http/pprof"
89
"net/url"
910
"os"
1011
"strconv"
1112
"sync/atomic"
1213
"time"
13-
1414
"github.com/Azure/blobporter/pipeline"
1515
"github.com/Azure/blobporter/transfer"
1616
"github.com/Azure/blobporter/util"
1717
)
1818

19-
const programVersion = "0.5.32"
19+
const programVersion = "0.5.33"
2020

2121
var argsUtil paramParserValidator
2222

@@ -138,6 +138,10 @@ func displayFinalWrapUpSummary(duration time.Duration, targetRetries int32, thre
138138
}
139139

140140
func main() {
141+
go func() {
142+
//runtime.SetBlockProfileRate(5)
143+
//log.Println(http.ListenAndServe("localhost:6060", nil))
144+
}()
141145

142146
flag.Parse()
143147

pipelinefactory.go

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,6 @@ func newTransferPipelines(params *validatedParameters) ([]pipeline.SourcePipelin
3333

3434
}
3535

36-
/*
37-
const openFileLimitForLinux = 1024
38-
39-
//validates if the number of readers needs to be adjusted to accommodate max filehandle limits in Debian systems
40-
func adjustReaders(numOfSources int) error {
41-
if runtime.GOOS != "linux" {
42-
return nil
43-
}
44-
45-
if (numOfSources * numberOfHandlesPerFile) > openFileLimitForLinux {
46-
numberOfHandlesPerFile = openFileLimitForLinux / (numOfSources * numberOfHandlesPerFile)
47-
48-
if numberOfHandlesPerFile == 0 {
49-
return fmt.Errorf("The number of files will cause the process to exceed the limit of open files allowed by the OS. Reduce the number of files to be transferred")
50-
}
51-
52-
fmt.Printf("Warning! Adjusting the number of handles per file (-h) to %v\n", numberOfHandlesPerFile)
53-
54-
}
55-
56-
return nil
57-
}
58-
*/
5936
type pipelinesFactory struct {
6037
source transfer.TransferSegment
6138
target transfer.TransferSegment
@@ -133,7 +110,7 @@ func (p *pipelinesFactory) newSourceParams() (interface{}, error) {
133110
NumOfPartitions: p.valParams.numberOfReaders, //TODO make this more explicit by numofpartitions as param..
134111
MD5: p.valParams.calculateMD5,
135112
KeepDirStructure: p.valParams.keepDirStructure,
136-
FilesPerPipeline: p.valParams.numberOfIlesInBatch}, nil
113+
FilesPerPipeline: p.valParams.numberOfFilesInBatch}, nil
137114
case transfer.HTTP:
138115
return sources.HTTPSourceParams{
139116
SourceURIs: p.valParams.sourceURIs,
@@ -151,7 +128,7 @@ func (p *pipelinesFactory) newSourceParams() (interface{}, error) {
151128
SourceParams: sources.SourceParams{
152129
CalculateMD5: p.valParams.calculateMD5,
153130
UseExactNameMatch: p.valParams.useExactMatch,
154-
FilesPerPipeline: p.valParams.numberOfIlesInBatch,
131+
FilesPerPipeline: p.valParams.numberOfFilesInBatch,
155132
//default to always true so blob names are kept
156133
KeepDirStructure: p.valParams.keepDirStructure}}, nil
157134
case transfer.Blob:
@@ -164,10 +141,11 @@ func (p *pipelinesFactory) newSourceParams() (interface{}, error) {
164141
SourceParams: sources.SourceParams{
165142
CalculateMD5: p.valParams.calculateMD5,
166143
UseExactNameMatch: p.valParams.useExactMatch,
167-
FilesPerPipeline: p.valParams.numberOfIlesInBatch,
144+
FilesPerPipeline: p.valParams.numberOfFilesInBatch,
168145
KeepDirStructure: p.valParams.keepDirStructure}}, nil
169146
case transfer.Perf:
170147
return sources.PerfSourceParams{
148+
BlockSize: p.valParams.blockSize,
171149
Definitions: p.valParams.perfSourceDefinitions,
172150
SourceParams: sources.SourceParams{
173151
CalculateMD5: p.valParams.calculateMD5}}, nil

transfer/transfer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ const (
8484
BlobToPage = "blob-pageblob"
8585
S3ToBlock = "s3-blockblob"
8686
S3ToPage = "s3-pageblob"
87-
PerfToBlock = "perf-block"
88-
PerfToPage = "perf-page"
87+
PerfToBlock = "perf-blockblob"
88+
PerfToPage = "perf-pageblob"
8989
BlobToPerf = "blob-perf"
9090
none = "none"
9191
)
@@ -158,9 +158,9 @@ func ParseTransferDefinition(str string) (Definition, error) {
158158
return S3ToBlock, nil
159159
case "s3-pageblob":
160160
return S3ToPage, nil
161-
case "perf-block":
161+
case "perf-blockblob":
162162
return PerfToBlock, nil
163-
case "perf-page":
163+
case "perf-pageblob":
164164
return PerfToPage, nil
165165
case "blob-perf":
166166
return BlobToPerf, nil

0 commit comments

Comments
 (0)