diff --git a/go/types/graph_builder.go b/go/types/graph_builder.go index 29ad3616df..4ce827e9cc 100644 --- a/go/types/graph_builder.go +++ b/go/types/graph_builder.go @@ -44,8 +44,6 @@ import ( "sync" "github.com/attic-labs/noms/go/d" - "github.com/attic-labs/noms/go/util/status" - "github.com/dustin/go-humanize" ) type GraphBuilder struct { @@ -53,17 +51,16 @@ type GraphBuilder struct { oc opCache vrw ValueReadWriter stack graphStack - verbose bool mutex sync.Mutex } // NewGraphBuilder() returns an new GraphBuilder object. -func NewGraphBuilder(vrw ValueReadWriter, rootKind NomsKind, verbose bool) *GraphBuilder { - return newGraphBuilder(vrw, newLdbOpCacheStore(vrw), rootKind, verbose) +func NewGraphBuilder(vrw ValueReadWriter, rootKind NomsKind) *GraphBuilder { + return newGraphBuilder(vrw, newLdbOpCacheStore(vrw), rootKind) } -func newGraphBuilder(vrw ValueReadWriter, opcStore opCacheStore, rootKind NomsKind, verbose bool) *GraphBuilder { - b := &GraphBuilder{oc: opcStore.opCache(), opcStore: opcStore, vrw: vrw, verbose: verbose} +func newGraphBuilder(vrw ValueReadWriter, opcStore opCacheStore, rootKind NomsKind) *GraphBuilder { + b := &GraphBuilder{oc: opcStore.opCache(), opcStore: opcStore, vrw: vrw} b.pushNewKeyOnStack(String("ROOT"), rootKind) return b } @@ -133,7 +130,6 @@ func (b *GraphBuilder) Build() Value { iter := opc.NewIterator() defer iter.Release() - keyCnt := int64(0) // start up a go routine that will do the reading from graphBuilder's private // ldb opCache. @@ -183,10 +179,6 @@ func (b *GraphBuilder) Build() Value { b.pushNewKeyOnStack(keys[b.stack.lastIdx()], kind) b.appendItemToCurrentTopOfStack(kind, item) } - if b.verbose { - keyCnt++ - status.Printf("Added %s keys to graph", humanize.Comma(keyCnt)) - } } } @@ -196,9 +188,6 @@ func (b *GraphBuilder) Build() Value { b.popKeyFromStack() } res := b.stack.pop().done() - if b.verbose { - status.Done() - } return res } diff --git a/go/types/graph_builder_test.go b/go/types/graph_builder_test.go index 170990ecb8..0cdafa40b2 100644 --- a/go/types/graph_builder_test.go +++ b/go/types/graph_builder_test.go @@ -248,7 +248,7 @@ func TestGraphBuilderNestedMapSet(t *testing.T) { defer vs.Close() expected := createTestMap(3, 4, valGen) - b := NewGraphBuilder(vs, MapKind, false) + b := NewGraphBuilder(vs, MapKind) ops := []testGraphOp{} @@ -306,7 +306,7 @@ func ExampleGraphBuilder_Build() { vs := newTestValueStore() defer vs.Close() - gb := NewGraphBuilder(vs, MapKind, false) + gb := NewGraphBuilder(vs, MapKind) gb.SetInsert([]Value{String("parent"), String("children")}, String("John")) gb.SetInsert([]Value{String("parent"), String("children")}, String("Mary")) gb.SetInsert([]Value{String("parent"), String("children")}, String("Frieda")) diff --git a/samples/go/csv/read.go b/samples/go/csv/read.go index 84b966bc97..82684aa592 100644 --- a/samples/go/csv/read.go +++ b/samples/go/csv/read.go @@ -190,7 +190,7 @@ func ReadToMap(r *csv.Reader, structName string, headersRaw []string, primaryKey temp, fieldOrder, kindMap := MakeStructTemplateFromHeaders(headersRaw, structName, kinds) pkIndices := getPkIndices(primaryKeys, headersRaw) d.Chk.True(len(pkIndices) >= 1, "No primary key defined when reading into map") - gb := types.NewGraphBuilder(vrw, types.MapKind, false) + gb := types.NewGraphBuilder(vrw, types.MapKind) for { row, err := r.Read() diff --git a/samples/go/nomdex/nomdex_update.go b/samples/go/nomdex/nomdex_update.go index 434653857a..fed18a95dc 100644 --- a/samples/go/nomdex/nomdex_update.go +++ b/samples/go/nomdex/nomdex_update.go @@ -141,7 +141,7 @@ func runUpdate(args []string) int { return 1 } - gb := types.NewGraphBuilder(db, types.MapKind, true) + gb := types.NewGraphBuilder(db, types.MapKind) addElementsToGraphBuilder(gb, db, rootObject, relPath) indexMap := gb.Build().(types.Map)