|
|
|
@ -17,7 +17,7 @@ |
|
|
|
|
|
|
|
|
|
using namespace ROCKSDB_NAMESPACE; |
|
|
|
|
|
|
|
|
|
std::string kDBPath = "/tmp/ipp_aes_example"; |
|
|
|
|
std::string kDBPath = "/tmp/ipp_aes_example_linux"; |
|
|
|
|
|
|
|
|
|
int main() { |
|
|
|
|
DB* db; |
|
|
|
@ -28,7 +28,6 @@ int main() { |
|
|
|
|
Status status = EncryptionProvider::CreateFromString( |
|
|
|
|
ConfigOptions(), IppcpProvider::kName(), &provider); |
|
|
|
|
|
|
|
|
|
std::printf("ok\n"); |
|
|
|
|
assert(status.ok()); |
|
|
|
|
|
|
|
|
|
status = |
|
|
|
@ -44,11 +43,9 @@ int main() { |
|
|
|
|
printf("writing 1M records..."); |
|
|
|
|
WriteOptions w_opts; |
|
|
|
|
for (int i = 0; i < 1000000; ++i) { |
|
|
|
|
std::printf("ok.%d.",i); |
|
|
|
|
status = db->Put(w_opts, std::to_string(i), std::to_string(i * i)); |
|
|
|
|
status = db->Put(w_opts, std::to_string(i), std::to_string(i)); |
|
|
|
|
assert(status.ok()); |
|
|
|
|
} |
|
|
|
|
printf("flush"); |
|
|
|
|
db->Flush(FlushOptions()); |
|
|
|
|
printf("done.\n"); |
|
|
|
|
|
|
|
|
@ -58,7 +55,7 @@ int main() { |
|
|
|
|
for (int i = 0; i < 1000000; ++i) { |
|
|
|
|
status = db->Get(r_opts, std::to_string(i), &value); |
|
|
|
|
assert(status.ok()); |
|
|
|
|
assert(value == std::to_string(i * i)); |
|
|
|
|
assert(value == std::to_string(i)); |
|
|
|
|
} |
|
|
|
|
printf("done.\n"); |
|
|
|
|
|
|
|
|
|