File tree Expand file tree Collapse file tree 1 file changed +30
-28
lines changed Expand file tree Collapse file tree 1 file changed +30
-28
lines changed Original file line number Diff line number Diff line change 1717package posting
1818
1919import (
20- "bytes"
2120 "context"
2221 "encoding/hex"
2322 "fmt"
@@ -499,37 +498,40 @@ func (r *rebuild) Run(ctx context.Context) error {
499498 // global lcache (the LRU cache).
500499 txn := NewTxn (r .startTs )
501500
502- var prevKey []byte
503- for it .Rewind (); it .Valid (); {
504- item := it .Item ()
505- if bytes .Equal (item .Key (), prevKey ) {
506- it .Next ()
507- continue
508- }
509- key := item .KeyCopy (nil )
510- prevKey = key
501+ glog .Infof ("No build index is set! Refusing to rebuild index." )
502+ /*
503+ var prevKey []byte
504+ for it.Rewind(); it.Valid(); {
505+ item := it.Item()
506+ if bytes.Equal(item.Key(), prevKey) {
507+ it.Next()
508+ continue
509+ }
510+ key := item.KeyCopy(nil)
511+ prevKey = key
511512
512- pk := x .Parse (key )
513- if pk == nil {
514- it .Next ()
515- continue
516- }
513+ pk := x.Parse(key)
514+ if pk == nil {
515+ it.Next()
516+ continue
517+ }
517518
518- // We should return quickly if the context is no longer valid.
519- select {
520- case <- ctx .Done ():
521- return ctx .Err ()
522- default :
523- }
519+ // We should return quickly if the context is no longer valid.
520+ select {
521+ case <-ctx.Done():
522+ return ctx.Err()
523+ default:
524+ }
524525
525- l , err := ReadPostingList (key , it )
526- if err != nil {
527- return err
528- }
529- if err := r .fn (pk .Uid , l , txn ); err != nil {
530- return err
526+ l, err := ReadPostingList(key, it)
527+ if err != nil {
528+ return err
529+ }
530+ if err := r.fn(pk.Uid, l, txn); err != nil {
531+ return err
532+ }
531533 }
532- }
534+ */
533535 glog .V (1 ).Infof ("Rebuild: Iteration done. Now commiting at ts=%d\n " , r .startTs )
534536
535537 txn .Update () // Convert data into deltas.
You can’t perform that action at this time.
0 commit comments