Skip to content
Snippets Groups Projects
Commit 0699663d authored by Ashwin's avatar Ashwin
Browse files

Formatting changes

parent 26afdb9a
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ int main(int argc, char* argv[]) { ...@@ -37,7 +37,7 @@ int main(int argc, char* argv[]) {
<folder_having_rocksDB_directories_to_be_merged> <destination_folder>\n"; <folder_having_rocksDB_directories_to_be_merged> <destination_folder>\n";
exit(0); exit(0);
} }
std::string destinationDB = argv[2], mergeDir = argv[1]; std::string destinationDB = argv[2], mergeDir = argv[1];
DB* db; DB* db;
Options options; Options options;
...@@ -46,7 +46,7 @@ int main(int argc, char* argv[]) { ...@@ -46,7 +46,7 @@ int main(int argc, char* argv[]) {
options.OptimizeLevelStyleCompaction(); options.OptimizeLevelStyleCompaction();
// create the DB if it's not already present // create the DB if it's not already present
options.create_if_missing = true; options.create_if_missing = true;
// open DB // open DB
Status s = DB::Open(options, destinationDB, &db); Status s = DB::Open(options, destinationDB, &db);
assert(s.ok()); assert(s.ok());
...@@ -59,7 +59,7 @@ int main(int argc, char* argv[]) { ...@@ -59,7 +59,7 @@ int main(int argc, char* argv[]) {
options.OptimizeLevelStyleCompaction(); options.OptimizeLevelStyleCompaction();
// Don't create the DB if it's not already present // Don't create the DB if it's not already present
options.create_if_missing = false; options.create_if_missing = false;
// open DB // open DB
Status s1 = DB::Open(options, dirEntry.path().c_str(), &cur_db); Status s1 = DB::Open(options, dirEntry.path().c_str(), &cur_db);
assert(s1.ok()); assert(s1.ok());
...@@ -67,10 +67,10 @@ int main(int argc, char* argv[]) { ...@@ -67,10 +67,10 @@ int main(int argc, char* argv[]) {
rocksdb::Iterator* it = cur_db->NewIterator(rocksdb::ReadOptions()); rocksdb::Iterator* it = cur_db->NewIterator(rocksdb::ReadOptions());
for (it->SeekToFirst(); it->Valid(); it->Next()) { for (it->SeekToFirst(); it->Valid(); it->Next()) {
Slice key_s = it->key(); Slice key_s = it->key();
Slice val_s = it->value(); Slice val_s = it->value();
std::string val_t; std::string val_t;
Status s = db->Get(ReadOptions(), key_s, &val_t); Status s = db->Get(ReadOptions(), key_s, &val_t);
if(s.ok()) { if(s.ok()) {
assert(val_t == val_s.ToString() && "Same key has different value"); assert(val_t == val_s.ToString() && "Same key has different value");
} else { } else {
s = db->Put(WriteOptions(), key_s, val_s); s = db->Put(WriteOptions(), key_s, val_s);
...@@ -82,6 +82,6 @@ int main(int argc, char* argv[]) { ...@@ -82,6 +82,6 @@ int main(int argc, char* argv[]) {
delete cur_db; delete cur_db;
} }
delete db; delete db;
return 0; return 0;
} }
...@@ -92,7 +92,7 @@ int main(int argc, char* argv[]) { ...@@ -92,7 +92,7 @@ int main(int argc, char* argv[]) {
it->SeekToFirst(); it->SeekToFirst();
if(!it->Valid()) { if(!it->Valid()) {
continue; continue;
} }
struct node tnode(it->key(), it->value(), counter++); struct node tnode(it->key(), it->value(), counter++);
itVec.push_back(it); itVec.push_back(it);
pq.push(tnode); pq.push(tnode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment