diff --git a/README.thirdparty b/README.thirdparty index 5c03effcfda..75d10c73d0a 100644 --- a/README.thirdparty +++ b/README.thirdparty @@ -856,6 +856,244 @@ Java thread affinity by Peter Lawrey * limitations under the License. */ ================================================================================ +Java Architecture for XML Binding https://javaee.github.io/jaxb-v2/ +JavaBeans Activation https://github.com/javaee/activation +Java Common Annotations https://github.com/javaee/javax.annotation +/* +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 + +1. Definitions. + +1.1. “Contributor” means each individual or entity that creates or contributes to the creation of Modifications. + +1.2. “Contributor Version” means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that +particular Contributor. + +1.3. “Covered Software” means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing +Modifications, in each case including portions thereof. + +1.4. “Executable” means the Covered Software in any form other than Source Code. + +1.5. “Initial Developer” means the individual or entity that first makes Original Software available under this License. + +1.6. “Larger Work” means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + +1.7. “License” means this document. + +1.8. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of +the rights conveyed herein. + +1.9. “Modifications” means the Source Code and Executable form of any of the following: + +A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + +B. Any new file that contains any part of the Original Software or previous Modification; or + +C. Any new file that is contributed or otherwise made available under the terms of this License. + +1.10. “Original Software” means the Source Code and Executable form of computer software code that is originally released under this License. + +1.11. “Patent Claims” means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent +Licensable by grantor. + +1.12. “Source Code” means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such +code. + +1.13. “You” (or “Your”) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, +“You” includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, +direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the +outstanding shares or beneficial ownership of such entity. + +2. License Grants. + +2.1. The Initial Developer Grant. +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a +world-wide, royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and +distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise +dispose of the Original Software (or portions thereof). + +(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available +to a third party under the terms of this License. + +(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: +(i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. + +2.2. Contributor Grant. +Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, +royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and +distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or +as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor +Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or +portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + +(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a +third party. + +(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for +infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software +(except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that +Contributor. + +3. Distribution Obligations. + +3.1. Availability of Source Code. +Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form +must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You +distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in +Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + +3.2. Modifications. +The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your +original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + +3.3. Required Notices. +You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent +or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial +Developer. + +3.4. Application of Additional Terms. +You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' +rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered +Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for +any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + +3.5. Distribution of Executable Versions. +You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain +terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt +to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form +under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or +Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a +result of any such terms You offer. + +3.6. Larger Works. +You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single +product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + +4. Versions of the License. + +4.1. New Versions. +Oracle is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing +version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + +4.2. Effect of New Versions. +You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the +License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being +distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of +the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered +Software available under the terms of any subsequent version of the License published by the license steward. + +4.3. Modified Versions. +When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version +of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this +License); and (b) otherwise make it clear that the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN “AS IS” BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE +QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER +CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF +ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + +6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days +of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + +6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or +Contributor against whom You assert such claim is referred to as “Participant”) alleging that the Participant Software (meaning the Contributor Version where the +Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all +rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under +Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice +period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant +to a written agreement with Participant. + +6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such +claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by +such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + +6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to +termination (excluding licenses granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER +CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR +CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL +OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO +LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW +THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + +The Covered Software is a “commercial item,” as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of “commercial computer software” (as that term is +defined at 48 C.F.R. § 252.227-7014(a)(1)) and “commercial computer software documentation” as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with +48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth +herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in +computer software under this License. + +9. MISCELLANEOUS. + +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall +be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within +the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation +relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original +Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the +United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a +contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States +export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any +Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights +under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended +or shall be deemed to constitute any admission of liability. + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) +The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this +License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue +lying in Santa Clara County, California. +*/ +================================================================================ +iStack Common Utility Code https://github.com/eclipse-ee4j/jaxb-istack-commons + +Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + - Neither the name of the Eclipse Foundation, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +================================================================================ CRC32c implementation by Evan Jones, Intel, and others Copyright (c) 2008,2009,2010 Massachusetts Institute of Technology. All rights reserved. @@ -1404,8 +1642,13 @@ Mockito * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ + ================================================================================ +PowerMock 2.0.0 +/* Copyright 2007-2017 PowerMock Contributors +This software is released under Apache software license as mentioned below. +*/ =============================================================================== - hamcrest-all-1.3 + hamcrest-2.1 BSD License Copyright (c) 2000-2006, www.hamcrest.org @@ -2582,6 +2825,7 @@ limitations under the License. =============================================================================== apache felix +version 5.6.12 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -3628,7 +3872,7 @@ vcversioner-2.16.0.0 License URL: https://github.com/habnabit/vcversioner/blob/master/COPYING Site: https://github.com/habnabit/vcversioner ========================================================================================= -owner-1.0.9 +owner-1.0.10 License URL: https://raw.githubusercontent.com/lviggiano/owner/master/LICENSE Site: https://github.com/lviggiano/owner ========================================================================================= diff --git a/bin/sqlcmd b/bin/sqlcmd index 1cfe20ad0d3..52d27086511 100755 --- a/bin/sqlcmd +++ b/bin/sqlcmd @@ -131,6 +131,15 @@ for s in "$@"; do fi done +JAVA_MAJOR_VERSION=$("$JAVA" -version 2>&1 | sed -E -n 's/.* version "([0-9]+).*/\1/p') +#echo $JAVA_MAJOR_VERSION +if [[ "$JAVA_MAJOR_VERSION" -ge 11 ]]; then + jvmOPTS+=("--add-opens" "java.base/java.lang=ALL-UNNAMED") + jvmOPTS+=("--add-opens" "java.base/sun.nio.ch=ALL-UNNAMED") + jvmOPTS+=("--add-opens" "java.base/java.net=ALL-UNNAMED") + jvmOPTS+=("--add-opens" "java.base/java.nio=ALL-UNNAMED") +fi + jvmOPTS+=("-Xmx512m" "-Dlog4j.configuration=file://${LOG4J_CONFIG_PATH}") jvmOPTS+=("-classpath" "${CLASSPATH}" "org.voltdb.utils.SQLCommand") diff --git a/build-client.xml b/build-client.xml index 90859fc9584..968e7df24f8 100644 --- a/build-client.xml +++ b/build-client.xml @@ -13,7 +13,7 @@ - + @@ -78,6 +78,7 @@ + @@ -134,6 +135,10 @@ org/voltcore/utils/ssl/SSLBufferDecrypter.java org/voltcore/utils/ssl/SSLBufferEncrypter.java org/voltcore/utils/ssl/SSLConfiguration.java + org/voltcore/utils/VoltUnsafe.java + org/voltcore/utils/DirectBufferCleaner.java + org/voltcore/utils/ReflectiveDirectBufferCleaner.java + org/voltcore/utils/UnsafeDirectBufferCleaner.java org/voltdb/CLIConfig.java org/voltdb/client/**/*.java @@ -331,8 +336,8 @@ JAVA COMPILATION - - + + diff --git a/build-importers.xml b/build-importers.xml index 284a11e672c..c5569bf8f63 100644 --- a/build-importers.xml +++ b/build-importers.xml @@ -126,7 +126,7 @@ - + diff --git a/lib/felix-framework-5.6.12.jar b/lib/felix-framework-5.6.12.jar new file mode 100644 index 00000000000..307f3263b44 Binary files /dev/null and b/lib/felix-framework-5.6.12.jar differ diff --git a/lib/felix.jar b/lib/felix.jar deleted file mode 100644 index f9f8aa6e5d3..00000000000 Binary files a/lib/felix.jar and /dev/null differ diff --git a/lib/istack-commons-runtime-3.0.8.jar b/lib/istack-commons-runtime-3.0.8.jar new file mode 100644 index 00000000000..8f37e950bec Binary files /dev/null and b/lib/istack-commons-runtime-3.0.8.jar differ diff --git a/lib/javax.activation-api-1.2.0.jar b/lib/javax.activation-api-1.2.0.jar new file mode 100644 index 00000000000..986c365096a Binary files /dev/null and b/lib/javax.activation-api-1.2.0.jar differ diff --git a/lib/javax.annotation-api-1.3.2.jar b/lib/javax.annotation-api-1.3.2.jar new file mode 100644 index 00000000000..a8a470a71a6 Binary files /dev/null and b/lib/javax.annotation-api-1.3.2.jar differ diff --git a/lib/jaxb-api-2.3.0.jar b/lib/jaxb-api-2.3.0.jar new file mode 100644 index 00000000000..0817c083ad9 Binary files /dev/null and b/lib/jaxb-api-2.3.0.jar differ diff --git a/lib/jaxb-core-2.3.0.1.jar b/lib/jaxb-core-2.3.0.1.jar new file mode 100644 index 00000000000..a5d3b65a534 Binary files /dev/null and b/lib/jaxb-core-2.3.0.1.jar differ diff --git a/lib/jaxb-runtime-2.3.0.1.jar b/lib/jaxb-runtime-2.3.0.1.jar new file mode 100644 index 00000000000..21d293ed2a4 Binary files /dev/null and b/lib/jaxb-runtime-2.3.0.1.jar differ diff --git a/lib/jetty-continuation-9.3.27.v20190418.jar b/lib/jetty-continuation-9.3.27.v20190418.jar deleted file mode 100644 index f3ba80f241d..00000000000 Binary files a/lib/jetty-continuation-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-continuation-9.4.15.v20190215.jar b/lib/jetty-continuation-9.4.15.v20190215.jar new file mode 100644 index 00000000000..4e90739f6ac Binary files /dev/null and b/lib/jetty-continuation-9.4.15.v20190215.jar differ diff --git a/lib/jetty-http-9.3.27.v20190418.jar b/lib/jetty-http-9.3.27.v20190418.jar deleted file mode 100644 index f45e7ef13ae..00000000000 Binary files a/lib/jetty-http-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-http-9.4.15.v20190215.jar b/lib/jetty-http-9.4.15.v20190215.jar new file mode 100644 index 00000000000..73bac0dc01b Binary files /dev/null and b/lib/jetty-http-9.4.15.v20190215.jar differ diff --git a/lib/jetty-io-9.3.27.v20190418.jar b/lib/jetty-io-9.3.27.v20190418.jar deleted file mode 100644 index 11b6a85fc67..00000000000 Binary files a/lib/jetty-io-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-io-9.4.15.v20190215.jar b/lib/jetty-io-9.4.15.v20190215.jar new file mode 100644 index 00000000000..7aeca583e50 Binary files /dev/null and b/lib/jetty-io-9.4.15.v20190215.jar differ diff --git a/lib/jetty-security-9.3.27.v20190418.jar b/lib/jetty-security-9.3.27.v20190418.jar deleted file mode 100644 index b7c76e2bd1b..00000000000 Binary files a/lib/jetty-security-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-security-9.4.15.v20190215.jar b/lib/jetty-security-9.4.15.v20190215.jar new file mode 100644 index 00000000000..06c0047d175 Binary files /dev/null and b/lib/jetty-security-9.4.15.v20190215.jar differ diff --git a/lib/jetty-server-9.3.27.v20190418.jar b/lib/jetty-server-9.3.27.v20190418.jar deleted file mode 100644 index f7cbd5886be..00000000000 Binary files a/lib/jetty-server-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-server-9.4.15.v20190215.jar b/lib/jetty-server-9.4.15.v20190215.jar new file mode 100644 index 00000000000..86d06d84ae0 Binary files /dev/null and b/lib/jetty-server-9.4.15.v20190215.jar differ diff --git a/lib/jetty-servlet-9.3.27.v20190418.jar b/lib/jetty-servlet-9.3.27.v20190418.jar deleted file mode 100644 index 8a464126952..00000000000 Binary files a/lib/jetty-servlet-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-servlet-9.4.15.v20190215.jar b/lib/jetty-servlet-9.4.15.v20190215.jar new file mode 100644 index 00000000000..abfb8badc5e Binary files /dev/null and b/lib/jetty-servlet-9.4.15.v20190215.jar differ diff --git a/lib/jetty-util-9.3.27.v20190418.jar b/lib/jetty-util-9.3.27.v20190418.jar deleted file mode 100644 index 9ca98ec7443..00000000000 Binary files a/lib/jetty-util-9.3.27.v20190418.jar and /dev/null differ diff --git a/lib/jetty-util-9.4.15.v20190215.jar b/lib/jetty-util-9.4.15.v20190215.jar new file mode 100644 index 00000000000..682313e7567 Binary files /dev/null and b/lib/jetty-util-9.4.15.v20190215.jar differ diff --git a/lib/owner-1.0.10.jar b/lib/owner-1.0.10.jar new file mode 100644 index 00000000000..3ba40f61339 Binary files /dev/null and b/lib/owner-1.0.10.jar differ diff --git a/lib/owner-1.0.9.jar b/lib/owner-1.0.9.jar deleted file mode 100644 index 8a502d44bb8..00000000000 Binary files a/lib/owner-1.0.9.jar and /dev/null differ diff --git a/lib/owner-java8-1.0.10.jar b/lib/owner-java8-1.0.10.jar new file mode 100644 index 00000000000..29fe9b10419 Binary files /dev/null and b/lib/owner-java8-1.0.10.jar differ diff --git a/lib/owner-java8-1.0.9.jar b/lib/owner-java8-1.0.9.jar deleted file mode 100644 index 52c2d683832..00000000000 Binary files a/lib/owner-java8-1.0.9.jar and /dev/null differ diff --git a/lib/python/voltcli/checkconfig.py b/lib/python/voltcli/checkconfig.py index cf2ef3d17ae..4187eb3cada 100644 --- a/lib/python/voltcli/checkconfig.py +++ b/lib/python/voltcli/checkconfig.py @@ -156,7 +156,7 @@ def test_java_version(output): if not java: utility.abort('Could not find java in environment, set JAVA_HOME or put java in the path.') javaVersion = utility.get_java_version(javaHome=java, verbose=True) - if '1.8.' in javaVersion: + if '1.8.' in javaVersion or '11.' in javaVersion: output['Java'] = ["PASS", javaVersion.strip()] elif len(javaVersion) > 0: output['Java'] = ["FAIL", "Unsupported " + javaVersion + " Check if Java has been installed properly and JAVA_HOME has been setup correctly."] diff --git a/lib/python/voltcli/environment.py b/lib/python/voltcli/environment.py index 1077137c5d3..8ad3f98cc57 100644 --- a/lib/python/voltcli/environment.py +++ b/lib/python/voltcli/environment.py @@ -99,7 +99,6 @@ java_opts.append('-Dsun.net.inetaddr.negative.ttl=3600') java_opts.append('-XX:+HeapDumpOnOutOfMemoryError') java_opts.append('-XX:HeapDumpPath=/tmp') -java_opts.append('-XX:+UseParNewGC') java_opts.append('-XX:+UseConcMarkSweepGC') java_opts.append('-XX:+CMSParallelRemarkEnabled') java_opts.append('-XX:+UseTLAB') @@ -114,10 +113,17 @@ java_opts.append('-XX:+CMSScavengeBeforeRemark') java_opts.append('-XX:+CMSClassUnloadingEnabled') -# skip PermSize in Java 8 -if "1.8" not in java_version: +# skip PermSize in Java 8 and above +if "1.7" in java_version: java_opts.append('-XX:PermSize=64m') +# Suppress Illegal reflective access warning +if "11." in java_version: + java_opts.extend(['--add-opens', 'java.base/java.lang=ALL-UNNAMED']) + java_opts.extend(['--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED']) + java_opts.extend(['--add-opens', 'java.base/java.net=ALL-UNNAMED']) + java_opts.extend(['--add-opens', 'java.base/java.nio=ALL-UNNAMED']) + def initialize(standalone_arg, command_name_arg, command_dir_arg, version_arg): """ Set the VOLTDB_LIB and VOLTDB_VOLTDB environment variables based on the diff --git a/lib/python/voltcli/utility.py b/lib/python/voltcli/utility.py index c47f1598157..df331ace06a 100644 --- a/lib/python/voltcli/utility.py +++ b/lib/python/voltcli/utility.py @@ -840,18 +840,12 @@ def get_java_version(javaHome="java", verbose=False): version.stdout.close() out, err = grep.communicate() version.wait() - if "1.8" in out: - if verbose: - return out - else: - return "1.8" - elif "1.7" in out: - if verbose: - return out - else: - return "1.7" - else: - return "" + if verbose: + return out + for version in ('11.0', '1.8', '1.7'): + if version in out: + return version + return "" except (OSError): return "" diff --git a/src/catgen/in/javasrc/CatalogDiffEngine.java b/src/catgen/in/javasrc/CatalogDiffEngine.java index 9eff5cd0343..7fd3726146b 100644 --- a/src/catgen/in/javasrc/CatalogDiffEngine.java +++ b/src/catgen/in/javasrc/CatalogDiffEngine.java @@ -267,7 +267,7 @@ public boolean hasSecurityUserChanges() { for (Map.Entry entry : ccg.groupChanges.entrySet()) { Set fields = new HashSet<>(); fields.addAll(entry.getValue().typeChanges.changedFields); - fields.remove(ignoredFields); + fields.removeAll(ignoredFields); if (fields.isEmpty()) { groupModifications.remove(entry.getKey()); } diff --git a/src/ee/voltdbjni.cpp b/src/ee/voltdbjni.cpp index 7322d421e4d..585e0fc6464 100644 --- a/src/ee/voltdbjni.cpp +++ b/src/ee/voltdbjni.cpp @@ -67,6 +67,7 @@ #define __USE_GNU #endif // __USE_GNU #include +#include #endif // LINUX #ifdef MACOSX #include @@ -139,6 +140,7 @@ using namespace voltdb; */ static VoltDBEngine *currentEngine = NULL; static JavaVM *currentVM = NULL; +static jfieldID field_fd; void signalHandler(int signum, siginfo_t *info, void *context) { if (currentVM == NULL || currentEngine == NULL) @@ -214,6 +216,16 @@ SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_jni_ExecutionEngine_nativeCrea currentVM = vm; if (isSunJVM == JNI_TRUE) setupSigHandler(); + // retrieving the fieldId fd of FileDescriptor for later use + jclass class_fdesc = env->FindClass("java/io/FileDescriptor"); + if (class_fdesc == NULL) { + assert(!"Failed to find filed if of FileDescriptor."); + throw std::exception(); + return 0; + } + // poke the "fd" field with the file descriptor + field_fd = env->GetFieldID(class_fdesc, "fd", "I"); + JNITopend *topend = NULL; VoltDBEngine *engine = NULL; try { @@ -1328,15 +1340,22 @@ SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_madvise #endif } +/** + * Utility used for access file descriptor number from JAVA FileDescriptor class + */ +jint getFdFromFileDescriptor(JNIEnv *env, jobject fdObject) { + return env-> GetIntField(fdObject, field_fd); +} + /* * Class: org_voltdb_utils_PosixAdvise - * Method: fadvise - * Signature: (JJJI)J + * Method: nativeFadvise + * Signature: (Ljava/io/FileDescriptor;JJI)J */ -SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_fadvise - (JNIEnv *, jclass, jlong fd, jlong offset, jlong length, jint advice) { +SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_nativeFadvise + (JNIEnv *env, jclass, jobject fdObject, jlong offset, jlong length, jint advice) { #ifdef LINUX - return posix_fadvise(static_cast(fd), static_cast(offset), static_cast(length), advice); + return posix_fadvise(getFdFromFileDescriptor(env,fdObject), static_cast(offset), static_cast(length), advice); #else return 0; #endif @@ -1345,20 +1364,20 @@ SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_fadvise /* * Class: org_voltdb_utils_PosixAdvise * Method: sync_file_range - * Signature: (JJJI)J + * Signature: (Ljava/io/FileDescriptor;JJI)J */ SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_sync_1file_1range - (JNIEnv *, jclass, jlong fd, jlong offset, jlong length, jint advice) { + (JNIEnv *env, jclass, jobject fdObject, jlong offset, jlong length, jint advice) { #ifdef LINUX #ifndef __NR_sync_file_range #error VoltDB server requires that your kernel headers define __NR_sync_file_range. #endif - return syscall(__NR_sync_file_range, static_cast(fd), static_cast(offset), static_cast(length), + return syscall(__NR_sync_file_range, getFdFromFileDescriptor(env,fdObject), static_cast(offset), static_cast(length), static_cast(advice)); #elif MACOSX return -1; #else - return fdatasync(static_cast(fd)); + return fdatasync(getFdFromFileDescriptor(env,fdObject)); #endif } @@ -1366,14 +1385,14 @@ SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_sync_1file_1 /* * Class: org_voltdb_utils_PosixAdvise * Method: fallocate - * Signature: (JJJ)J + * Signature: (Ljava/io/FileDescriptor;JJ)J */ SHAREDLIB_JNIEXPORT jlong JNICALL Java_org_voltdb_utils_PosixAdvise_fallocate - (JNIEnv *, jclass, jlong fd, jlong offset, jlong length) { + (JNIEnv *env, jclass, jobject fdObject, jlong offset, jlong length) { #ifdef MACOSX return -1; #else - return posix_fallocate(static_cast(fd), static_cast(offset), static_cast(length)); + return posix_fallocate(getFdFromFileDescriptor(env,fdObject), static_cast(offset), static_cast(length)); #endif } diff --git a/src/frontend/org/voltcore/utils/DBBPool.java.template b/src/frontend/org/voltcore/utils/DBBPool.java.template index fb07bb4be0f..67148681891 100644 --- a/src/frontend/org/voltcore/utils/DBBPool.java.template +++ b/src/frontend/org/voltcore/utils/DBBPool.java.template @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicLong; import com.google_voltpatches.common.base.Preconditions; import org.cliffc_voltpatches.high_scale_lib.NonBlockingHashMap; import org.voltcore.logging.VoltLogger; -import sun.misc.Cleaner; +import org.voltcore.utils.VoltUnsafe; import sun.nio.ch.DirectBuffer; #ifndef NO_MEMCHECK @@ -45,6 +45,7 @@ public final class DBBPool { private static final VoltLogger TRACE = new VoltLogger("DBBPOOL"); private static final VoltLogger HOST = new VoltLogger("DBBPOOL"); + #ifndef NO_MEMCHECK static { @@ -237,6 +238,26 @@ public final class DBBPool { } } + /** + * Wrapper for native allocated direct memory + * + */ + public static final class NDBBWrapperContainer extends BBContainer { + private NDBBWrapperContainer(ByteBuffer b) { + super( b ); + } + + @Override + public final void discard() { + final ByteBuffer buf = checkDoubleFree(); + if (buf == null || !buf.isDirect()) { + return; + } + final DirectBuffer dbuf = (DirectBuffer) buf; + deleteCharArrayMemory(dbuf.address()); + } + } + public static class MBBContainer extends BBContainer { private MBBContainer(MappedByteBuffer buf) { super(buf); @@ -544,7 +565,7 @@ public final class DBBPool { private static native void nativeDeleteCharArrayMemory(long pointer); public static BBContainer allocateUnsafeByteBuffer(long size) { - final BBContainer retcont = DBBPool.wrapBB(nativeAllocateUnsafeByteBuffer(size)); + final BBContainer retcont = new NDBBWrapperContainer(nativeAllocateUnsafeByteBuffer(size)); #ifdef MEMCHECK_FULL final long pointer = retcont.address(); m_allocatedStuff.put(pointer, new Throwable("Thread \"" + Thread.currentThread().getName() + "\" allocated " + Long.toHexString(pointer) + " here at " + System.currentTimeMillis())); @@ -566,11 +587,12 @@ public final class DBBPool { * called deleteCharArrayMemory on the address */ private static void cleanByteBuffer(ByteBuffer buf) { - if (buf == null) return; - if (!buf.isDirect()) return; + if (buf == null || !buf.isDirect()) { + return; + } final DirectBuffer dbuf = (DirectBuffer) buf; - final Cleaner cleaner = dbuf.cleaner(); - if (cleaner != null) cleaner.clean(); - else deleteCharArrayMemory(dbuf.address()); + if (!VoltUnsafe.cleanDirectBuffer(buf)) { + deleteCharArrayMemory(dbuf.address()); + } } } diff --git a/src/frontend/org/voltcore/utils/DirectBufferCleaner.java b/src/frontend/org/voltcore/utils/DirectBufferCleaner.java new file mode 100644 index 00000000000..8ea359c92a9 --- /dev/null +++ b/src/frontend/org/voltcore/utils/DirectBufferCleaner.java @@ -0,0 +1,31 @@ +/* This file is part of VoltDB. + * Copyright (C) 2008-2019 VoltDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with VoltDB. If not, see . + */ + +package org.voltcore.utils; +import java.nio.ByteBuffer; + +/** + * Cleaner interface for {@code java.nio.ByteBuffer}. + */ +public interface DirectBufferCleaner { + /** + * frees the memory backing the ByteBuffer if possible + * + * @param buf direct buffer. + */ + public boolean clean(ByteBuffer buf); +} \ No newline at end of file diff --git a/src/frontend/org/voltcore/utils/ReflectiveDirectBufferCleaner.java b/src/frontend/org/voltcore/utils/ReflectiveDirectBufferCleaner.java new file mode 100644 index 00000000000..72b5662c150 --- /dev/null +++ b/src/frontend/org/voltcore/utils/ReflectiveDirectBufferCleaner.java @@ -0,0 +1,64 @@ +/* This file is part of VoltDB. + * Copyright (C) 2008-2019 VoltDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with VoltDB. If not, see . + */ + +package org.voltcore.utils; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; + +/** + * {@link DirectBufferCleaner} implementation based on {@code sun.misc.Cleaner} and + * {@code sun.nio.ch.DirectBuffer.cleaner()} method. + * + * Note: This implementation will not work on Java 9+. + */ +public class ReflectiveDirectBufferCleaner implements DirectBufferCleaner { + /** Cleaner method. */ + private final Method cleanerMtd; + + /** Clean method. */ + private final Method cleanMtd; + + /** */ + public ReflectiveDirectBufferCleaner() { + try { + cleanerMtd = Class.forName("sun.nio.ch.DirectBuffer").getMethod("cleaner"); + } catch (ClassNotFoundException | NoSuchMethodException e) { + throw new RuntimeException("No sun.nio.ch.DirectBuffer.cleaner() method found", e); + } + + try { + cleanMtd = Class.forName("sun.misc.Cleaner").getMethod("clean"); + } catch (ClassNotFoundException | NoSuchMethodException e) { + throw new RuntimeException("No sun.misc.Cleaner.clean() method found", e); + } + } + + @Override + public boolean clean(ByteBuffer buf) { + try { + Object cleaner = cleanerMtd.invoke(buf); + if (cleaner == null) { + return false; + } + cleanMtd.invoke(cleaner); + return true; + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Failed to invoke direct buffer cleaner", e); + } + } +} diff --git a/src/frontend/org/voltcore/utils/UnsafeDirectBufferCleaner.java b/src/frontend/org/voltcore/utils/UnsafeDirectBufferCleaner.java new file mode 100644 index 00000000000..d114d10169f --- /dev/null +++ b/src/frontend/org/voltcore/utils/UnsafeDirectBufferCleaner.java @@ -0,0 +1,47 @@ +/* This file is part of VoltDB. + * Copyright (C) 2008-2019 VoltDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with VoltDB. If not, see . + */ + +package org.voltcore.utils; +import sun.misc.Unsafe; + +import java.lang.reflect.Method; +import java.nio.ByteBuffer; + +/** + * {@link DirectBufferCleaner} implementation based on {@code Unsafe.invokeCleaner} method. + * + * Note: This implementation will work only for Java 9+. + */ +public class UnsafeDirectBufferCleaner implements DirectBufferCleaner { + /** Cleaner method. */ + private final Method invokeCleanerMtd; + + /** */ + public UnsafeDirectBufferCleaner() { + try { + invokeCleanerMtd = Unsafe.class.getMethod("invokeCleaner", ByteBuffer.class); + } catch (NoSuchMethodException e) { + throw new RuntimeException("Reflection failure: no sun.misc.Unsafe.invokeCleaner() method found", e); + } + } + + @Override + public boolean clean(ByteBuffer buf) { + VoltUnsafe.invoke(invokeCleanerMtd, buf); + return true; + } +} \ No newline at end of file diff --git a/src/frontend/org/voltcore/utils/VoltUnsafe.java b/src/frontend/org/voltcore/utils/VoltUnsafe.java new file mode 100644 index 00000000000..9fc59d83207 --- /dev/null +++ b/src/frontend/org/voltcore/utils/VoltUnsafe.java @@ -0,0 +1,97 @@ +/* This file is part of VoltDB. + * Copyright (C) 2008-2019 VoltDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with VoltDB. If not, see . + */ + +package org.voltcore.utils; + +import sun.misc.Unsafe; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/* + *

