move build-tagged shardwidth files to subpackage

This commit is contained in:
Matt Jaffee 2019-04-04 14:27:52 -05:00
parent 836b467d3d
commit 811f1b4124
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
20 changed files with 87 additions and 10 deletions

View file

@ -22,6 +22,7 @@ import (
"time"
"github.com/pilosa/pilosa/pql"
"github.com/pilosa/pilosa/shardwidth"
"github.com/pilosa/pilosa/tracing"
"github.com/pkg/errors"
)
@ -1234,7 +1235,7 @@ func (e *executor) executeRowsShard(_ context.Context, index string, fieldName s
if columnID, ok, err := c.UintArg("column"); err != nil {
return nil, err
} else if ok {
colShard := columnID >> shardWidthExponent
colShard := columnID >> shardwidth.Exponent
if colShard != shard {
return rowIDs, nil
}

View file

@ -40,6 +40,7 @@ import (
"github.com/pilosa/pilosa/logger"
"github.com/pilosa/pilosa/pql"
"github.com/pilosa/pilosa/roaring"
"github.com/pilosa/pilosa/shardwidth"
"github.com/pilosa/pilosa/stats"
"github.com/pilosa/pilosa/syswrap"
"github.com/pilosa/pilosa/tracing"
@ -50,7 +51,7 @@ const (
// ShardWidth is the number of column IDs in a shard. It must be a power of 2 greater than or equal to 16.
// shardWidthExponent = 20 // set in shardwidthNN.go files
ShardWidth = 1 << shardWidthExponent
ShardWidth = 1 << shardwidth.Exponent
// shardVsContainerExponent is the power of 2 of ShardWith minus the power
// of two of roaring container width (which is 16).
@ -60,7 +61,7 @@ const (
// which a given container is in means dividing by the number of rows per
// container which is performantly expressed as a right shift by this
// exponent.
shardVsContainerExponent = shardWidthExponent - 16
shardVsContainerExponent = shardwidth.Exponent - 16
// width of roaring containers is 2^16
containerWidth = 1 << 16

5
shardwidth/16.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth16
package shardwidth
const Exponent = 16

5
shardwidth/17.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth17
package shardwidth
const Exponent = 17

5
shardwidth/18.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth18
package shardwidth
const Exponent = 18

5
shardwidth/19.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth19
package shardwidth
const Exponent = 19

View file

@ -1,5 +1,5 @@
// +build !shardwidth16,!shardwidth17,!shardwidth18,!shardwidth19,!shardwidth21,!shardwidth22,!shardwidth23,!shardwidth24,!shardwidth25,!shardwidth26,!shardwidth27,!shardwidth28,!shardwidth29,!shardwidth30,!shardwidth31,!shardwidth32
package pilosa
package shardwidth
const shardWidthExponent = 20
const Exponent = 20

5
shardwidth/21.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth21
package shardwidth
const Exponent = 21

5
shardwidth/22.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth22
package shardwidth
const Exponent = 22

5
shardwidth/23.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth23
package shardwidth
const Exponent = 23

5
shardwidth/24.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth24
package shardwidth
const Exponent = 24

5
shardwidth/25.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth25
package shardwidth
const Exponent = 25

5
shardwidth/26.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth26
package shardwidth
const Exponent = 26

5
shardwidth/27.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth27
package shardwidth
const Exponent = 27

5
shardwidth/28.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth28
package shardwidth
const Exponent = 28

5
shardwidth/29.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth29
package shardwidth
const Exponent = 29

5
shardwidth/30.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth30
package shardwidth
const Exponent = 30

5
shardwidth/31.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth31
package shardwidth
const Exponent = 31

5
shardwidth/32.go Normal file
View file

@ -0,0 +1,5 @@
// +build shardwidth32
package shardwidth
const Exponent = 32

View file

@ -1,5 +0,0 @@
// +build shardwidth22
package pilosa
const shardWidthExponent = 22