Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/set #64

Merged
merged 37 commits into from May 19, 2019

Conversation

Projects
None yet
7 participants
@gengxinMT
Copy link
Contributor

commented Mar 6, 2019

Improve the code implementation of set

gengxinMT added some commits Mar 5, 2019

@codelingo
Copy link

left a comment

0 issues found before hitting an error.
Error: Sorry, an error occurred while processing your request. Please try again.

@codelingo
Copy link

left a comment

0 issues found before hitting an error.
Error: Sorry, an error occurred while processing your request. Please try again.

gengxinMT added some commits Mar 7, 2019

Show resolved Hide resolved db/hash.go Outdated
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go Outdated
Show resolved Hide resolved db/set.go Outdated

@shafreeck shafreeck force-pushed the feature/set branch from 551ec86 to 2bc32fe May 14, 2019

@nioshield
Copy link
Contributor

left a comment

请检查所有使用Iter 的地方是否应该添加endkey,避免迭代器返回不必要的key

for i, member := range ctx.Args[1:] {
members[i] = []byte(member)
}
set, err := txn.Set(key)

This comment has been minimized.

Copy link
@nioshield

nioshield May 15, 2019

Contributor

txn.Set 方法是否可以改为txn.Sets

db/set.go Outdated
var siter SetIter
dkey := DataKey(set.txn.db, set.meta.ID)
prefix := append(dkey, ':')
iter, _ := set.txn.t.Iter(prefix, nil)

This comment has been minimized.

Copy link
@nioshield

nioshield May 15, 2019

Contributor

是否应该把nil替换为计算后的endPrefix,减少tikv seek 的不必要扫描

db/set.go Outdated
count := set.meta.Len
members := make([][]byte, 0, count)

iter, err := set.txn.t.Iter(prefix, nil)

This comment has been minimized.

Copy link
@nioshield

nioshield May 15, 2019

Contributor

请注意添加endkey

gengxinMT and others added some commits May 15, 2019

@shafreeck shafreeck merged commit bcff727 into master May 19, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+1.7%) to 46.75%
Details

@arthurkiller arthurkiller deleted the feature/set branch Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.