Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
221 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
each | ||
keys | ||
new_iterator | ||
rocksdb_close | ||
rocksdb_create_iterator | ||
rocksdb_delete | ||
rocksdb_get | ||
rocksdb_iter_destroy | ||
rocksdb_iter_key | ||
rocksdb_iter_next | ||
rocksdb_iter_prev | ||
rocksdb_iter_seek | ||
rocksdb_iter_seek_to_first | ||
rocksdb_iter_seek_to_last | ||
rocksdb_iter_valid | ||
rocksdb_iter_value | ||
rocksdb_open | ||
rocksdb_put |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
require "./spec_helper" | ||
|
||
describe "Iterator" do | ||
path = "tmp/db_iteration" | ||
|
||
it "work" do | ||
db = RocksDB::DB.new(path) | ||
3.times{|i| db.put("k#{i}", i) } | ||
iter = RocksDB::Iterator.new(db) | ||
|
||
iter.valid?.should be_false | ||
|
||
iter.first | ||
iter.valid?.should be_true | ||
iter.key.should eq("k0") | ||
iter.value.should eq("0") | ||
|
||
iter.next | ||
iter.key.should eq("k1") | ||
iter.value.should eq("1") | ||
|
||
iter.next | ||
iter.key.should eq("k2") | ||
iter.value.should eq("2") | ||
|
||
iter.prev | ||
iter.key.should eq("k1") | ||
iter.value.should eq("1") | ||
|
||
iter.first | ||
iter.key.should eq("k0") | ||
iter.value.should eq("0") | ||
|
||
iter.last | ||
iter.key.should eq("k2") | ||
iter.value.should eq("2") | ||
|
||
iter.next | ||
iter.valid?.should be_false | ||
|
||
iter.seek("k1") | ||
iter.valid?.should be_true | ||
iter.key.should eq("k1") | ||
|
||
iter.seek("xx") | ||
iter.valid?.should be_false | ||
|
||
db.close | ||
end | ||
|
||
it "#rocksdb_create_iterator" do ; end | ||
it "#rocksdb_iter_destroy" do ; end | ||
it "#rocksdb_iter_seek_to_first" do ; end | ||
it "#rocksdb_iter_seek_to_last" do ; end | ||
it "#rocksdb_iter_seek" do; end | ||
it "#rocksdb_iter_prev" do; end | ||
it "#rocksdb_iter_next" do; end | ||
it "#rocksdb_iter_key" do; end | ||
it "#rocksdb_iter_value" do ; end | ||
it "#rocksdb_iter_valid" do ; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.