Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
c91159b7
Unverified
Commit
c91159b7
authored
6 years ago
by
Manish R Jain
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary function.
parent
14548ae4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
posting/rollup.go
+0
-41
0 additions, 41 deletions
posting/rollup.go
worker/mutation.go
+8
-7
8 additions, 7 deletions
worker/mutation.go
with
8 additions
and
48 deletions
posting/rollup.go
+
0
−
41
View file @
c91159b7
...
@@ -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
}
This diff is collapsed.
Click to expand it.
worker/mutation.go
+
8
−
7
View file @
c91159b7
...
@@ -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
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment