diff --git a/pkg/prop/prop.go b/pkg/prop/prop.go index 03aa8458..6c6daa7b 100644 --- a/pkg/prop/prop.go +++ b/pkg/prop/prop.go @@ -71,6 +71,8 @@ const ( RequestDistributionDefault = "uniform" ZeroPadding = "zeropadding" ZeroPaddingDefault = int64(1) + MinScanLength = "minscanlength" + MinScanLengthDefault = int64(1) MaxScanLength = "maxscanlength" MaxScanLengthDefault = int64(1000) // "uniform", "zipfian" diff --git a/pkg/workload/core.go b/pkg/workload/core.go index 04bb41a8..0df29fc1 100644 --- a/pkg/workload/core.go +++ b/pkg/workload/core.go @@ -621,6 +621,7 @@ func (coreCreator) Create(p *properties.Properties) (ycsb.Workload, error) { } requestDistrib := p.GetString(prop.RequestDistribution, prop.RequestDistributionDefault) + minScanLength := p.GetInt64(prop.MinScanLength, prop.MinScanLengthDefault) maxScanLength := p.GetInt64(prop.MaxScanLength, prop.MaxScanLengthDefault) scanLengthDistrib := p.GetString(prop.ScanLengthDistribution, prop.ScanLengthDistributionDefault) @@ -680,9 +681,9 @@ func (coreCreator) Create(p *properties.Properties) (ycsb.Workload, error) { c.fieldChooser = generator.NewUniform(0, c.fieldCount-1) switch scanLengthDistrib { case "uniform": - c.scanLength = generator.NewUniform(1, maxScanLength) + c.scanLength = generator.NewUniform(minScanLength, maxScanLength) case "zipfian": - c.scanLength = generator.NewZipfianWithRange(1, maxScanLength, generator.ZipfianConstant) + c.scanLength = generator.NewZipfianWithRange(minScanLength, maxScanLength, generator.ZipfianConstant) default: util.Fatalf("distribution %s not allowed for scan length", scanLengthDistrib) }