From df88b5a78c8cb86be7511140b3be06cfc782529f Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Tue, 11 Jan 2022 10:09:29 -0600 Subject: [PATCH] remove a bunch of commented print statements and unecessary prints --- ingest/codec.go | 2 +- internal/clustertests/cluster_test.go | 2 -- rbf/db.go | 5 ----- rbf/tx.go | 1 - roaring/printutil.go | 2 +- short_txkey/txkey_test.go | 3 --- testhook/hook.go | 2 -- txkey/txkey_test.go | 3 --- 8 files changed, 2 insertions(+), 18 deletions(-) diff --git a/ingest/codec.go b/ingest/codec.go index bdf4eca86..c1e11f375 100644 --- a/ingest/codec.go +++ b/ingest/codec.go @@ -1077,7 +1077,7 @@ func (o *Operation) EncodeJSON(dst *jsonBuffer, codec *JSONCodec) (err error) { // or a different id for j = idx; j < len(op.RecordIDs) && op.RecordIDs[j] == id; j++ { } - // fmt.Printf("field %s encoding %d-%d (v %d, s %d, k %d)\n", + // field, idx, j, len(op.Values), len(op.Signed), len(fieldKeys[i])) // print this one, and advance this index to next position dst.EncodeString(field) diff --git a/internal/clustertests/cluster_test.go b/internal/clustertests/cluster_test.go index e23d10f8c..806d68101 100644 --- a/internal/clustertests/cluster_test.go +++ b/internal/clustertests/cluster_test.go @@ -118,8 +118,6 @@ func TestClusterStuff(t *testing.T) { t.Fatalf("waiting on backup to finish: %v", err) } - fmt.Println("STARTING RESTORE") - client := http.Client{} if req, err := http.NewRequest(http.MethodDelete, "http://pilosa1:10101/index/testidx", nil); err != nil { t.Fatalf("getting req: %v", err) diff --git a/rbf/db.go b/rbf/db.go index 6e4955f94..97de950e6 100644 --- a/rbf/db.go +++ b/rbf/db.go @@ -358,7 +358,6 @@ func (db *DB) checkpoint() (err error) { } } - // fmt.Printf("checkpoint: walPageN %d, PageMap size %d\n", db.walPageN, db.pageMap.size) for pgno, walID := range pages { page, err = db.readWALPageAt(walID) if err != nil { @@ -698,10 +697,8 @@ func (db *DB) afterCurrentTx(callback func()) { db.txWaiters = append(db.txWaiters, txw) go func() { <-txw.ready - // fmt.Printf("afterCurrentTx: locking db\n") db.mu.Lock() defer db.mu.Unlock() - // fmt.Printf("afterCurrentTx: running callback\n") txw.callback() }() return @@ -759,11 +756,9 @@ func (db *DB) removeTx(tx *Tx) error { // because every existing transaction could want to look up pages // which are in the database before our operations, but which should // now be in the WAL. We want them to use the WAL instead. - // fmt.Printf("possibly-async checkpoint...\n") db.afterCurrentTx(func() { // We still hold db.rwmu here. checkpoint unlocks it when it's // ready. - // fmt.Printf("checkpoint starting\n") if err := db.checkpoint(); err != nil { db.logger.Errorf("async checkpoint: %v", err) } diff --git a/rbf/tx.go b/rbf/tx.go index c45380469..3d7a76e15 100644 --- a/rbf/tx.go +++ b/rbf/tx.go @@ -1122,7 +1122,6 @@ func (tx *Tx) deallocateTree(pgno uint32) error { func (tx *Tx) readPage(pgno uint32) (_ []byte, isHeap bool, err error) { // Meta page is always cached on the transaction. - //fmt.Printf("readPage %d\n", pgno) if pgno == 0 { return tx.meta[:], false, nil } diff --git a/roaring/printutil.go b/roaring/printutil.go index c18a59c23..bffd3b0b0 100644 --- a/roaring/printutil.go +++ b/roaring/printutil.go @@ -42,7 +42,7 @@ func (b *Bitmap) AsContainerMatrixString() (r string) { const rowWidthInContainerCount = 1 << (shardwidth.Exponent - 16) // - 16 because roaring.Container always holds 2^16 bits. sw := uint64(1 << shardwidth.Exponent) - //fmt.Printf("sw = %v, shardwidth.Exponent = %v, rowWidthInContainerCount=%v\n", sw, shardwidth.Exponent, rowWidthInContainerCount) + maxrow := uint64(math.Ceil(float64(max) / float64(sw))) if max == 0 { maxrow++ diff --git a/short_txkey/txkey_test.go b/short_txkey/txkey_test.go index 6fbeca361..5ecc05d83 100644 --- a/short_txkey/txkey_test.go +++ b/short_txkey/txkey_test.go @@ -20,9 +20,6 @@ func Test_KeyPrefix(t *testing.T) { // prefix example: i%f;v:12345678< prefix := Prefix(index, field, view, 0) - //fmt.Printf("needle = '%v'\n", string(needle)) - //fmt.Printf("prefix = '%v'\n", string(prefix)) - if !bytes.HasPrefix(needle, prefix) { panic(fmt.Sprintf("Prefix() output '%v'was not a prefix of Key() '%v'", string(needle), string(prefix))) } diff --git a/testhook/hook.go b/testhook/hook.go index 72d4b54ae..fd146ac29 100644 --- a/testhook/hook.go +++ b/testhook/hook.go @@ -74,7 +74,6 @@ func TempDir(tb testing.TB, pattern string) (path string, err error) { if err == nil { Cleanup(tb, func() { os.RemoveAll(path) - // fmt.Println("--- testhook: cleaning up dir", path, tb.Name()) }) } return path, err @@ -89,7 +88,6 @@ func TempFile(tb testing.TB, pattern string) (file *os.File, err error) { Cleanup(tb, func() { file.Close() os.Remove(path) - // fmt.Println("--- testhook: cleaning up file", path, tb.Name()) }) } return file, err diff --git a/txkey/txkey_test.go b/txkey/txkey_test.go index 46809bd94..b1881b1b4 100644 --- a/txkey/txkey_test.go +++ b/txkey/txkey_test.go @@ -21,9 +21,6 @@ func Test_KeyPrefix(t *testing.T) { // prefix example: i%f;v:12345678< prefix := Prefix(index, field, view, shard) - //fmt.Printf("needle = '%v'\n", string(needle)) - //fmt.Printf("prefix = '%v'\n", string(prefix)) - if !bytes.HasPrefix(needle, prefix) { panic(fmt.Sprintf("Prefix() output '%v'was not a prefix of Key() '%v'", string(needle), string(prefix))) }