Commit Graph

2842 Commits

Author SHA1 Message Date
Igor Canadi
5c04acda08 Explicitly clean JobContext
Summary: This way we can gurantee that old MemTables get destructed before DBImpl gets destructed, which might be useful if we want to make them depend on state from DBImpl.

Test Plan: make check with asserts in JobContext's destructor

Reviewers: ljin, sdong, yhchiang, rven, jonahcohen

Reviewed By: jonahcohen

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28959
2014-11-14 15:43:10 -08:00
fyrz
4947a0674f [RocksJava] Incorporated review comments D28947 2014-11-15 00:14:36 +01:00
fyrz
07cd3c42a2 [RocksJava] LogLevel support in Options
It's now possible to set a LogLevel in Options and
DBOptions to control LOG verbosity.
2014-11-14 23:40:20 +01:00
Igor Canadi
26dc5da96c Fix compaction_job_test 2014-11-14 13:42:13 -08:00
Igor Canadi
5f583d2a9c Merge pull request #394 from lalinsky/cuckoo-c
Cuckoo table options missing in the C interface
2014-11-14 13:23:06 -08:00
Yueh-Hsuan Chiang
353303a765 Merge pull request #380 from fyrz/RocksJava-Junit-Framework
[RocksJava] Test framework support
2014-11-14 12:47:07 -08:00
fyrz
3f9c95a519 [RocksJava] Minor lint correction 2014-11-14 21:34:24 +01:00
fyrz
e46450da6d [RocksJava] Rebased + integrated CF tests 2014-11-14 20:59:38 +01:00
fyrz
cd82beb0cb [RocksJava] Merged in latest changes. 2014-11-14 20:59:38 +01:00
fyrz
b6abab8b77 [RocksJava] Merged & rebased to HEAD 2014-11-14 20:59:38 +01:00
fyrz
74057d6d2d [RocksJava] Improved tests within RocksJava 2014-11-14 20:59:36 +01:00
fyrz
628e39e97d [RocksJava] Integrated review comments from D28209 2014-11-14 20:59:36 +01:00
fyrz
a4b28c1ae7 [RocksJava] Extended Testcases 2014-11-14 20:59:36 +01:00
fyrz
36f3a0bb8e [RocksJava] Integrated review comments from adamretter in D28209 2014-11-14 20:59:36 +01:00
fyrz
b092686959 [RocksJava] Extended testcases
+ 7% coverage + 3% branch coverage
2014-11-14 20:59:36 +01:00
fyrz
9bec23c413 [RocksJava] Test-framework integration
Summary:
As we had the discussion some weeks ago. Java needs a test framework and should support code coverage analysis. This pull request includes:

    Move Tests from main method functionality to Junit4
    Move WriteBatchTest to test package
    Adjust the Makefile to run Junit4
    Download dependencies from Make (once if not-present)
    Adjustment of the rocksjni.pom to run coverage analysis using jacoco
    Javadoc excludes now tests
    Two bugfixes regarding GC cleanup which came up within the test runs

Make can be used as beforehand to build and run RocksJava. make test runs tests using the command-line version of Junit4.

Maven can be used to retrieve code coverage reports using mvn -f rocksjni.pom package. Code coverage reports can then be found as usual in the site folder.

Testing libraries available within Java

    Junit4 (incl. hamcrest-core dependency)
    AssertJ (providing fluent syntax for assertions, cglib dependency)
    Mockito to provide mocktests

Libraries as said before are not statically within this commit or filesystem instead they are downloaded using curl. Make checks if files are present, if so it will perform tests without downloading the libraries again.

Note: Libraries are only necessary to compile & run tests.

Next steps after merge:

    Get the maven build into travis-ci and coveralls.io
    Filling up the missing test spots (based on coverage data)

Test Plan:
make rocksdbjava
make jtest

Reviewers: yhchiang, ankgup87, adamretter

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D28209
2014-11-14 20:59:36 +01:00
fyrz
f617135d5f [RocksJava] Testcase improvements 2014-11-14 20:59:36 +01:00
fyrz
1fe7a4c62f [RocksJava] Test-framework integration 2014-11-14 20:59:36 +01:00
Igor Canadi
04ca7481d2 Fix build 2014-11-14 11:52:17 -08:00
Venkatesh Radhakrishnan
6c1b040cc9 Provide openable snapshots
Summary: Store links to live files in directory on same disk

Test Plan:
Take snapshot and open it. Added a test GetSnapshotLink in
db_test.

Reviewers: sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28713
2014-11-14 11:38:26 -08:00
Igor Canadi
9be338cf9d CompactionJobTest
Summary:
This is just a simple test that passes two files though a compaction. It shows the framework so that people can continue building new compaction *unit* tests.
In the future we might want to move some Compaction* tests from DBTest here. For example, CompactBetweenSnapshot seems a good candidate.

Hopefully this test can be simpler when we mock out VersionSet.

Test Plan: this is a test

Reviewers: ljin, rven, yhchiang, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28449
2014-11-14 11:35:48 -08:00
Lukáš Lalinský
c9fd03ec51 Update docs for NewAdaptiveTableFactory 2014-11-14 11:34:32 -08:00
Lukáš Lalinský
e6c3cc6574 Add very basic tests to make sure the C cuckoo table options compile and run 2014-11-14 11:31:52 -08:00
Yueh-Hsuan Chiang
7fe247080f Update HISTORY.md for RocksJava 2014-11-14 11:23:00 -08:00
Lukáš Lalinský
c44a292781 Add cuckoo table options to the C interface 2014-11-14 11:00:39 -08:00
Siying Dong
136b8583bf Merge pull request #395 from lalinsky/fix-env-test
Relax the block count check on deallocation in env_test
2014-11-14 10:56:41 -08:00
Igor Canadi
94fa542f82 Update HISTROY.md for 3.8 release 2014-11-14 10:43:12 -08:00
sdong
a177742a9b Make db_stress built for ROCKSDB_LITE
Summary:
Make db_stress built for ROCKSDB_LITE.
The test doesn't pass tough. It seg fault quickly. But I took a look and it doesn't seem to be related to lite version. Likely to be a bug inside RocksDB.

Test Plan: make db_stress

Reviewers: yhchiang, rven, ljin, igor

Reviewed By: igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D28797
2014-11-14 10:20:51 -08:00
Lukáš Lalinský
746cfaac58 Relax the block count check on deallocation in env_test
It seems that on some FS we get more blocks than we ask for. This is
already handled when checking the allocated number of blocks, but
after the file is closed it checks for an exact number of blocks,
which fails on my machine.

I changed the test to add one full page to the size, then calculate
the expected number of blocks and check if the actual number of blocks
is less or equal to that.
2014-11-13 16:58:05 -08:00
sdong
f822129b32 Add a unit test for behavior when merge operator and compaction filter co-exist.
Summary: Add a unit test in db_test to verify the behavior when both of merge operator and compaction filter apply to a key when merging.

Test Plan: Run the new test

Reviewers: ljin, yhchiang, rven, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28455
2014-11-13 15:21:12 -08:00
Yueh-Hsuan Chiang
4161de92a3 Fix SIGSEGV
Summary: As a short-term fix, let's go back to previous way of calculating NeedsCompaction(). SIGSEGV happens because NeedsCompaction() can happen before super_version (and thus MutableCFOptions) is initialized.

Test Plan: make check

Reviewers: ljin, sdong, rven, yhchiang

Reviewed By: yhchiang

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28875
2014-11-13 15:21:04 -08:00
Hasnain Lakhani
373c665edf Fix broken test in 31b02d.
Summary:
CorruptionTest for backupable_db_test did not call
GarbageCollect() after deleting a corrupt backup,
which sometimes lead to test failures as the newly created backup
would reuse the same backup ID and files and fail the consistency
check.

Moved around some of the test logic to ensure that GarbageCollect()
is called at the right time.

Test Plan:
Run backupable_db_test eight times and make sure
it passes repeatedly. Also run make check to make sure other
tests don't fail.

Reviewers: igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28863
2014-11-13 14:46:30 -08:00
Igor Canadi
772bc97f13 No CompactFiles in ROCKSDB_LITE
Summary: It adds lots of code.

Test Plan: compile for iOS, compile for mac. works.

Reviewers: rven, sdong, ljin, yhchiang

Reviewed By: yhchiang

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28857
2014-11-13 16:45:33 -05:00
Yueh-Hsuan Chiang
1d1a64f58a Move NeedsCompaction() from VersionStorageInfo to CompactionPicker
Summary:
Move NeedsCompaction() from VersionStorageInfo to CompactionPicker
to allow different compaction strategy to have their own way to
determine whether doing compaction is necessary.

When compaction style is set to kCompactionStyleNone, then
NeedsCompaction() will always return false.

Test Plan:
export ROCKSDB_TESTS=Compact
./db_test

Reviewers: ljin, sdong, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28719
2014-11-13 13:41:43 -08:00
Igor Canadi
cd0980150b Add concurrency to compacting SpatialDB
Summary: This will speed up our import times

