Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Jul 16, 2024
1 parent f2b070d commit 6849f07
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions posting/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,36 +773,36 @@ func (r *rebuilder) RunWithoutTemp(ctx context.Context) error {
return err
}

res := []int{0, 0, 0}
nn := []int{0, 0, 0}

// Temp stuff to analyse the tree
var edges [][]uint64
for key, pl := range txn.cache.plists {
pk, _ := x.Parse([]byte(key))
if pk.Attr[len(pk.Attr)-1] != '_' {
continue
}
data, err := pl.Value(r.startTs)
if data.Value != nil && err == nil {
err = decodeUint64MatrixUnsafe(data.Value.([]byte), &edges)
if err != nil {
fmt.Println(err)
}
fmt.Printf("%s %d ", pk.Attr, pk.Uid)
for i, r := range edges {
res[i] += len(r)
if len(r) > 0 {
nn[i] += 1
}
fmt.Printf("%d ", len(r))
}
fmt.Printf("\n")
}
}

fmt.Println(res)
fmt.Println(nn)
//res := []int{0, 0, 0}
//nn := []int{0, 0, 0}

//// Temp stuff to analyse the tree
//var edges [][]uint64
//for key, pl := range txn.cache.plists {
// pk, _ := x.Parse([]byte(key))
// if pk.Attr[len(pk.Attr)-1] != '_' {
// continue
// }
// data, err := pl.Value(r.startTs)
// if data.Value != nil && err == nil {
// err = decodeUint64MatrixUnsafe(data.Value.([]byte), &edges)
// if err != nil {
// fmt.Println(err)
// }
// fmt.Printf("%s %d ", pk.Attr, pk.Uid)
// for i, r := range edges {
// res[i] += len(r)
// if len(r) > 0 {
// nn[i] += 1
// }
// fmt.Printf("%d ", len(r))
// }
// fmt.Printf("\n")
// }
//}

//fmt.Println(res)
//fmt.Println(nn)

txn.Update()
writer := NewTxnWriter(pstore)
Expand Down

0 comments on commit 6849f07

Please sign in to comment.