make bunchSize configurable with GOPOSM_DELTACACHE_BUNCHSIZE env

master
Oliver Tonnhofer 2013-05-10 11:18:15 +02:00
parent 69ee95fa27
commit 25b16b437c
2 changed files with 8 additions and 1 deletions

7
cache/db.go vendored
View File

@ -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 {

2
cache/delta.go vendored
View File

@ -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 {