-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Minor fixes in the way of init & start #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ _testmain.go | |
.vagrant | ||
|
||
cockroach | ||
*.swp |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ import ( | |
"flag" | ||
"syscall" | ||
"unsafe" | ||
|
||
"github.com/golang/glog" | ||
) | ||
|
||
|
@@ -210,7 +211,7 @@ func (r *RocksDB) scan(start, end Key, max int64) ([]KeyValue, error) { | |
defer C.rocksdb_iter_destroy(it) | ||
|
||
keyVals := []KeyValue{} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an actual difference between these two statements in go? I confess I know very little about the cgo interface; Andy's worked on this part. I need to learn a bit more. I noticed the continuous integration build is failing. Do the unittests pass for you? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see exactly what the problem is (sorry didn't read your PR note about scan on ""). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately that fix is wrong (as you pointed out - the tests), I have one that works now, it may not be ideal but I'm sure someone who knows their cgo will be able to improve. It will be on Phabricator. |
||
C.rocksdb_iter_seek(it, (*C.char)(unsafe.Pointer(&start[0])), C.size_t(len(start))) | ||
C.rocksdb_iter_seek(it, (*C.char)(unsafe.Pointer(&start)), C.size_t(len(start))) | ||
for i := int64(1); C.rocksdb_iter_valid(it) == 1; C.rocksdb_iter_next(it) { | ||
if max > 0 && i > max { | ||
break | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really do need a test for this.