Wrapper for {@link sun.misc.Unsafe} class.

+ */ +public abstract class VoltUnsafe { + + public static final boolean IS_JAVA8 = System.getProperty("java.version").startsWith("1.8"); + + /** Unsafe. */ + private static final Unsafe UNSAFE = unsafe(); + + /** Cleaner code for direct {@code java.nio.ByteBuffer}. */ + public static final DirectBufferCleaner DIRECT_BYTE_BUFFER_CLEANER = IS_JAVA8 + ? new ReflectiveDirectBufferCleaner() + : new UnsafeDirectBufferCleaner(); + + /** + * Invokes some method on {@code sun.misc.Unsafe} instance. + * + * @param mtd Method. + * @param args Arguments. + */ + public static Object invoke(Method mtd, Object... args) { + try { + return mtd.invoke(UNSAFE, args); + } + catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Unsafe invocation failed [cls=" + UNSAFE.getClass() + ", mtd=" + mtd + ']', e); + } + } + + /** + * Cleans direct {@code java.nio.ByteBuffer} + * + * @param buf Direct buffer. + */ + public static boolean cleanDirectBuffer(ByteBuffer buf) { + assert buf.isDirect(); + + return DIRECT_BYTE_BUFFER_CLEANER.clean(buf); + } + + + /** + * @return Instance of Unsafe class. + */ + private static Unsafe unsafe() { + try { + return Unsafe.getUnsafe(); + } + catch (SecurityException ignored) { + try { + return AccessController.doPrivileged + (new PrivilegedExceptionAction() { + @Override public Unsafe run() throws Exception { + Field f = Unsafe.class.getDeclaredField("theUnsafe"); + + f.setAccessible(true); + + return (Unsafe)f.get(null); + } + }); + } + catch (PrivilegedActionException e) { + throw new RuntimeException("Could not initialize intrinsics.", e.getCause()); + } + } + } +} diff --git a/src/frontend/org/voltdb/ElasticHashinator.java b/src/frontend/org/voltdb/ElasticHashinator.java index af77abe75e1..8c59be28f56 100644 --- a/src/frontend/org/voltdb/ElasticHashinator.java +++ b/src/frontend/org/voltdb/ElasticHashinator.java @@ -21,6 +21,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.Thread.State; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Arrays; @@ -39,10 +41,9 @@ import org.json_voltpatches.JSONStringer; import org.voltcore.utils.Bits; import org.voltcore.utils.Pair; +import org.voltcore.utils.VoltUnsafe; import org.voltdb.utils.CompressionService; -import sun.misc.Cleaner; - import com.google_voltpatches.common.base.Preconditions; import com.google_voltpatches.common.base.Supplier; import com.google_voltpatches.common.base.Suppliers; @@ -64,6 +65,11 @@ public class ElasticHashinator extends TheHashinator { public static int DEFAULT_TOTAL_TOKENS = Integer.parseInt(System.getProperty("ELASTIC_TOTAL_TOKENS", "16384")); + private static final ElasticHashinatorCleaner CLEANER = VoltUnsafe.IS_JAVA8 + ? new ElasticHashinatorCleanerJRE8() + : new ElasticHashinatorCleanerJRE9(); + + /** * Tokens on the ring. A value hashes to a token if the token is the first value <= * the value's hash @@ -79,8 +85,7 @@ public class ElasticHashinator extends TheHashinator { // Provide a hook for the GC @SuppressWarnings("unused") - private final Cleaner m_cleaner; - + private final Object m_cleaner; private final Supplier m_configBytes; private final Supplier m_configBytesSupplier = Suppliers.memoize(new Supplier() { @Override @@ -127,7 +132,7 @@ public ElasticHashinator(byte configBytes[], boolean cooked) { : updateRaw(configBytes)); m_tokens = p.getFirst(); m_tokenCount = p.getSecond(); - m_cleaner = Cleaner.create(this, new Deallocator(m_tokens, m_tokenCount * 8)); + m_cleaner = CLEANER.register(this, new Deallocator(m_tokens, m_tokenCount * 8)); m_configBytes = !cooked ? Suppliers.ofInstance(configBytes) : m_configBytesSupplier; m_cookedBytes = cooked ? Suppliers.ofInstance(configBytes) : m_cookedBytesSupplier; m_tokensMap = Suppliers.memoize(new Supplier>() { @@ -157,7 +162,7 @@ private ElasticHashinator(SortedMap tokens) { final int bytes = 8 * tokens.size(); m_tokens = Bits.unsafe.allocateMemory(bytes); trackAllocatedHashinatorBytes(bytes); - m_cleaner = Cleaner.create(this, new Deallocator(m_tokens, bytes)); + m_cleaner = CLEANER.register(this, new Deallocator(m_tokens, bytes)); int ii = 0; for (Map.Entry e : tokens.entrySet()) { final long ptr = m_tokens + (ii * 8); @@ -785,4 +790,57 @@ public void run() { public int getPartitionFromHashedToken(int hashedToken) { return partitionForToken(hashedToken); } + + public interface ElasticHashinatorCleaner { + public Object register(Object obj, Runnable action); + } + + public static class ElasticHashinatorCleanerJRE8 implements ElasticHashinatorCleaner { + /** create method. */ + private final Method createMtd; + + public ElasticHashinatorCleanerJRE8() { + try { + createMtd = Class.forName("sun.misc.Cleaner").getMethod("create", Object.class, Runnable.class); + } catch (ClassNotFoundException | NoSuchMethodException e) { + throw new RuntimeException("Reflection failure: no sun.misc.Cleaner.create method found", e); + } + } + + @Override + public Object register(Object obj, Runnable action) { + try { + return createMtd.invoke(null, obj, action); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Reflection failure: invoke sun.misc.Cleaner.create method failed", e); + } + } + } + + public static class ElasticHashinatorCleanerJRE9 implements ElasticHashinatorCleaner { + /** create method. */ + private final Method createMtd; + private final Method registerMtd; + + public ElasticHashinatorCleanerJRE9() { + try { + Class cleanerClass = Class.forName("java.lang.ref.Cleaner"); + createMtd = cleanerClass.getMethod("create"); + registerMtd = cleanerClass.getMethod("register", Object.class, Runnable.class); + } catch (ClassNotFoundException | NoSuchMethodException e) { + throw new RuntimeException("Reflection failure: no java.lang.ref.Cleaner found", e); + } + } + + @Override + public Object register(Object obj, Runnable action) { + try { + Object cleaner = createMtd.invoke(null); + registerMtd.invoke(cleaner, obj, action); + return cleaner; + } catch (IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException("Reflection failure: invoke java.lang.ref.Cleaner method failed", e); + } + } + } } diff --git a/src/frontend/org/voltdb/RealVoltDB.java b/src/frontend/org/voltdb/RealVoltDB.java index 0905901dce9..913aac9f572 100644 --- a/src/frontend/org/voltdb/RealVoltDB.java +++ b/src/frontend/org/voltdb/RealVoltDB.java @@ -76,6 +76,8 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLException; @@ -3682,18 +3684,20 @@ public String verifyJarAndPrepareProcRunners(byte[] catalogBytes, String diffCom " in use. Class " + classname + " was compiled with "; Integer major = 0; - try { - major = Integer.parseInt(e.getMessage().split("version")[1].trim().split("\\.")[0]); - } catch (Exception ex) { - hostLog.info("Unable to parse compile version number from UnsupportedClassVersionError.", - ex); + // update the matcher pattern for various jdk + Pattern pattern = Pattern.compile("version\\s(\\d+).(\\d+)"); + Matcher matcher = pattern.matcher(e.getMessage()); + if (matcher.find()) { + major = Integer.parseInt(matcher.group(1)); + } else { + hostLog.info("Unable to parse compile version number from UnsupportedClassVersionError."); } if (VerifyCatalogAndWriteJar.SupportedJavaVersionMap.containsKey(major)) { errorMsg = errorMsg.concat(VerifyCatalogAndWriteJar.SupportedJavaVersionMap.get(major) + ", current runtime version is " + System.getProperty("java.version") + "."); } else { - errorMsg = errorMsg.concat("an incompatable Java version."); + errorMsg = errorMsg.concat("an incompatible Java version."); } hostLog.info(errorMsg); return errorMsg; diff --git a/src/frontend/org/voltdb/compiler/PlannerTool.java b/src/frontend/org/voltdb/compiler/PlannerTool.java index a1db068b1f8..4bce6724ddc 100644 --- a/src/frontend/org/voltdb/compiler/PlannerTool.java +++ b/src/frontend/org/voltdb/compiler/PlannerTool.java @@ -344,7 +344,9 @@ public synchronized AdHocPlannedStatement planSql(String sql, StatementPartition logException(e, "Error compiling query"); loggedMsg = " (Stack trace has been written to the log.)"; } - if (e.getMessage() != null) { + // JAVA 9+ NumberFormatException from BigDecimal will contain message + // TODO: why need to omit other exception types? + if (!(e instanceof NumberFormatException) && (e.getMessage() != null)) { throw new RuntimeException("SQL error while compiling query: " + e.getMessage() + loggedMsg, e); } throw new RuntimeException("SQL error while compiling query: " + e.toString() + loggedMsg, e); diff --git a/src/frontend/org/voltdb/sysprocs/UpdateCore.java b/src/frontend/org/voltdb/sysprocs/UpdateCore.java index 9d28691fd69..1a0bd98c802 100644 --- a/src/frontend/org/voltdb/sysprocs/UpdateCore.java +++ b/src/frontend/org/voltdb/sysprocs/UpdateCore.java @@ -231,18 +231,6 @@ public Class forName(String name, boolean initialize, ClassLoader jarfileLoad } } - public final static HashMap m_versionMap = new HashMap<>(); - static { - m_versionMap.put(45, "Java 1.1"); - m_versionMap.put(46, "Java 1.2"); - m_versionMap.put(47, "Java 1.3"); - m_versionMap.put(48, "Java 1.4"); - m_versionMap.put(49, "Java 5"); - m_versionMap.put(50, "Java 6"); - m_versionMap.put(51, "Java 7"); - m_versionMap.put(52, "Java 8"); - } - @Override public DependencyPair executePlanFragment( Map> dependencies, long fragmentId, diff --git a/src/frontend/org/voltdb/sysprocs/VerifyCatalogAndWriteJar.java b/src/frontend/org/voltdb/sysprocs/VerifyCatalogAndWriteJar.java index 69501c52d92..6ff34527f69 100644 --- a/src/frontend/org/voltdb/sysprocs/VerifyCatalogAndWriteJar.java +++ b/src/frontend/org/voltdb/sysprocs/VerifyCatalogAndWriteJar.java @@ -45,6 +45,9 @@ public class VerifyCatalogAndWriteJar extends UpdateApplicationBase { SupportedJavaVersionMap.put(50, "Java 6"); SupportedJavaVersionMap.put(51, "Java 7"); SupportedJavaVersionMap.put(52, "Java 8"); + SupportedJavaVersionMap.put(53, "Java 9"); + SupportedJavaVersionMap.put(54, "Java 10"); + SupportedJavaVersionMap.put(55, "Java 11"); } private static VoltLogger log = new VoltLogger("HOST"); diff --git a/src/frontend/org/voltdb/utils/CommandLine.java b/src/frontend/org/voltdb/utils/CommandLine.java index b58efedd968..f419c959b29 100644 --- a/src/frontend/org/voltdb/utils/CommandLine.java +++ b/src/frontend/org/voltdb/utils/CommandLine.java @@ -552,7 +552,6 @@ public List createCommandLine() { cmdline.add("-Xloggc:"+ volt_root + "/" + VEM_GC_ROLLOVER_FILE_NAME+" -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles="+VEM_GC_ROLLOVER_FILE_COUNT+" -XX:GCLogFileSize="+VEM_GC_ROLLOVER_FILE_SIZE); } cmdline.add(maxHeap); - cmdline.add("-XX:+UseParNewGC"); cmdline.add("-XX:+UseConcMarkSweepGC"); cmdline.add("-XX:+CMSParallelRemarkEnabled"); cmdline.add("-XX:+UseTLAB"); diff --git a/src/frontend/org/voltdb/utils/HTTPAdminListener.java b/src/frontend/org/voltdb/utils/HTTPAdminListener.java index c3378557b1d..7763f3d22ad 100644 --- a/src/frontend/org/voltdb/utils/HTTPAdminListener.java +++ b/src/frontend/org/voltdb/utils/HTTPAdminListener.java @@ -35,11 +35,9 @@ import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HttpChannel; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.SecureRequestCustomizer; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; @@ -61,8 +59,7 @@ import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.gzip.GzipHandler; -import org.eclipse.jetty.server.session.HashSessionIdManager; -import org.eclipse.jetty.server.session.HashSessionManager; +import org.eclipse.jetty.server.session.DefaultSessionIdManager; import org.eclipse.jetty.server.session.SessionHandler; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHandler; @@ -82,8 +79,7 @@ public class HTTPAdminListener { static final String HTML_CONTENT_TYPE = "text/html;charset=utf-8"; final Server m_server; - final HashSessionIdManager m_idmanager = new HttpSessionIdManager(); - final HashSessionManager m_manager = new HashSessionManager(); + final DefaultSessionIdManager m_idmanager; final SessionHandler m_sessionHandler = new SessionHandler(); final HTTPClientInterface httpClientInterface = new HTTPClientInterface(); @@ -196,12 +192,12 @@ public HTTPAdminListener( ); //Keep inactive session only for 10 seconds VMC will ping every 5 second and thus keep session alive. - m_manager.setMaxInactiveInterval(HTTPClientInterface.MAX_SESSION_INACTIVITY_SECONDS); + m_sessionHandler.setMaxInactiveInterval(HTTPClientInterface.MAX_SESSION_INACTIVITY_SECONDS); + m_idmanager = new HttpSessionIdManager(m_server); m_server.setSessionIdManager(m_idmanager); m_idmanager.setWorkerName("vmc"); - m_manager.setSessionIdManager(m_idmanager); + m_sessionHandler.setSessionIdManager(m_idmanager); m_sessionHandler.setServer(m_server); - m_sessionHandler.setSessionManager(m_manager); m_mustListen = mustListen; // PRE-LOAD ALL HTML TEMPLATES (one for now) @@ -242,14 +238,14 @@ public HTTPAdminListener( rootContext.setMaxFormContentSize(HTTPClientInterface.MAX_QUERY_PARAM_SIZE); // close another attack vector where potentially one may send a large number of keys rootContext.setMaxFormKeys(HTTPClientInterface.MAX_FORM_KEYS); - rootContext.getSessionHandler().getSessionManager().getSessionCookieConfig().setHttpOnly(true); + rootContext.getSessionHandler().getSessionCookieConfig().setHttpOnly(true); //Only use cookie mode and dont support URL Set trackModes = new HashSet<>(); trackModes.add(SessionTrackingMode.COOKIE); - rootContext.getSessionHandler().getSessionManager().setSessionTrackingModes(trackModes); + rootContext.getSessionHandler().setSessionTrackingModes(trackModes); if (useSecure) { //Make cookie secure when using SSL - rootContext.getSessionHandler().getSessionManager().getSessionCookieConfig().setSecure(useSecure); + rootContext.getSessionHandler().getSessionCookieConfig().setSecure(useSecure); } ContextHandler cssResourceHandler = new ContextHandler("/css"); @@ -370,12 +366,16 @@ public void dontStoreAuthenticationResultInHttpSession() { } } - private static class HttpSessionIdManager extends HashSessionIdManager { + private static class HttpSessionIdManager extends DefaultSessionIdManager { + + HttpSessionIdManager(Server server) { + super(server); + } //remove all sessions in cache - public void cleanSessions() throws Exception { - synchronized (this) { - doStop(); + void cleanSessions() throws Exception { + for (SessionHandler sh:getSessionHandlers()) { + sh.getSessionCache().shutdown(); } } } diff --git a/src/frontend/org/voltdb/utils/PosixAdvise.java b/src/frontend/org/voltdb/utils/PosixAdvise.java index 5a56b1b2455..4b28362c782 100644 --- a/src/frontend/org/voltdb/utils/PosixAdvise.java +++ b/src/frontend/org/voltdb/utils/PosixAdvise.java @@ -20,8 +20,6 @@ import org.voltcore.logging.VoltLogger; -import sun.misc.SharedSecrets; - public class PosixAdvise { private static final VoltLogger hostLog = new VoltLogger("HOST"); @@ -64,27 +62,19 @@ public class PosixAdvise { public static final int SYNC_FILE_RANGE_SYNC = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER; - public static native long fadvise(long fd, long offset, long size, int advice); + public static native long nativeFadvise(FileDescriptor fd, long offset, long size, int advice); public static long fadvise(FileDescriptor fd, long offset, long size, int advice) { if (advice == POSIX_FADV_DONTNEED && !ENABLE_FADVISE_DONTNEED) return 0; - final long filedescriptor = SharedSecrets.getJavaIOFileDescriptorAccess().get(fd); - return fadvise(filedescriptor, offset, size, advice); + return nativeFadvise(fd, offset, size, advice); } - public static native long fallocate(long fd, long offset, long size); - public static long fallocate(FileDescriptor fd, long offset, long size) { - final long filedescriptor = SharedSecrets.getJavaIOFileDescriptorAccess().get(fd); - return fallocate(filedescriptor, offset, size); - } + + public static native long fallocate(FileDescriptor fd, long offset, long size); /* * Be aware sync_file_range does not make data durable. It doesn't handle ordering with metadata * nor does it emit write barriers */ - public static native long sync_file_range(long fd, long offset, long size, int flags); - public static long sync_file_range(FileDescriptor fd, long offset, long size, int flags) { - final long filedescriptor = SharedSecrets.getJavaIOFileDescriptorAccess().get(fd); - return sync_file_range(filedescriptor, offset, size, flags); - } + public static native long sync_file_range(FileDescriptor fd, long offset, long size, int flags); } diff --git a/template.classpath b/template.classpath index 588e586e268..d16d55b979e 100644 --- a/template.classpath +++ b/template.classpath @@ -9,7 +9,7 @@ - + @@ -28,12 +28,17 @@ - - + + - - - + + + + + + + + @@ -52,7 +57,7 @@ - + @@ -83,15 +88,15 @@ - - - - - - - + + + + + + + - + diff --git a/tests/frontend/org/voltcore/agreement/TestMeshArbiter.java b/tests/frontend/org/voltcore/agreement/TestMeshArbiter.java index 46c2d5d7170..62c9a436307 100644 --- a/tests/frontend/org/voltcore/agreement/TestMeshArbiter.java +++ b/tests/frontend/org/voltcore/agreement/TestMeshArbiter.java @@ -27,16 +27,16 @@ import static com.natpryce.makeiteasy.MakeItEasy.make; import static com.natpryce.makeiteasy.MakeItEasy.with; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyLong; -import static org.mockito.Matchers.argThat; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.mockito.hamcrest.MockitoHamcrest.argThat; import static org.voltcore.agreement.maker.SiteFailureMessageMaker.FailureSiteForwardMessage; import static org.voltcore.agreement.maker.SiteFailureMessageMaker.SiteFailureMessage; import static org.voltcore.agreement.maker.SiteFailureMessageMaker.fsfmMsg; @@ -315,7 +315,6 @@ public void testOneLinkDownFromThePerspictiveOfWitness() throws Exception { ); Maker uf = a(FailureSiteForwardMessage); - when(aide.getNewestSafeTransactionForInitiator(0L)).thenReturn(10L); when(aide.getNewestSafeTransactionForInitiator(1L)).thenReturn(11L); when(mbox.recvBlocking(any(Subject[].class), eq(5L))) diff --git a/tests/frontend/org/voltdb/TestClientInterface.java b/tests/frontend/org/voltdb/TestClientInterface.java index 70a16592c2a..d0a671b41ba 100644 --- a/tests/frontend/org/voltdb/TestClientInterface.java +++ b/tests/frontend/org/voltdb/TestClientInterface.java @@ -27,12 +27,10 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyBoolean; -import static org.mockito.Matchers.anyInt; -import static org.mockito.Matchers.anyLong; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -187,7 +185,7 @@ public Object answer(InvocationOnMock invocation) Object args[] = invocation.getArguments(); return ses.scheduleAtFixedRate((Runnable) args[0], (long) args[1], (long) args[2], (TimeUnit) args[3]); } - }).when(m_volt).scheduleWork(any(Runnable.class), anyLong(), anyLong(), (TimeUnit)anyObject()); + }).when(m_volt).scheduleWork(any(Runnable.class), anyLong(), anyLong(), any()); m_ci = spy(new ClientInterface(null, VoltDB.DEFAULT_PORT, null, VoltDB.DEFAULT_ADMIN_PORT, m_context, m_messenger, ReplicationRole.NONE, @@ -337,7 +335,7 @@ public void testSystemInformation() throws Exception { ByteBuffer msg = createMsg("@SystemInformation"); ClientResponseImpl resp = m_ci.handleRead(msg, m_handler, m_cxn); assertNull(resp); - verify(m_sysinfoAgent).performOpsAction(any(Connection.class), anyInt(), eq(OpsSelector.SYSTEMINFORMATION), + verify(m_sysinfoAgent).performOpsAction(any(Connection.class), anyLong(), eq(OpsSelector.SYSTEMINFORMATION), any(ParameterSet.class)); } diff --git a/tests/frontend/org/voltdb/TestInitStartAction.java b/tests/frontend/org/voltdb/TestInitStartAction.java index 9e31141458e..4c326abc997 100644 --- a/tests/frontend/org/voltdb/TestInitStartAction.java +++ b/tests/frontend/org/voltdb/TestInitStartAction.java @@ -35,6 +35,8 @@ import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.Files; import java.util.EnumSet; import java.util.Map.Entry; @@ -46,6 +48,7 @@ import org.junit.ClassRule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.voltcore.utils.VoltUnsafe; import org.voltdb.VoltDB.Configuration; import org.voltdb.VoltDB.SimulatedExitException; import org.voltdb.catalog.Catalog; @@ -59,6 +62,7 @@ import com.google_voltpatches.common.io.CharStreams; import com.google_voltpatches.common.reflect.ClassPath; import com.google_voltpatches.common.reflect.ClassPath.ClassInfo; +import org.voltdb_testprocs.fakeusecase.greetings.GetGreetingBase; /** Tests starting the server with init + start without a schema, * and 'init --schema --classes'. @@ -457,13 +461,22 @@ public void testInitWithClassesAndArtifacts() throws Exception { System.out.println("Creating a .jar file using all of the classes associated with this test."); InMemoryJarfile originalInMemoryJar = new InMemoryJarfile(); VoltCompiler compiler = new VoltCompiler(false, false); - ClassPath classpath = ClassPath.from(this.getClass().getClassLoader()); + // Start with JAVA 9, the appClassLoader no longer an instance of java.net.URLClassLoader + ClassPath classpath = ClassPath.from(new URLClassLoader(new URL[]{GetGreetingBase.class.getResource(".")}, GetGreetingBase.class.getClassLoader())); String packageName = "org.voltdb_testprocs.fakeusecase.greetings"; int classesFound = 0; - for (ClassInfo myclass : classpath.getTopLevelClassesRecursive(packageName)) { - compiler.addClassToJar(originalInMemoryJar, myclass.load()); - classesFound++; + if (VoltUnsafe.IS_JAVA8) { + for (ClassInfo myclass : classpath.getTopLevelClassesRecursive(packageName)) { + compiler.addClassToJar(originalInMemoryJar, myclass.load()); + classesFound++; + } + } else { + for (ClassInfo myclass : classpath.getTopLevelClasses()) { + compiler.addClassToJar(originalInMemoryJar, Class.forName(packageName + "." + myclass.getName())); + classesFound++; + } } + // check that classes were found and loaded. If another test modifies "fakeusecase.greetings" it should modify this assert also. assertEquals(5, classesFound); @@ -492,12 +505,19 @@ public void testInitWithClassesAndNoSchema() throws Exception { System.out.println("Creating a .jar file using all of the classes associated with this test."); InMemoryJarfile originalInMemoryJar = new InMemoryJarfile(); VoltCompiler compiler = new VoltCompiler(false, false); - ClassPath classpath = ClassPath.from(this.getClass().getClassLoader()); String packageName = "org.voltdb_testprocs.fakeusecase.greetings"; + ClassPath classpath = ClassPath.from(new URLClassLoader(new URL[]{GetGreetingBase.class.getResource(".")}, GetGreetingBase.class.getClassLoader())); int classesFound = 0; - for (ClassInfo myclass : classpath.getTopLevelClassesRecursive(packageName)) { - compiler.addClassToJar(originalInMemoryJar, myclass.load()); - classesFound++; + if (VoltUnsafe.IS_JAVA8) { + for (ClassInfo myclass : classpath.getTopLevelClassesRecursive(packageName)) { + compiler.addClassToJar(originalInMemoryJar, myclass.load()); + classesFound++; + } + } else { + for (ClassInfo myclass : classpath.getTopLevelClasses()) { + compiler.addClassToJar(originalInMemoryJar, Class.forName(packageName + "." + myclass.getName())); + classesFound++; + } } // check that classes were found and loaded. If another test modifies "fakeusecase.greetings" it should modify this assert also. assertEquals(5, classesFound); @@ -557,16 +577,27 @@ public void testInitWithMultipleJarFiles() throws Exception { InMemoryJarfile inMemoryJar1 = new InMemoryJarfile(); InMemoryJarfile inMemoryJar2 = new InMemoryJarfile(); VoltCompiler compiler = new VoltCompiler(false, false); - ClassPath classpath = ClassPath.from(this.getClass().getClassLoader()); String packageName = "org.voltdb_testprocs.fakeusecase.greetings"; + ClassPath classpath = ClassPath.from(new URLClassLoader(new URL[]{GetGreetingBase.class.getResource(".")}, GetGreetingBase.class.getClassLoader())); int classesFound = 0; - for (ClassInfo myclass : classpath.getTopLevelClassesRecursive(packageName)) { - if (myclass.getSimpleName().startsWith("Get")) { - compiler.addClassToJar(inMemoryJar1, myclass.load()); - } else { - compiler.addClassToJar(inMemoryJar2, myclass.load()); + if (VoltUnsafe.IS_JAVA8) { + for (ClassInfo myclass : classpath.getTopLevelClassesRecursive(packageName)) { + if (myclass.getSimpleName().startsWith("Get")) { + compiler.addClassToJar(inMemoryJar1, myclass.load()); + } else { + compiler.addClassToJar(inMemoryJar2, myclass.load()); + } + classesFound++; + } + } else { + for (ClassInfo myclass : classpath.getTopLevelClasses()) { + if (myclass.getSimpleName().startsWith("Get")) { + compiler.addClassToJar(inMemoryJar1, Class.forName(packageName + "." + myclass.getName())); + } else { + compiler.addClassToJar(inMemoryJar2, Class.forName(packageName + "." + myclass.getName())); + } + classesFound++; } - classesFound++; } // check that classes were found and loaded. If another test modifies "fakeusecase.greetings" it should modify // this assert also. @@ -593,4 +624,4 @@ public void testInitWithMultipleJarFiles() throws Exception { /* For 'voltdb start' test coverage see TestStartWithSchema and (in Pro) TestStartWithSchemaAndDurability. */ -} +} \ No newline at end of file diff --git a/tests/frontend/org/voltdb/export/TestExportDataSource.java b/tests/frontend/org/voltdb/export/TestExportDataSource.java index 7b11e49c54c..8cbdc7a2dc7 100644 --- a/tests/frontend/org/voltdb/export/TestExportDataSource.java +++ b/tests/frontend/org/voltdb/export/TestExportDataSource.java @@ -25,13 +25,13 @@ import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyLong; -import static org.mockito.Matchers.argThat; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.mockito.hamcrest.MockitoHamcrest.argThat; import static org.voltdb.export.ExportMatchers.ackPayloadIs; import java.io.File; diff --git a/tests/frontend/org/voltdb/exportclient/TestExportToFileClient.java b/tests/frontend/org/voltdb/exportclient/TestExportToFileClient.java index 3be17cba0a2..982e0397c16 100644 --- a/tests/frontend/org/voltdb/exportclient/TestExportToFileClient.java +++ b/tests/frontend/org/voltdb/exportclient/TestExportToFileClient.java @@ -425,7 +425,7 @@ public void testFailGetWriter() throws Exception + "does not exist but cannot be created, or cannot be opened for any other reason"); // throw IOexception first two times on create new FileOutputStream (mock cannot create csv file case) - PowerMockito.whenNew(FileOutputStream.class).withArguments(Matchers.anyString(),Matchers.anyBoolean()). + PowerMockito.whenNew(FileOutputStream.class).withParameterTypes(File.class, boolean.class).withArguments(Matchers.any(), Matchers.anyBoolean()). thenThrow(fnfe). thenThrow(fnfe). thenReturn(fos); diff --git a/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java b/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java index 57e15a78268..0d188d8be48 100644 --- a/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java +++ b/tests/frontend/org/voltdb/iv2/TestMpPromoteAlgo.java @@ -26,8 +26,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; @@ -184,7 +184,7 @@ public void testRepairSurvivors() throws InterruptedException, ExecutionExceptio needsRepair.add(1L); needsRepair.add(2L); needsRepair.add(3L); - verify(mailbox, times(1)).repairReplicasWith(eq(needsRepair), any(Iv2RepairLogResponseMessage.class)); + verify(mailbox, times(1)).repairReplicasWith(eq(needsRepair), any(CompleteTransactionMessage.class)); assertEquals(txnEgo(1000L), result.get().m_txnId); // check if the hashinator was updated to the newer version @@ -325,7 +325,7 @@ public void testRepairSurvivorsFromJustMPI() throws InterruptedException, Execut List needsRepair = new ArrayList(); needsRepair.add(1L); needsRepair.add(2L); - verify(mailbox, times(1)).repairReplicasWith(eq(needsRepair), any(Iv2RepairLogResponseMessage.class)); + verify(mailbox, times(1)).repairReplicasWith(eq(needsRepair), any(CompleteTransactionMessage.class)); assertEquals(txnEgo(1000L), result.get().m_txnId); } diff --git a/tests/frontend/org/voltdb/iv2/TestSpPromoteAlgo.java b/tests/frontend/org/voltdb/iv2/TestSpPromoteAlgo.java index 0c4bf773e0a..7a7e52992ee 100644 --- a/tests/frontend/org/voltdb/iv2/TestSpPromoteAlgo.java +++ b/tests/frontend/org/voltdb/iv2/TestSpPromoteAlgo.java @@ -27,7 +27,8 @@ import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -35,7 +36,6 @@ import static org.mockito.Mockito.when; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -246,7 +246,7 @@ public void testRepairSurvivorOrder() inOrder.verify(mailbox).repairReplicasWith(repair3, msgs[5].getPayload()); // verify exactly 3 repairs happened. - verify(mailbox, times(3)).repairReplicasWith(any(repair3.getClass()), any(Iv2RepairLogResponseMessage.class)); + verify(mailbox, times(3)).repairReplicasWith(eq(repair3), any(Iv2InitiateTaskMessage.class)); } // Verify that a babysitter update causes the term to be cancelled. diff --git a/tests/test_apps/exportbenchmark/run.sh b/tests/test_apps/exportbenchmark/run.sh index 4e3f6992557..bc8efca8705 100755 --- a/tests/test_apps/exportbenchmark/run.sh +++ b/tests/test_apps/exportbenchmark/run.sh @@ -94,7 +94,7 @@ function server() { cp exportbenchmark-exporter.jar ${VOLTDB_LIB}/extension # Set up options - VOLTDB_OPTS="-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseTLAB" + VOLTDB_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseTLAB" VOLTDB_OPTS="${VOLTDB_OPTS} -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly" [[ -d log && -w log ]] && > log/volt.log # run the server diff --git a/third_party/java/jars/byte-buddy-1.9.10.jar b/third_party/java/jars/byte-buddy-1.9.10.jar new file mode 100644 index 00000000000..239fc8025c4 Binary files /dev/null and b/third_party/java/jars/byte-buddy-1.9.10.jar differ diff --git a/third_party/java/jars/byte-buddy-agent-1.9.10.jar b/third_party/java/jars/byte-buddy-agent-1.9.10.jar new file mode 100644 index 00000000000..8dfab05c460 Binary files /dev/null and b/third_party/java/jars/byte-buddy-agent-1.9.10.jar differ diff --git a/third_party/java/jars/hamcrest-2.1.jar b/third_party/java/jars/hamcrest-2.1.jar new file mode 100644 index 00000000000..e323d5e81d0 Binary files /dev/null and b/third_party/java/jars/hamcrest-2.1.jar differ diff --git a/third_party/java/jars/hamcrest-all-1.3.jar b/third_party/java/jars/hamcrest-all-1.3.jar deleted file mode 100644 index 6f62ba00c7b..00000000000 Binary files a/third_party/java/jars/hamcrest-all-1.3.jar and /dev/null differ diff --git a/third_party/java/jars/jaxb-api-2.3.1.jar b/third_party/java/jars/jaxb-api-2.3.1.jar new file mode 100644 index 00000000000..45658654712 Binary files /dev/null and b/third_party/java/jars/jaxb-api-2.3.1.jar differ diff --git a/third_party/java/jars/mockito-all-1.10.19.jar b/third_party/java/jars/mockito-all-1.10.19.jar deleted file mode 100644 index c831489cd99..00000000000 Binary files a/third_party/java/jars/mockito-all-1.10.19.jar and /dev/null differ diff --git a/third_party/java/jars/mockito-core-2.24.5.jar b/third_party/java/jars/mockito-core-2.24.5.jar new file mode 100644 index 00000000000..3a4bd49f007 Binary files /dev/null and b/third_party/java/jars/mockito-core-2.24.5.jar differ diff --git a/third_party/java/jars/objenesis-2.1.jar b/third_party/java/jars/objenesis-2.1.jar deleted file mode 100644 index 92ab8ea7431..00000000000 Binary files a/third_party/java/jars/objenesis-2.1.jar and /dev/null differ diff --git a/third_party/java/jars/objenesis-3.0.1.jar b/third_party/java/jars/objenesis-3.0.1.jar new file mode 100644 index 00000000000..8521c847068 Binary files /dev/null and b/third_party/java/jars/objenesis-3.0.1.jar differ diff --git a/third_party/java/jars/powermock-api-mockito2-2.0.0.jar b/third_party/java/jars/powermock-api-mockito2-2.0.0.jar new file mode 100644 index 00000000000..edafac76048 Binary files /dev/null and b/third_party/java/jars/powermock-api-mockito2-2.0.0.jar differ diff --git a/third_party/java/jars/powermock-api-support-2.0.0.jar b/third_party/java/jars/powermock-api-support-2.0.0.jar new file mode 100644 index 00000000000..2b1c07a505f Binary files /dev/null and b/third_party/java/jars/powermock-api-support-2.0.0.jar differ diff --git a/third_party/java/jars/powermock-core-2.0.0.jar b/third_party/java/jars/powermock-core-2.0.0.jar new file mode 100644 index 00000000000..3a28481e70d Binary files /dev/null and b/third_party/java/jars/powermock-core-2.0.0.jar differ diff --git a/third_party/java/jars/powermock-mockito-1.6.3-full.jar b/third_party/java/jars/powermock-mockito-1.6.3-full.jar deleted file mode 100644 index 25bddf03c92..00000000000 Binary files a/third_party/java/jars/powermock-mockito-1.6.3-full.jar and /dev/null differ diff --git a/third_party/java/jars/powermock-module-junit4-2.0.0.jar b/third_party/java/jars/powermock-module-junit4-2.0.0.jar new file mode 100644 index 00000000000..2764ecb553a Binary files /dev/null and b/third_party/java/jars/powermock-module-junit4-2.0.0.jar differ diff --git a/third_party/java/jars/powermock-module-junit4-common-2.0.0.jar b/third_party/java/jars/powermock-module-junit4-common-2.0.0.jar new file mode 100644 index 00000000000..7895d89c48a Binary files /dev/null and b/third_party/java/jars/powermock-module-junit4-common-2.0.0.jar differ diff --git a/third_party/java/jars/powermock-reflect-2.0.0.jar b/third_party/java/jars/powermock-reflect-2.0.0.jar new file mode 100644 index 00000000000..bc58caeeb3a Binary files /dev/null and b/third_party/java/jars/powermock-reflect-2.0.0.jar differ diff --git a/voltcore.eml b/voltcore.eml index 3c59a1ecf2f..a2a2ea885d7 100644 --- a/voltcore.eml +++ b/voltcore.eml @@ -8,9 +8,6 @@ - - - @@ -62,24 +59,9 @@ - - - - - - - - - - - - - - - @@ -110,9 +92,6 @@ - - - @@ -182,26 +161,26 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + +