Tune compression options a bit for intermediates (binloader) vs. final output (binmer...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 9 Dec 2014 21:09:20 +0000 (22:09 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 9 Dec 2014 21:09:20 +0000 (22:09 +0100)
book/binloader.cpp
book/binmerger.cpp

index a561829..9658c2e 100644 (file)
@@ -83,7 +83,9 @@ int main(int argc, char **argv)
        sort(elems.begin(), elems.end());
 
        printf("Writing SSTable...\n");
        sort(elems.begin(), elems.end());
 
        printf("Writing SSTable...\n");
-       mtbl_writer* mtbl = mtbl_writer_init(argv[argc - 1], NULL);
+       mtbl_writer_options* wopt = mtbl_writer_options_init();
+       mtbl_writer_options_set_compression(wopt, MTBL_COMPRESSION_SNAPPY);
+       mtbl_writer* mtbl = mtbl_writer_init(argv[argc - 1], wopt);
        Count c;
        for (int i = 0; i < elems.size(); ++i) {
                if (elems[i].result == WHITE) {
        Count c;
        for (int i = 0; i < elems.size(); ++i) {
                if (elems[i].result == WHITE) {
index 480bd83..612a19b 100644 (file)
@@ -45,7 +45,9 @@ int main(int argc, char **argv)
                mtbl_merger_add_source(merger, mtbl_reader_source(mtbl));
        }
 
                mtbl_merger_add_source(merger, mtbl_reader_source(mtbl));
        }
 
-       mtbl_writer* writer = mtbl_writer_init(argv[argc - 1], NULL);
+       mtbl_writer_options* wopt = mtbl_writer_options_init();
+       mtbl_writer_options_set_block_size(wopt, 65536);
+       mtbl_writer* writer = mtbl_writer_init(argv[argc - 1], wopt);
        mtbl_source_write(mtbl_merger_source(merger), writer);
        mtbl_writer_destroy(&writer);
 }
        mtbl_source_write(mtbl_merger_source(merger), writer);
        mtbl_writer_destroy(&writer);
 }