2016-08-17 11 views
0

に動作していない私は、次のコードがありますはrocksdbを使用して::イテレータと列の家族が

rocksdb::DBWithTTL* db = ... 
rocksdb::WriteOptions writeOptions; 
rocksdb::ColumnFamilyHandle cfHandle = ... 

std::string keyPrefix = "prefix"; 
std::string key = keyPrefix + "_key"; 
std::string value = "value"; 
rocksdb::Status s = db->Put(writeOptions, cfHandle, key, value); 

rocksdb::ReadOptions readOptions; 
readOptions.prefix_same_as_start; 
readOptions.snapshot = db->GetSnapshot(); 
rocksdb::Iterator* iterator = db->NewIterator(readOptions); 

rocksdb::Sliced start = rocksdb::Slice(keyPrefix); 
for (iterator->Seek(start); iterator->Valid(); iterator->Next()) { 
    printf("hello"); 
} 

printfがヒットされることはありません。私はPutラインを変更した場合

しかし、:column family handleの除去、

rocksdb::Status s = db->Put(writeOptions, key, value); 

意味、私はライン印刷罰金を取得しています。

イテレータAPIが列ファミリを考慮する必要があると推測していますが、ドキュメントが見つかりませんでした。

答えて

0

は確かに不足しているAPIの呼び出しがあった。

rocksdb::Iterator* iterator = db->NewIterator(readOptions, cfHandle); 
関連する問題