From 02593a22d18dca6c3a536b202ea59232376110a2 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Thu, 18 Sep 2014 11:43:12 +0200 Subject: [PATCH] mtredisalze: made quantification a constant (default 1). Increase value if the _really_ produces too much data. --- cmd/mtredisalize/changetracker.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/mtredisalize/changetracker.go b/cmd/mtredisalize/changetracker.go index 6024e97..92bca33 100644 --- a/cmd/mtredisalize/changetracker.go +++ b/cmd/mtredisalize/changetracker.go @@ -11,6 +11,9 @@ import ( "bitbucket.org/s_l_teichmann/mtredisalize/common" ) +// Pull up if it _really_ produces too much data. +const quantizationFactor = 1 + type quantizedXZ struct { X, Z int16 } @@ -32,12 +35,13 @@ func (ct *ChangeTracker) BlockChanged(key []byte) { return } ct.mutex.Lock() - ct.changes[quantizedXZ{X: coord.X / 16, Z: coord.Z / 16}] = true + ct.changes[quantizedXZ{ + X: coord.X / quantizationFactor, + Z: coord.Z / quantizationFactor}] = true ct.mutex.Unlock() } func (ct *ChangeTracker) FlushChanges(url string) (err error) { - log.Println("change flush triggered") var oldChanges map[quantizedXZ]bool ct.mutex.Lock() if len(ct.changes) > 0 {