495 Commits

Author SHA1 Message Date
Scott Fines
397af989bb More PR comments 2021-03-05 15:15:05 -06:00
Scott Fines
75be7243e8 Addressing PR comments 2021-03-05 14:27:00 -06:00
Scott Fines
c6731cc053 Basic instrumentation of Java Bindings 2021-03-05 14:26:46 -06:00
Andrew Noyes
e62cdbad3b Mention that tests share an fdb cluster 2021-03-02 16:31:58 +00:00
Andrew Noyes
18ee11e69a Use add_fdbclient_test for java integration tests
Also change add_fdbclient_test to run its subcommand with FDB_CLUSTER_FILE set
2021-03-02 01:54:17 +00:00
Scott Fines
7054328d8a New Unit and Integration Tests, and associated infrastructure.
First, this converts the java unit testing framework to junit 5.

Then we create some easy unit tests, move TupleTest logic into unit
tests, and move some other tests into ArrayUtilTests.

This also adds new cmake configuration to run junit and integration tests
through ctest.

There is a mechanism to write integration tests that depend on a running
fdb cluster by having those tests be skipped if they can't connect to a
database quickly. This should help to add those tests in CI, although
eventually we'll probably want to move this to throw an error instead
(once the CI build process clears out and we can guarantee a running
server during CI testing).

Converting to junit 5
2021-03-01 09:11:45 -06:00
Scott Fines
236510652d Resolves 4323: make Junit tests run as separate ctest tests.
This adds the ability to run junit tests through ctest a little more
easily (no Suites required). It also adds a small amount of
documentation to explain to the average developer how to go about using
Junit effectively.
2021-02-24 14:24:23 -06:00
Scott Fines
0bf7f9cf63 New Unit and Integration Tests, and associated infrastructure.
First, this converts the java unit testing framework to junit 5.

Then we create some easy unit tests, move TupleTest logic into unit
tests, and move some other tests into ArrayUtilTests.

This also adds new cmake configuration to run junit and integration tests
through ctest.

There is a mechanism to write integration tests that depend on a running
fdb cluster by having those tests be skipped if they can't connect to a
database quickly. This should help to add those tests in CI, although
eventually we'll probably want to move this to throw an error instead
(once the CI build process clears out and we can guarantee a running
server during CI testing).

