Skip to content
Snippets Groups Projects
Unverified Commit c91159b7 authored by Manish R Jain's avatar Manish R Jain
Browse files

Remove unnecessary function.

parent 14548ae4
No related branches found
No related tags found
No related merge requests found
...@@ -141,44 +141,3 @@ func (l *List) Rollup() (*intern.PostingList, error) { ...@@ -141,44 +141,3 @@ func (l *List) Rollup() (*intern.PostingList, error) {
// atomic.StoreInt32(&l.estimatedSize, l.calculateSize()) // atomic.StoreInt32(&l.estimatedSize, l.calculateSize())
// return nil // return nil
} }
func scanKeysToRoll(snapshotTs uint64, keyChan chan *intern.KVS) error {
txn := pstore.NewTransactionAt(snapshotTs, false)
defer txn.Discard()
opts := badger.DefaultIteratorOptions
opts.AllVersions = false
opts.PrefetchValues = false
itr := txn.NewIterator(opts)
defer itr.Close()
kvs := new(intern.KVS)
// We just pick up the first version of each key. If it is already complete, we skip.
// If it is a delta, we add that to KVS, to be rolled up.
for itr.Rewind(); itr.Valid(); itr.Next() {
item := itr.Item()
pk := x.Parse(item.Key())
if pk.IsSchema() {
// Skip schema.
continue
}
if item.UserMeta()&BitCompletePosting > 0 {
// First version is complete. Therefore, skip.
} else if item.UserMeta()&BitDeltaPosting > 0 {
kvs.Kv = append(kvs.Kv, &intern.KV{Key: item.KeyCopy(nil)})
if len(kvs.Kv) >= 100 {
keyChan <- kvs
kvs = new(intern.KVS)
}
} else {
x.Fatalf("unexpected meta: %d", item.UserMeta())
}
}
if len(kvs.Kv) > 0 {
keyChan <- kvs
}
return nil
}
...@@ -85,13 +85,14 @@ func runSchemaMutation(ctx context.Context, update *intern.SchemaUpdate, startTs ...@@ -85,13 +85,14 @@ func runSchemaMutation(ctx context.Context, update *intern.SchemaUpdate, startTs
} }
// Flush to disk // Flush to disk
posting.CommitLists(func(key []byte) bool { // TODO: Figure out how to do this.
pk := x.Parse(key) // posting.CommitLists(func(key []byte) bool {
if pk.Attr == update.Predicate { // pk := x.Parse(key)
return true // if pk.Attr == update.Predicate {
} // return true
return false // }
}) // return false
// })
updateSchema(update.Predicate, *update) updateSchema(update.Predicate, *update)
return nil return nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment