1
0
mirror of https://github.com/apple/foundationdb.git synced 2025-05-19 12:34:48 +08:00

319 Commits

Author SHA1 Message Date
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
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
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  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
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
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 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
Meng Xu
1b68665228 Merge branch 'master' into release-6.3 2020-07-08 18:52:05 -07:00
bchavez
ecf340da88
Corrects spelling mistakes in various markdown files. 2020-06-28 21:30:34 -07:00
Meng Xu
8595813b7d
Merge pull request from apple/release-6.3
Merge Release 6.3 into master branch
2020-06-12 20:08:47 -07:00
Vishesh Yadav
5bd8145fbf
Merge pull request from ajbeamon/fix-java-test-resource-closing
Fix Java tests that weren't closing resources
2020-06-10 13:19:13 -07:00
Steve Atherton
61fcce08cc
Merge pull request from apple/release-6.3
merge Release 6.3
2020-06-09 18:56:47 -07:00
john_leach
c122eff58a Fixes 3316 ByteArrayUtil.join is used heavily and creates a lot of objects 2020-06-09 14:06:12 -07:00
Balachandar Namasivayam
a167bf344e Update api version to 700 2020-05-28 12:16:03 -07:00
A.J. Beamon
8bc830e8ce Fix a few places where we weren't closing resources in Java. 2020-05-28 09:45:34 -07:00
A.J. Beamon
d128252e90 Merge release-6.3 into master 2020-05-22 09:25:32 -07:00
A.J. Beamon
0da31ab856 Fix filename in header comment 2020-05-21 15:51:20 -07:00
Markus Pilman
2f55ee12ef suppress Unsafe warning in java bindings
Fixes 
2020-04-22 14:14:24 -07:00
A.J. Beamon
b6e22b4a63
Merge pull request from jleach4/2822
Fix : ByteArrayUtil does not use the now standard Unsafe Approach for byte[] comparisons
2020-04-21 14:36:13 -07:00
John Leach
7f75eab32b Fix : ByteArrayUtil does not use the now standard Unsafe Approach for byte[] comparisons. 2020-04-21 12:20:12 -07:00
A.J. Beamon
251e0201a1
Merge pull request from jleach4/2808
2808: Add caching for jmethodID, jfieldID and jclass for JNI for Java Binding
2020-04-21 11:52:13 -07:00
A.J. Beamon
71c0d52868
Revert "Fix : ByteArrayUtil does not use the now standard Unsafe Approach for byte[] comparisons." 2020-04-21 10:50:33 -07:00
John Leach
d41dca5a94 2808: Add caching for jmethodID, jfieldID and jclass for JNI for Java Binding 2020-04-21 10:29:23 -07:00
John Leach
3834d8ecec Fix : ByteArrayUtil does not use the now standard Unsafe Approach for byte[] comparisons. 2020-04-21 10:13:52 -07:00
Alvin Moore
54813e2d46 Added support for copying fdb java tests to package directory 2020-04-13 17:20:25 -07:00
Markus Pilman
d4542dbb5a Delete old build system 2020-04-07 11:03:45 -07:00
Balachandar Namasivayam
6d570cd865 Change version from 7.0 to 6.3 2020-04-03 21:38:58 -07:00
Markus Pilman
28cd38913d Merge branch 'master' of github.com:apple/foundationdb into features/boost70 2020-03-27 13:44:10 -07:00
Xin Dong
338c62b176 Moved up the new test cases to comply the convention there. 2020-03-24 09:53:52 -07:00
Xin Dong
527686ffe0 Added a test in API tests for the new API(getEstimagedRangeSize). 2020-03-24 09:26:56 -07:00
Alvin Moore
0f64505d0b Merge branch 'release-6.2' of github.com:apple/foundationdb
Needed to pull in changes to build docker
2020-02-23 23:27:53 -08:00