Converting to junit 5
2021-02-24 09:35:35 -06:00
Scott Fines
2589c26907 Resolves 4323: make Junit tests run as separate ctest tests.
This adds the ability to run junit tests through ctest a little more
easily (no Suites required). It also adds a small amount of
documentation to explain to the average developer how to go about using
Junit effectively.
2021-02-12 15:34:04 -06:00
Xin Dong
8f311543f9
Apply suggestions from code review
Co-authored-by: A.J. Beamon <ajbeamon@users.noreply.github.com>
2020-10-12 09:50:45 -07:00
Xin Dong
079f27d47d Added API doc for the new range split API. Updated some old ones to be consistent. 2020-10-08 15:20:55 -07:00
Xin Dong
5d902f9177
Merge pull request #3394 from dongxinEric/feature/range-split-points-based-on-size
Feature/range split points based on size
2020-10-08 14:25:11 -07:00
Markus Pilman
c5af8c8dd0 Restore pom.xml.in
(which is apparently still in use)
2020-09-30 12:34:35 -06:00
Andrew Noyes
cd520dcf93
Merge pull request #3808 from sfc-gh-mpilman/features/ctest-client-smoketests
Add ability to run tests on fdb in ctest
2020-09-29 12:09:51 -07:00
Markus Pilman
3395e2b1a2 fix junit tests 2020-09-28 14:00:48 -06:00
Markus Pilman
38857b9773 remove pom reference 2020-09-28 12:49:12 -06:00
Markus Pilman
a5439f39a2 Run junit tests with ctest 2020-09-25 16:28:07 -06:00
Markus Pilman
a3c65f81d2 Build with maven (doesn't work yet) 2020-09-25 14:59:25 -06:00
Markus Pilman
33d6c412c1 return error code correctly and cmake fixes 2020-09-24 15:58:41 -06:00
Markus Pilman
4c25214085 Add ability to run tests on fdb in ctest 2020-09-24 15:43:05 -06:00
sfc-gh-tclinkenbeard
05c33a98ff Replace NULL with nullptr in java bindings 2020-09-20 11:33:17 -07:00
Xin Dong
813a2b3efe Remove a function that have been removed in previous commits in master but was added back by this PR due to target branch change. 2020-09-11 14:30:41 -07:00
Xin Dong
1b923477f7
Apply suggestions from code review
Co-authored-by: A.J. Beamon <ajbeamon@users.noreply.github.com>
2020-09-11 14:28:56 -07:00
Xin Dong
c6477bbc61
Merge branch 'master' into feature/range-split-points-based-on-size 2020-09-02 09:41:17 -07:00
Evan Tschannen
12edadd059 Merge branch 'release-6.3'
# Conflicts:
#	CMakeLists.txt
#	fdbclient/Knobs.cpp
#	fdbclient/MasterProxyInterface.h
#	fdbrpc/simulator.h
#	fdbserver/MasterProxyServer.actor.cpp
#	tests/fast/CycleAndLock.txt
#	tests/fast/TxnStateStoreCycleTest.txt
#	tests/fast/VersionStamp.txt
#	tests/slow/ParallelRestoreOldBackupApiCorrectnessAtomicRestore.txt
#	tests/slow/ParallelRestoreOldBackupCorrectnessCycle.txt
#	versions.target
2020-08-31 19:33:34 -07:00
Vishesh Yadav
f080b772aa java-bindings: Fix javadoc errors 2020-08-31 15:08:40 -07:00
Vishesh Yadav
973a9b2423 java-bindings: More typo fix 2020-08-27 14:21:46 -07:00
Vishesh Yadav
775cf06574 java-bindings: Javadoc typo fixes 2020-08-27 14:07:44 -07:00
Vishesh Yadav
c103dc3ec9
Update bindings/java/src/main/com/apple/foundationdb/FDB.java
Co-authored-by: Alec Grieser <alloc@apple.com>
2020-08-27 14:01:02 -07:00
Vishesh Yadav
aa326c030b java-bindings: Changes per review comments
- Add function to check if DirectBuffer queries are enabled.
- Javadoc comment fixes
- Fix min buffer limits.
2020-08-27 11:14:58 -07:00
Vishesh Yadav
b3432c0ce0 java-bindings: Addressed review comments
- Change DirectBufferPool constructor to take ByteBuffer
- Moved enableDirectBufferQueries() to public FDB class.
- Handle the edge case in resize() when called in middle of oudstanding queries.
- Don't count space need to store all KV pairs in JNI.
2020-08-26 22:33:59 -07:00
Vishesh Yadav
5d5dab1040 java-bindings: Minors fixes and refactor 2020-08-25 17:01:37 -07:00
Vishesh Yadav
738cd82a85 java-bindings: Add function to disable/enable/resize DirectBuffer 2020-08-25 16:19:42 -07:00
Vishesh Yadav
5cefb27fe2 java-bindings: Addressed review comments 2020-08-25 16:03:27 -07:00
Vishesh Yadav
9123ffb1bf java-bindings: Use DirectBuffer with standard Async call 2020-08-25 14:29:50 -07:00
Vishesh Yadav
be184a9dc2 java-bindings: Use DirectBuffer for getRange requests #3682
This patch keeps a batch of Java's DirectBuffers, which can be shared with JNI C
world. This means:

1. No need for JNI wrapper to make several JNI calls, to allocate and convert
   Java objectd to bytes.
2. We already made a PR #3582 to reduce 3 JNI calls for each getRange() i.e. to
   fetch summary and then results. As mentioned in that PR, this patch also
   makes similar decision to make `getDirectRange()` call synchronous and
   instead schedule it asynchronously in Java executor.
3. No need for JNI to dynamically allocate buffers to store KVs.
4. Use one big DirectBuffer to make request and get reponse. `DirectBuffers` give
   direct access to the memory, and are much fast than the regular non-direct
   buffers we use.
5. We keep a pool of reasonably big DirectBuffers, which are borrowed and
   returned by `getRange()` requests.

The downside to this are:

1. We have to manually and "carefully" serialize and deserialize the
   request/response both in C and Java world. It is no longer high-level Java
   objects.
2. Because `DirectBuffers` are expensive, we can only keep a few of them, which
   number of outstanding `getRange()` requests are limited by that.
3. Each request, currently uses 2 buffers, one for current chunk and one for
   outstanding request.
4. The performance bump seems to be excellent for bigger key-values. We didn't
   observe significant difference for smaller KV sizes (I can't say its better
   or worse, as from quick glance it didn't look statistically significant to me).

Performance is currently measured using `PerformanceTester.java`, which measures
throughput for several operations. The results are:

```
 1. Using Key = 16bytes, Value = 100bytes
=========================================

Without this PR=>
                                                           Count     Avg    Min      Q1    Median      Q3     Max
-------------------------------------------------------  -------  ------  -----  ------  --------  ------  ------
get_range throughput (local client) [keys/s]                  30  349363  73590  316218    342523  406445  540731
get_single_key_range throughput (local client) [keys/s]       30    7685   6455    6981      7744    8129    9773

** With this PR ==>
                                                           Count     Avg    Min      Q1    Median      Q3     Max
-------------------------------------------------------  -------  ------  -----  ------  --------  ------  ------
get_range throughput (local client) [keys/s]                  30  383404  70181  338810    396950  437335  502886
get_single_key_range throughput (local client) [keys/s]       30    7029   5515    6635      7090    7353    8219

=======================================
2. Using Key = 256bytes, Value = 512bytes
========================================

** Without this PR ==>
                                                           Count     Avg     Min      Q1    Median      Q3     Max
-------------------------------------------------------  -------  ------  ------  ------  --------  ------  ------
get_range throughput (local client) [keys/s]                  90  132787  102036  122650    130204  138269  202790
get_single_key_range throughput (local client) [keys/s]       90    5833    4894    5396      5690    6061    8986

** With this PR ==>
                                                           Count     Avg     Min      Q1    Median      Q3     Max
-------------------------------------------------------  -------  ------  ------  ------  --------  ------  ------
get_range throughput (local client) [keys/s]                  90  359302  196676  310931    344029  407232  494259
get_single_key_range throughput (local client) [keys/s]       90    7227    5573    6771      7177    7477   10108
====================================================================================================================

=======================================
3. Using Key = 128bytes, Value = 512bytes
========================================

** Without this PR ==>
                                                           Count     Avg     Min      Q1    Median      Q3     Max
-------------------------------------------------------  -------  ------  ------  ------  --------  ------  ------
get_range throughput (local client) [keys/s]                  30  235661  148963  213670    229090  256825  317050
get_single_key_range throughput (local client) [keys/s]       30   10441    6302   10586     10873   10960   11065
====================================================================================================================

** With this PR ==>
                                                           Count     Avg     Min      Q1    Median      Q3     Max
-------------------------------------------------------  -------  ------  ------  ------  --------  ------  ------
get_range throughput (local client) [keys/s]                  30  350612  185698  320868    348998  406750  459101
get_single_key_range throughput (local client) [keys/s]       30   10338    6570   10664     10847   10901   11040
====================================================================================================================
```

NOTE: These tests were run on a shared VM. Benchmark in each group was run
serially, and the groups themselves run at different times. Therefore there
might be some skew based on load, but the difference is compelling enough to
show that there is performance benefit for larger KV.
2020-08-24 23:34:54 -07:00
Vishesh Yadav
9c7b502b68 java-bindings: Combine getSummary() and getResult() into single JNI
RangeQuery makes getSummary() and getResult() JNI calls, which are redundant in
nature. This patch combines them into single call.

This reduce 3 JNI to 2 JNI calls. Next logical step is to remove the 2nd JNI
call, i.e. getResults() after getRange() which is slighly more convoluted
because C API doesn't allow primitives to compose new Futures.
2020-08-24 23:34:47 -07:00
Xin Dong
daead84fdd Merge master 2020-08-14 14:07:08 -07:00
Evan Tschannen
2f52c5f79b Merge branch 'release-6.3'
# Conflicts:
#	fdbserver/RestoreLoader.actor.cpp
2020-08-11 22:45:43 -07:00
Alvin Moore
1933826737 Fixed typos and removed extraneous space 2020-08-11 13:09:41 -04:00
Alvin Moore
ba9f203858 Fixed warnings for documentation greater than and less than characters which appear as errors within Java 1.8
Removed broken link
2020-08-11 03:26:56 -04:00
Xin Dong
a46e620baa Merge branch 'master' into feature/range-split-points-based-on-size 2020-08-06 15:23:11 -07:00
Tao Lin
077b618675
Fix broken doc links in ReadTransaction.java 2020-08-05 09:45:05 -07:00
Evan Tschannen
a49cb41de7 Merge branch 'release-6.3'
# Conflicts:
#	CMakeLists.txt
#	cmake/ConfigureCompiler.cmake
#	fdbserver/Knobs.cpp
#	fdbserver/StorageCache.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	flow/ThreadHelper.actor.h
#	flow/serialize.h
#	tests/CMakeLists.txt
2020-07-29 00:31:55 -07:00
Evan Tschannen
3f1e51c821
Merge pull request #3543 from dongxinEric/doc/add-explanation-about-accuracy-of-estiamted-range-size-api
Added some explanation about the accuracy about the get estimated ran…
2020-07-27 11:03:17 -07:00
Evan Tschannen
e1dedff7b3 Merge branch 'release-6.2' into release-6.3
# Conflicts:
#	CMakeLists.txt
#	bindings/c/test/mako/mako.c
#	cmake/ConfigureCompiler.cmake
#	documentation/sphinx/source/downloads.rst
#	fdbcli/fdbcli.actor.cpp
#	fdbclient/FileBackupAgent.actor.cpp
#	packaging/msi/FDBInstaller.wxs
#	versions.target
2020-07-24 12:10:44 -07:00
Andrew Noyes
7e10464fc5 Fix a few java warnings
Finally got vscode to understand the java bindings.
Adding this to .vscode/settings.json did the trick

    "java.project.referencedLibraries": [
        "fdb-build/packages/*.jar"
    ]

Where fdb-build is my cmake build dir
2020-07-23 17:28:37 +00:00
Xin Dong
9e1f253c08 Added some explanation about the accuracy about the get estimated range size API. 2020-07-21 16:14:23 -07:00
Andrew Noyes
f077d9889b Fix osx build 2020-07-10 09:46:32 -07:00
Andrew Noyes
6446b4c082 WIP 2020-07-09 22:02:43 +00:00