1. 16 4月, 2014 4 次提交
  2. 11 4月, 2014 1 次提交
  3. 09 4月, 2014 2 次提交
    • Y
      [JNI] Add an initial benchmark for java binding for rocksdb. · 0f5cbcd7
      Yueh-Hsuan Chiang 提交于
      Summary:
      * Add a benchmark for java binding for rocksdb.  The java benchmark
        is a complete rewrite based on the c++ db/db_bench.cc and the
        DbBenchmark in dain's java leveldb.
      * Support multithreading.
      * 'readseq' is currently not supported as it requires RocksDB Iterator.
      
      * usage:
      
        --benchmarks
          Comma-separated list of operations to run in the specified order
              Actual benchmarks:
                      fillseq    -- write N values in sequential key order in async mode
                      fillrandom -- write N values in random key order in async mode
                      fillbatch  -- write N/1000 batch where each batch has 1000 values
                                    in random key order in sync mode
                      fillsync   -- write N/100 values in random key order in sync mode
                      fill100K   -- write N/1000 100K values in random order in async mode
                      readseq    -- read N times sequentially
                      readrandom -- read N times in random order
                      readhot    -- read N times in random order from 1% section of DB
              Meta Operations:
                      delete     -- delete DB
          DEFAULT: [fillseq, readrandom, fillrandom]
      
        --compression_ratio
          Arrange to generate values that shrink to this fraction of
              their original size after compression
          DEFAULT: 0.5
      
        --use_existing_db
          If true, do not destroy the existing database.  If you set this
              flag and also specify a benchmark that wants a fresh database,  that benchmark will fail.
          DEFAULT: false
      
        --num
          Number of key/values to place in database.
          DEFAULT: 1000000
      
        --threads
          Number of concurrent threads to run.
          DEFAULT: 1
      
        --reads
          Number of read operations to do.  If negative, do --nums reads.
      
        --key_size
          The size of each key in bytes.
          DEFAULT: 16
      
        --value_size
          The size of each value in bytes.
          DEFAULT: 100
      
        --write_buffer_size
          Number of bytes to buffer in memtable before compacting
              (initialized to default value by 'main'.)
          DEFAULT: 4194304
      
        --cache_size
          Number of bytes to use as a cache of uncompressed data.
              Negative means use default settings.
          DEFAULT: -1
      
        --seed
          Seed base for random number generators.
          DEFAULT: 0
      
        --db
          Use the db with the following name.
          DEFAULT: /tmp/rocksdbjni-bench
      
      * Add RocksDB.write().
      
      Test Plan: make jbench
      
      Reviewers: haobo, sdong, dhruba, ankgup87
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17433
      0f5cbcd7
    • L
      macros for perf_context · 92c1eb02
      Lei Jin 提交于
      Summary: This will allow us to disable them completely for iOS or for better performance
      
      Test Plan: will run make all check
      
      Reviewers: igor, haobo, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17511
      92c1eb02
  4. 05 4月, 2014 2 次提交
  5. 03 4月, 2014 1 次提交
    • Y
      [JNI] Add java api and java tests for WriteBatch and WriteOptions, add put()... · da0887a3
      Yueh-Hsuan Chiang 提交于
      [JNI] Add java api and java tests for WriteBatch and WriteOptions, add put() and remove() to RocksDB.
      
      Summary:
      * Add java api for rocksdb::WriteBatch and rocksdb::WriteOptions, which are necessary components
        for running benchmark.
      * Add java test for org.rocksdb.WriteBatch and org.rocksdb.WriteOptions.
      * Add remove() to org.rocksdb.RocksDB, and add put() and remove() to RocksDB which take
        org.rocksdb.WriteOptions.
      
      Test Plan: make jtest
      
      Reviewers: haobo, sdong, dhruba
      
      Reviewed By: sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D17373
      da0887a3
  6. 02 4月, 2014 1 次提交
  7. 01 4月, 2014 1 次提交
  8. 29 3月, 2014 2 次提交
    • D
      A GIS implementation for rocksdb. · 4031b983
      Dhruba Borthakur 提交于
      Summary:
          This patch stores gps locations in rocksdb.
      
          Each object is uniquely identified by an id. Each object has
          a gps (latitude, longitude) associated with it. The geodb
          supports looking up an object either by its gps location
          or by its id. There is a method to retrieve all objects
          within a circular radius centered at a specified gps location.
      
      Test Plan: Simple unit-test attached.
      
      Reviewers: leveldb, haobo
      
      Reviewed By: haobo
      
      CC: leveldb, tecbot, haobo
      
      Differential Revision: https://reviews.facebook.net/D15567
      4031b983
    • Y
      Add a jni library for rocksdb which supports Open, Get, Put, and Close. · 0d463a36
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff contains a simple jni library for rocksdb which supports open, get,
      put and closeusing default options (including Options, ReadOptions, and
      WriteOptions.)  In the usual case, Java developers can use the c++ rocksdb
      library in the way similar to the following:
      
          RocksDB db = RocksDB.open(path_to_db);
          ...
          db.put("hello".getBytes(), "world".getBytes();
          byte[] value = db.get("hello".getBytes());
          ...
          db.close();
      
      Specifically, this diff has the following major classes:
      
      * RocksDB: a Java wrapper class which forwards the operations
        from the java side to c++ rocksdb library.
      * RocksDBException: ncapsulates the error of an operation.
        This exception type is used to describe an internal error from
        the c++ rocksdb library.
      
      This diff also include a simple java sample code calling c++ rocksdb library.
      
      To build the rocksdb jni library, simply run make jni, and make jtest will try to
      build and run the sample code.
      
      Note that if the rocksdb is not built with the default glibc that Java uses,
      java will try to load the wrong glibc during the run time.  As a result,
      the sample code might not work properly during the run time.
      
      Test Plan:
      * make jni
      * make jtest
      
      Reviewers: haobo, dhruba, sdong, igor, ljin
      
      Reviewed By: dhruba
      
      CC: leveldb, xjin
      
      Differential Revision: https://reviews.facebook.net/D17109
      0d463a36
  9. 18 3月, 2014 1 次提交
  10. 07 3月, 2014 1 次提交
    • I
      DB Sanity Test · 9c8ad626
      Igor Canadi 提交于
      Summary:
      @kailiu mentioned on meeting yesterday that we sometimes have trouble opening DB created by old version with the new version. This will be very important to test for column families, since I'm changing disk format for the MANIFEST.
      
      I added a tool that can help us test that. Usage:
      ./db_sanity_test <path> create
      will create a bunch of DBs under <path>
      <change RocksDB version>
      ./db_sanity_test <path> verify
      will verify consistency of DBs created under <path>
      
      Test Plan: ran the db_sanity_test
      
      Reviewers: kailiu, dhruba, haobo
      
      Reviewed By: kailiu
      
      CC: leveldb, kailiu, xjin
      
      Differential Revision: https://reviews.facebook.net/D16605
      9c8ad626
  11. 04 3月, 2014 2 次提交
  12. 28 2月, 2014 1 次提交
  13. 26 2月, 2014 1 次提交
    • L
      thread local pointer storage · b2795b79
      Lei Jin 提交于
      Summary:
      This is not a generic thread local implementation in the sense that it
      only takes pointer. But it does support multiple instances per thread
      and lets user plugin function to perform cleanup when thread exits or an
      instance gets destroyed.
      
      Test Plan: unit test for now
      
      Reviewers: haobo, igor, sdong, dhruba
      
      Reviewed By: igor
      
      CC: leveldb, kailiu
      
      Differential Revision: https://reviews.facebook.net/D16131
      b2795b79
  14. 25 2月, 2014 1 次提交
  15. 20 2月, 2014 1 次提交
    • S
      Add a test in prefix_test to verify correctness of results · b2d29675
      sdong 提交于
      Summary:
      Add a test to verify HashLinkList and HashSkipList (mainly for the former one) returns the correct results when inserting the same bucket in the different orders.
      
      Some other changes:
      (1) add the test to test list
      (2) fix compile error
      (3) add header
      
      Test Plan: ./prefix_test
      
      Reviewers: haobo, kailiu
      
      Reviewed By: haobo
      
      CC: igor, yhchiang, i.am.jin.lei, dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D16143
      b2d29675
  16. 13 2月, 2014 1 次提交
  17. 11 2月, 2014 1 次提交
  18. 07 2月, 2014 2 次提交
  19. 30 1月, 2014 1 次提交
    • K
      LIBNAME in Makefile is not really configurable · b7db2411
      Kai Liu 提交于
      Summary:
      In new third-party release tool, `LIBNAME=<customized_library> make`
      will not really change the LIBNAME.
      
      However it's very odd that the same approach works with old third-party
      release tools. I checked previous rocksdb version and both librocksdb.a
      and librocksdb_debug.a were correctly generated and copied to the
      right place.
      
      Test Plan:
      `LIBNAME=hello make -j32` generates hello.a
      `make -j32` generates librocksdb.a
      
      Reviewers: igor, sdong, haobo, dhruba
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15555
      b7db2411
  20. 25 1月, 2014 1 次提交
    • K
      Add a make target for shared library · f131d4c2
      kailiu 提交于
      Summary:
      Previous we made `make release` also compile shared library. However it takes a long time to complete.
      
      To make our development process more efficient. I added a new make target shared_lib.
      
      User can of course run `make <library_name>` for direct compilation. However the <library_name> changed under certain condition. Thus we need `make shared_lib` to get rid of the memorization from users' side.
      
      Test Plan: make shared_lib
      
      Reviewers: igor, sdong, haobo, dhruba
      
      Reviewed By: igor
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15309
      f131d4c2
  21. 17 1月, 2014 1 次提交
  22. 15 1月, 2014 2 次提交
    • K
      Move the compilation of the shared libraries to "make release" · 481c77e5
      kailiu 提交于
      Compiling the shared libraries took a long time. Thus to speed up the development speed, it still makes sense to be separated from regular compilation.
      481c77e5
    • K
      A script that automatically reformat affected lines · d702d807
      Kai Liu 提交于
      Summary:
      Added a script that reformat only the affected lines in a given diff.
      
      I planned to make that file as pre-commit hook but looks it's a little bit more difficult than I thought. Since I don't want to spend too much time on this task right now, I eventually added a "make command" to achieve this with a few additional key strokes.
      
      Also make the clang-format solely inherited from Google's style -- there are still debates on some of the style issues, but we can address them later once we reach a consensus.
      
      Test Plan: Did some ugly format change and ran "make format", all affected lines are formatted as expected.
      
      Reviewers: igor, sdong, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15147
      d702d807
  23. 14 1月, 2014 1 次提交
    • K
      Compile dynamic library by default · ac2fe728
      kailiu 提交于
      Summary:
      Per request, some users need to use dynamic rocksdb library instead of static one.
      
      However currently the dynamic libraries have to be manually compiled by default, which is inconvenient. I made dymamic libraries to be compiled by default.
      
      Test Plan: make clean; make; make clean;
      
      Reviewers: haobo, sdong, dhruba, igor
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15117
      ac2fe728
  24. 03 1月, 2014 1 次提交
  25. 02 1月, 2014 1 次提交
  26. 27 12月, 2013 1 次提交
    • K
      Implement autovector · c01676e4
      kailiu 提交于
      Summary:
      A vector that leverages pre-allocated stack-based array to achieve better
      performance for array with small amount of items.
      
      Test Plan:
      Added tests for both correctness and performance
      
      Here is the performance benchmark between vector and autovector
      
      Please note that in the test "Creation and Insertion Test", the test case were designed with the motivation described below:
      
      * no element inserted: internal array of std::vector may not really get
        initialize.
      * one element inserted: internal array of std::vector must have
        initialized.
      * kSize elements inserted. This shows the most time we'll spend if we
        keep everything in stack.
      * 2 * kSize elements inserted. The internal vector of
        autovector must have been initialized.
      
      Note: kSize is the capacity of autovector
      
        =====================================================
        Creation and Insertion Test
        =====================================================
        created 100000 vectors:
        	each was inserted with 0 elements
        	total time elapsed: 128000 (ns)
        created 100000 autovectors:
        	each was inserted with 0 elements
        	total time elapsed: 3641000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 0 elements
        	total time elapsed: 9896000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 1 elements
        	total time elapsed: 11089000 (ns)
        created 100000 autovectors:
        	each was inserted with 1 elements
        	total time elapsed: 5008000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 1 elements
        	total time elapsed: 24271000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 4 elements
        	total time elapsed: 39369000 (ns)
        created 100000 autovectors:
        	each was inserted with 4 elements
        	total time elapsed: 10121000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 4 elements
        	total time elapsed: 28473000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 8 elements
        	total time elapsed: 75013000 (ns)
        created 100000 autovectors:
        	each was inserted with 8 elements
        	total time elapsed: 18237000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 8 elements
        	total time elapsed: 42464000 (ns)
        -----------------------------------
        created 100000 vectors:
        	each was inserted with 16 elements
        	total time elapsed: 102319000 (ns)
        created 100000 autovectors:
        	each was inserted with 16 elements
        	total time elapsed: 76724000 (ns)
        created 100000 VectorWithReserveSizes:
        	each was inserted with 16 elements
        	total time elapsed: 68285000 (ns)
        -----------------------------------
        =====================================================
        Sequence Access Test
        =====================================================
        performed 100000 sequence access against vector
        	size: 4
        	total time elapsed: 198000 (ns)
        performed 100000 sequence access against autovector
        	size: 4
        	total time elapsed: 306000 (ns)
        -----------------------------------
        performed 100000 sequence access against vector
        	size: 8
        	total time elapsed: 565000 (ns)
        performed 100000 sequence access against autovector
        	size: 8
        	total time elapsed: 512000 (ns)
        -----------------------------------
        performed 100000 sequence access against vector
        	size: 16
        	total time elapsed: 1076000 (ns)
        performed 100000 sequence access against autovector
        	size: 16
        	total time elapsed: 1070000 (ns)
        -----------------------------------
      
      Reviewers: dhruba, haobo, sdong, chip
      
      Reviewed By: dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14655
      c01676e4
  27. 19 12月, 2013 1 次提交
  28. 11 12月, 2013 1 次提交
  29. 10 12月, 2013 2 次提交
    • D
      Fix shared lib build · f6012ab8
      Doğan Çeçen 提交于
      f6012ab8
    • I
      [RocksDB] BackupableDB · fb9fce4f
      Igor Canadi 提交于
      Summary:
      In this diff I present you BackupableDB v1. You can easily use it to backup your DB and it will do incremental snapshots for you.
      Let's first describe how you would use BackupableDB. It's inheriting StackableDB interface so you can easily construct it with your DB object -- it will add a method RollTheSnapshot() to the DB object. When you call RollTheSnapshot(), current snapshot of the DB will be stored in the backup dir. To restore, you can just call RestoreDBFromBackup() on a BackupableDB (which is a static method) and it will restore all files from the backup dir. In the next version, it will even support automatic backuping every X minutes.
      
      There are multiple things you can configure:
      1. backup_env and db_env can be different, which is awesome because then you can easily backup to HDFS or wherever you feel like.
      2. sync - if true, it *guarantees* backup consistency on machine reboot
      3. number of snapshots to keep - this will keep last N snapshots around if you want, for some reason, be able to restore from an earlier snapshot. All the backuping is done in incremental fashion - if we already have 00010.sst, we will not copy it again. *IMPORTANT* -- This is based on assumption that 00010.sst never changes - two files named 00010.sst from the same DB will always be exactly the same. Is this true? I always copy manifest, current and log files.
      4. You can decide if you want to flush the memtables before you backup, or you're fine with backing up the log files -- either way, you get a complete and consistent view of the database at a time of backup.
      5. More things you can find in BackupableDBOptions
      
      Here is the directory structure I use:
      
         backup_dir/CURRENT_SNAPSHOT - just 4 bytes holding the latest snapshot
                     0, 1, 2, ... - files containing serialized version of each snapshot - containing a list of files
                     files/*.sst - sst files shared between snapshots - if one snapshot references 00010.sst and another one needs to backup it from the DB, it will just reference the same file
                     files/ 0/, 1/, 2/, ... - snapshot directories containing private snapshot files - current, manifest and log files
      
      All the files are ref counted and deleted immediatelly when they get out of scope.
      
      Some other stuff in this diff:
      1. Added GetEnv() method to the DB. Discussed with @haobo and we agreed that it seems right thing to do.
      2. Fixed StackableDB interface. The way it was set up before, I was not able to implement BackupableDB.
      
      Test Plan:
      I have a unittest, but please don't look at this yet. I just hacked it up to help me with debugging. I will write a lot of good tests and update the diff.
      
      Also, `make asan_check`
      
      Reviewers: dhruba, haobo, emayanke
      
      Reviewed By: dhruba
      
      CC: leveldb, haobo
      
      Differential Revision: https://reviews.facebook.net/D14295
      fb9fce4f
  30. 03 12月, 2013 1 次提交