Test Plan: Added simple unit test just to get code coverage

Reviewers: sdong, ljin, yhchiang, rven, mohaps

Reviewed By: mohaps

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28869
2014-11-13 16:34:29 -05:00
Igor Canadi
3c92e52338 Fix include 2014-11-13 14:47:54 -05:00
Igor Canadi
25f273027b Fix iOS compile with -Wshorten-64-to-32
Summary: So iOS size_t is 32-bit, so we need to static_cast<size_t> any uint64_t :(

Test Plan: TARGET_OS=IOS make static_lib

Reviewers: dhruba, ljin, yhchiang, rven, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28743
2014-11-13 14:39:30 -05:00
sdong
fa50abb726 Fix bug of reading from empty DB.
Summary: I found that db_stress sometimes segfault on my machine. Fix the bug.

Test Plan: make all check. Run db_stress

Reviewers: ljin, yhchiang, rven, igor

Reviewed By: igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D28803
2014-11-13 10:42:18 -08:00
Hasnain Lakhani
31b02dc21d Improve Backup Engine.
Summary:
Improve the backup engine by not deleting the corrupted
backup when it is detected; instead leaving it to the client
to delete the corrupted backup.

Also add a BackupEngine::Open() call.

Test Plan:
Add check to CorruptionTest inside backupable_db_test
to check that the corrupt backups are not deleted. The previous
version of the code failed this test as backups were deleted,
but after the changes in this commit, this test passes.

Run make check to ensure that no other tests fail.

Reviewers: sdong, benj, sanketh, sumeet, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28521
2014-11-13 09:51:41 -08:00
Yueh-Hsuan Chiang
1033db29f9 Merge pull request #390 from fyrz/RocksJava-Cleanup
[RocksJava] Cleanup
2014-11-12 12:26:21 -08:00
Yueh-Hsuan Chiang
9a03da773c Merge pull request #375 from fyrz/RocksJava-ColumnFamilyOptions-Extension-3.6
[RocksJava] ColumnFamilyOptions extension 3.6
2014-11-12 12:25:15 -08:00
fyrz
d50c68e3a5 [RocksJava] JavaDoc cleanup warnings with Java8
Java8 is more restrictive than Java7 with generating
JavaDocs. This commit resolves current existing Java8
warnings.
2014-11-12 20:51:04 +01:00
fyrz
079d942ea8 [RocksJava] Code-cleanup + Java7 warnings removed 2014-11-12 20:42:25 +01:00
fyrz
9a255b95f0 [RocksJava] Sample and Default value
- RocksDB ColumnFamilySample adjusted to C++ sample.
- DefaultColumnFamily is available now as constant in RocksDB.
2014-11-12 19:49:13 +01:00
fyrz
9d2ba21361 [RocksJava] Incorporated review comments 2014-11-12 19:28:26 +01:00
fyrz
fa9cfc65f3 [RocksJava] Integrated Review comments from yhchiang in D28023 2014-11-12 19:28:25 +01:00
fyrz
75010d2084 [RocksJava] ColumnFamily custom Options API extension
*********************
                   ***************************
                 ******** ************* ********
                ********   ***********   ********
               ********     *********     ********
              *************************************
              *************************************
              *************************************
               ******     ***       ***     ******
                ******    ***  ***  ***    ******
                 ******        ***        ******
                   ***************************
                      *********************
2014-11-12 19:28:24 +01:00
fyrz
0345c2156f [RocksJava] Extend Options with ColumnFamilyOptions implementation ColumnFamilyOptions implementation with tests
[RocksJava] Extended ColumnFamilyTest

Summary: Options Refactoring split part 3

Test Plan:
make rocksdbjava
make jtest

Reviewers: yhchiang, ankgup87

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D28023
2014-11-12 19:28:23 +01:00
Yueh-Hsuan Chiang
9759495229 Fixed clang compile error in version_builder_test
Summary: Fixed clang compile error in version_builder_test

Test Plan: ./version_builder_test

Reviewers: igor, sdong

Reviewed By: sdong

Subscribers: sdong, dhruba

Differential Revision: https://reviews.facebook.net/D28731
2014-11-11 15:22:06 -08:00
Yueh-Hsuan Chiang
5811419357 Fixed GetEstimatedActiveKeys
Summary:
Fixed a bug in GetEstimatedActiveKeys which does not normalized
the sampled information correctly.

Add a test in version_builder_test.

Test Plan: version_builder_test

Reviewers: ljin, igor, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D28707
2014-11-11 14:28:18 -08:00