make bunchSize configurable with GOPOSM_DELTACACHE_BUNCHSIZE env
parent
69ee95fa27
commit
25b16b437c
|
@ -12,12 +12,19 @@ import (
|
|||
)
|
||||
|
||||
var levelDbWriteBufferSize, levelDbWriteBlockSize int64
|
||||
var deltaCachBunchSize int64
|
||||
|
||||
func init() {
|
||||
levelDbWriteBufferSize, _ = strconv.ParseInt(
|
||||
os.Getenv("GOPOSM_LEVELDB_BUFFERSIZE"), 10, 32)
|
||||
levelDbWriteBlockSize, _ = strconv.ParseInt(
|
||||
os.Getenv("GOPOSM_LEVELDB_BLOCKSIZE"), 10, 32)
|
||||
deltaCachBunchSize, _ = strconv.ParseInt(
|
||||
os.Getenv("GOPOSM_DELTACACHE_BUNCHSIZE"), 10, 32)
|
||||
|
||||
if deltaCachBunchSize == 0 {
|
||||
deltaCachBunchSize = 128
|
||||
}
|
||||
}
|
||||
|
||||
type OSMCache struct {
|
||||
|
|
|
@ -208,7 +208,7 @@ func (p *DeltaCoordsCache) getCoordsPacked(bunchId int64, nodes []element.Node)
|
|||
}
|
||||
|
||||
func getBunchId(nodeId int64) int64 {
|
||||
return nodeId / bunchSize
|
||||
return nodeId / deltaCachBunchSize
|
||||
}
|
||||
|
||||
func (self *DeltaCoordsCache) getBunch(bunchId int64) *CoordsBunch {
|
||||
|
|
Loading…
Reference in New Issue