summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2020-10-23 08:18:20 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-22 21:58:53 +0000
commit429811de2fdc81613ba9ed9b4b03854ee6ff3128 (patch)
tree7d11812b5e410c28717e0e38098e252900d844c1
parented2af140e1793988bcb6235629e8f3d0aea7a110 (diff)
downloadmongo-429811de2fdc81613ba9ed9b4b03854ee6ff3128.tar.gz
Import wiredtiger: aecb18daca54af24f50be193b62f85d35ad5e603 from branch mongodb-4.4
ref: 03178d7f9c..aecb18daca for: 4.4.2 WT-5691 Handle scenario where imported files have write generations ahead of current DB WT-6612 Increase cache size in test_prepare08 to fix rollback error due to cache pressure WT-6629 Support index tables in metadata:create cursors WT-6675 Remove WiredTiger Java language API and documentation WT-6736 Add statistics to track evictions in parallel with checkpoint WT-6764 Wait for stable timestamp to move before publishing checkpoint information in timestamp abort test WT-6798 Utilize Arm LSE atomics and the correct strength barriers WT-6808 Documentation: add top level architecture picture WT-6812 Fix "out-of-order fixup" potentially corrupting historical values WT-6813 Fix memory leak in schema_create
-rw-r--r--src/third_party/wiredtiger/SConstruct56
-rw-r--r--src/third_party/wiredtiger/build_posix/Make.subdirs2
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_check_class.m4144
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_check_junit.m472
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_java_options.m448
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_jni_include_dir.m4128
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_prog_jar.m452
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java.m4115
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java_works.m4134
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac.m479
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac_works.m472
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/ax_try_compile_java.m455
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/options.m414
-rw-r--r--src/third_party/wiredtiger/build_posix/configure.ac.in24
-rw-r--r--src/third_party/wiredtiger/dist/java_doc.py44
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_all1
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_copyright2
-rw-r--r--src/third_party/wiredtiger/dist/s_copyright.list10
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_docs33
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_docs_plantuml2
-rwxr-xr-xsrc/third_party/wiredtiger/dist/s_release5
-rw-r--r--src/third_party/wiredtiger/dist/s_string.ok7
-rw-r--r--src/third_party/wiredtiger/dist/stat_data.py1
-rw-r--r--src/third_party/wiredtiger/examples/java/Makefile.am21
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_access.java94
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_all.java1108
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_call_center.java302
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_cursor.java283
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_log.java401
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_schema.java453
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_stat.java304
-rw-r--r--src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_thread.java149
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/lang/java/Makefile.am94
-rw-r--r--src/third_party/wiredtiger/lang/java/java_doc.i67
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java196
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java374
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java319
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackUtil.java70
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerException.java40
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java42
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java43
-rw-r--r--src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java42
-rw-r--r--src/third_party/wiredtiger/lang/java/wiredtiger.i1522
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_handle.c19
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_vrfy.c2
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_metadata.c18
-rw-r--r--src/third_party/wiredtiger/src/docs/Doxyfile2
-rw-r--r--src/third_party/wiredtiger/src/docs/arch-index.dox121
-rw-r--r--src/third_party/wiredtiger/src/docs/backup.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/basic-api.dox12
-rwxr-xr-xsrc/third_party/wiredtiger/src/docs/build-javadoc.sh12
-rw-r--r--src/third_party/wiredtiger/src/docs/build-posix.dox4
-rw-r--r--src/third_party/wiredtiger/src/docs/build-windows.dox4
-rw-r--r--src/third_party/wiredtiger/src/docs/checkpoint.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/compact.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/compression.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/config-strings.dox8
-rw-r--r--src/third_party/wiredtiger/src/docs/cursor-join.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/cursor-log.dox15
-rw-r--r--src/third_party/wiredtiger/src/docs/cursor-ops.dox4
-rw-r--r--src/third_party/wiredtiger/src/docs/cursor-random.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/cursors.dox8
-rw-r--r--src/third_party/wiredtiger/src/docs/data-sources.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/durability.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/encryption.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/error-handling.dox32
-rw-r--r--src/third_party/wiredtiger/src/docs/eviction.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/file-formats.dox8
-rw-r--r--src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_create.pngbin124661 -> 162127 bytes
-rw-r--r--src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_generic.pngbin13799 -> 16233 bytes
-rw-r--r--src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_rename.pngbin113981 -> 148026 bytes
-rw-r--r--src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.cmapx4
-rw-r--r--src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.pngbin0 -> 67012 bytes
-rw-r--r--src/third_party/wiredtiger/src/docs/in-memory.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/introduction.dox3
-rw-r--r--src/third_party/wiredtiger/src/docs/lsm.dox19
-rw-r--r--src/third_party/wiredtiger/src/docs/namespace.dox15
-rw-r--r--src/third_party/wiredtiger/src/docs/operation_tracking.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/packing.dox8
-rw-r--r--src/third_party/wiredtiger/src/docs/programming.dox10
-rw-r--r--src/third_party/wiredtiger/src/docs/readonly.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/schema.dox43
-rw-r--r--src/third_party/wiredtiger/src/docs/shared-cache.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/spell.ok5
-rw-r--r--src/third_party/wiredtiger/src/docs/statistics.dox2
-rw-r--r--src/third_party/wiredtiger/src/docs/threads.dox2
-rwxr-xr-xsrc/third_party/wiredtiger/src/docs/tools/doxfilter.py145
-rw-r--r--src/third_party/wiredtiger/src/docs/transactions.dox2
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_page.c4
-rw-r--r--src/third_party/wiredtiger/src/history/hs_rec.c12
-rw-r--r--src/third_party/wiredtiger/src/include/btree.h5
-rw-r--r--src/third_party/wiredtiger/src/include/cell_inline.h2
-rw-r--r--src/third_party/wiredtiger/src/include/gcc.h29
-rw-r--r--src/third_party/wiredtiger/src/include/stat.h1
-rw-r--r--src/third_party/wiredtiger/src/include/wiredtiger.in690
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_create.c8
-rw-r--r--src/third_party/wiredtiger/src/support/stat.c4
-rwxr-xr-xsrc/third_party/wiredtiger/src/utilities/util_dump.c6
-rw-r--r--src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c6
-rwxr-xr-xsrc/third_party/wiredtiger/test/evergreen/configure_combinations.sh3
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/AutoCloseTest.java370
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/BackupCursorTest.java85
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConcurrentCloseTest.java180
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConfigTest.java192
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest.java118
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest02.java88
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest03.java175
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/ExceptionTest.java176
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest.java288
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest02.java253
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest03.java360
-rw-r--r--src/third_party/wiredtiger/test/java/com/wiredtiger/test/WiredTigerSuite.java50
-rw-r--r--src/third_party/wiredtiger/test/suite/test_import08.py178
-rw-r--r--src/third_party/wiredtiger/test/suite/test_metadata_cursor04.py76
-rw-r--r--src/third_party/wiredtiger/test/suite/test_prepare08.py2
-rw-r--r--src/third_party/wiredtiger/test/suite/test_timestamp20.py79
117 files changed, 965 insertions, 10056 deletions
diff --git a/src/third_party/wiredtiger/SConstruct b/src/third_party/wiredtiger/SConstruct
index adc174ec759..fca0a520a65 100644
--- a/src/third_party/wiredtiger/SConstruct
+++ b/src/third_party/wiredtiger/SConstruct
@@ -28,9 +28,6 @@ AddOption("--enable-diagnostic", dest="diagnostic", action="store_true", default
AddOption("--enable-lz4", dest="lz4", type="string", nargs=1, action="store",
help="Use LZ4 compression")
-AddOption("--enable-java", dest="lang-java", type="string", nargs=1, action="store",
- help="Build java extension, specify location of swig.exe binary and Java JDK dir separated by comma")
-
AddOption("--enable-python", dest="lang-python", type="string", nargs=1, action="store",
help="Build Python extension, specify location of swig.exe binary")
@@ -342,59 +339,6 @@ if GetOption("lang-python"):
Default(swiginstall, copySwig)
-# Javap SWIG wrapper for WiredTiger
-enableJava = GetOption("lang-java")
-if enableJava and enableJava.count(",") == 1:
- enableJavaPaths = enableJava.split(',')
-
- swigExe = enableJavaPaths[0]
- javaPath = enableJavaPaths[1]
- conf.env.Append(CPPPATH=[ javaPath + '/include'])
- conf.env.Append(CPPPATH=[ javaPath + '/include/win32'])
-
- swigJavaFiles = ["lang/java/src/com/wiredtiger/db/Connection.java",
- "lang/java/src/com/wiredtiger/db/Cursor.java",
- "lang/java/src/com/wiredtiger/db/Modify.java",
- "lang/java/src/com/wiredtiger/db/SearchStatus.java",
- "lang/java/src/com/wiredtiger/db/Session.java",
- "lang/java/src/com/wiredtiger/db/WT_ITEM_HOLD.java",
- "lang/java/src/com/wiredtiger/db/WT_MODIFY_LIST.java",
- "lang/java/src/com/wiredtiger/db/wiredtiger.java",
- "lang/java/src/com/wiredtiger/db/wiredtigerConstants.java",
- "lang/java/src/com/wiredtiger/db/wiredtigerJNI.java"]
-
- swigCFile = "wiredtiger_wrap.c"
-
- swigFiles = env.Command(
- swigJavaFiles + [swigCFile], '',
- '"' + swigExe + '" -Wall -v -java -nodefaultctor -nodefaultdtor -package com.wiredtiger.db -outdir lang/java/src/com/wiredtiger/db -o wiredtiger_wrap.c lang/java/wiredtiger.i')
- env.Depends(swigFiles, wtheader)
- objectJavaWrap = env.Object(swigCFile)
- env.Depends(objectJavaWrap, swigCFile)
-
- #
- # Dynamically Loaded Library - wiredtiger_java.dll
- wtjavadll = env.SharedLibrary(
- target="wiredtiger_java",
- source=wt_objs + [objectJavaWrap] + ['build_win/wiredtiger.def'], LIBS=wtlibs)
-
- env.Depends(wtjavadll, [filelistfile, version_file])
- Default(wtjavadll)
-
- #
- # wiredtiger.jar
- env['JAVAC'] = '"' + javaPath + '/bin/javac.exe"'
- env['JAR'] = '"' + javaPath + '/bin/jar.exe"'
- # Build classes
- wtClasses = env.Java('lang/java/build', 'lang/java/src/')
- env.Depends(wtClasses, swigJavaFiles)
- # Pack classes in jar
- wtJar = env.Command( 'lang/java/wiredtiger.jar', 'lang/java/build', env['JAR'] + " -cf $TARGET -C $SOURCE .")
- env.Depends(wtJar, wtClasses)
- Default(wtJar)
-else:
- print("Error using --enable-java, this option may contain two paths separated by comma, the first is the swig.exe binary and the second is the Java JDK directory. e.g. C:\Python27\python.exe C:\Python27\Scripts\scons.py --enable-java=\"C:\Program Files\swigwin-3.0.12\swig.exe\",\"C:\Program Files\Java\jdk1.8.0_151\"")
-
# Shim library of functions to emulate POSIX on Windows
shim = env.Library("window_shim",
["test/windows/windows_shim.c"])
diff --git a/src/third_party/wiredtiger/build_posix/Make.subdirs b/src/third_party/wiredtiger/build_posix/Make.subdirs
index f98a88e0daa..da149c335f4 100644
--- a/src/third_party/wiredtiger/build_posix/Make.subdirs
+++ b/src/third_party/wiredtiger/build_posix/Make.subdirs
@@ -18,7 +18,6 @@ ext/encryptors/rotn
ext/extractors/csv
ext/test/fail_fs
.
-lang/java JAVA
lang/python PYTHON
# Test/Benchmark/Examples support library.
@@ -26,7 +25,6 @@ test/utility
# Example programs.
examples/c
-examples/java JAVA
# Test programs.
test/bloom
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_check_class.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_check_class.m4
deleted file mode 100644
index 098aa77290b..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_check_class.m4
+++ /dev/null
@@ -1,144 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_class.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CHECK_CLASS
-#
-# DESCRIPTION
-#
-# AX_CHECK_CLASS tests the existence of a given Java class, either in a
-# jar or in a '.class' file.
-#
-# *Warning*: its success or failure can depend on a proper setting of the
-# CLASSPATH env. variable.
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission. The
-# general documentation, as well as the sample configure.in, is included
-# in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 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 General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 7
-
-AU_ALIAS([AC_CHECK_CLASS], [AX_CHECK_CLASS])
-AC_DEFUN([AX_CHECK_CLASS],[
-AC_REQUIRE([AX_PROG_JAVA])
-ac_var_name=`echo $1 | sed 's/\./_/g'`
-dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is
-dnl dynamic I need an extra level of extraction
-AC_MSG_CHECKING([for $1 class])
-AC_CACHE_VAL(ax_cv_class_$ac_var_name, [
-if test x$ac_cv_prog_uudecode_base64 = xyes; then
-dnl /**
-dnl * Test.java: used to test dynamicaly if a class exists.
-dnl */
-dnl public class Test
-dnl {
-dnl
-dnl public static void
-dnl main( String[] argv )
-dnl {
-dnl Class lib;
-dnl if (argv.length < 1)
-dnl {
-dnl System.err.println ("Missing argument");
-dnl System.exit (77);
-dnl }
-dnl try
-dnl {
-dnl lib = Class.forName (argv[0]);
-dnl }
-dnl catch (ClassNotFoundException e)
-dnl {
-dnl System.exit (1);
-dnl }
-dnl lib = null;
-dnl System.exit (0);
-dnl }
-dnl
-dnl }
-cat << \EOF > Test.uue
-begin-base64 644 Test.class
-yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
-bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
-bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ
-AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt
-ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV
-ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp
-VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM
-amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi
-AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B
-AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA
-AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN
-uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK
-AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA
-JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA
-JwAAAAIAKA==
-====
-EOF
- if $UUDECODE Test.uue; then
- :
- else
- echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AS_MESSAGE_LOG_FD
- echo "configure: failed file was:" >&AS_MESSAGE_LOG_FD
- cat Test.uue >&AS_MESSAGE_LOG_FD
- ac_cv_prog_uudecode_base64=no
- fi
- rm -f Test.uue
- if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then
- eval "ac_cv_class_$ac_var_name=yes"
- else
- eval "ac_cv_class_$ac_var_name=no"
- fi
- rm -f Test.class
-else
- AX_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"],
- [eval "ac_cv_class_$ac_var_name=no"])
-fi
-eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
-eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
-HAVE_LAST_CLASS=$ac_var_val
-if test x$ac_var_val = xyes; then
- ifelse([$2], , :, [$2])
-else
- ifelse([$3], , :, [$3])
-fi
-])
-dnl for some reason the above statment didn't fall though here?
-dnl do scripts have variable scoping?
-eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
-AC_MSG_RESULT($ac_var_val)
-])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_check_junit.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_check_junit.m4
deleted file mode 100644
index 724e0e0814f..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_check_junit.m4
+++ /dev/null
@@ -1,72 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_junit.html
-# ===========================================================================
-#
-# WiredTiger: Updated to use JUnit 4 call semantics.
-#
-# SYNOPSIS
-#
-# AX_CHECK_JUNIT
-#
-# DESCRIPTION
-#
-# AX_CHECK_JUNIT tests the availability of the Junit testing framework,
-# and set some variables for conditional compilation of the test suite by
-# automake.
-#
-# If available, JUNIT is set to a command launching the text based user
-# interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT and @TESTS_JUNIT@
-# is set to $TESTS_JUNIT, otherwise they are set to empty values.
-#
-# You can use these variables in your Makefile.am file like this :
-#
-# # Some of the following classes are built only if junit is available
-# JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java
-#
-# noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@
-#
-# EXTRA_JAVA = $(JAVA_JUNIT)
-#
-# TESTS_JUNIT = AllJunitTests
-#
-# TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@
-#
-# EXTRA_TESTS = $(TESTS_JUNIT)
-#
-# AllJunitTests :
-# echo "#! /bin/sh" > $@
-# echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@
-# chmod +x $@
-#
-# LICENSE
-#
-# Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 5
-
-AU_ALIAS([AC_CHECK_JUNIT], [AX_CHECK_JUNIT])
-AC_DEFUN([AX_CHECK_JUNIT],[
-AC_CACHE_VAL(ac_cv_prog_JUNIT,[
-AX_CHECK_CLASS(org.junit.runner.JUnitCore)
-if test x"`eval 'echo $ac_cv_class_org_junit_runner_JUnitCore'`" != xno ; then
- ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) org.junit.runner.JUnitCore'
-fi])
-AC_MSG_CHECKING([for junit])
-if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then
- JUNIT="$ac_cv_prog_JUNIT"
- JAVA_JUNIT='$(JAVA_JUNIT)'
- TESTS_JUNIT='$(TESTS_JUNIT)'
-else
- JUNIT=
- JAVA_JUNIT=
- TESTS_JUNIT=
-fi
-AC_MSG_RESULT($JAVA_JUNIT)
-AC_SUBST(JUNIT)
-AC_SUBST(JAVA_JUNIT)
-AC_SUBST(TESTS_JUNIT)])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_java_options.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_java_options.m4
deleted file mode 100644
index 36c10d922bd..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_java_options.m4
+++ /dev/null
@@ -1,48 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_java_options.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_JAVA_OPTIONS
-#
-# DESCRIPTION
-#
-# AX_JAVA_OPTIONS adds configure command line options used for Java m4
-# macros. This Macro is optional.
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission. The
-# general documentation, as well as the sample configure.in, is included
-# in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Devin Weaver <ktohg@tritarget.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 6
-
-AU_ALIAS([AC_JAVA_OPTIONS], [AX_JAVA_OPTIONS])
-AC_DEFUN([AX_JAVA_OPTIONS],[
-AC_ARG_WITH(java-prefix,
- [ --with-java-prefix=PFX prefix where Java runtime is installed (optional)])
-AC_ARG_WITH(javac-flags,
- [ --with-javac-flags=FLAGS flags to pass to the Java compiler (optional)])
-AC_ARG_WITH(java-flags,
- [ --with-java-flags=FLAGS flags to pass to the Java VM (optional)])
-JAVAPREFIX=$with_java_prefix
-JAVACFLAGS=$with_javac_flags
-JAVAFLAGS=$with_java_flags
-AC_SUBST(JAVAPREFIX)dnl
-AC_SUBST(JAVACFLAGS)dnl
-AC_SUBST(JAVAFLAGS)dnl
-AC_SUBST(JAVA)dnl
-AC_SUBST(JAVAC)dnl
-])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_jni_include_dir.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_jni_include_dir.m4
deleted file mode 100644
index 249e3650f0d..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_jni_include_dir.m4
+++ /dev/null
@@ -1,128 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_JNI_INCLUDE_DIR
-#
-# DESCRIPTION
-#
-# AX_JNI_INCLUDE_DIR finds include directories needed for compiling
-# programs using the JNI interface.
-#
-# JNI include directories are usually in the Java distribution. This is
-# deduced from the value of $JAVA_HOME, $JAVAC, or the path to "javac", in
-# that order. When this macro completes, a list of directories is left in
-# the variable JNI_INCLUDE_DIRS.
-#
-# Example usage follows:
-#
-# AX_JNI_INCLUDE_DIR
-#
-# for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
-# do
-# CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
-# done
-#
-# If you want to force a specific compiler:
-#
-# - at the configure.in level, set JAVAC=yourcompiler before calling
-# AX_JNI_INCLUDE_DIR
-#
-# - at the configure level, setenv JAVAC
-#
-# Note: This macro can work with the autoconf M4 macros for Java programs.
-# This particular macro is not part of the original set of macros.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Don Anderson <dda@sleepycat.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 10
-
-AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
-AC_DEFUN([AX_JNI_INCLUDE_DIR],[
-
-JNI_INCLUDE_DIRS=""
-
-if test "x$JAVA_HOME" != x; then
- _JTOPDIR="$JAVA_HOME"
-else
- if test "x$JAVAC" = x; then
- JAVAC=javac
- fi
- AC_PATH_PROG([_ACJNI_JAVAC], [$JAVAC], [no])
- if test "x$_ACJNI_JAVAC" = xno; then
- AC_MSG_ERROR([cannot find JDK; try setting \$JAVAC or \$JAVA_HOME])
- fi
- _ACJNI_FOLLOW_SYMLINKS("$_ACJNI_JAVAC")
- _JTOPDIR=`echo "$_ACJNI_FOLLOWED" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`
-fi
-
-case "$host_os" in
- darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
- _JINC="$_JTOPDIR/Headers";;
- *) _JINC="$_JTOPDIR/include";;
-esac
-_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
-_AS_ECHO_LOG([_JINC=$_JINC])
-
-# get the likely subdirectories for system specific java includes
-case "$host_os" in
-bsdi*) _JNI_INC_SUBDIRS="bsdos";;
-freebsd*) _JNI_INC_SUBDIRS="freebsd";;
-linux*) _JNI_INC_SUBDIRS="linux genunix";;
-osf*) _JNI_INC_SUBDIRS="alpha";;
-solaris*) _JNI_INC_SUBDIRS="solaris";;
-mingw*) _JNI_INC_SUBDIRS="win32";;
-cygwin*) _JNI_INC_SUBDIRS="win32";;
-*) _JNI_INC_SUBDIRS="genunix";;
-esac
-
-# search for jni.h in the paths
-found=no
-for dir in "$_JINC" "`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`"/include ; do
- # add any subdirectories that are present
- saved_CPPFLAGS="$CPPFLAGS"
- for JINCSUBDIR in $_JNI_INC_SUBDIRS ; do
- if test -d "$dir/$JINCSUBDIR" ; then
- JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $dir/$JINCSUBDIR"
- CPPFLAGS="$CPPFLAGS -I$dir/$JINCSUBDIR"
- fi
- done
-
- AC_CHECK_HEADER([$dir/jni.h],
- [JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $dir" ; found=yes; break])
- CPPFLAGS="$saved_CPPFLAGS"
-done
-
-if test $found = no ; then
- AC_MSG_ERROR([cannot find JDK header files])
-fi
-])
-
-# _ACJNI_FOLLOW_SYMLINKS <path>
-# Follows symbolic links on <path>,
-# finally setting variable _ACJNI_FOLLOWED
-# ----------------------------------------
-AC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[
-# find the include directory relative to the javac executable
-_cur="$1"
-while ls -ld "$_cur" 2>/dev/null | grep " -> " >/dev/null; do
- AC_MSG_CHECKING([symlink for $_cur])
- _slink=`ls -ld "$_cur" | sed 's/.* -> //'`
- case "$_slink" in
- /*) _cur="$_slink";;
- # 'X' avoids triggering unwanted echo options.
- *) _cur=`echo "X$_cur" | sed -e 's/^X//' -e 's:[[^/]]*$::'`"$_slink";;
- esac
- AC_MSG_RESULT([$_cur])
-done
-_ACJNI_FOLLOWED="$_cur"
-])# _ACJNI
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_jar.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_jar.m4
deleted file mode 100644
index 776e804ad9f..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_jar.m4
+++ /dev/null
@@ -1,52 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_jar.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_JAR
-#
-# DESCRIPTION
-#
-# AX_PROG_JAR tests for an existing jar program. It uses the environment
-# variable JAR then tests in sequence various common jar programs.
-#
-# If you want to force a specific compiler:
-#
-# - at the configure.in level, set JAR=yourcompiler before calling
-# AX_PROG_JAR
-#
-# - at the configure level, setenv JAR
-#
-# You can use the JAR variable in your Makefile.in, with @JAR@.
-#
-# Note: This macro depends on the autoconf M4 macros for Java programs. It
-# is VERY IMPORTANT that you download that whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission.
-#
-# The general documentation of those macros, as well as the sample
-# configure.in, is included in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Egon Willighagen <e.willighagen@science.ru.nl>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 6
-
-AU_ALIAS([AC_PROG_JAR], [AX_PROG_JAR])
-AC_DEFUN([AX_PROG_JAR],[
-AC_REQUIRE([AC_EXEEXT])dnl
-if test "x$JAVAPREFIX" = x; then
- test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar$EXEEXT)
-else
- test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar, $JAVAPREFIX)
-fi
-test "x$JAR" = x && AC_MSG_ERROR([no acceptable jar program found in \$PATH])
-AC_PROVIDE([$0])dnl
-])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java.m4
deleted file mode 100644
index 5471f322d25..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java.m4
+++ /dev/null
@@ -1,115 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_java.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_JAVA
-#
-# DESCRIPTION
-#
-# Here is a summary of the main macros:
-#
-# AX_PROG_JAVAC: finds a Java compiler.
-#
-# AX_PROG_JAVA: finds a Java virtual machine.
-#
-# AX_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!).
-#
-# AX_CHECK_RQRD_CLASS: finds if we have the given class and stops
-# otherwise.
-#
-# AX_TRY_COMPILE_JAVA: attempt to compile user given source.
-#
-# AX_TRY_RUN_JAVA: attempt to compile and run user given source.
-#
-# AX_JAVA_OPTIONS: adds Java configure options.
-#
-# AX_PROG_JAVA tests an existing Java virtual machine. It uses the
-# environment variable JAVA then tests in sequence various common Java
-# virtual machines. For political reasons, it starts with the free ones.
-# You *must* call [AX_PROG_JAVAC] before.
-#
-# If you want to force a specific VM:
-#
-# - at the configure.in level, set JAVA=yourvm before calling AX_PROG_JAVA
-#
-# (but after AC_INIT)
-#
-# - at the configure level, setenv JAVA
-#
-# You can use the JAVA variable in your Makefile.in, with @JAVA@.
-#
-# *Warning*: its success or failure can depend on a proper setting of the
-# CLASSPATH env. variable.
-#
-# TODO: allow to exclude virtual machines (rationale: most Java programs
-# cannot run with some VM like kaffe).
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission.
-#
-# A Web page, with a link to the latest CVS snapshot is at
-# <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
-#
-# This is a sample configure.in Process this file with autoconf to produce
-# a configure script.
-#
-# AC_INIT(UnTag.java)
-#
-# dnl Checks for programs.
-# AC_CHECK_CLASSPATH
-# AX_PROG_JAVAC
-# AX_PROG_JAVA
-#
-# dnl Checks for classes
-# AX_CHECK_RQRD_CLASS(org.xml.sax.Parser)
-# AX_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
-#
-# AC_OUTPUT(Makefile)
-#
-# LICENSE
-#
-# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 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 General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 8
-
-AU_ALIAS([AC_PROG_JAVA], [AX_PROG_JAVA])
-AC_DEFUN([AX_PROG_JAVA],[
-if test x$JAVAPREFIX = x; then
- test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe java)
-else
- test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe java, $JAVAPREFIX)
-fi
-test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
-AX_PROG_JAVA_WORKS
-AC_PROVIDE([$0])dnl
-])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java_works.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java_works.m4
deleted file mode 100644
index 741bd561b62..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_java_works.m4
+++ /dev/null
@@ -1,134 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_java_works.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_JAVA_WORKS
-#
-# DESCRIPTION
-#
-# Internal use ONLY.
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission. The
-# general documentation, as well as the sample configure.in, is included
-# in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 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 General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 8
-
-AU_ALIAS([AC_PROG_JAVA_WORKS], [AX_PROG_JAVA_WORKS])
-AC_DEFUN([AX_PROG_JAVA_WORKS], [
-AC_PATH_PROG(UUDECODE, uudecode, [no])
-if test x$UUDECODE != xno; then
-AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
-dnl /**
-dnl * Test.java: used to test if java compiler works.
-dnl */
-dnl public class Test
-dnl {
-dnl
-dnl public static void
-dnl main( String[] argv )
-dnl {
-dnl System.exit (0);
-dnl }
-dnl
-dnl }
-cat << \EOF > Test.uue
-begin-base64 644 Test.class
-yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
-bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
-bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
-YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
-aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
-AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
-AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
-====
-EOF
-if $UUDECODE Test.uue; then
- ac_cv_prog_uudecode_base64=yes
-else
- echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AS_MESSAGE_LOG_FD
- echo "configure: failed file was:" >&AS_MESSAGE_LOG_FD
- cat Test.uue >&AS_MESSAGE_LOG_FD
- ac_cv_prog_uudecode_base64=no
-fi
-rm -f Test.uue])
-fi
-if test x$ac_cv_prog_uudecode_base64 != xyes; then
- rm -f Test.class
- AC_MSG_WARN([I have to compile Test.class from scratch])
- if test x$ac_cv_prog_javac_works = xno; then
- AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
- fi
- if test x$ac_cv_prog_javac_works = x; then
- AX_PROG_JAVAC
- fi
-fi
-AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
-JAVA_TEST=Test.java
-CLASS_TEST=Test.class
-TEST=Test
-changequote(, )dnl
-cat << \EOF > $JAVA_TEST
-/* [#]line __oline__ "configure" */
-public class Test {
-public static void main (String args[]) {
- System.exit (0);
-} }
-EOF
-changequote([, ])dnl
-if test x$ac_cv_prog_uudecode_base64 != xyes; then
- if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
- :
- else
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat $JAVA_TEST >&AS_MESSAGE_LOG_FD
- AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
- fi
-fi
-if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
- ac_cv_prog_java_works=yes
-else
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat $JAVA_TEST >&AS_MESSAGE_LOG_FD
- AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
-fi
-rm -fr $JAVA_TEST $CLASS_TEST Test.uue
-])
-AC_PROVIDE([$0])dnl
-]
-)
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac.m4
deleted file mode 100644
index d9bcc2d7c34..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac.m4
+++ /dev/null
@@ -1,79 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_javac.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_JAVAC
-#
-# DESCRIPTION
-#
-# AX_PROG_JAVAC tests an existing Java compiler. It uses the environment
-# variable JAVAC then tests in sequence various common Java compilers. For
-# political reasons, it starts with the free ones.
-#
-# If you want to force a specific compiler:
-#
-# - at the configure.in level, set JAVAC=yourcompiler before calling
-# AX_PROG_JAVAC
-#
-# - at the configure level, setenv JAVAC
-#
-# You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
-#
-# *Warning*: its success or failure can depend on a proper setting of the
-# CLASSPATH env. variable.
-#
-# TODO: allow to exclude compilers (rationale: most Java programs cannot
-# compile with some compilers like guavac).
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission. The
-# general documentation, as well as the sample configure.in, is included
-# in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 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 General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 6
-
-AU_ALIAS([AC_PROG_JAVAC], [AX_PROG_JAVAC])
-AC_DEFUN([AX_PROG_JAVAC],[
-if test "x$JAVAPREFIX" = x; then
- test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj -C" guavac jikes javac)
-else
- test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj -C" guavac jikes javac, $JAVAPREFIX)
-fi
-test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
-AX_PROG_JAVAC_WORKS
-AC_PROVIDE([$0])dnl
-])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac_works.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac_works.m4
deleted file mode 100644
index 7dfa1e37d89..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_prog_javac_works.m4
+++ /dev/null
@@ -1,72 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_prog_javac_works.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PROG_JAVAC_WORKS
-#
-# DESCRIPTION
-#
-# Internal use ONLY.
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission. The
-# general documentation, as well as the sample configure.in, is included
-# in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 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 General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 6
-
-AU_ALIAS([AC_PROG_JAVAC_WORKS], [AX_PROG_JAVAC_WORKS])
-AC_DEFUN([AX_PROG_JAVAC_WORKS],[
-AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
-JAVA_TEST=Test.java
-CLASS_TEST=Test.class
-cat << \EOF > $JAVA_TEST
-/* [#]line __oline__ "configure" */
-public class Test {
-}
-EOF
-if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
- ac_cv_prog_javac_works=yes
-else
- AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat $JAVA_TEST >&AS_MESSAGE_LOG_FD
-fi
-rm -f $JAVA_TEST $CLASS_TEST
-])
-AC_PROVIDE([$0])dnl
-])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/ax_try_compile_java.m4 b/src/third_party/wiredtiger/build_posix/aclocal/ax_try_compile_java.m4
deleted file mode 100644
index 8efd091c43b..00000000000
--- a/src/third_party/wiredtiger/build_posix/aclocal/ax_try_compile_java.m4
+++ /dev/null
@@ -1,55 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_try_compile_java.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_TRY_COMPILE_JAVA
-#
-# DESCRIPTION
-#
-# AX_TRY_COMPILE_JAVA attempt to compile user given source.
-#
-# *Warning*: its success or failure can depend on a proper setting of the
-# CLASSPATH env. variable.
-#
-# Note: This is part of the set of autoconf M4 macros for Java programs.
-# It is VERY IMPORTANT that you download the whole set, some macros depend
-# on other. Unfortunately, the autoconf archive does not support the
-# concept of set of macros, so I had to break it for submission. The
-# general documentation, as well as the sample configure.in, is included
-# in the AX_PROG_JAVA macro.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Devin Weaver <ktohg@tritarget.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 7
-
-AU_ALIAS([AC_TRY_COMPILE_JAVA], [AX_TRY_COMPILE_JAVA])
-AC_DEFUN([AX_TRY_COMPILE_JAVA],[
-AC_REQUIRE([AX_PROG_JAVAC])dnl
-cat << \EOF > Test.java
-/* [#]line __oline__ "configure" */
-ifelse([$1], , , [import $1;])
-public class Test {
-[$2]
-}
-EOF
-if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class
-then
-dnl Don't remove the temporary files here, so they can be examined.
- ifelse([$3], , :, [$3])
-else
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat Test.java >&AS_MESSAGE_LOG_FD
-ifelse([$4], , , [ rm -fr Test*
- $4
-])dnl
-fi
-rm -fr Test*])
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/options.m4 b/src/third_party/wiredtiger/build_posix/aclocal/options.m4
index 2a20716a9bc..3148c986b50 100644
--- a/src/third_party/wiredtiger/build_posix/aclocal/options.m4
+++ b/src/third_party/wiredtiger/build_posix/aclocal/options.m4
@@ -65,20 +65,6 @@ no) wt_cv_enable_diagnostic=no;;
esac
AC_MSG_RESULT($wt_cv_enable_diagnostic)
-AC_MSG_CHECKING(if --enable-java option specified)
-AC_ARG_ENABLE(java,
- [AS_HELP_STRING([--enable-java],
- [Configure the Java API.])], r=$enableval, r=no)
-case "$r" in
-no) wt_cv_enable_java=no;;
-*) if test "$enable_shared" = "no"; then
- AC_MSG_ERROR([--enable-java requires shared libraries])
- fi
- wt_cv_enable_java=yes;;
-esac
-AC_MSG_RESULT($wt_cv_enable_java)
-AM_CONDITIONAL([JAVA], [test x$wt_cv_enable_java = xyes])
-
AC_MSG_CHECKING(if --enable-python option specified)
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python],
diff --git a/src/third_party/wiredtiger/build_posix/configure.ac.in b/src/third_party/wiredtiger/build_posix/configure.ac.in
index 0cbf422de08..02c56f4fe73 100644
--- a/src/third_party/wiredtiger/build_posix/configure.ac.in
+++ b/src/third_party/wiredtiger/build_posix/configure.ac.in
@@ -102,6 +102,12 @@ if test "$GCC" = "yes"; then
# instructions.
if test "$wt_cv_arm64" = "yes"; then
AM_CFLAGS="$AM_CFLAGS -march=armv8-a+crc"
+ # moutline-atomics preserves backwards compatibility with Arm v8.0
+ # systems but also supports using Arm v8.1 atomics. The latter can
+ # massively improve performance on larger Arm systems. The flag was
+ # back ported to gcc8, 9 and is the default in gcc10+. See if the
+ # compiler supports the flag.
+ AX_CHECK_COMPILE_FLAG([-moutline-atomics], [AM_CFLAGS="$AM_CFLAGS -moutline-atomics"])
fi
else
# The Solaris native compiler gets the additional -mt flag.
@@ -134,26 +140,14 @@ if test "$wt_cv_enable_strict" = "yes"; then
AM_CFLAGS="$AM_CFLAGS $wt_cv_strict_warnings"
fi
-# Java and Python APIs
-if test "$wt_cv_enable_java" = "yes" -o "$wt_cv_enable_python" = "yes"; then
+# Python API
+if test "$wt_cv_enable_python" = "yes"; then
# Only a warning, we need to build release packages without SWIG.
AX_PKG_SWIG(2.0.4, [],
- [AC_MSG_WARN([SWIG is required to rebuild Java or Python APIs.]) &&
+ [AC_MSG_WARN([SWIG is required to rebuild Python API.]) &&
SWIG="SWIG_NOT_FOUND_DURING_CONFIGURE"])
fi
-if test "$wt_cv_enable_java" = "yes"; then
- JAVAC=${JAVAC-javac}
- AX_PROG_JAVAC
- AX_PROG_JAR
- AX_JNI_INCLUDE_DIR
- AX_CHECK_JUNIT
- for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS ; do
- JNI_CPPFLAGS="$JNI_CPPFLAGS -I$JNI_INCLUDE_DIR"
- done
- AC_SUBST(JNI_CPPFLAGS)
-fi
-
if test "$wt_cv_enable_python" = "yes"; then
AM_PATH_PYTHON([2.6])
if test -n "$with_python_prefix" ; then
diff --git a/src/third_party/wiredtiger/dist/java_doc.py b/src/third_party/wiredtiger/dist/java_doc.py
deleted file mode 100644
index 3a7d2c3d820..00000000000
--- a/src/third_party/wiredtiger/dist/java_doc.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python
-
-# This program pulls the function names from wiredtiger.in and generates
-# an input file for Java SWIG that adds doxygen copydoc comments to functions.
-
-from __future__ import print_function
-import os, re, sys
-import api_data
-from dist import compare_srcfile
-
-# Temporary file.
-tmp_file = '__tmp'
-
-#####################################################################
-# Update wiredtiger.in with doxygen comments
-#####################################################################
-f='../src/include/wiredtiger.in'
-o='../lang/java/java_doc.i'
-tfile = open(tmp_file, 'w')
-
-tfile.write('''/* DO NOT EDIT: automatically built by dist/java_doc.py. */
-
-''')
-
-cclass_re = re.compile('^struct __([a-z_]*) {')
-cfunc_re = re.compile('\s+.*? __F\(([a-z_]*)\)')
-
-curr_class = ""
-for line in open(f, 'r'):
-
- m = cclass_re.match(line)
- if m:
- curr_class = m.group(1)
-
- if curr_class == "":
- continue
-
- m = cfunc_re.match(line)
- if m:
- tfile.write('COPYDOC(__' + curr_class.lower() + ', ' +
- curr_class.upper() + ', ' + m.group(1) + ')\n')
-
-tfile.close()
-compare_srcfile(tmp_file, o)
diff --git a/src/third_party/wiredtiger/dist/s_all b/src/third_party/wiredtiger/dist/s_all
index 298fbed0fe2..ac9c9699f5a 100755
--- a/src/third_party/wiredtiger/dist/s_all
+++ b/src/third_party/wiredtiger/dist/s_all
@@ -78,7 +78,6 @@ run "python api_err.py"
run "python flags.py"
run "python log.py"
run "python stat.py"
-run "python java_doc.py"
run "sh ./s_copyright"
run "sh ./s_style"
run "./s_clang-format"
diff --git a/src/third_party/wiredtiger/dist/s_copyright b/src/third_party/wiredtiger/dist/s_copyright
index f7c90f95bbb..ee246999486 100755
--- a/src/third_party/wiredtiger/dist/s_copyright
+++ b/src/third_party/wiredtiger/dist/s_copyright
@@ -109,7 +109,6 @@ fi
(cd .. && find [a-z]* -name '*.[ch]' \
-o -name '*.cxx' \
-o -name '*.in' \
- -o -name '*.java' \
-o -name '*.py' \
-o -name '*.swig' |
sed -e '/Makefile.in/d' \
@@ -142,7 +141,6 @@ special_copyright()
special_copyright LICENSE 1 "$string1"
special_copyright dist/s_c_test_create 1 "$string4"
-special_copyright src/docs/build-javadoc.sh 1 "$string2"
special_copyright src/docs/style/footer.html 2 "$string2"
special_copyright src/utilities/util_cpyright.c 1 "$string3"
diff --git a/src/third_party/wiredtiger/dist/s_copyright.list b/src/third_party/wiredtiger/dist/s_copyright.list
index 1cb3e0b4744..8ed935a9c06 100644
--- a/src/third_party/wiredtiger/dist/s_copyright.list
+++ b/src/third_party/wiredtiger/dist/s_copyright.list
@@ -8,7 +8,6 @@ skip dist/db.py
skip dist/dist.py
skip dist/flags.py
skip dist/function.py
-skip dist/java_doc.py
skip dist/log.py
skip dist/log_data.py
skip dist/prototypes.py
@@ -18,15 +17,6 @@ skip dist/stat.py
skip dist/stat_data.py
skip dist/style.py
skip dist/wtperf_config.py
-skip lang/java/java_doc.i
-skip lang/java/src/com/wiredtiger/db/Connection.java
-skip lang/java/src/com/wiredtiger/db/Cursor.java
-skip lang/java/src/com/wiredtiger/db/SearchStatus.java
-skip lang/java/src/com/wiredtiger/db/Session.java
-skip lang/java/src/com/wiredtiger/db/wiredtiger.java
-skip lang/java/src/com/wiredtiger/db/wiredtigerConstants.java
-skip lang/java/src/com/wiredtiger/db/wiredtigerJNI.java
-skip lang/java/wiredtiger_wrap.c
skip lang/python/wiredtiger.py
skip lang/python/wiredtiger/__init__.py
skip lang/python/wiredtiger_wrap.c
diff --git a/src/third_party/wiredtiger/dist/s_docs b/src/third_party/wiredtiger/dist/s_docs
index 095ada474d3..2bb134d0244 100755
--- a/src/third_party/wiredtiger/dist/s_docs
+++ b/src/third_party/wiredtiger/dist/s_docs
@@ -145,27 +145,28 @@ EOF
e=1
}
- # Add optional extras
- EXTRAS="../lang/java/src/com/wiredtiger/db"
- EXTRA_INPUT=""
- for f in $EXTRAS ; do
- [ -e "$f" ] && EXTRA_INPUT="$EXTRA_INPUT ../$f"
- done
-
- # Run again to generate the full doc set with Python and Java.
- [ "$additional_languages" -eq 1 ] && [ "x$EXTRA_INPUT" != "x" ] && (
- cd ../src/docs &&
- (eval cat Doxyfile $filter ; cat <<EOF
-QUIET=YES
-INPUT+=$EXTRA_INPUT
-EOF
-) | doxygen -)
-
# Fix up bad links doxygen generates in navtree.js
(cd ../docs &&
sed -i~ -e 's,/\.html,/,' -e 's,\.html\.html,.html,' navtree.js &&
rm -f navtree.js~)
+ # Any cmapx files that are generated by plantuml need to be referred to
+ CMAPX=`find ../src/docs/ -type f -name "*.cmapx" 2>/dev/null`
+ if [ "$CMAPX" != '' ]; then
+ cd ../docs
+ for f in $CMAPX; do
+ b=`echo $f | sed -e 's:.*/::' -e 's/.cmapx$//'`
+ for html in `grep -l $b.png *.html`; do
+ # There's an image in this HTML file that has a map file
+ # generated by plantuml. Refer to the map by its name
+ # and insert the contents of the map into the HTML source.
+ sed -e "/<img.*=\"$b[.]png\"/s/\(\"$b[.]png\"\)/\1 usemap=\"#${b}_map\"/" \
+ -e "/<img.*=\"$b[.]png\"/r $f" $html > $html.NEW
+ mv $html.NEW $html
+ done
+ done
+ fi
+
# Fixup the man pages generated by Doxygen. We want the command line
# documentation to be the main man page, but also install a man page
# for the WiredTiger header into the library section.
diff --git a/src/third_party/wiredtiger/dist/s_docs_plantuml b/src/third_party/wiredtiger/dist/s_docs_plantuml
index c646739d7ba..43c669591a7 100755
--- a/src/third_party/wiredtiger/dist/s_docs_plantuml
+++ b/src/third_party/wiredtiger/dist/s_docs_plantuml
@@ -35,7 +35,7 @@ test -f "../dist/plantuml.jar" || {
if [ $download_plantuml -eq 1 ]
then
echo 'Downloading plantuml:'
- wget $PLANTUML_URL -O ../dist/plantuml.jar
+ curl -Li $PLANTUML_URL -o ../dist/plantuml.jar
else
echo 'plantuml can be downloaded from:'
echo 'https://sourceforge.net/projects/plantuml/files/plantuml.jar/download'
diff --git a/src/third_party/wiredtiger/dist/s_release b/src/third_party/wiredtiger/dist/s_release
index ec85341d0ff..f55247f6fe2 100755
--- a/src/third_party/wiredtiger/dist/s_release
+++ b/src/third_party/wiredtiger/dist/s_release
@@ -32,10 +32,9 @@ fi
echo "Running 'dist/s_all' in the release tree"
(cd "$DEST/dist" && env WT_RELEASE_BUILD=yes sh s_all -A > /dev/null)
-echo "Running swig to generate the Java and Python API"
+echo "Running swig to generate the Python API"
(cd "$DEST/build_posix" &&
- ../configure --enable-java --enable-python &&
- (cd lang/java && make ../../../lang/java/wiredtiger_wrap.c) &&
+ ../configure --enable-python &&
(cd lang/python && make ../../../lang/python/wiredtiger_wrap.c) &&
make distclean &&
find . -type d -a -empty | xargs rmdir &&
diff --git a/src/third_party/wiredtiger/dist/s_string.ok b/src/third_party/wiredtiger/dist/s_string.ok
index be6ae0893fe..3df400be17d 100644
--- a/src/third_party/wiredtiger/dist/s_string.ok
+++ b/src/third_party/wiredtiger/dist/s_string.ok
@@ -698,12 +698,14 @@ dll
dlopen
dlsym
dmalloc
+dmb
dmsg
doxgen
doxygen
drealloc
ds
dsb
+dsbs
dsk
dsrc
dst
@@ -894,6 +896,9 @@ isalpha
iscntrl
isdigit
isgraph
+ish
+ishld
+ishst
islocked
islower
ispo
@@ -1224,6 +1229,7 @@ setstr
setv
setvbuf
sfence
+shareability
signalled
sii
sizeof
@@ -1306,6 +1312,7 @@ timestamp
timestamped
timestamps
tinfo
+tlb
tmp
todo
tokenizer
diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py
index 4d8072b5cee..8e2d1ef2ca6 100644
--- a/src/third_party/wiredtiger/dist/stat_data.py
+++ b/src/third_party/wiredtiger/dist/stat_data.py
@@ -244,6 +244,7 @@ connection_stats = [
CacheStat('cache_eviction_pages_queued_urgent', 'pages queued for urgent eviction'),
CacheStat('cache_eviction_pages_seen', 'pages seen by eviction walk'),
CacheStat('cache_eviction_pages_already_queued', 'pages seen by eviction walk that are already queued'),
+ CacheStat('cache_eviction_pages_in_parallel_with_checkpoint', 'pages evicted in parallel with checkpoint'),
CacheStat('cache_eviction_queue_empty', 'eviction server candidate queue empty when topping up'),
CacheStat('cache_eviction_queue_not_empty', 'eviction server candidate queue not empty when topping up'),
CacheStat('cache_eviction_server_evicting', 'eviction server evicting pages'),
diff --git a/src/third_party/wiredtiger/examples/java/Makefile.am b/src/third_party/wiredtiger/examples/java/Makefile.am
deleted file mode 100644
index c7fbfffa48c..00000000000
--- a/src/third_party/wiredtiger/examples/java/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-AM_CPPFLAGS = -I$(abs_top_builddir)
-
-JAVAEXAMPLES = $(top_srcdir)/examples/java/com/wiredtiger/examples
-
-# TODO: How to add to existing Javadoc from main API?
-# JDOCDIR = $(top_srcdir)/docs/java
-# java_DATA = $(JDOCDIR)/index.html
-
-javadir = $(datadir)/java
-dist_java_JAVA = \
- $(JAVAEXAMPLES)/ex_access.java
-
-all-local: wiredtiger.jar
-
-$(JDOCDIR)/index.html: $(dist_java_JAVA)
- mkdir -p $(JDOCDIR)
- javadoc -public -d $(JDOCDIR) -link http://docs.oracle.com/javase/6/docs/api $(JAVAEXAMPLES)/[A-Z]*.java
-
-wiredtiger.jar: $(dist_java_JAVA)
- (cd $(top_builddir) && \
- $(JAR) -cf wiredtiger.jar com/)
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_access.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_access.java
deleted file mode 100644
index 02d983d1fdc..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_access.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_access.java
- * demonstrates how to create and access a simple table.
- */
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-
-public class ex_access {
- public static void main(String[] args) {
- /*! [access example connection] */
- Connection conn;
- Session s;
- Cursor c;
-
- try {
- conn = wiredtiger.open("WT_HOME", "create");
- s = conn.open_session(null);
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- return;
- }
- /*! [access example connection] */
- try {
- /*! [access example table create] */
- s.create("table:t", "key_format=S,value_format=u");
- /*! [access example table create] */
- /*! [access example cursor open] */
- c = s.open_cursor("table:t", null, null);
- /*! [access example cursor open] */
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- return;
- }
- System.out.println("Key format: " + c.getKeyFormat());
- System.out.println("Value format: " + c.getValueFormat());
- /*! [access example cursor insert] */
- try {
- c.putKeyString("foo");
- c.putValueByteArray("bar".getBytes());
- c.insert();
- } catch (WiredTigerPackingException wtpe) {
- System.err.println("WiredTigerPackingException: " + wtpe);
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- }
- /*! [access example cursor insert] */
- /*! [access example cursor list] */
- try {
- c.reset();
- while (c.next() == 0) {
- System.out.println("Got: " + c.getKeyString());
- }
- } catch (WiredTigerPackingException wtpe) {
- System.err.println("WiredTigerPackingException: " + wtpe);
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- }
- /*! [access example cursor list] */
-
- /*! [access example close] */
- try {
- conn.close(null);
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- }
- /*! [access example close] */
- }
-}
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_all.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_all.java
deleted file mode 100644
index 50130663462..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_all.java
+++ /dev/null
@@ -1,1108 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_all.java
- * Containing a call to every method in the WiredTiger API.
- *
- * It doesn't do anything very useful, just demonstrates how to call each
- * method. This file is used to populate the API reference with code
- * fragments.
- */
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.nio.*;
-
-/* Note: indentation in non-standard so it will display nicely in doc. */
-public class ex_all {
-
-public static String progname = "ex_all";
-
-public static int cursor_ops(Session session)
- throws WiredTigerException
-{
- Cursor cursor;
- int ret;
-
- /*! [Open a cursor] */
- cursor = session.open_cursor("table:mytable", null, null);
- /*! [Open a cursor] */
-
- /*! [Open a cursor on the metadata] */
- cursor = session.open_cursor("metadata:", null, null);
- /*! [Open a cursor on the metadata] */
-
- {
- Cursor duplicate;
- String key = "some key";
- /*! [Duplicate a cursor] */
- cursor = session.open_cursor("table:mytable", null, null);
- cursor.putKeyString(key);
- ret = cursor.search();
-
- /* Duplicate the cursor. */
- duplicate = session.open_cursor(null, cursor, null);
- /*! [Duplicate a cursor] */
- }
-
- {
- Cursor overwrite_cursor;
- String key = "some key", value = "some value";
- /*! [Reconfigure a cursor] */
- cursor = session.open_cursor("table:mytable", null, null);
- cursor.putKeyString(key);
-
- /* Reconfigure the cursor to overwrite the record. */
- overwrite_cursor = session.open_cursor(null, cursor, "overwrite");
- ret = cursor.close();
-
- overwrite_cursor.putValueString(value);
- ret = overwrite_cursor.insert();
- /*! [Reconfigure a cursor] */
- }
-
- {
- /*! [boolean configuration string example] */
- cursor = session.open_cursor("table:mytable", null, "overwrite");
- cursor = session.open_cursor("table:mytable", null, "overwrite=true");
- cursor = session.open_cursor("table:mytable", null, "overwrite=1");
- /*! [boolean configuration string example] */
- }
-
- {
- /*! [open a named checkpoint] */
- cursor = session.open_cursor("table:mytable", null, "checkpoint=midnight");
- /*! [open a named checkpoint] */
- }
-
- {
- /*! [open the default checkpoint] */
- cursor = session.open_cursor("table:mytable", null,
- "checkpoint=WiredTigerCheckpoint");
- /*! [open the default checkpoint] */
- }
-
- {
- /*! [Get the cursor's string key] */
- String key; /* Get the cursor's string key. */
- key = cursor.getKeyString();
- /*! [Get the cursor's string key] */
- }
-
- {
- /*! [Set the cursor's string key] */
- /* Set the cursor's string key. */
- String key = "another key";
- cursor.putKeyString(key);
- /*! [Set the cursor's string key] */
- }
-
- {
- /*! [Get the cursor's record number key] */
- long recno; /* Get the cursor's record number key. */
- recno = cursor.getKeyLong();
- /*! [Get the cursor's record number key] */
- }
-
- {
- /*! [Set the cursor's record number key] */
- long recno = 37; /* Set the cursor's record number key. */
- cursor.putKeyLong(recno);
- /*! [Set the cursor's record number key] */
- }
-
- {
- /*! [Get the cursor's composite key] */
- /* Get the cursor's "SiH" format composite key. */
- String first;
- int second;
- short third;
-
- first = cursor.getKeyString();
- second = cursor.getKeyInt();
- third = cursor.getKeyShort();
- /*! [Get the cursor's composite key] */
- }
-
- {
- /*! [Set the cursor's composite key] */
- /* Set the cursor's "SiH" format composite key. */
- cursor.putKeyString("first");
- cursor.putKeyInt(5);
- cursor.putKeyShort((short)7);
- /*! [Set the cursor's composite key] */
- }
-
- {
- /*! [Get the cursor's string value] */
- String value; /* Get the cursor's string value. */
- value = cursor.getValueString();
- /*! [Get the cursor's string value] */
- }
-
- {
- /*! [Set the cursor's string value] */
- /* Set the cursor's string value. */
- String value = "another value";
- cursor.putValueString(value);
- /*! [Set the cursor's string value] */
- }
-
- {
- /*! [Get the cursor's raw value] */
- byte[] value; /* Get the cursor's raw value. */
- value = cursor.getValueByteArray();
- /*! [Get the cursor's raw value] */
- }
-
- {
- /*! [Set the cursor's raw value] */
- byte[] value; /* Set the cursor's raw value. */
- value = "another value".getBytes();
- cursor.putValueByteArray(value);
- /*! [Set the cursor's raw value] */
- }
-
- /*! [Return the next record] */
- ret = cursor.next();
- /*! [Return the next record] */
-
- /*! [Return the previous record] */
- ret = cursor.prev();
- /*! [Return the previous record] */
-
- /*! [Reset the cursor] */
- ret = cursor.reset();
- /*! [Reset the cursor] */
-
- {
- Cursor other = null;
- /*! [Cursor comparison] */
- int compare;
- compare = cursor.compare(other);
- if (compare == 0) {
- /* Cursors reference the same key */
- } else if (compare < 0) {
- /* Cursor key less than other key */
- } else if (compare > 0) {
- /* Cursor key greater than other key */
- }
- /*! [Cursor comparison] */
- }
-
- {
- Cursor other = null;
- /*! [Cursor equality] */
- int compare;
- compare = cursor.equals(other);
- if (compare == 0) {
- /* redtiger.iCursors reference the same key */
- } else {
- /* Cursors don't reference the same key */
- }
- /*! [Cursor equality] */
- }
-
- {
- /*! [Search for an exact match] */
- String key = "some key";
- cursor.putKeyString(key);
- ret = cursor.search();
- /*! [Search for an exact match] */
- }
-
- cursor_search_near(cursor);
-
- {
- /*! [Insert a new record or overwrite an existing record] */
- /* Insert a new record or overwrite an existing record. */
- String key = "some key", value = "some value";
- cursor = session.open_cursor("table:mytable", null, null);
- cursor.putKeyString(key);
- cursor.putValueString(value);
- ret = cursor.insert();
- /*! [Insert a new record or overwrite an existing record] */
- }
-
- {
- /*! [Insert a new record and fail if the record exists] */
- /* Insert a new record and fail if the record exists. */
- String key = "some key", value = "some value";
- cursor = session.open_cursor("table:mytable", null, "overwrite=false");
- cursor.putKeyString(key);
- cursor.putValueString(value);
- ret = cursor.insert();
- /*! [Insert a new record and fail if the record exists] */
- }
-
- {
- /*! [Insert a new record and assign a record number] */
- /* Insert a new record and assign a record number. */
- long recno;
- String value = "some value";
- cursor = session.open_cursor("table:mytable", null, "append");
- cursor.putValueString(value);
- ret = cursor.insert();
- if (ret == 0)
- recno = cursor.getKeyLong();
- /*! [Insert a new record and assign a record number] */
- }
-
- {
- /*! [Update an existing record or insert a new record] */
- String key = "some key", value = "some value";
- cursor = session.open_cursor("table:mytable", null, null);
- cursor.putKeyString(key);
- cursor.putValueString(value);
- ret = cursor.update();
- /*! [Update an existing record or insert a new record] */
- }
-
- {
- /*! [Update an existing record and fail if DNE] */
- String key = "some key", value = "some value";
- cursor = session.open_cursor("table:mytable", null, "overwrite=false");
- cursor.putKeyString(key);
- cursor.putValueString(value);
- ret = cursor.update();
- /*! [Update an existing record and fail if DNE] */
- }
-
- {
- /*! [Remove a record] */
- String key = "some key";
- cursor = session.open_cursor("table:mytable", null, null);
- cursor.putKeyString(key);
- ret = cursor.remove();
- /*! [Remove a record] */
- }
-
- {
- /*! [Remove a record and fail if DNE] */
- String key = "some key";
- cursor = session.open_cursor("table:mytable", null, "overwrite=false");
- cursor.putKeyString(key);
- ret = cursor.remove();
- /*! [Remove a record and fail if DNE] */
- }
-
- {
- /*! [Display an error] */
- try {
- String key = "non-existent key";
- cursor.putKeyString(key);
- if ((ret = cursor.remove()) != 0) {
- System.err.println(
- "cursor.remove: " + wiredtiger.wiredtiger_strerror(ret));
- return (ret);
- }
- } catch (WiredTigerException wte) { /* Catch severe errors. */
- System.err.println("cursor.remove exception: " + wte);
- }
- /*! [Display an error] */
- }
-
- {
- /*! [Display an error thread safe] */
- try {
- String key = "non-existent key";
- cursor.putKeyString(key);
- if ((ret = cursor.remove()) != 0) {
- System.err.println(
- "cursor.remove: " + wiredtiger.wiredtiger_strerror(ret));
- return (ret);
- }
- } catch (WiredTigerException wte) { /* Catch severe errors. */
- System.err.println("cursor.remove exception: " + wte);
- }
- /*! [Display an error thread safe] */
- }
-
- /*! [Close the cursor] */
- ret = cursor.close();
- /*! [Close the cursor] */
-
- return (ret);
-}
-
-static int
-cursor_search_near(Cursor cursor)
- throws WiredTigerException
-{
- int ret;
- String key = "some key";
- SearchStatus status;
-
- /*! [Search for an exact or adjacent match] */
- cursor.putKeyString(key);
- status = cursor.search_near();
- if (status == SearchStatus.FOUND) {
- /* an exact match */
- } else if (status == SearchStatus.SMALLER) {
- /* returned smaller key */
- } else if (status == SearchStatus.LARGER) {
- /* returned larger key */
- } else if (status == SearchStatus.NOTFOUND) {
- /* no match found */
- }
- /*! [Search for an exact or adjacent match] */
-
- /*! [Forward scan greater than or equal] */
- cursor.putKeyString(key);
- status = cursor.search_near();
- if (status == SearchStatus.FOUND || status == SearchStatus.LARGER) {
- /* include first key returned in the scan */
- }
-
- while ((ret = cursor.next()) == 0) {
- /* the rest of the scan */
- }
- /*! [Forward scan greater than or equal] */
-
- /*! [Backward scan less than] */
- cursor.putKeyString(key);
- status = cursor.search_near();
- if (status == SearchStatus.SMALLER) {
- /* include first key returned in the scan */
- }
-
- while ((ret = cursor.prev()) == 0) {
- /* the rest of the scan */
- }
- /*! [Backward scan less than] */
-
- return (ret);
-}
-
-static int
-checkpoint_ops(Session session)
- throws WiredTigerException
-{
- int ret;
-
- /*! [Checkpoint examples] */
- /* Checkpoint the database. */
- ret = session.checkpoint(null);
-
- /* Checkpoint of the database, creating a named snapshot. */
- ret = session.checkpoint("name=June01");
-
- /*
- * Checkpoint a list of objects.
- * JSON parsing requires quoting the list of target URIs.
- */
- ret = session.
- checkpoint("target=(\"table:table1\",\"table:table2\")");
-
- /*
- * Checkpoint a list of objects, creating a named snapshot.
- * JSON parsing requires quoting the list of target URIs.
- */
- ret = session.
- checkpoint("target=(\"table:mytable\"),name=midnight");
-
- /* Checkpoint the database, discarding all previous snapshots. */
- ret = session.checkpoint("drop=(from=all)");
-
- /* Checkpoint the database, discarding the "midnight" snapshot. */
- ret = session.checkpoint("drop=(midnight)");
-
- /*
- * Checkpoint the database, discarding all snapshots after and
- * including "noon".
- */
- ret = session.checkpoint("drop=(from=noon)");
-
- /*
- * Checkpoint the database, discarding all snapshots before and
- * including "midnight".
- */
- ret = session.checkpoint("drop=(to=midnight)");
-
- /*
- * Create a checkpoint of a table, creating the "July01" snapshot and
- * discarding the "May01" and "June01" snapshots.
- * JSON parsing requires quoting the list of target URIs.
- */
- ret = session.checkpoint("target=(\"table:mytable\"),name=July01,drop=(May01,June01)");
- /*! [Checkpoint examples] */
-
- /*! [JSON quoting example] */
- /*
- * Checkpoint a list of objects.
- * JSON parsing requires quoting the list of target URIs.
- */
- ret = session.
- checkpoint("target=(\"table:table1\",\"table:table2\")");
- /*! [JSON quoting example] */
-
- return (ret);
-}
-
-static boolean
-cursor_statistics(Session session)
- throws WiredTigerException
-{
- Cursor cursor;
-
- /*! [Statistics cursor database] */
- cursor = session.open_cursor(
- "statistics:", null, null);
- /*! [Statistics cursor database] */
-
- /*! [Statistics cursor table] */
- cursor = session.open_cursor(
- "statistics:table:mytable", null, null);
- /*! [Statistics cursor table] */
-
- /*! [Statistics cursor table fast] */
- cursor = session.open_cursor("statistics:table:mytable", null, "statistics=(fast)");
- /*! [Statistics cursor table fast] */
-
- /*! [Statistics clear configuration] */
- cursor = session.open_cursor("statistics:", null, "statistics=(fast,clear)");
- /*! [Statistics clear configuration] */
-
- /*! [Statistics cursor clear configuration] */
- cursor = session.open_cursor("statistics:table:mytable",
- null, "statistics=(all,clear)");
- /*! [Statistics cursor clear configuration] */
-
- /*! [Statistics cursor session] */
- cursor = session.open_cursor(
- "statistics:session", null, null);
- /*! [Statistics cursor session] */
-
- return (true);
-}
-
-static int
-session_ops(Session session)
- throws WiredTigerException
-{
- int ret;
-
- /*! [Reconfigure a session] */
- ret = session.reconfigure("isolation=snapshot");
- /*! [Reconfigure a session] */
-
- /*! [Create a table] */
- ret = session.create("table:mytable", "key_format=S,value_format=S");
- /*! [Create a table] */
- ret = session.drop("table:mytable", null);
-
- /*! [Create a column-store table] */
- ret = session.create("table:mytable", "key_format=r,value_format=S");
- /*! [Create a column-store table] */
- ret = session.drop("table:mytable", null);
-
- /*! [Create a table with columns] */
- /*
- * Create a table with columns: keys are record numbers, values are
- * (string, signed 32-bit integer, unsigned 16-bit integer).
- */
- ret = session.create("table:mytable",
- "key_format=r,value_format=SiH," +
- "columns=(id,department,salary,year-started)");
- /*! [Create a table with columns] */
- ret = session.drop("table:mytable", null);
-
- /*
- * This example code gets run, and the compression libraries might not
- * be loaded, causing the create to fail. The documentation requires
- * the code snippets, use if (false) to avoid running it.
- */
- if (false) { // MIGHT_NOT_RUN
- /*! [Create a lz4 compressed table] */
- ret = session.create("table:mytable",
- "block_compressor=lz4,key_format=S,value_format=S");
- /*! [Create a lz4 compressed table] */
- ret = session.drop("table:mytable", null);
-
- /*! [Create a snappy compressed table] */
- ret = session.create("table:mytable",
- "block_compressor=snappy,key_format=S,value_format=S");
- /*! [Create a snappy compressed table] */
- ret = session.drop("table:mytable", null);
-
- /*! [Create a zlib compressed table] */
- ret = session.create("table:mytable",
- "block_compressor=zlib,key_format=S,value_format=S");
- /*! [Create a zlib compressed table] */
- ret = session.drop("table:mytable", null);
-
- /*! [Create a zstd compressed table] */
- ret = session.create("table:mytable",
- "block_compressor=zstd,key_format=S,value_format=S");
- /*! [Create a zstd compressed table] */
- ret = session.drop("table:mytable", null);
- } // if (false)
-
- /*! [Configure checksums to uncompressed] */
- ret = session.create("table:mytable",
- "key_format=S,value_format=S,checksum=uncompressed");
- /*! [Configure checksums to uncompressed] */
- ret = session.drop("table:mytable", null);
-
- /*! [Configure dictionary compression on] */
- ret = session.create("table:mytable",
- "key_format=S,value_format=S,dictionary=1000");
- /*! [Configure dictionary compression on] */
- ret = session.drop("table:mytable", null);
-
- /*! [Configure key prefix compression on] */
- ret = session.create("table:mytable",
- "key_format=S,value_format=S,prefix_compression=true");
- /*! [Configure key prefix compression on] */
- ret = session.drop("table:mytable", null);
-
- if (false) { // MIGHT_NOT_RUN
- /* Requires sync_file_range */
- /*! [os_cache_dirty_max configuration] */
- ret = session.create(
- "table:mytable", "os_cache_dirty_max=500MB");
- /*! [os_cache_dirty_max configuration] */
- ret = session.drop("table:mytable", null);
-
- /* Requires posix_fadvise */
- /*! [os_cache_max configuration] */
- ret = session.create("table:mytable", "os_cache_max=1GB");
- /*! [os_cache_max configuration] */
- ret = session.drop("table:mytable", null);
- } // if (false)
-
- /*! [Configure block_allocation] */
- ret = session.create("table:mytable",
- "key_format=S,value_format=S,block_allocation=first");
- /*! [Configure block_allocation] */
- ret = session.drop("table:mytable", null);
-
- /*! [Create a cache-resident object] */
- ret = session.create("table:mytable", "key_format=r,value_format=S,cache_resident=true");
- /*! [Create a cache-resident object] */
- ret = session.drop("table:mytable", null);
-
- {
- /* Create a table for the session operations. */
- ret = session.create(
- "table:mytable", "key_format=S,value_format=S");
-
- /*! [Compact a table] */
- ret = session.compact("table:mytable", null);
- /*! [Compact a table] */
-
- /*! [Rename a table] */
- ret = session.rename("table:old", "table:new", null);
- /*! [Rename a table] */
-
- /*! [Salvage a table] */
- ret = session.salvage("table:mytable", null);
- /*! [Salvage a table] */
-
- /*! [Truncate a table] */
- ret = session.truncate("table:mytable", null, null, null);
- /*! [Truncate a table] */
-
- {
- /*
- * Insert a pair of keys so we can truncate a range.
- */
- Cursor cursor;
- cursor = session.open_cursor(
- "table:mytable", null, null);
- cursor.putKeyString("June01");
- cursor.putValueString("value");
- ret = cursor.update();
- cursor.putKeyString("June30");
- cursor.putValueString("value");
- ret = cursor.update();
- cursor.close();
-
- {
- /*! [Truncate a range] */
- Cursor start, stop;
-
- start = session.open_cursor(
- "table:mytable", null, null);
- start.putKeyString("June01");
- ret = start.search();
-
- stop = session.open_cursor(
- "table:mytable", null, null);
- stop.putKeyString("June30");
- ret = stop.search();
-
- ret = session.truncate(null, start, stop, null);
- /*! [Truncate a range] */
- }
- }
-
- /*! [Upgrade a table] */
- ret = session.upgrade("table:mytable", null);
- /*! [Upgrade a table] */
-
- /*! [Verify a table] */
- ret = session.verify("table:mytable", null);
- /*! [Verify a table] */
-
- /*! [Drop a table] */
- ret = session.drop("table:mytable", null);
- /*! [Drop a table] */
- }
-
- /*! [Close a session] */
- ret = session.close(null);
- /*! [Close a session] */
-
- return (ret);
-}
-
-static int
-transaction_ops(Connection conn, Session session)
- throws WiredTigerException
-{
- Cursor cursor;
- int ret;
-
- /*! [transaction commit/rollback] */
- cursor = session.open_cursor("table:mytable", null, null);
- ret = session.begin_transaction(null);
- /*
- * Cursors may be opened before or after the transaction begins, and in
- * either case, subsequent operations are included in the transaction.
- * The begin_transaction call resets all open cursors.
- */
-
- cursor.putKeyString("key");
- cursor.putValueString("value");
- switch (ret = cursor.update()) {
- case 0: /* Update success */
- ret = session.commit_transaction(null);
- /*
- * The commit_transaction call resets all open cursors.
- * If commit_transaction fails, the transaction was rolled-back.
- */
- break;
- case wiredtiger.WT_ROLLBACK: /* Update conflict */
- default: /* Other error */
- ret = session.rollback_transaction(null);
- /* The rollback_transaction call resets all open cursors. */
- break;
- }
-
- /* Cursors remain open and may be used for multiple transactions. */
- /*! [transaction commit/rollback] */
- ret = cursor.close();
-
- /*! [transaction isolation] */
- /* A single transaction configured for snapshot isolation. */
- cursor = session.open_cursor("table:mytable", null, null);
- ret = session.begin_transaction("isolation=snapshot");
- cursor.putKeyString("some-key");
- cursor.putValueString("some-value");
- ret = cursor.update();
- ret = session.commit_transaction(null);
- /*! [transaction isolation] */
-
- /*! [session isolation configuration] */
- /* Open a session configured for read-uncommitted isolation. */
- session = conn.open_session(
- "isolation=read_uncommitted");
- /*! [session isolation configuration] */
-
- /*! [session isolation re-configuration] */
- /* Re-configure a session for snapshot isolation. */
- ret = session.reconfigure("isolation=snapshot");
- /*! [session isolation re-configuration] */
-
- return (ret);
-}
-
-/*! [Implement WT_COLLATOR] */
-/* Not available for java */
-/*! [Implement WT_COLLATOR] */
-
-/*! [WT_EXTRACTOR] */
-/* Not available for java */
-/*! [WT_EXTRACTOR] */
-
-static int
-connection_ops(Connection conn)
- throws WiredTigerException
-{
- int ret;
-
- if (false) { // Might not run.
- /*! [Load an extension] */
- ret = conn.load_extension("my_extension.dll", null);
-
- ret = conn.load_extension(
- "datasource/libdatasource.so",
- "config=[device=/dev/sd1,alignment=64]");
- /*! [Load an extension] */
- } // if (false)
-
- /*! [Reconfigure a connection] */
- ret = conn.reconfigure("eviction_target=75");
- /*! [Reconfigure a connection] */
-
- /*! [Get the database home directory] */
- System.out.println("The database home is " + conn.get_home());
- /*! [Get the database home directory] */
-
- /*! [Check if the database is newly created] */
- if (conn.is_new() != 0) {
- /* First time initialization. */
- }
- /*! [Check if the database is newly created] */
-
- {
- /*! [Open a session] */
- Session session;
- session = conn.open_session(null);
- /*! [Open a session] */
-
- session_ops(session);
- }
-
- /*! [Configure method configuration] */
- /*
- * Applications opening a cursor for the data-source object "my_data"
- * have an additional configuration option "entries", which is an
- * integer type, defaults to 5, and must be an integer between 1 and 10.
- */
- ret = conn.configure_method(
- "session.open_cursor",
- "my_data:", "entries=5", "int", "min=1,max=10");
-
- /*
- * Applications opening a cursor for the data-source object "my_data"
- * have an additional configuration option "devices", which is a list
- * of strings.
- */
- ret = conn.configure_method(
- "session.open_cursor", "my_data:", "devices", "list", null);
- /*! [Configure method configuration] */
-
- /*! [Close a connection] */
- ret = conn.close(null);
- /*! [Close a connection] */
-
- return (ret);
-}
-
-static int
-pack_ops(Session session)
-{
- {
- /*! [Get the packed size] */
- /* Not available for java */
- /*! [Get the packed size] */
- }
-
- {
- /*! [Pack fields into a buffer] */
- /* Not available for java */
- /*! [Pack fields into a buffer] */
- }
-
- {
- /*! [Unpack fields from a buffer] */
- /* Not available for java */
- /*! [Unpack fields from a buffer] */
- }
-
- return (0);
-}
-
-static boolean
-backup(Session session)
- throws WiredTigerException
-{
- char buf[] = new char[1024];
-
- Cursor dup_cursor;
- /*! [backup]*/
- Cursor cursor;
- String filename;
- int ret = 0;
- String databasedir = "/path/database";
- String backdir = "/path/database.backup";
- final String sep = File.separator;
-
- try {
- /* Create the backup directory. */
- if (!(new File(backdir)).mkdir()) {
- System.err.println(progname + ": cannot create backup dir: " +
- backdir);
- return false;
- }
-
- /* Open the backup data source. */
- cursor = session.open_cursor("backup:", null, null);
-
- /* Copy the list of files. */
- while ((ret = cursor.next()) == 0 &&
- (filename = cursor.getKeyString()) != null) {
- String src = databasedir + sep + filename;
- String dest = backdir + sep + filename;
- java.nio.file.Files.copy(
- new java.io.File(src).toPath(),
- new java.io.File(dest).toPath(),
- java.nio.file.StandardCopyOption.REPLACE_EXISTING,
- java.nio.file.StandardCopyOption.COPY_ATTRIBUTES);
- }
- if (ret == wiredtiger.WT_NOTFOUND)
- ret = 0;
- if (ret != 0)
- System.err.println(progname +
- ": cursor next(backup:) failed: " +
- wiredtiger.wiredtiger_strerror(ret));
-
- ret = cursor.close();
- }
- catch (Exception ex) {
- System.err.println(progname +
- ": backup failed: " + ex.toString());
- }
- /*! [backup]*/
- try {
- /*! [backup log duplicate]*/
- /* Open the backup data source. */
- cursor = session.open_cursor("backup:", null, null);
- /* Open a duplicate cursor for additional log files. */
- dup_cursor = session.open_cursor(null, cursor, "target=(\"log:\")");
- /*! [backup log duplicate]*/
-
- ret = dup_cursor.close();
- ret = cursor.close();
- }
- catch (Exception ex) {
- System.err.println(progname +
- ": duplicate log backup failed: " + ex.toString());
- }
- try {
- /*! [incremental backup]*/
- /* Open the backup data source for incremental backup. */
- cursor = session.open_cursor("backup:", null, "target=(\"log:\")");
- /*! [incremental backup]*/
-
- ret = cursor.close();
- }
- catch (Exception ex) {
- System.err.println(progname +
- ": incremental backup failed: " + ex.toString());
- }
-
- try {
- /*! [incremental block backup]*/
- /* Open the backup data source for incremental backup. */
- cursor = session.open_cursor("backup:", null, "incremental=(enabled,src_id=ID0,this_id=ID1)");
- /*! [incremental block backup]*/
-
- ret = cursor.close();
- }
- catch (Exception ex) {
- System.err.println(progname +
- ": incremental backup failed: " + ex.toString());
- }
-
- /*! [backup of a checkpoint]*/
- ret = session.checkpoint("drop=(from=June01),name=June01");
- /*! [backup of a checkpoint]*/
-
- return (ret == 0);
-}
-
-public static int
-allExample()
- throws WiredTigerException
-{
- Connection conn;
- int ret = 0;
- String home = "/home/example/WT_TEST";
-
- /*! [Open a connection] */
- conn = wiredtiger.open(home, "create,cache_size=500M");
- /*! [Open a connection] */
-
- connection_ops(conn);
- /*
- * The connection has been closed.
- */
-
- if (false) { // MIGHT_NOT_RUN
- /*
- * This example code gets run, and the compression libraries might not
- * be installed, causing the open to fail. The documentation requires
- * the code snippets, use if (false) to avoid running it.
- */
- /*! [Configure lz4 extension] */
- conn = wiredtiger.open(home,
- "create," +
- "extensions=[/usr/local/lib/libwiredtiger_lz4.so]");
- /*! [Configure lz4 extension] */
- conn.close(null);
-
- /*! [Configure snappy extension] */
- conn = wiredtiger.open(home,
- "create," +
- "extensions=[/usr/local/lib/libwiredtiger_snappy.so]");
- /*! [Configure snappy extension] */
- conn.close(null);
-
- /*! [Configure zlib extension] */
- conn = wiredtiger.open(home,
- "create," +
- "extensions=[/usr/local/lib/libwiredtiger_zlib.so]");
- /*! [Configure zlib extension] */
- conn.close(null);
-
- /*! [Configure zlib extension with compression level] */
- conn = wiredtiger.open(home,
- "create," +
- "extensions=[/usr/local/lib/" +
- "libwiredtiger_zlib.so=[config=[compression_level=3]]]");
- /*! [Configure zlib extension with compression level] */
- conn.close(null);
-
- /*! [Configure zstd extension] */
- conn = wiredtiger.open(home,
- "create," +
- "extensions=[/usr/local/lib/libwiredtiger_zstd.so]");
- /*! [Configure zstd extension] */
- conn.close(null);
-
- /*! [Configure zstd extension with compression level] */
- conn = wiredtiger.open(home,
- "create," +
- "extensions=[/usr/local/lib/" +
- "libwiredtiger_zstd.so=[config=[compression_level=9]]]");
- /*! [Configure zstd extension with compression level] */
- conn.close(null);
-
- /*
- * This example code gets run, and direct I/O might not be available,
- * causing the open to fail. The documentation requires code snippets,
- * use if (false) to avoid running it.
- */
- /* Might Not Run: direct I/O may not be available. */
- /*! [Configure direct_io for data files] */
- conn = wiredtiger.open(home, "create,direct_io=[data]");
- /*! [Configure direct_io for data files] */
- conn.close(null);
- } // if (false)
-
- /*! [Configure file_extend] */
- conn = wiredtiger.open(
- home, "create,file_extend=(data=16MB)");
- /*! [Configure file_extend] */
- conn.close(null);
-
- /*! [Eviction configuration] */
- /*
- * Configure eviction to begin at 90% full, and run until the cache
- * is only 75% dirty.
- */
- conn = wiredtiger.open(home,
- "create,eviction_trigger=90,eviction_dirty_target=75");
- /*! [Eviction configuration] */
- conn.close(null);
-
- /*! [Eviction worker configuration] */
- /* Configure up to four eviction threads */
- conn = wiredtiger.open(home,
- "create,eviction_trigger=90,eviction=(threads_max=4)");
- /*! [Eviction worker configuration] */
- conn.close(null);
-
- /*! [Statistics configuration] */
- conn = wiredtiger.open(home, "create,statistics=(all)");
- /*! [Statistics configuration] */
- conn.close(null);
-
- /*! [Statistics logging] */
- conn = wiredtiger.open(
- home, "create,statistics_log=(wait=30)");
- /*! [Statistics logging] */
- conn.close(null);
-
- if (false) { // MIGHT_NOT_RUN
- /*
- * Don't run this code, statistics logging doesn't yet support tables.
- */
- /*! [Statistics logging with a table] */
- conn = wiredtiger.open(home,
- "create," +
- "statistics_log=(sources=(\"table:table1\",\"table:table2\"))");
- /*! [Statistics logging with a table] */
- conn.close(null);
-
- /*
- * Don't run this code, statistics logging doesn't yet support indexes.
- */
- /*! [Statistics logging with a source type] */
- conn = wiredtiger.open(home,
- "create,statistics_log=(sources=(\"index:\"))");
- /*! [Statistics logging with a source type] */
- conn.close(null);
-
- /*
- * Don't run this code, because memory checkers get very upset when we
- * leak memory.
- */
- conn = wiredtiger.open(home, "create");
- /*! [Connection close leaking memory] */
- ret = conn.close("leak_memory=true");
- /*! [Connection close leaking memory] */
- } // if (false)
-
- /*! [Get the WiredTiger library version #1] */
- /* Not available for java */
- /*! [Get the WiredTiger library version #1] */
-
- {
- /*! [Get the WiredTiger library version #2] */
- /* Not available for java */
- /*! [Get the WiredTiger library version #2] */
- }
-
- return (0);
-}
-
-public static int
-main(String[] argv)
-{
- try {
- return (allExample());
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- return (-1);
- }
-}
-} /* Non-standard indentation */
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_call_center.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_call_center.java
deleted file mode 100644
index 2114387ff17..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_call_center.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_call_center.java
- * This is an example application that demonstrates how to map a
- * moderately complex SQL application into WiredTiger.
- */
-
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.util.*;
-
-/*! [call-center decl] */
-/*
- * In SQL, the tables are described as follows:
- *
- * CREATE TABLE Customers(id INTEGER PRIMARY KEY,
- * name VARCHAR(30), address VARCHAR(50), phone VARCHAR(15))
- * CREATE INDEX CustomersPhone ON Customers(phone)
- *
- * CREATE TABLE Calls(id INTEGER PRIMARY KEY, call_date DATE,
- * cust_id INTEGER, emp_id INTEGER, call_type VARCHAR(12),
- * notes VARCHAR(25))
- * CREATE INDEX CallsCustDate ON Calls(cust_id, call_date)
- *
- * In this example, both tables will use record numbers for their IDs, which
- * will be the key. The C structs for the records are as follows.
- */
-
-/* Customer records. */
-class Customer {
- public long id;
- public String name;
- public String address;
- public String phone;
- public Customer(long id, String name, String address, String phone) {
- this.id = id;
- this.name = name;
- this.address = address;
- this.phone = phone;
- }
- public Customer() {}
-}
-
-/* Call records. */
-class Call {
- public long id;
- public long call_date;
- public long cust_id;
- public long emp_id;
- public String call_type;
- public String notes;
- public Call(long id, long call_date, long cust_id, long emp_id,
- String call_type, String notes) {
- this.id = id;
- this.call_date = call_date;
- this.cust_id = cust_id;
- this.emp_id = emp_id;
- this.call_type = call_type;
- this.notes = notes;
- }
- public Call() {}
-}
-/*! [call-center decl] */
-
-public class ex_call_center {
-
- public static String home;
-
- public static int
- callCenterExample()
- throws WiredTigerException
- {
- Connection conn;
- Cursor cursor;
- Session session;
- int count, ret;
- SearchStatus nearstatus;
- List<Customer> custSample = new ArrayList<Customer>();
- List<Call> callSample = new ArrayList<Call>();
-
- custSample.add(new Customer(0, "Professor Oak",
- "LeafGreen Avenue", "123-456-7890"));
- custSample.add(new Customer(0, "Lorelei",
- "Sevii Islands", "098-765-4321"));
- callSample.add(new Call(0, 32, 1, 2, "billing", "unavailable"));
- callSample.add(new Call(0, 33, 1, 2, "billing", "available"));
- callSample.add(new Call(0, 34, 1, 2, "reminder", "unavailable"));
- callSample.add(new Call(0, 35, 1, 2, "reminder", "available"));
-
- /*
- * Create a clean test directory for this run of the test program if the
- * environment variable isn't already set (as is done by make check).
- */
- if (System.getenv("WIREDTIGER_HOME") == null) {
- home = "WT_HOME";
- try {
- Process proc = Runtime.getRuntime().exec("/bin/rm -rf WT_HOME");
- BufferedReader br = new BufferedReader(
- new InputStreamReader(proc.getInputStream()));
- while(br.ready())
- System.out.println(br.readLine());
- br.close();
- proc.waitFor();
- new File("WT_HOME").mkdir();
- } catch (Exception ex) {
- System.err.println("Exception: " + ex);
- return (1);
- }
- } else
- home = null;
-
- try {
- conn = wiredtiger.open(home, "create");
- session = conn.open_session(null);
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- return(1);
- }
- /* Note: further error checking omitted for clarity. */
-
- /*! [call-center work] */
- /*
- * Create the customers table, give names and types to the columns.
- * The columns will be stored in two groups: "main" and "address",
- * created below.
- */
- ret = session.create("table:customers",
- "key_format=r," +
- "value_format=SSS," +
- "columns=(id,name,address,phone)," +
- "colgroups=(main,address)");
-
- /* Create the main column group with value columns except address. */
- ret = session.create(
- "colgroup:customers:main", "columns=(name,phone)");
-
- /* Create the address column group with just the address. */
- ret = session.create(
- "colgroup:customers:address", "columns=(address)");
-
- /* Create an index on the customer table by phone number. */
- ret = session.create(
- "index:customers:phone", "columns=(phone)");
-
- /* Populate the customers table with some data. */
- cursor = session.open_cursor("table:customers", null, "append");
- for (Customer cust : custSample) {
- cursor.putValueString(cust.name);
- cursor.putValueString(cust.address);
- cursor.putValueString(cust.phone);
- ret = cursor.insert();
- }
- ret = cursor.close();
-
- /*
- * Create the calls table, give names and types to the columns. All the
- * columns will be stored together, so no column groups are declared.
- */
- ret = session.create("table:calls",
- "key_format=r," +
- "value_format=qrrSS," +
- "columns=(id,call_date,cust_id,emp_id,call_type,notes)");
-
- /*
- * Create an index on the calls table with a composite key of cust_id
- * and call_date.
- */
- ret = session.create("index:calls:cust_date",
- "columns=(cust_id,call_date)");
-
- /* Populate the calls table with some data. */
- cursor = session.open_cursor("table:calls", null, "append");
- for (Call call : callSample) {
- cursor.putValueLong(call.call_date);
- cursor.putValueRecord(call.cust_id);
- cursor.putValueRecord(call.emp_id);
- cursor.putValueString(call.call_type);
- cursor.putValueString(call.notes);
- ret = cursor.insert();
- }
- ret = cursor.close();
-
- /*
- * First query: a call arrives. In SQL:
- *
- * SELECT id, name FROM Customers WHERE phone=?
- *
- * Use the cust_phone index, lookup by phone number to fill the
- * customer record. The cursor will have a key format of "S" for a
- * string because the cust_phone index has a single column ("phone"),
- * which is of type "S".
- *
- * Specify the columns we want: the customer ID and the name. This
- * means the cursor's value format will be "rS".
- */
- cursor = session.open_cursor(
- "index:customers:phone(id,name)", null, null);
- cursor.putKeyString("123-456-7890");
- ret = cursor.search();
- if (ret == 0) {
- Customer cust = new Customer();
- cust.id = cursor.getValueRecord();
- cust.name = cursor.getValueString();
- System.out.println("Read customer record for " + cust.name +
- " (ID " + cust.id + ")");
- }
- ret = cursor.close();
-
- /*
- * Next query: get the recent order history. In SQL:
- *
- * SELECT * FROM Calls WHERE cust_id=? ORDER BY call_date DESC LIMIT 3
- *
- * Use the call_cust_date index to find the matching calls. Since it is
- * in increasing order by date for a given customer, we want to start
- * with the last record for the customer and work backwards.
- *
- * Specify a subset of columns to be returned. (Note that if these were
- * all covered by the index, the primary would not have to be accessed.)
- * Stop after getting 3 records.
- */
- cursor = session.open_cursor(
- "index:calls:cust_date(cust_id,call_type,notes)",
- null, null);
-
- /*
- * The keys in the index are (cust_id,call_date) -- we want the largest
- * call date for a given cust_id. Search for (cust_id+1,0), then work
- * backwards.
- */
- long custid = 1;
- cursor.putKeyRecord(custid + 1);
- cursor.putKeyLong(0);
- nearstatus = cursor.search_near();
-
- /*
- * If the table is empty, search_near will return WT_NOTFOUND, else the
- * cursor will be positioned on a matching key if one exists, or an
- * adjacent key if one does not. If the positioned key is equal to or
- * larger than the search key, go back one.
- */
- if (ret == 0 && (nearstatus == SearchStatus.LARGER ||
- nearstatus == SearchStatus.FOUND))
- ret = cursor.prev();
- for (count = 0; ret == 0 && count < 3; ++count) {
- Call call = new Call();
- call.cust_id = cursor.getValueRecord();
- call.call_type = cursor.getValueString();
- call.notes = cursor.getValueString();
- if (call.cust_id != custid)
- break;
- System.out.println("Call record: customer " + call.cust_id +
- " (" + call.call_type +
- ": " + call.notes + ")");
- ret = cursor.prev();
- }
- /*! [call-center work] */
-
- ret = conn.close(null);
-
- return (ret);
- }
-
- public static void
- main(String[] argv)
- {
- try {
- System.exit(callCenterExample());
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_cursor.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_cursor.java
deleted file mode 100644
index a1b1fc64fb5..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_cursor.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_cursor.java
- * This is an example demonstrating some cursor types and operations.
- */
-
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.util.*;
-
-public class ex_cursor {
-
- public static String home;
-
- /*! [cursor next] */
- public static int
- cursor_forward_scan(Cursor cursor)
- throws WiredTigerException
- {
- String key, value;
- int ret;
-
- while ((ret = cursor.next()) == 0) {
- key = cursor.getKeyString();
- value = cursor.getValueString();
- }
- return (ret);
- }
- /*! [cursor next] */
-
- /*! [cursor prev] */
- public static int
- cursor_reverse_scan(Cursor cursor)
- throws WiredTigerException
- {
- String key, value;
- int ret;
-
- while ((ret = cursor.prev()) == 0) {
- key = cursor.getKeyString();
- value = cursor.getValueString();
- }
- return (ret);
- }
- /*! [cursor prev] */
-
- /*! [cursor reset] */
- public static int
- cursor_reset(Cursor cursor)
- throws WiredTigerException
- {
- return (cursor.reset());
- }
- /*! [cursor reset] */
-
- /*! [cursor search] */
- public static int
- cursor_search(Cursor cursor)
- throws WiredTigerException
- {
- String value;
- int ret;
-
- cursor.putKeyString("foo");
-
- if ((ret = cursor.search()) != 0)
- value = cursor.getValueString();
-
- return (ret);
- }
- /*! [cursor search] */
-
- /*! [cursor search near] */
- public static int
- cursor_search_near(Cursor cursor)
- throws WiredTigerException
- {
- String key, value;
- SearchStatus exact;
-
- key = "foo";
- cursor.putKeyString(key);
-
- exact = cursor.search_near();
- if (exact == SearchStatus.SMALLER)
- /* Returned key smaller than search key */
- key = cursor.getKeyString();
- else if (exact == SearchStatus.LARGER)
- /* Returned key larger than search key */
- key = cursor.getKeyString();
- /* Else exact match found, and key already set */
-
- value = cursor.getValueString();
-
- return (0);
- }
- /*! [cursor search near] */
-
- /*! [cursor insert] */
- public static int
- cursor_insert(Cursor cursor)
- throws WiredTigerException
- {
- cursor.putKeyString("foo");
- cursor.putValueString("bar");
-
- return (cursor.insert());
- }
- /*! [cursor insert] */
-
- /*! [cursor update] */
- public static int
- cursor_update(Cursor cursor)
- throws WiredTigerException
- {
- cursor.putKeyString("foo");
- cursor.putValueString("newbar");
-
- return (cursor.update());
- }
- /*! [cursor update] */
-
- /*! [cursor remove] */
- public static int
- cursor_remove(Cursor cursor)
- throws WiredTigerException
- {
- cursor.putKeyString("foo");
- return (cursor.remove());
- }
- /*! [cursor remove] */
-
- /*! [cursor modify] */
- public static int
- cursor_modify(Cursor cursor)
- throws WiredTigerException
- {
- byte orig[] = new byte[4];
- for (int i = 0; i < 4; i++)
- orig[i] = (byte)i;
- cursor.putKeyString("key");
- cursor.putValueByteArray(orig);
- cursor.insert(); // 0x0 0x1 0x2 0x3
-
- byte b10[] = new byte[4];
- for (int i = 0; i < 4; i++)
- b10[i] = (byte)(0x10 + i);
- byte b20[] = new byte[4];
- for (int i = 0; i < 4; i++)
- b20[i] = (byte)(0x20 + i);
-
- Modify modlist[] = new Modify[2];
- // The following Modify replaces one byte at position one by:
- // (0x10 0x11 0x12 0x13), leaving:
- // 0x0 0x10 0x11 0x12 0x13 0x2 0x3
- modlist[0] = new Modify(b10, 1, 1);
-
- // The following Modify replaces one byte at position three by:
- // (0x20 0x21 0x22 0x23), leaving:
- // 0x0 0x10 0x11 0x20 0x21 0x22 0x23 0x13 0x2 0x3
- modlist[1] = new Modify(b20, 3, 1);
-
- cursor.putKeyString("key");
- return (cursor.modify(modlist));
- }
- /*! [cursor modify] */
-
- public static int
- cursorExample()
- throws WiredTigerException
- {
- Connection conn;
- Cursor cursor;
- Session session;
- int ret;
-
- /*
- * Create a clean test directory for this run of the test program if the
- * environment variable isn't already set (as is done by make check).
- */
- if (System.getenv("WIREDTIGER_HOME") == null) {
- home = "WT_HOME";
- try {
- Process proc = Runtime.getRuntime().exec("/bin/rm -rf WT_HOME");
- BufferedReader br = new BufferedReader(
- new InputStreamReader(proc.getInputStream()));
- while(br.ready())
- System.out.println(br.readLine());
- br.close();
- proc.waitFor();
- new File("WT_HOME").mkdir();
- } catch (Exception ex) {
- System.err.println("Exception: " + ex);
- return (1);
- }
- } else
- home = null;
-
- conn = wiredtiger.open(home, "create,statistics=(fast)");
- session = conn.open_session(null);
-
- ret = session.create("table:world",
- "key_format=r,value_format=5sii," +
- "columns=(id,country,population,area)");
-
- /*! [open cursor #1] */
- cursor = session.open_cursor("table:world", null, null);
- /*! [open cursor #1] */
-
- /*! [open cursor #2] */
- cursor = session.open_cursor("table:world(country,population)", null, null);
- /*! [open cursor #2] */
-
- /*! [open cursor #3] */
- cursor = session.open_cursor("statistics:", null, null);
- /*! [open cursor #3] */
-
- /* Create a simple string table to illustrate basic operations. */
- ret = session.create("table:map", "key_format=S,value_format=S");
- cursor = session.open_cursor("table:map", null, null);
- ret = cursor_insert(cursor);
- ret = cursor_reset(cursor);
- ret = cursor_forward_scan(cursor);
- ret = cursor_reset(cursor);
- ret = cursor_reverse_scan(cursor);
- ret = cursor_search_near(cursor);
- ret = cursor_update(cursor);
- ret = cursor_remove(cursor);
- ret = cursor.close();
-
- /* Create a table with a raw value to illustrate certain operations. */
- ret = session.create("table:raw", "key_format=S,value_format=u");
- cursor = session.open_cursor("table:raw", null, null);
- ret = cursor_modify(cursor);
- ret = cursor.close();
-
- /* Note: closing the connection implicitly closes open session(s). */
- if ((ret = conn.close(null)) != 0)
- System.err.println("Error connecting to " + home + ": " +
- wiredtiger.wiredtiger_strerror(ret));
-
- return (ret);
- }
-
- public static void
- main(String[] argv)
- {
- try {
- System.exit(cursorExample());
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_log.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_log.java
deleted file mode 100644
index 34c1790069c..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_log.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_log.java
- * demonstrates how to logging and log cursors.
- */
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.util.*;
-
-class Lsn {
- int file;
- int offset;
-}
-
-public class ex_log {
-
- public static String home1 = "WT_HOME_LOG_1";
- public static String home2 = "WT_HOME_LOG_2";
- public static String uri = "table:logtest";
-
- public static final String CONN_CONFIG =
- "create,cache_size=100MB,log=(archive=false,enabled=true)";
- public static final int MAX_KEYS = 10;
-
- static Session
- setup_copy()
- throws WiredTigerException
- {
- int ret = 0;
- Connection conn;
-
- conn = wiredtiger.open(home2, CONN_CONFIG);
- Session session = conn.open_session(null);
- session.create(uri, "key_format=S,value_format=S");
- return (session);
- }
-
- static int
- compare_tables(Session session, Session sess_copy)
- throws WiredTigerException
- {
- int ret;
-
- Cursor cursor = session.open_cursor(uri, null, null);
- Cursor curs_copy = sess_copy.open_cursor(uri, null, null);
-
- while ((ret = cursor.next()) == 0) {
- ret = curs_copy.next();
- String key = cursor.getKeyString();
- String value = cursor.getValueString();
- String key_copy = curs_copy.getKeyString();
- String value_copy = curs_copy.getValueString();
- if (!key.equals(key_copy) ||
- !value.equals(value_copy)) {
- System.err.println(
- "Mismatched: key " + key + ", key_copy " + key_copy +
- ", value " + value + ", value_copy " + value_copy);
- ret = cursor.close();
- ret = curs_copy.close();
- return (1);
- }
- }
- if (ret != wiredtiger.WT_NOTFOUND)
- System.err.println("WT_CURSOR.next: " +
- wiredtiger.wiredtiger_strerror(ret));
- ret = cursor.close();
-
- ret = curs_copy.next();
- if (ret != wiredtiger.WT_NOTFOUND)
- System.err.println("WT_CURSOR.next: " +
- wiredtiger.wiredtiger_strerror(ret));
- ret = curs_copy.close();
-
- return (ret);
- }
-
- /*! [log cursor walk] */
- static void
- print_record(Lsn lsn, int opcount,
- int rectype, int optype, long txnid, int fileid,
- byte[] key, byte[] value)
- {
- System.out.print(
- "LSN [" + lsn.file + "][" + lsn.offset + "]." + opcount +
- ": record type " + rectype + " optype " + optype +
- " txnid " + txnid + " fileid " + fileid);
- System.out.println(" key size " + key.length +
- " value size " + value.length);
- if (rectype == wiredtiger.WT_LOGREC_MESSAGE)
- System.out.println("Application Record: " + new String(value));
- }
-
- /*
- * simple_walk_log --
- * A simple walk of the log.
- */
- static int
- simple_walk_log(Session session, int count_min)
- throws WiredTigerException
- {
- Cursor cursor;
- Lsn lsn = new Lsn();
- byte[] logrec_key, logrec_value;
- long txnid;
- int fileid, opcount, optype, rectype;
- int count, ret;
-
- /*! [log cursor open] */
- cursor = session.open_cursor("log:", null, null);
- /*! [log cursor open] */
-
- count = 0;
- while ((ret = cursor.next()) == 0) {
- count++;
- /*! [log cursor get_key] */
- lsn.file = cursor.getKeyInt();
- lsn.offset = cursor.getKeyInt();
- opcount = cursor.getKeyInt();
- /*! [log cursor get_key] */
- /*! [log cursor get_value] */
- txnid = cursor.getValueLong();
- rectype = cursor.getValueInt();
- optype = cursor.getValueInt();
- fileid = cursor.getValueInt();
- logrec_key = cursor.getValueByteArray();
- logrec_value = cursor.getValueByteArray();
- /*! [log cursor get_value] */
-
- print_record(lsn, opcount,
- rectype, optype, txnid, fileid, logrec_key, logrec_value);
- }
- if (ret == wiredtiger.WT_NOTFOUND)
- ret = 0;
- ret = cursor.close();
- if (count < count_min) {
- System.err.println("Expected minimum " + count_min +
- " records, found " + count);
- return (1);
- }
- return (ret);
- }
- /*! [log cursor walk] */
-
- static int
- walk_log(Session session)
- throws WiredTigerException
- {
- Connection wt_conn2;
- Cursor cursor, cursor2;
- Lsn lsn, lsnsave;
- byte[] logrec_key, logrec_value;
- Session session2;
- long txnid;
- int fileid, opcount, optype, rectype;
- int i, ret;
- boolean in_txn, first;
-
- session2 = setup_copy();
- wt_conn2 = session2.getConnection();
- cursor = session.open_cursor("log:", null, null);
- cursor2 = session2.open_cursor(uri, null, "raw=true");
- i = 0;
- in_txn = false;
- txnid = 0;
- lsn = new Lsn();
- lsnsave = new Lsn();
- while ((ret = cursor.next()) == 0) {
- lsn.file = cursor.getKeyInt();
- lsn.offset = cursor.getKeyInt();
- opcount = cursor.getKeyInt();
-
- /*
- * Save one of the LSNs we get back to search for it
- * later. Pick a later one because we want to walk from
- * that LSN to the end (where the multi-step transaction
- * was performed). Just choose the record that is MAX_KEYS.
- */
- if (++i == MAX_KEYS) {
- lsnsave.file = lsn.file;
- lsnsave.offset = lsn.offset;
- }
- txnid = cursor.getValueLong();
- rectype = cursor.getValueInt();
- optype = cursor.getValueInt();
- fileid = cursor.getValueInt();
- logrec_key = cursor.getValueByteArray();
- logrec_value = cursor.getValueByteArray();
-
- print_record(lsn, opcount,
- rectype, optype, txnid, fileid, logrec_key, logrec_value);
-
- /*
- * If we are in a transaction and this is a new one, end
- * the previous one.
- */
- if (in_txn && opcount == 0) {
- ret = session2.commit_transaction(null);
- in_txn = false;
- }
-
- /*
- * If the operation is a put, replay it here on the backup
- * connection. Note, we cheat by looking at the fileid.
- * The metadata is fileid 0, skip its records.
- */
- if (fileid != 0 && rectype == wiredtiger.WT_LOGREC_COMMIT &&
- optype == wiredtiger.WT_LOGOP_ROW_PUT) {
- if (!in_txn) {
- ret = session2.begin_transaction(null);
- in_txn = true;
- }
- cursor2.putKeyByteArray(logrec_key);
- cursor2.putValueByteArray(logrec_value);
- ret = cursor2.insert();
- }
- }
- if (in_txn)
- ret = session2.commit_transaction(null);
-
- ret = cursor2.close();
- /*
- * Compare the tables after replay. They should be identical.
- */
- if (compare_tables(session, session2) != 0) {
- cursor.close();
- session2.close(null);
- wt_conn2.close(null);
- return (ret);
- }
- ret = session2.close(null);
- ret = wt_conn2.close(null);
-
- ret = cursor.reset();
- /*! [log cursor set_key] */
- cursor.putKeyInt(lsnsave.file);
- cursor.putKeyInt(lsnsave.offset);
- cursor.putKeyInt(0);
- /*! [log cursor set_key] */
- /*! [log cursor search] */
- ret = cursor.search();
- /*! [log cursor search] */
- System.out.println("Reset to saved...");
- /*
- * Walk all records starting with this key.
- */
- first = true;
- while (ret == 0) {
- lsn.file = cursor.getKeyInt();
- lsn.offset = cursor.getKeyInt();
- opcount = cursor.getKeyInt();
- if (first) {
- first = false;
- if (lsnsave.file != lsn.file ||
- lsnsave.offset != lsn.offset) {
- System.err.println("search returned the wrong LSN");
- System.exit(1);
- }
- }
- txnid = cursor.getValueLong();
- rectype = cursor.getValueInt();
- optype = cursor.getValueInt();
- fileid = cursor.getValueInt();
- logrec_key = cursor.getValueByteArray();
- logrec_value = cursor.getValueByteArray();
-
- print_record(lsn, opcount, rectype, optype, txnid,
- fileid, logrec_key, logrec_value);
-
- ret = cursor.next();
- if (ret != 0)
- break;
- }
- ret = cursor.close();
- return (ret);
- }
-
- public static int
- logExample()
- throws WiredTigerException
- {
- Connection wt_conn;
- Cursor cursor;
- Session session;
- int count_min, i, record_count, ret;
-
- count_min = 0;
- try {
- String command = "/bin/rm -rf " + home1 + " " + home2;
- Process proc = Runtime.getRuntime().exec(command);
- BufferedReader br = new BufferedReader(
- new InputStreamReader(proc.getInputStream()));
- while(br.ready())
- System.out.println(br.readLine());
- br.close();
- proc.waitFor();
- new File(home1).mkdir();
- new File(home2).mkdir();
- } catch (Exception ex) {
- System.err.println("Exception: " + ex);
- return (1);
- }
- if ((wt_conn = wiredtiger.open(home1, CONN_CONFIG)) == null) {
- System.err.println("Error connecting to " + home1);
- return (1);
- }
-
- session = wt_conn.open_session(null);
- ret = session.create(uri, "key_format=S,value_format=S");
- count_min++;
-
- cursor = session.open_cursor(uri, null, null);
- /*
- * Perform some operations with individual auto-commit transactions.
- */
- for (record_count = 0, i = 0; i < MAX_KEYS; i++, record_count++) {
- String k = "key" + i;
- String v = "value" + i;
- cursor.putKeyString(k);
- cursor.putValueString(v);
- ret = cursor.insert();
- count_min++;
- }
- ret = session.begin_transaction(null);
- /*
- * Perform some operations within a single transaction.
- */
- for (i = MAX_KEYS; i < MAX_KEYS+5; i++, record_count++) {
- String k = "key" + i;
- String v = "value" + i;
- cursor.putKeyString(k);
- cursor.putValueString(v);
- ret = cursor.insert();
- }
- ret = session.commit_transaction(null);
- count_min++;
- ret = cursor.close();
-
- /*! [log cursor printf] */
- ret = session.log_printf("Wrote " + record_count + " records");
- count_min++;
- /*! [log cursor printf] */
-
- session.close(null);
- /*
- * Close and reopen the connection so that the log ends up with
- * a variety of records such as file sync and checkpoint. We
- * have archiving turned off.
- */
- ret = wt_conn.close(null);
- if ((wt_conn = wiredtiger.open(home1, CONN_CONFIG)) == null) {
- System.err.println("Error connecting to " + home1);
- return (ret);
- }
-
- session = wt_conn.open_session(null);
- ret = simple_walk_log(session, count_min);
- ret = walk_log(session);
- ret = session.close(null);
- ret = wt_conn.close(null);
- return (ret);
- }
-
- public static void
- main(String[] args)
- {
- try {
- System.exit(logExample());
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_schema.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_schema.java
deleted file mode 100644
index c3d7364d410..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_schema.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_schema.java
- * This is an example application demonstrating how to create and access
- * tables using a schema.
- */
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.util.*;
-
-public class ex_schema {
-
- public static String home;
-
- /*! [schema declaration] */
- /* The class for the data we are storing in a WiredTiger table. */
- static class PopRecord {
- public String country; // Stored in database as fixed size char[5];
- public short year;
- public long population;
- public PopRecord(String country, short year, long population) {
- this.country = country;
- this.year = year;
- this.population = population;
- }
- }
-
- static List<PopRecord> popData;
-
- static {
- popData = new ArrayList<PopRecord>();
-
- popData.add(new PopRecord("AU", (short)1900, 4000000 ));
- popData.add(new PopRecord("AU", (short)1950, 8267337 ));
- popData.add(new PopRecord("AU", (short)2000, 19053186 ));
- popData.add(new PopRecord("CAN", (short)1900, 5500000 ));
- popData.add(new PopRecord("CAN", (short)1950, 14011422 ));
- popData.add(new PopRecord("CAN", (short)2000, 31099561 ));
- popData.add(new PopRecord("UK", (short)1900, 369000000 ));
- popData.add(new PopRecord("UK", (short)1950, 50127000 ));
- popData.add(new PopRecord("UK", (short)2000, 59522468 ));
- popData.add(new PopRecord("USA", (short)1900, 76212168 ));
- popData.add(new PopRecord("USA", (short)1950, 150697361 ));
- popData.add(new PopRecord("USA", (short)2000, 301279593 ));
- };
- /*! [schema declaration] */
-
- public static int
- schemaExample()
- throws WiredTigerException
- {
- Connection conn;
- Cursor country_cursor, country_cursor2, cursor, join_cursor,
- stat_cursor, subjoin_cursor, year_cursor;
- Session session;
- String country;
- long recno, population;
- short year;
- int ret;
-
- /*
- * Create a clean test directory for this run of the test program if the
- * environment variable isn't already set (as is done by make check).
- */
- if (System.getenv("WIREDTIGER_HOME") == null) {
- home = "WT_HOME";
- try {
- Process proc = Runtime.getRuntime().exec("/bin/rm -rf WT_HOME");
- BufferedReader br = new BufferedReader(
- new InputStreamReader(proc.getInputStream()));
- while(br.ready())
- System.out.println(br.readLine());
- br.close();
- proc.waitFor();
- new File("WT_HOME").mkdir();
- } catch (Exception ex) {
- System.err.println("Exception: " + ex);
- return (1);
- }
- } else
- home = null;
-
- try {
- conn = wiredtiger.open(home, "create,statistics=(fast)");
- session = conn.open_session(null);
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- return(1);
- }
-
- /*! [Create a table with column groups] */
- /*
- * Create the population table.
- * Keys are record numbers, the format for values is (5-byte string,
- * long, long).
- * See ::wiredtiger_struct_pack for details of the format strings.
- */
- ret = session.create("table:poptable",
- "key_format=r,value_format=5sHQ," +
- "columns=(id,country,year,population),colgroups=(main,population)");
-
- /*
- * Create two column groups: a primary column group with the country
- * code, year and population (named "main"), and a population column
- * group with the population by itself (named "population").
- */
- ret = session.create("colgroup:poptable:main",
- "columns=(country,year,population)");
- ret = session.create("colgroup:poptable:population",
- "columns=(population)");
- /*! [Create a table with column groups] */
-
- /*! [Create an index] */
- /* Create an index with a simple key. */
- ret = session.create("index:poptable:country",
- "columns=(country)");
- /*! [Create an index] */
-
- /*! [Create an immutable index] */
- /* Create an index with a simple key. */
- ret = session.create("index:poptable:immutable_year",
- "columns=(year),immutable");
- /*! [Create an immutable index] */
-
- /*! [Create an index with a composite key] */
- /* Create an index with a composite key (country,year). */
- ret = session.create("index:poptable:country_plus_year",
- "columns=(country,year)");
- /*! [Create an index with a composite key] */
-
- /*! [Insert and list records] */
- /* Insert the records into the table. */
- cursor = session.open_cursor("table:poptable", null, "append");
- for (PopRecord p : popData) {
- cursor.putValueString(p.country);
- cursor.putValueShort(p.year);
- cursor.putValueLong(p.population);
- ret = cursor.insert();
- }
- ret = cursor.close();
-
- /* Update records in the table. */
- cursor = session.open_cursor("table:poptable", null, null);
- while ((ret = cursor.next()) == 0) {
- recno = cursor.getKeyRecord();
- country = cursor.getValueString();
- year = cursor.getValueShort();
- population = cursor.getValueLong();
- cursor.putValueString(country);
- cursor.putValueShort(year);
- cursor.putValueLong(population + 1);
- }
- ret = cursor.close();
-
- /* List the records in the table. */
- cursor = session.open_cursor("table:poptable", null, null);
- while ((ret = cursor.next()) == 0) {
- recno = cursor.getKeyRecord();
- country = cursor.getValueString();
- year = cursor.getValueShort();
- population = cursor.getValueLong();
- System.out.print("ID " + recno);
- System.out.println(": country " + country + ", year " + year +
- ", population " + population);
- }
- ret = cursor.close();
- /*! [Insert and list records] */
-
- /*! [List the records in the table using raw mode.] */
- cursor = session.open_cursor("table:poptable", null, "raw");
- while ((ret = cursor.next()) == 0) {
- byte[] key, value;
-
- key = cursor.getKeyByteArray();
- System.out.println(Arrays.toString(key));
- value = cursor.getValueByteArray();
- System.out.println("raw key: " + Arrays.toString(key) +
- ", raw value: " + Arrays.toString(value));
- }
- /*! [List the records in the table using raw mode.] */
-
- /*! [Read population from the primary column group] */
- /*
- * Open a cursor on the main column group, and return the information
- * for a particular country.
- */
- cursor = session.open_cursor("colgroup:poptable:main", null, null);
- cursor.putKeyRecord(2);
- if ((ret = cursor.search()) == 0) {
- country = cursor.getValueString();
- year = cursor.getValueShort();
- population = cursor.getValueLong();
- System.out.println("ID 2: country " + country +
- ", year " + year + ", population " + population);
- }
- /*! [Read population from the primary column group] */
- ret = cursor.close();
-
- /*! [Read population from the standalone column group] */
- /*
- * Open a cursor on the population column group, and return the
- * population of a particular country.
- */
- cursor = session.open_cursor("colgroup:poptable:population", null, null);
- cursor.putKeyRecord(2);
- if ((ret = cursor.search()) == 0) {
- population = cursor.getValueLong();
- System.out.println("ID 2: population " + population);
- }
- /*! [Read population from the standalone column group] */
- ret = cursor.close();
-
- /*! [Search in a simple index] */
- /* Search in a simple index. */
- cursor = session.open_cursor("index:poptable:country", null, null);
- cursor.putKeyString("AU");
- ret = cursor.search();
- country = cursor.getValueString();
- year = cursor.getValueShort();
- population = cursor.getValueLong();
- System.out.println("AU: country " + country + ", year " + year +
- ", population " + population);
- /*! [Search in a simple index] */
- ret = cursor.close();
-
- /*! [Search in a composite index] */
- /* Search in a composite index. */
- cursor = session.open_cursor(
- "index:poptable:country_plus_year", null, null);
- cursor.putKeyString("USA");
- cursor.putKeyShort((short)1900);
- ret = cursor.search();
- country = cursor.getValueString();
- year = cursor.getValueShort();
- population = cursor.getValueLong();
- System.out.println("US 1900: country " + country +
- ", year " + year + ", population " + population);
- /*! [Search in a composite index] */
- ret = cursor.close();
-
- /*! [Return a subset of values from the table] */
- /*
- * Use a projection to return just the table's country and year
- * columns.
- */
- cursor = session.open_cursor("table:poptable(country,year)", null, null);
- while ((ret = cursor.next()) == 0) {
- country = cursor.getValueString();
- year = cursor.getValueShort();
- System.out.println("country " + country + ", year " + year);
- }
- /*! [Return a subset of values from the table] */
- ret = cursor.close();
-
- /*! [Return a subset of values from the table using raw mode] */
- /*
- * Use a projection to return just the table's country and year
- * columns.
- */
- cursor = session.open_cursor("table:poptable(country,year)", null, null);
- while ((ret = cursor.next()) == 0) {
- country = cursor.getValueString();
- year = cursor.getValueShort();
- System.out.println("country " + country + ", year " + year);
- }
- /*! [Return a subset of values from the table using raw mode] */
- ret = cursor.close();
-
- /*! [Return the table's record number key using an index] */
- /*
- * Use a projection to return just the table's record number key
- * from an index.
- */
- cursor = session.open_cursor("index:poptable:country_plus_year(id)", null, null);
- while ((ret = cursor.next()) == 0) {
- country = cursor.getKeyString();
- year = cursor.getKeyShort();
- recno = cursor.getValueRecord();
- System.out.println("row ID " + recno + ": country " + country +
- ", year " + year);
- }
- /*! [Return the table's record number key using an index] */
- ret = cursor.close();
-
- /*! [Return a subset of the value columns from an index] */
- /*
- * Use a projection to return just the population column from an
- * index.
- */
- cursor = session.open_cursor(
- "index:poptable:country_plus_year(population)", null, null);
- while ((ret = cursor.next()) == 0) {
- country = cursor.getKeyString();
- year = cursor.getKeyShort();
- population = cursor.getValueLong();
- System.out.println("population " + population +
- ": country " + country + ", year " + year);
- }
- /*! [Return a subset of the value columns from an index] */
- ret = cursor.close();
-
- /*! [Access only the index] */
- /*
- * Use a projection to avoid accessing any other column groups when
- * using an index: supply an empty list of value columns.
- */
- cursor = session.open_cursor(
- "index:poptable:country_plus_year()", null, null);
- while ((ret = cursor.next()) == 0) {
- country = cursor.getKeyString();
- year = cursor.getKeyShort();
- System.out.println("country " + country + ", year " + year);
- }
- /*! [Access only the index] */
- ret = cursor.close();
-
- /*! [Join cursors] */
- /* Open cursors needed by the join. */
- join_cursor = session.open_cursor(
- "join:table:poptable", null, null);
- country_cursor = session.open_cursor(
- "index:poptable:country", null, null);
- year_cursor = session.open_cursor(
- "index:poptable:immutable_year", null, null);
-
- /* select values WHERE country == "AU" AND year > 1900 */
- country_cursor.putKeyString("AU");
- ret = country_cursor.search();
- session.join(join_cursor, country_cursor, "compare=eq,count=10");
- year_cursor.putKeyShort((short)1900);
- ret = year_cursor.search();
- session.join(join_cursor, year_cursor,
- "compare=gt,count=10,strategy=bloom");
-
- /* List the values that are joined */
- while ((ret = join_cursor.next()) == 0) {
- recno = join_cursor.getKeyRecord();
- country = join_cursor.getValueString();
- year = join_cursor.getValueShort();
- population = join_cursor.getValueLong();
- System.out.print("ID " + recno);
- System.out.println( ": country " + country + ", year " + year +
- ", population " + population);
- }
- /*! [Join cursors] */
-
- /*! [Statistics cursor join cursor] */
- stat_cursor = session.open_cursor(
- "statistics:join", join_cursor, null);
- /*! [Statistics cursor join cursor] */
-
- ret = stat_cursor.close();
- ret = join_cursor.close();
- ret = year_cursor.close();
- ret = country_cursor.close();
-
- /*! [Complex join cursors] */
- /* Open cursors needed by the join. */
- join_cursor = session.open_cursor(
- "join:table:poptable", null, null);
- subjoin_cursor = session.open_cursor(
- "join:table:poptable", null, null);
- country_cursor = session.open_cursor(
- "index:poptable:country", null, null);
- country_cursor2 = session.open_cursor(
- "index:poptable:country", null, null);
- year_cursor = session.open_cursor(
- "index:poptable:immutable_year", null, null);
-
- /*
- * select values WHERE (country == "AU" OR country == "UK")
- * AND year > 1900
- *
- * First, set up the join representing the country clause.
- */
- country_cursor.putKeyString("AU");
- ret = country_cursor.search();
- ret = session.join(subjoin_cursor, country_cursor,
- "operation=or,compare=eq,count=10");
- country_cursor2.putKeyString("UK");
- ret = country_cursor2.search();
- ret = session.join(subjoin_cursor, country_cursor2,
- "operation=or,compare=eq,count=10");
-
- /* Join that to the top join, and add the year clause */
- ret = session.join(join_cursor, subjoin_cursor, null);
- year_cursor.putKeyShort((short)1900);
- ret = year_cursor.search();
- ret = session.join(join_cursor, year_cursor,
- "compare=gt,count=10,strategy=bloom");
-
- /* List the values that are joined */
- while ((ret = join_cursor.next()) == 0) {
- recno = join_cursor.getKeyRecord();
- country = join_cursor.getValueString();
- year = join_cursor.getValueShort();
- population = join_cursor.getValueLong();
- System.out.print("ID " + recno);
- System.out.println( ": country " + country + ", year " + year +
- ", population " + population);
- }
- /*! [Complex join cursors] */
-
- ret = join_cursor.close();
- ret = subjoin_cursor.close();
- ret = year_cursor.close();
- ret = country_cursor.close();
- ret = country_cursor2.close();
-
- ret = conn.close(null);
-
- return (ret);
- }
-
- public static void
- main(String[] argv)
- {
- try {
- System.exit(schemaExample());
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_stat.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_stat.java
deleted file mode 100644
index 006c93a10d5..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_stat.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_stat.java
- * This is an example demonstrating how to query database statistics.
- */
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.util.*;
-
-public class ex_stat {
-
- public static String home;
-
- /*! [statistics display function] */
- int
- print_cursor(Cursor cursor)
- throws WiredTigerException
- {
- String desc, pvalue;
- long value;
- int ret;
-
- while ((ret = cursor.next()) == 0) {
- desc = cursor.getValueString();
- pvalue = cursor.getValueString();
- value = cursor.getValueLong();
- if (value != 0)
- System.out.println(desc + "=" + pvalue);
- }
-
- return (ret == wiredtiger.WT_NOTFOUND ? 0 : ret);
- }
- /*! [statistics display function] */
-
- int
- print_database_stats(Session session)
- throws WiredTigerException
- {
- Cursor cursor;
- int ret;
-
- /*! [statistics database function] */
- cursor = session.open_cursor("statistics:", null, null);
-
- ret = print_cursor(cursor);
- ret = cursor.close();
- /*! [statistics database function] */
-
- return (ret);
- }
-
- int
- print_file_stats(Session session)
- throws WiredTigerException
- {
- Cursor cursor;
- int ret;
-
- /*! [statistics table function] */
- cursor = session.open_cursor("statistics:table:access", null, null);
- ret = print_cursor(cursor);
- ret = cursor.close();
- /*! [statistics table function] */
-
- return (ret);
- }
-
- int
- print_join_cursor_stats(Session session)
- throws WiredTigerException
- {
- Cursor idx_cursor, join_cursor, stat_cursor;
- int ret;
-
- ret = session.create("index:access:idx", "columns=(v)");
- idx_cursor = session.open_cursor("index:access:idx", null, null);
- ret = idx_cursor.next();
- join_cursor = session.open_cursor("join:table:access", null, null);
- ret = session.join(join_cursor, idx_cursor, "compare=gt");
- ret = join_cursor.next();
-
- /*! [statistics join cursor function] */
- stat_cursor = session.open_cursor("statistics:join", join_cursor, null);
-
- ret = print_cursor(stat_cursor);
- ret = stat_cursor.close();
- /*! [statistics join cursor function] */
-
- ret = join_cursor.close();
- ret = idx_cursor.close();
-
- return (ret);
- }
-
- int
- print_session_stats(Session session)
- throws WiredTigerException
- {
- Cursor cursor;
- int ret;
-
- /*! [statistics session function] */
- cursor = session.open_cursor("statistics:session", null, null);
- ret = print_cursor(cursor);
- ret = cursor.close();
- /*! [statistics session function] */
-
- return (ret);
- }
-
- int
- print_overflow_pages(Session session)
- throws WiredTigerException
- {
- /*! [statistics retrieve by key] */
- Cursor cursor;
- String desc, pvalue;
- long value;
- int ret;
-
- cursor = session.open_cursor("statistics:table:access", null, null);
-
- cursor.putKeyInt(wiredtiger.WT_STAT_DSRC_BTREE_OVERFLOW);
- ret = cursor.search();
- desc = cursor.getValueString();
- pvalue = cursor.getValueString();
- value = cursor.getValueLong();
- System.out.println(desc + "=" + pvalue);
-
- ret = cursor.close();
- /*! [statistics retrieve by key] */
-
- return (ret);
- }
-
- /*! [statistics calculation helper function] */
- long
- get_stat(Cursor cursor, int stat_field)
- throws WiredTigerException
- {
- long value;
- int ret;
-
- cursor.putKeyInt(stat_field);
- if ((ret = cursor.search()) != 0) {
- System.err.println("stat_field: " + stat_field + " not found");
- value = 0;
- }
- else {
- String desc = cursor.getValueString();
- String pvalue = cursor.getValueString();
- value = cursor.getValueLong();
- }
- return (value);
- }
- /*! [statistics calculation helper function] */
-
- int
- print_derived_stats(Session session)
- throws WiredTigerException
- {
- Cursor cursor;
- int ret;
-
- /*! [statistics calculate open table stats] */
- cursor = session.open_cursor("statistics:table:access", null, null);
- /*! [statistics calculate open table stats] */
-
- {
- /*! [statistics calculate table fragmentation] */
- long ckpt_size = get_stat(cursor,
- wiredtiger.WT_STAT_DSRC_BLOCK_CHECKPOINT_SIZE);
- long file_size = get_stat(cursor,
- wiredtiger.WT_STAT_DSRC_BLOCK_SIZE);
-
- System.out.println("File is " +
- (int)(100 * (file_size - ckpt_size) / file_size) +
- "% fragmented\n");
- /*! [statistics calculate table fragmentation] */
- }
-
- {
- /*! [statistics calculate write amplification] */
- long app_insert = get_stat(cursor,
- wiredtiger.WT_STAT_DSRC_CURSOR_INSERT_BYTES);
- long app_remove = get_stat(cursor,
- wiredtiger.WT_STAT_DSRC_CURSOR_REMOVE_BYTES);
- long app_update = get_stat(cursor,
- wiredtiger.WT_STAT_DSRC_CURSOR_UPDATE_BYTES);
-
- long fs_writes = get_stat(cursor,
- wiredtiger.WT_STAT_DSRC_CACHE_BYTES_WRITE);
-
- if (app_insert + app_remove + app_update != 0)
- System.out.println("Write amplification is " +
- (double)fs_writes / (app_insert + app_remove + app_update));
- /*! [statistics calculate write amplification] */
- }
-
- ret = cursor.close();
-
- return (ret);
- }
-
- public int
- statExample()
- throws WiredTigerException
- {
- Connection conn;
- Cursor cursor;
- Session session;
- int ret;
-
- /*
- * Create a clean test directory for this run of the test program if the
- * environment variable isn't already set (as is done by make check).
- */
- if (System.getenv("WIREDTIGER_HOME") == null) {
- home = "WT_HOME";
- try {
- Process proc = Runtime.getRuntime().exec("/bin/rm -rf " + home);
- BufferedReader br = new BufferedReader(
- new InputStreamReader(proc.getInputStream()));
- while(br.ready())
- System.out.println(br.readLine());
- br.close();
- proc.waitFor();
- if (!(new File(home)).mkdir())
- System.err.println("mkdir: failed");
- } catch (Exception ex) {
- System.err.println("Exception: " + home + ": " + ex);
- System.exit(1);
- }
- } else
- home = null;
-
- conn = wiredtiger.open(home, "create,statistics=(all)");
- session = conn.open_session(null);
-
- ret = session.create("table:access",
- "key_format=S,value_format=S,columns=(k,v)");
-
- cursor = session.open_cursor("table:access", null, null);
- cursor.putKeyString("key");
- cursor.putValueString("value");
- ret = cursor.insert();
- ret = cursor.close();
-
- ret = session.checkpoint(null);
-
- ret = print_database_stats(session);
-
- ret = print_file_stats(session);
-
- ret = print_join_cursor_stats(session);
-
- ret = print_session_stats(session);
-
- ret = print_overflow_pages(session);
-
- ret = print_derived_stats(session);
-
- return (conn.close(null) == 0 ? ret : -1);
- }
-
- public static void
- main(String[] argv)
- {
- try {
- System.exit((new ex_stat()).statExample());
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_thread.java b/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_thread.java
deleted file mode 100644
index 5e64e46007f..00000000000
--- a/src/third_party/wiredtiger/examples/java/com/wiredtiger/examples/ex_thread.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ex_thread.java
- * This is an example demonstrating how to create and access a simple
- * table from multiple threads.
- */
-
-package com.wiredtiger.examples;
-import com.wiredtiger.db.*;
-import java.io.*;
-import java.util.*;
-
-/*! [thread scan] */
-class ScanThread extends Thread {
- private Connection conn;
-
- public ScanThread(Connection conn) {
- this.conn = conn;
- }
-
- public void run()
- {
- try {
- int ret;
-
- Session session = conn.open_session(null);
- Cursor cursor = session.open_cursor("table:access", null, null);
-
- /* Show all records. */
- while ((ret = cursor.next()) == 0) {
- String key = cursor.getKeyString();
- String value = cursor.getValueString();
- System.out.println("Got record: " + key + " : " + value);
- }
- if (ret != wiredtiger.WT_NOTFOUND)
- System.err.println("Cursor.next: " +
- wiredtiger.wiredtiger_strerror(ret));
- cursor.close();
- session.close(null);
- } catch (WiredTigerException wte) {
- System.err.println("Exception " + wte);
- }
- }
-}
-/*! [thread scan] */
-
-public class ex_thread {
-
- public static String home;
-
- public static final int NUM_THREADS = 10;
-
- /*! [thread main] */
- public static void main(String[] argv)
- {
- try {
- Thread[] threads = new Thread[NUM_THREADS];
- int i, ret;
- Connection conn;
-
- /*
- * Create a clean test directory for this run of the test program if the
- * environment variable isn't already set (as is done by make check).
- */
- if (System.getenv("WIREDTIGER_HOME") == null) {
- home = "WT_HOME";
- try {
- Process proc = Runtime.getRuntime().exec("/bin/rm -rf " + home);
- BufferedReader br = new BufferedReader(
- new InputStreamReader(proc.getInputStream()));
- while(br.ready())
- System.out.println(br.readLine());
- br.close();
- proc.waitFor();
- if (!(new File(home)).mkdir())
- System.err.println("mkdir: failed");
- } catch (Exception ex) {
- System.err.println("Exception: " + home + ": " + ex);
- System.exit(1);
- }
- } else
- home = null;
-
- if ((conn = wiredtiger.open(home, "create")) == null) {
- System.err.println("Error connecting to " + home);
- System.exit(1);
- }
-
- /* Note: further error checking omitted for clarity. */
-
- Session session = conn.open_session(null);
- ret = session.create("table:access", "key_format=S,value_format=S");
- Cursor cursor = session.open_cursor("table:access", null, "overwrite");
- cursor.putKeyString("key1");
- cursor.putValueString("value1");
- ret = cursor.insert();
- cursor.close();
- ret = session.close(null);
-
- for (i = 0; i < NUM_THREADS; i++) {
- threads[i] = new ScanThread(conn);
- threads[i].start();
- }
-
- for (i = 0; i < NUM_THREADS; i++)
- try {
- threads[i].join();
- ret = -1;
- }
- catch (InterruptedException ie) {
- }
-
- ret = conn.close(null);
- System.exit(ret);
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
- /*! [thread main] */
-
-}
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 1d28cb2f834..b6a9a0ad3b6 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-4.4",
- "commit": "03178d7f9c3e1db7383268bfb346bd9cb551da1c"
+ "commit": "aecb18daca54af24f50be193b62f85d35ad5e603"
}
diff --git a/src/third_party/wiredtiger/lang/java/Makefile.am b/src/third_party/wiredtiger/lang/java/Makefile.am
deleted file mode 100644
index 221c08070e3..00000000000
--- a/src/third_party/wiredtiger/lang/java/Makefile.am
+++ /dev/null
@@ -1,94 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/include
-
-JAVADEST = src/com/wiredtiger/db
-JAVADESTFULL = $(srcdir)/$(JAVADEST)
-JAVAEXAMPLES = $(top_srcdir)/examples/java/com/wiredtiger/examples
-JAVATEST = $(top_srcdir)/test/java/com/wiredtiger/test
-BUILT_SOURCES = wiredtiger_wrap.c
-SWIG_SOURCES = wiredtiger.i
-
-JDOCDIR = $(top_srcdir)/docs/java
-# The Java documentation is currently generated by Doxygen - disable javadoc
-#java_DATA = $(JDOCDIR)/index.html
-
-javadir = $(datadir)/java/$(PACKAGE)-$(PACKAGE_VERSION)
-JAVA_SRC = \
- $(JAVADESTFULL)/Connection.java \
- $(JAVADESTFULL)/Cursor.java \
- $(JAVADESTFULL)/Modify.java \
- $(JAVADESTFULL)/SearchStatus.java \
- $(JAVADESTFULL)/PackFormatInputStream.java \
- $(JAVADESTFULL)/PackInputStream.java \
- $(JAVADESTFULL)/PackOutputStream.java \
- $(JAVADESTFULL)/PackUtil.java \
- $(JAVADESTFULL)/Session.java \
- $(JAVADESTFULL)/WiredTigerException.java \
- $(JAVADESTFULL)/WiredTigerPackingException.java \
- $(JAVADESTFULL)/WiredTigerPanicException.java \
- $(JAVADESTFULL)/WiredTigerRollbackException.java \
- $(JAVADESTFULL)/wiredtiger.java \
- $(JAVADESTFULL)/wiredtigerConstants.java \
- $(JAVADESTFULL)/wiredtigerJNI.java \
- $(JAVADESTFULL)/WT_MODIFY_LIST.java \
- $(JAVAEXAMPLES)/ex_access.java \
- $(JAVAEXAMPLES)/ex_all.java \
- $(JAVAEXAMPLES)/ex_call_center.java \
- $(JAVAEXAMPLES)/ex_cursor.java \
- $(JAVAEXAMPLES)/ex_log.java \
- $(JAVAEXAMPLES)/ex_schema.java \
- $(JAVAEXAMPLES)/ex_stat.java \
- $(JAVAEXAMPLES)/ex_thread.java
-
-JAVA_JUNIT = \
- $(JAVATEST)/AutoCloseTest.java \
- $(JAVATEST)/BackupCursorTest.java \
- $(JAVATEST)/ConfigTest.java \
- $(JAVATEST)/ConcurrentCloseTest.java \
- $(JAVATEST)/CursorTest.java \
- $(JAVATEST)/CursorTest02.java \
- $(JAVATEST)/CursorTest03.java \
- $(JAVATEST)/ExceptionTest.java \
- $(JAVATEST)/PackTest.java \
- $(JAVATEST)/PackTest02.java \
- $(JAVATEST)/PackTest03.java \
- $(JAVATEST)/WiredTigerSuite.java
-
-dist_java_JAVA = $(JAVA_SRC) @JAVA_JUNIT@
-dist_java_DATA = wiredtiger.jar
-
-EXTRA_JAVA = $(JAVA_JUNIT)
-
-java_LTLIBRARIES = libwiredtiger_java.la
-
-TESTS_JUNIT = AllJunitTests
-
-TESTS = @TESTS_JUNIT@
-
-AllJunitTests:
- echo "#! /bin/sh" > $@
- echo 'SCRIPT_DIR=`dirname $$0`' >> $@
- echo 'env LD_LIBRARY_PATH=$$SCRIPT_DIR/../../.libs:$$SCRIPT_DIR/.libs DYLD_LIBRARY_PATH=$$SCRIPT_DIR/../../.libs JAVA_LIBRARY_PATH=$$SCRIPT_DIR/.libs @JUNIT@ com.wiredtiger.test.WiredTigerSuite' >> $@
- chmod +x $@
- mkdir -p WT_HOME
-
-CPPFLAGS += $(JNI_CPPFLAGS)
-# Some warnings when compiling the generated code are unavoidable
-CFLAGS += -w
-libwiredtiger_java_la_SOURCES = $(BUILT_SOURCES) $(SWIG_SOURCES)
-#libwiredtiger_java_la_LDFLAGS = -module
-libwiredtiger_java_la_LIBADD = $(abs_top_builddir)/libwiredtiger.la
-
-all-local: wiredtiger.jar
-
-$(srcdir)/wiredtiger_wrap.c: $(top_srcdir)/src/include/wiredtiger.in $(SWIG_SOURCES)
- (cd $(srcdir) && \
- $(SWIG) -Wall -v -java -nodefaultctor -nodefaultdtor -package com.wiredtiger.db -I$(abs_top_builddir) -outdir $(JAVADEST) -o wiredtiger_wrap.c wiredtiger.i)
-
-$(JDOCDIR)/index.html: $(dist_java_JAVA)
- mkdir -p $(JDOCDIR)
- javadoc -public -d $(JDOCDIR) -link http://docs.oracle.com/javase/6/docs/api $(JAVADESTFULL)/wiredtiger.java $(JAVADESTFULL)/wiredtigerConstants.java $(JAVADESTFULL)/[A-Z]*.java
-
-wiredtiger.jar: $(dist_java_JAVA) classjava.stamp
- (cd $(top_builddir) && \
- $(JAR) -cf wiredtiger.jar com/)
- cp $(top_builddir)/wiredtiger.jar .
diff --git a/src/third_party/wiredtiger/lang/java/java_doc.i b/src/third_party/wiredtiger/lang/java/java_doc.i
deleted file mode 100644
index b932d91cd03..00000000000
--- a/src/third_party/wiredtiger/lang/java/java_doc.i
+++ /dev/null
@@ -1,67 +0,0 @@
-/* DO NOT EDIT: automatically built by dist/java_doc.py. */
-
-COPYDOC(__wt_cursor, WT_CURSOR, get_key)
-COPYDOC(__wt_cursor, WT_CURSOR, get_value)
-COPYDOC(__wt_cursor, WT_CURSOR, set_key)
-COPYDOC(__wt_cursor, WT_CURSOR, set_value)
-COPYDOC(__wt_cursor, WT_CURSOR, compare)
-COPYDOC(__wt_cursor, WT_CURSOR, equals)
-COPYDOC(__wt_cursor, WT_CURSOR, next)
-COPYDOC(__wt_cursor, WT_CURSOR, prev)
-COPYDOC(__wt_cursor, WT_CURSOR, reset)
-COPYDOC(__wt_cursor, WT_CURSOR, search)
-COPYDOC(__wt_cursor, WT_CURSOR, search_near)
-COPYDOC(__wt_cursor, WT_CURSOR, insert)
-COPYDOC(__wt_cursor, WT_CURSOR, modify)
-COPYDOC(__wt_cursor, WT_CURSOR, update)
-COPYDOC(__wt_cursor, WT_CURSOR, remove)
-COPYDOC(__wt_cursor, WT_CURSOR, reserve)
-COPYDOC(__wt_cursor, WT_CURSOR, close)
-COPYDOC(__wt_cursor, WT_CURSOR, reconfigure)
-COPYDOC(__wt_cursor, WT_CURSOR, cache)
-COPYDOC(__wt_cursor, WT_CURSOR, reopen)
-COPYDOC(__wt_session, WT_SESSION, close)
-COPYDOC(__wt_session, WT_SESSION, reconfigure)
-COPYDOC(__wt_session, WT_SESSION, open_cursor)
-COPYDOC(__wt_session, WT_SESSION, alter)
-COPYDOC(__wt_session, WT_SESSION, create)
-COPYDOC(__wt_session, WT_SESSION, compact)
-COPYDOC(__wt_session, WT_SESSION, drop)
-COPYDOC(__wt_session, WT_SESSION, join)
-COPYDOC(__wt_session, WT_SESSION, log_flush)
-COPYDOC(__wt_session, WT_SESSION, log_printf)
-COPYDOC(__wt_session, WT_SESSION, rename)
-COPYDOC(__wt_session, WT_SESSION, reset)
-COPYDOC(__wt_session, WT_SESSION, salvage)
-COPYDOC(__wt_session, WT_SESSION, truncate)
-COPYDOC(__wt_session, WT_SESSION, upgrade)
-COPYDOC(__wt_session, WT_SESSION, verify)
-COPYDOC(__wt_session, WT_SESSION, begin_transaction)
-COPYDOC(__wt_session, WT_SESSION, commit_transaction)
-COPYDOC(__wt_session, WT_SESSION, prepare_transaction)
-COPYDOC(__wt_session, WT_SESSION, rollback_transaction)
-COPYDOC(__wt_session, WT_SESSION, timestamp_transaction)
-COPYDOC(__wt_session, WT_SESSION, query_timestamp)
-COPYDOC(__wt_session, WT_SESSION, checkpoint)
-COPYDOC(__wt_session, WT_SESSION, transaction_pinned_range)
-COPYDOC(__wt_session, WT_SESSION, transaction_sync)
-COPYDOC(__wt_session, WT_SESSION, breakpoint)
-COPYDOC(__wt_connection, WT_CONNECTION, close)
-COPYDOC(__wt_connection, WT_CONNECTION, debug_info)
-COPYDOC(__wt_connection, WT_CONNECTION, reconfigure)
-COPYDOC(__wt_connection, WT_CONNECTION, configure_method)
-COPYDOC(__wt_connection, WT_CONNECTION, is_new)
-COPYDOC(__wt_connection, WT_CONNECTION, open_session)
-COPYDOC(__wt_connection, WT_CONNECTION, query_timestamp)
-COPYDOC(__wt_connection, WT_CONNECTION, set_timestamp)
-COPYDOC(__wt_connection, WT_CONNECTION, rollback_to_stable)
-COPYDOC(__wt_connection, WT_CONNECTION, load_extension)
-COPYDOC(__wt_connection, WT_CONNECTION, add_data_source)
-COPYDOC(__wt_connection, WT_CONNECTION, add_collator)
-COPYDOC(__wt_connection, WT_CONNECTION, add_compressor)
-COPYDOC(__wt_connection, WT_CONNECTION, add_encryptor)
-COPYDOC(__wt_connection, WT_CONNECTION, add_extractor)
-COPYDOC(__wt_connection, WT_CONNECTION, set_file_system)
-COPYDOC(__wt_config_parser, WT_CONFIG_PARSER, close)
-COPYDOC(__wt_config_parser, WT_CONFIG_PARSER, next)
-COPYDOC(__wt_config_parser, WT_CONFIG_PARSER, get)
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
deleted file mode 100644
index b2ea8cada90..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-import java.io.ByteArrayInputStream;
-import java.lang.StringBuffer;
-import com.wiredtiger.db.PackUtil;
-import com.wiredtiger.db.WiredTigerPackingException;
-
-/**
- * An internal helper class for consuming pack format strings.
- *
- * Applications should not need to use this class.
- */
-public class PackFormatInputStream {
-
- protected String format;
- protected boolean isRaw;
- protected int formatOff;
- protected int formatRepeatCount;
-
- /**
- * Constructor for a format stream.
- *
- * \param format the encoded format backing string.
- */
- protected PackFormatInputStream(String format, boolean isRaw) {
- this.format = format;
- this.isRaw = isRaw;
- formatOff = 0;
- formatRepeatCount = 0;
- }
-
- /**
- * Standard toString - returns the string used during construction.
- */
- public String toString() {
- return format;
- }
-
- /**
- * Returns the approximate count of elements left in the format.
- * This method does not account for repeat counts or string length
- * encodings - so should be used as a guide only.
- */
- public int available() {
- return format.length() - formatOff + formatRepeatCount;
- }
-
- /**
- * Reset the current stream position.
- */
- public void reset() {
- formatOff = 0;
- formatRepeatCount = 0;
- }
-
- /**
- * Return the decoded type for the next entry in the format stream. Does
- * not adjust the position of the stream.
- */
- protected char getType()
- throws WiredTigerPackingException {
- if (formatOff >= format.length()) {
- throw new WiredTigerPackingException(
- "No more fields in format.");
- }
-
- String fieldName;
- boolean lenOK = false;
- int countOff = 0;
-
- while (PackUtil.PackSpecialCharacters.indexOf(
- format.charAt(formatOff + countOff)) != -1) {
- countOff++;
- }
- // Skip repeat counts and sizes
- while (Character.isDigit(format.charAt(formatOff + countOff))) {
- countOff++;
- }
- return format.charAt(formatOff + countOff);
- }
-
- /**
- * Check to see if the next entry is compatible with the requested type.
- *
- * \param asking the format type to match.
- * \param consume indicates whether to update the stream position.
- */
- protected void checkType(char asking, boolean consume)
- throws WiredTigerPackingException {
-
- char expected = getType();
- if (isRaw)
- throw new WiredTigerPackingException(
- "Format mismatch for raw mode");
- if (Character.toLowerCase(expected) != Character.toLowerCase(asking))
- throw new WiredTigerPackingException(
- "Format mismatch. Wanted: " + asking + ", got: " + expected);
- if (consume) {
- consume();
- }
- }
-
- /**
- * Move the format stream position ahead one position.
- */
- protected void consume() {
- if (formatRepeatCount > 1) {
- --formatRepeatCount;
- } else if (formatRepeatCount == 1) {
- formatRepeatCount = 0;
- ++formatOff;
- } else {
- while (PackUtil.PackSpecialCharacters.indexOf(
- format.charAt(formatOff)) != -1) {
- ++formatOff;
- }
-
- // Don't need to worry about String or byte array size counts
- // since they have already been consumed.
- formatRepeatCount = getIntFromFormat(true);
- if (formatRepeatCount == 0) {
- ++formatOff;
- }
- }
- }
-
- /**
- * Decode an integer from the format string, return zero if not starting
- * on a digit.
- *
- * \param advance whether to move the stream position.
- */
- private int getIntFromFormat(boolean advance) {
- int valueLen = 0;
- int countOff;
- for (countOff = 0;
- Character.isDigit(format.charAt(formatOff + countOff));
- countOff++) {
- valueLen *= 10;
- valueLen += Character.digit(format.charAt(formatOff + countOff), 10);
- }
- if (advance) {
- formatOff += countOff;
- }
- return valueLen;
- }
-
- /**
- * Retrieve a length from the format string. Either for a repeat count
- * or a string length. Return one if no explicit repeat count.
- *
- * \param advance whether to move the stream position.
- */
- protected int getLengthFromFormat(boolean advance) {
- int valueLen = getIntFromFormat(advance);
- if (valueLen == 0) {
- valueLen = 1;
- }
- return valueLen;
- }
-
- /**
- * Return whether there is an explicit length indicated in the format
- * string.
- */
- protected boolean hasLength() {
- return (getIntFromFormat(false) > 0);
- }
-}
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java
deleted file mode 100644
index ef369b162f2..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackInputStream.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-import java.io.ByteArrayInputStream;
-import java.lang.StringBuffer;
-import com.wiredtiger.db.PackUtil;
-import com.wiredtiger.db.WiredTigerPackingException;
-
-/**
- * An internal helper class for decoding WiredTiger packed values.
- *
- * Applications should not need to use this class.
- */
-public class PackInputStream {
-
- protected PackFormatInputStream format;
- protected byte[] value;
- protected int valueOff;
- protected int valueLen;
- protected boolean isRaw;
-
- /**
- * Constructor.
- *
- * \param format A String that contains the WiredTiger format that
- * defines the layout of this packed value.
- * \param value The raw bytes that back the stream.
- */
- public PackInputStream(String format, byte[] value) {
- this(format, value, false, 0, value.length);
- }
-
- /**
- * Constructor.
- *
- * \param format A String that contains the WiredTiger format that
- * defines the layout of this packed value.
- * \param value The raw bytes that back the stream.
- * \param isRaw The stream is opened raw.
- */
- public PackInputStream(String format, byte[] value, boolean isRaw) {
- this(format, value, isRaw, 0, value.length);
- }
-
- /**
- * Constructor.
- *
- * \param format A String that contains the WiredTiger format that
- * defines the layout of this packed value.
- * \param value The raw bytes that back the stream.
- * \param isRaw The stream is opened raw.
- * \param off Offset into the value array at which the stream begins.
- * \param len Length of the value array that forms the stream.
- */
- public PackInputStream(
- String format, byte[] value, boolean isRaw, int off, int len) {
- this.format = new PackFormatInputStream(format, isRaw);
- this.value = value;
- this.valueOff = off;
- this.valueLen = len;
- this.isRaw = isRaw;
- }
-
- /**
- * Returns the raw packing format string.
- */
- public String getFormat() {
- return format.toString();
- }
-
- /**
- * Returns the raw value byte array.
- */
- public byte[] getValue() {
- return value;
- }
-
- /**
- * Retrieves a byte field from the stream.
- */
- public byte getByte()
- throws WiredTigerPackingException {
- format.checkType('b', false);
- format.consume();
- return (byte)(value[valueOff++] - 0x80);
- }
-
- /**
- * Retrieves a byte array field from the stream.
- *
- * \param dest The byte array where the returned value will be stored. The
- * array should be large enough to store the entire data item,
- * if it is not, a truncated value will be returned.
- */
- public void getByteArray(byte[] dest)
- throws WiredTigerPackingException {
- this.getByteArray(dest, 0, dest.length);
- }
-
- /**
- * Retrieves a byte array field from the stream.
- *
- * \param dest The byte array where the returned value will be stored.
- * \param off Offset into the destination buffer to start copying into.
- * \param len The length should be large enough to store the entire data
- * item, if it is not, a truncated value will be returned.
- */
- public void getByteArray(byte[] dest, int off, int len)
- throws WiredTigerPackingException {
- if (!isRaw) {
- format.checkType('U', false);
- }
- getByteArrayInternal(getByteArrayLength(), dest, off, len);
- }
-
- /**
- * Retrieves a byte array field from the stream. Creates a new byte array
- * that is the size of the object being retrieved.
- */
- public byte[] getByteArray()
- throws WiredTigerPackingException {
- if (!isRaw) {
- format.checkType('U', false);
- }
- int itemLen = getByteArrayLength();
- byte[] unpacked = new byte[itemLen];
- getByteArrayInternal(itemLen, unpacked, 0, itemLen);
- return unpacked;
- }
-
- /**
- * Finds the length of a byte array. Either by decoding the length from
- * the format or using the remaining size of the stream.
- */
- private int getByteArrayLength()
- throws WiredTigerPackingException {
- int itemLen = 0;
-
- if (isRaw) {
- // The rest of the buffer is a byte array.
- itemLen = valueLen - valueOff;
- } else if (format.hasLength()) {
- // If the format has a length, it's always used.
- itemLen = format.getLengthFromFormat(true);
- } else if (format.getType() == 'U') {
- // The 'U' format is used internally, and may be exposed to us.
- // It indicates that the size is always stored unless there
- // is a size in the format.
- itemLen = unpackInt(false);
- } else if (format.available() == 1) {
- // The rest of the buffer is a byte array.
- itemLen = valueLen - valueOff;
- } else {
- itemLen = unpackInt(false);
- }
- return itemLen;
- }
-
- /**
- * Do the work of retrieving a byte array.
- */
- private void getByteArrayInternal(
- int itemLen, byte[] dest, int off, int destLen)
- throws WiredTigerPackingException {
- int copyLen = itemLen;
- if (itemLen > destLen) {
- copyLen = destLen;
- }
- format.consume();
- System.arraycopy(value, valueOff, dest, off, copyLen);
- valueOff += itemLen;
- }
-
- /**
- * Retrieves an integer field from the stream.
- */
- public int getInt()
- throws WiredTigerPackingException {
- boolean signed = true;
- format.checkType('i', false);
- if (format.getType() == 'I' ||
- format.getType() == 'L') {
- signed = false;
- }
- format.consume();
- return unpackInt(signed);
- }
-
- /**
- * Retrieves a long field from the stream.
- */
- public long getLong()
- throws WiredTigerPackingException {
- boolean signed = true;
- format.checkType('q', false);
- if (format.getType() == 'Q') {
- signed = false;
- }
- format.consume();
- return unpackLong(signed);
- }
-
- /**
- * Retrieves a record field from the stream.
- */
- public long getRecord()
- throws WiredTigerPackingException {
- format.checkType('r', false);
- format.consume();
- return unpackLong(false);
- }
-
- /**
- * Retrieves a short field from the stream.
- */
- public short getShort()
- throws WiredTigerPackingException {
- boolean signed = true;
- format.checkType('h', false);
- if (format.getType() == 'H') {
- signed = false;
- }
- format.consume();
- return unpackShort(signed);
- }
-
- /**
- * Retrieves a string field from the stream.
- */
- public String getString()
- throws WiredTigerPackingException {
- int stringLength = 0;
- int skipnull = 0;
- format.checkType('S', false);
- // Get the length for a fixed length string
- if (format.getType() != 'S') {
- stringLength = format.getLengthFromFormat(true);
- } else {
- // The string is null terminated, but we need to know how many
- // bytes are consumed - which won't necessarily match up to the
- // string length.
- for (; valueOff + stringLength < value.length &&
- value[valueOff + stringLength] != 0; stringLength++) {}
- skipnull = 1;
- }
- format.consume();
- String result = new String(value, valueOff, stringLength);
- valueOff += stringLength + skipnull;
- return result;
- }
-
- /**
- * Decodes an encoded short from the stream. This method does bounds
- * checking, to ensure values fit, since some values may be encoded as
- * unsigned values, and Java types are all signed.
- */
- private short unpackShort(boolean signed)
- throws WiredTigerPackingException {
- long ret = unpackLong(true);
- if ((signed && (ret > Short.MAX_VALUE || ret < Short.MIN_VALUE)) ||
- (!signed && (short)ret < 0)) {
- throw new WiredTigerPackingException("Overflow unpacking short.");
- }
- return (short)ret;
- }
-
- /**
- * Decodes an encoded integer from the stream. This method does bounds
- * checking, to ensure values fit, since some values may be encoded as
- * unsigned values, and Java types are all signed.
- */
- private int unpackInt(boolean signed)
- throws WiredTigerPackingException {
- long ret = unpackLong(true);
- if ((signed && (ret > Integer.MAX_VALUE || ret < Integer.MIN_VALUE)) ||
- (!signed && (int)ret < 0)) {
- throw new WiredTigerPackingException("Overflow unpacking integer.");
- }
- return (int)ret;
- }
-
- /**
- * Decodes an encoded long from the stream. This method does bounds
- * checking, to ensure values fit, since some values may be encoded as
- * unsigned values, and Java types are all signed.
- * The packing format is defined in the WiredTiger C integer packing
- * implementation, which is at src/include/intpack.i
- */
- private long unpackLong(boolean signed)
- throws WiredTigerPackingException {
- int len;
- long unpacked = 0;
- switch (value[valueOff] & 0xf0) {
- case PackUtil.NEG_MULTI_MARKER & 0xff:
- len = (int)PackUtil.SIZEOF_LONG - (value[valueOff++] & 0xf);
-
- for (unpacked = 0xffffffff; len != 0; --len) {
- unpacked = (unpacked << 8) | value[valueOff++] & 0xff;
- }
- break;
- case PackUtil.NEG_2BYTE_MARKER & 0xff:
- case (PackUtil.NEG_2BYTE_MARKER | 0x10) & 0xff:
- unpacked = PackUtil.GET_BITS(value[valueOff++], 5, 0) << 8;
- unpacked |= value[valueOff++] & 0xff;
- unpacked += PackUtil.NEG_2BYTE_MIN;
- break;
- case PackUtil.NEG_1BYTE_MARKER & 0xff:
- case (PackUtil.NEG_1BYTE_MARKER | 0x10) & 0xff:
- case (PackUtil.NEG_1BYTE_MARKER | 0x20) & 0xff:
- case (PackUtil.NEG_1BYTE_MARKER | 0x30) & 0xff:
- unpacked = PackUtil.NEG_1BYTE_MIN +
- PackUtil.GET_BITS(value[valueOff++], 6, 0);
- break;
- case PackUtil.POS_1BYTE_MARKER & 0xff:
- case (PackUtil.POS_1BYTE_MARKER | 0x10) & 0xff:
- case (PackUtil.POS_1BYTE_MARKER | 0x20) & 0xff:
- case (PackUtil.POS_1BYTE_MARKER | 0x30) & 0xff:
- unpacked = PackUtil.GET_BITS(value[valueOff++], 6, 0);
- break;
- case PackUtil.POS_2BYTE_MARKER & 0xff:
- case (PackUtil.POS_2BYTE_MARKER | 0x10) & 0xff:
- unpacked = PackUtil.GET_BITS(value[valueOff++], 5, 0) << 8;
- unpacked |= value[valueOff++] & 0xff;
- unpacked += PackUtil.POS_1BYTE_MAX + 1;
- break;
- case PackUtil.POS_MULTI_MARKER & 0xff:
- // There are four length bits in the first byte.
- len = (value[valueOff++] & 0xf);
-
- for (unpacked = 0; len != 0; --len) {
- unpacked = (unpacked << 8) | value[valueOff++] & 0xff;
- }
- unpacked += PackUtil.POS_2BYTE_MAX + 1;
- break;
- default:
- throw new WiredTigerPackingException(
- "Error decoding packed value.");
- }
- // Check for overflow if decoding an unsigned value - since Java only
- // supports signed values.
- if (!signed && unpacked < 0) {
- throw new WiredTigerPackingException("Overflow unpacking long.");
- }
-
- return (unpacked);
- }
-}
-
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java
deleted file mode 100644
index 7c836d36d61..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackOutputStream.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-import java.io.ByteArrayOutputStream;
-import java.lang.StringBuffer;
-import com.wiredtiger.db.WiredTigerPackingException;
-
-/**
- * An internal helper class for encoding WiredTiger packed values.
- *
- * Applications should not need to use this class.
- */
-public class PackOutputStream {
-
- final static int MAX_INT_BYTES = 21;
- protected PackFormatInputStream format;
- protected ByteArrayOutputStream packed;
- protected byte[] intBuf;
- protected boolean isRaw;
-
- /**
- * Constructor.
- *
- * \param format A String that contains the WiredTiger format that
- * defines the layout of this packed value.
- */
- public PackOutputStream(String format) {
- this(format, false);
- }
-
- /**
- * Constructor.
- *
- * \param format A String that contains the WiredTiger format that
- * defines the layout of this packed value.
- * \param isRaw The stream is opened raw.
- */
- public PackOutputStream(String format, boolean isRaw) {
- this.format = new PackFormatInputStream(format, isRaw);
- this.intBuf = new byte[MAX_INT_BYTES];
- this.packed = new ByteArrayOutputStream(100);
- this.isRaw = isRaw;
- }
-
- /**
- * Returns the raw packing format string.
- */
- public String getFormat() {
- return format.toString();
- }
-
- /**
- * Returns the current packed value.
- */
- public byte[] getValue() {
- return packed.toByteArray();
- }
-
- /**
- * Reset the stream position.
- */
- public void reset() {
- format.reset();
- packed.reset();
- }
-
- /**
- * Add a byte field to the stream.
- *
- * \param value The byte value to be added.
- */
- public void addByte(byte value)
- throws WiredTigerPackingException {
- format.checkType('b', true);
- /* Translate to maintain ordering with the sign bit. */
- byte input = (byte)(value + 0x80);
- packed.write(input);
- }
-
- /**
- * Add a byte array field to the stream.
- *
- * \param value The byte array value to be added.
- */
- public void addByteArray(byte[] value)
- throws WiredTigerPackingException {
- this.addByteArray(value, 0, value.length);
- }
-
- /**
- * Add a byte array field to the stream.
- *
- * \param value The byte array value to be added.
- * \param off The offset from the start of value to begin using the array.
- * \param len The length of the value to encode.
- */
- public void addByteArray(byte[] value, int off, int len)
- throws WiredTigerPackingException {
- int padBytes = 0;
-
- if (!isRaw) {
- format.checkType('U', false);
- }
- boolean havesize = format.hasLength();
- char type = format.getType();
- if (havesize) {
- int size = format.getLengthFromFormat(true);
- if (len > size) {
- len = size;
- } else if (size > len) {
- padBytes = size - len;
- }
- }
- // We're done pulling information from the field now.
- format.consume();
-
- // If this is not the last item and the format does not have the
- // size, or we're using the internal 'U' format, store the size.
- if (!havesize && (format.available() > 0 || type == 'U')) {
- packLong(len, false);
- }
- packed.write(value, off, len);
- while(padBytes-- > 0) {
- packed.write(0);
- }
- }
-
- /**
- * Add an integer field to the stream.
- *
- * \param value The integer value to be added.
- */
- public void addInt(int value)
- throws WiredTigerPackingException {
- format.checkType('i', true);
- packLong(value, true);
- }
-
- /**
- * Add a long field to the stream.
- *
- * \param value The long value to be added.
- */
- public void addLong(long value)
- throws WiredTigerPackingException {
- format.checkType('q', true);
- packLong(value, true);
- }
-
- /**
- * Add a record field to the stream.
- *
- * \param value The record value to be added.
- */
- public void addRecord(long value)
- throws WiredTigerPackingException {
- format.checkType('r', true);
- packLong(value, true);
- }
-
- /**
- * Add a short field to the stream.
- *
- * \param value The short value to be added.
- */
- public void addShort(short value)
- throws WiredTigerPackingException {
- format.checkType('h', true);
- packLong(value, true);
- }
-
- /**
- * Add a string field to the stream.
- *
- * \param value The string value to be added.
- */
- public void addString(String value)
- throws WiredTigerPackingException {
- format.checkType('s', false);
- char fieldFormat = format.getType();
- int stringLen = 0;
- int padBytes = 0;
- int valLen = 0;
- // Strings have two possible encodings. A lower case 's' is not null
- // terminated, and has a length define in the format (default 1). An
- // upper case 'S' is variable length and has a null terminator.
-
- // Logic from python packing.py:
- boolean havesize = format.hasLength();
- int nullpos = value.indexOf('\0');
- int size = 0;
-
- if (fieldFormat == 'S' && nullpos >= 0) {
- stringLen = nullpos;
- } else {
- stringLen = value.length();
- }
- if (havesize || fieldFormat == 's') {
- size = format.getLengthFromFormat(true);
- if (stringLen > size) {
- stringLen = size;
- }
- }
-
- if (fieldFormat == 'S' && !havesize) {
- padBytes = 1;
- } else if (size > stringLen) {
- padBytes = size - stringLen;
- }
-
- // We're done pulling information from the field now.
- format.consume();
-
- // Use the default Charset.
- packed.write(value.getBytes(), 0, stringLen);
- while(padBytes-- > 0) {
- packed.write(0);
- }
- }
-
- /**
- * Add a long field to the stream.
- * The packing format is defined in the WiredTiger C integer packing
- * implementation, which is at src/include/intpack.i
- *
- * \param x The long value to be added.
- * \param signed Whether the value is signed or unsigned.
- */
- private void packLong(long x, boolean signed)
- throws WiredTigerPackingException {
- int offset = 0;
-
- if (!signed && x < 0) {
- throw new WiredTigerPackingException("Overflow packing long.");
- }
-
- if (x < PackUtil.NEG_2BYTE_MIN) {
- intBuf[offset] = PackUtil.NEG_MULTI_MARKER;
- int lz = Long.numberOfLeadingZeros(~x) / 8;
- int len = PackUtil.SIZEOF_LONG - lz;
-
- //
- // There are four size bits we can use in the first
- // byte. For negative numbers, we store the number of
- // leading 0xff byes to maintain ordering (if this is
- // not obvious, it may help to remember that -1 is the
- // largest negative number).
- intBuf[offset++] |= (lz & 0xf);
-
- for (int shift = (len - 1) << 3;
- len != 0; shift -= 8, --len) {
- intBuf[offset++] = (byte)(x >> shift);
- }
- } else if (x < PackUtil.NEG_1BYTE_MIN) {
- x -= PackUtil.NEG_2BYTE_MIN;
- intBuf[offset++] =
- (byte)(PackUtil.NEG_2BYTE_MARKER | PackUtil.GET_BITS(x, 13, 8));
- intBuf[offset++] = PackUtil.GET_BITS(x, 8, 0);
- } else if (x < 0) {
- x -= PackUtil.NEG_1BYTE_MIN;
- intBuf[offset++] =
- (byte)(PackUtil.NEG_1BYTE_MARKER | PackUtil.GET_BITS(x, 6, 0));
- } else if (x <= PackUtil.POS_1BYTE_MAX) {
- intBuf[offset++] =
- (byte)(PackUtil.POS_1BYTE_MARKER | PackUtil.GET_BITS(x, 6, 0));
- } else if (x <= PackUtil.POS_2BYTE_MAX) {
- x -= PackUtil.POS_1BYTE_MAX + 1;
- intBuf[offset++] =
- (byte)(PackUtil.POS_2BYTE_MARKER | PackUtil.GET_BITS(x, 13, 8));
- intBuf[offset++] = PackUtil.GET_BITS(x, 8, 0);
- } else if (x == PackUtil.POS_2BYTE_MAX + 1) {
- // This is a special case where we could store the value with
- // just a single byte, but we append a zero byte so that the
- // encoding doesn't get shorter for this one value.
- intBuf[offset++] = (byte)(PackUtil.POS_MULTI_MARKER | 0x01);
- intBuf[offset++] = 0;
- } else {
- x -= PackUtil.POS_2BYTE_MAX + 1;
- intBuf[offset] = PackUtil.POS_MULTI_MARKER;
- int lz = Long.numberOfLeadingZeros(x) / 8;
- int len = PackUtil.SIZEOF_LONG - lz;
-
- // There are four bits we can use in the first byte.
- intBuf[offset++] |= (len & 0xf);
-
- for (int shift = (len - 1) << 3;
- len != 0; --len, shift -= 8) {
- intBuf[offset++] = (byte)(x >> shift);
- }
- }
- packed.write(intBuf, 0, offset);
- }
-}
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackUtil.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackUtil.java
deleted file mode 100644
index aa5112304c6..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/PackUtil.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-import java.lang.String;
-
-/**
- * An internal helper class with utilities for packing and unpacking values.
- *
- * Applications should not need to use this class.
- */
-class PackUtil {
- /* Contants. */
- final static byte NEG_MULTI_MARKER = (byte)0x10;
- final static byte NEG_2BYTE_MARKER = (byte)0x20;
- final static byte NEG_1BYTE_MARKER = (byte)0x40;
- final static byte POS_1BYTE_MARKER = (byte)0x80;
- final static byte POS_2BYTE_MARKER = (byte)0xc0;
- final static byte POS_MULTI_MARKER = (byte)0xe0;
-
- final static int NEG_1BYTE_MIN = ((-1) << 6);
- final static int NEG_2BYTE_MIN = (((-1) << 13) + NEG_1BYTE_MIN);
- final static int POS_1BYTE_MAX = ((1 << 6) - 1);
- final static int POS_2BYTE_MAX = ((1 << 13) + POS_1BYTE_MAX);
-
- // See: http://docs.python.org/2/library/struct.html for an explanation
- // of what these special characters mean.
- // TODO: Care about byte ordering and padding in packed formats.
- final static String PackSpecialCharacters = "@=<>!x";
-
- final static int SIZEOF_LONG = 8;
-
- /**
- * Extract bits from a value, counting from LSB == 0.
- *
- * \param x The value to extract bits from.
- * \param start The first bit to extract.
- * \param end The last bit to extract.
- */
- public static byte GET_BITS(long x, int start, int end) {
- return (byte)((x & ((1 << start) - 1)) >> end);
- }
-
-
-}
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerException.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerException.java
deleted file mode 100644
index 2f8bee8f5f0..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-/**
- * An exception that is generated by the WiredTiger application.
- */
-public class WiredTigerException extends RuntimeException {
- /**
- * Constructor.
- */
- public WiredTigerException(String msg) {
- super(msg);
- }
-}
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
deleted file mode 100644
index 7c7286ecb4b..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-/**
- * An exception that is generated by the WiredTiger application during
- * encoding or decoding of packed values.
- */
-public class WiredTigerPackingException extends WiredTigerException {
- /**
- * Constructor.
- */
- public WiredTigerPackingException(String msg) {
- super(msg);
- }
-}
-
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
deleted file mode 100644
index e0d44faa174..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-/**
- * An exception that is generated by the WiredTiger application when
- * there is an underlying problem that requires the application exit
- * and restart.
- */
-public class WiredTigerPanicException extends WiredTigerException {
- /**
- * Constructor.
- */
- public WiredTigerPanicException(String msg) {
- super(msg);
- }
-}
-
diff --git a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java b/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
deleted file mode 100644
index 47e0ae8688d..00000000000
--- a/src/third_party/wiredtiger/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.db;
-
-/**
- * An exception that is generated by the WiredTiger application
- * when there is a conflict between concurrent operations.
- */
-public class WiredTigerRollbackException extends WiredTigerException {
- /**
- * Constructor.
- */
- public WiredTigerRollbackException(String msg) {
- super(msg);
- }
-}
-
diff --git a/src/third_party/wiredtiger/lang/java/wiredtiger.i b/src/third_party/wiredtiger/lang/java/wiredtiger.i
deleted file mode 100644
index 1e6c1770b89..00000000000
--- a/src/third_party/wiredtiger/lang/java/wiredtiger.i
+++ /dev/null
@@ -1,1522 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * wiredtiger.i
- * The SWIG interface file defining the wiredtiger Java API.
- */
-
-%module wiredtiger
-
-%include "enums.swg"
-%include "typemaps.i"
-%include "stdint.i"
-
-%pragma(java) jniclasscode=%{
- static {
- try {
- System.loadLibrary("wiredtiger_java");
- } catch (UnsatisfiedLinkError e) {
- System.err.println("Native code library failed to load. \n" + e);
- System.exit(1);
- }
- }
-%}
-
-%{
-#include "wiredtiger.h"
-#include "src/include/wt_internal.h"
-
-/*
- * Closed handle checking:
- *
- * The typedef WT_CURSOR_NULLABLE used in wiredtiger.h is only made
- * visible to the SWIG parser and is used to identify arguments of
- * Cursor type that are permitted to be null. Likewise, typedefs
- * WT_{CURSOR,SESSION,CONNECTION}_CLOSED identify 'close' calls that
- * need explicit nulling of the swigCPtr. These typedefs permit
- * special casing in typemaps for input args.
- *
- * We want SWIG to see these 'fake' typenames, but not the compiler.
- */
-#define WT_CURSOR_NULLABLE WT_CURSOR
-#define WT_CURSOR_CLOSED WT_CURSOR
-#define WT_SESSION_CLOSED WT_SESSION
-#define WT_CONNECTION_CLOSED WT_CONNECTION
-
-/*
- * For Connections, Sessions and Cursors created in Java, each of
- * WT_CONNECTION_IMPL, WT_SESSION_IMPL and WT_CURSOR have a
- * lang_private field that store a pointer to a JAVA_CALLBACK, alloced
- * during the various open calls. {conn,session,cursor}CloseHandler()
- * functions reach into the associated java object, set the swigCPtr
- * to 0, and free the JAVA_CALLBACK. Typemaps matching Connection,
- * Session, Cursor args use the NULL_CHECK macro, which checks if
- * swigCPtr is 0.
- */
-typedef struct {
- JNIEnv *jnienv; /* jni env that created the Session/Cursor */
- WT_SESSION_IMPL *session; /* session used for alloc/free */
- bool cursor_raw; /* is the cursor opened raw? */
- jobject jobj; /* the java Session/Cursor object */
- jfieldID cptr_fid; /* cached Cursor.swigCPtr field id in session */
-} JAVA_CALLBACK;
-
-static void throwWiredTigerException(JNIEnv *jenv, int err) {
- const char *clname;
- jclass excep;
-
- clname = NULL;
- excep = NULL;
- if (err == WT_PANIC)
- clname = "com/wiredtiger/db/WiredTigerPanicException";
- else if (err == WT_ROLLBACK)
- clname = "com/wiredtiger/db/WiredTigerRollbackException";
- else
- clname = "com/wiredtiger/db/WiredTigerException";
- if (clname)
- excep = (*jenv)->FindClass(jenv, clname);
- if (excep)
- (*jenv)->ThrowNew(jenv, excep, wiredtiger_strerror(err));
-}
-
-struct __wt_java_modify_impl;
-struct __wt_java_modify_list;
-typedef struct __wt_java_modify_impl WT_MODIFY_IMPL;
-typedef struct __wt_java_modify_list WT_MODIFY_LIST;
-static void modify_impl_release(WT_MODIFY_IMPL *impl);
-static void modify_list_release(WT_MODIFY_LIST *impl);
-
-/*
- * An extension to the WT_MODIFY struct, so we can associate some Java-specific
- * information with it.
- */
-typedef struct __wt_java_modify_impl {
- WT_MODIFY modify;
- JNIEnv *jnienv;
- jobject ref;
-} WT_MODIFY_IMPL;
-
-%}
-
-/* No finalizers */
-%typemap(javafinalize) SWIGTYPE ""
-
-/* Event handlers are not supported in Java. */
-%typemap(in, numinputs=0) WT_EVENT_HANDLER * %{ $1 = NULL; %}
-
-/* Allow silently passing the Java object and JNIEnv into our code. */
-%typemap(in, numinputs=0) jobject *jthis %{ $1 = jarg1_; %}
-%typemap(in, numinputs=0) JNIEnv * %{ $1 = jenv; %}
-
-/* 64 bit typemaps. */
-%typemap(jni) uint64_t "jlong"
-%typemap(jtype) uint64_t "long"
-%typemap(jstype) uint64_t "long"
-
-%typemap(javain) uint64_t "$javainput"
-%typemap(javaout) uint64_t {
- return ($jnicall);
-}
-
-/* Return byte[] from cursor.get_value */
-%typemap(jni) WT_ITEM, WT_ITEM * "jbyteArray"
-%typemap(jtype) WT_ITEM, WT_ITEM * "byte[]"
-%typemap(jstype) WT_ITEM, WT_ITEM * "byte[]"
-
-%typemap(javain) WT_ITEM, WT_ITEM * "$javainput"
-%typemap(javaout) WT_ITEM, WT_ITEM * {
- return ($jnicall);
-}
-
-%typemap(in) WT_ITEM * (WT_ITEM item) %{
- $1 = &item;
- $1->data = (*jenv)->GetByteArrayElements(jenv, $input, 0);
- $1->size = (size_t)(*jenv)->GetArrayLength(jenv, $input);
-%}
-
-%typemap(argout) WT_ITEM * %{
- (*jenv)->ReleaseByteArrayElements(jenv, $input, (void *)$1->data, 0);
-%}
-
-%typemap(out) WT_ITEM %{
- if ($1.data == NULL)
- $result = NULL;
- else if (($result = (*jenv)->NewByteArray(jenv, (jsize)$1.size)) != NULL) {
- (*jenv)->SetByteArrayRegion(jenv,
- $result, 0, (jsize)$1.size, $1.data);
- }
-%}
-
-/*
- * In some cases, for an internal interface, we need something like a WT_ITEM,
- * but we need to hold onto the memory past the method call, and release it
- * later. A WT_ITEM_HOLD serves the purpose, it retains the java object
- * for the byte array that we make into a global reference.
- */
-%typemap(jni) WT_ITEM_HOLD, WT_ITEM_HOLD * "jbyteArray"
-%typemap(jtype) WT_ITEM_HOLD, WT_ITEM_HOLD * "byte[]"
-%typemap(jstype) WT_ITEM_HOLD, WT_ITEM_HOLD * "byte[]"
-
-%typemap(javain) WT_ITEM_HOLD, WT_ITEM_HOLD * "$javainput"
-%typemap(javaout) WT_ITEM_HOLD, WT_ITEM_HOLD * {
- return ($jnicall);
-}
-%typemap(in) WT_ITEM_HOLD * (WT_ITEM_HOLD item) %{
- $1 = &item;
- $1->data = (*jenv)->GetByteArrayElements(jenv, $input, 0);
- $1->size = (size_t)(*jenv)->GetArrayLength(jenv, $input);
- $1->jnienv = jenv;
- $1->ref = (*jenv)->NewGlobalRef(jenv, $input);
-%}
-
-%typemap(argout) WT_ITEM_HOLD * %{
- /* Explicitly don't release the byte array elements here. */
-%}
-
-/* Don't require empty config strings. */
-%typemap(default) const char *config %{ $1 = NULL; %}
-
-%typemap(out) int %{
- if ($1 != 0 && $1 != WT_NOTFOUND) {
- throwWiredTigerException(jenv, $1);
- return ($null);
- }
- $result = $1;
-%}
-
-%define NULL_CHECK(val, name)
- if (!val) {
- SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException,
- #name " is null");
- return ($null);
- }
-%enddef
-
-/*
- * 'Declare' a WiredTiger class. This sets up boilerplate typemaps.
- */
-%define WT_CLASS(type, class, name)
-/*
- * Extra 'self' elimination.
- * The methods we're wrapping look like this:
- * struct __wt_xxx {
- * int method(WT_XXX *, ...otherargs...);
- * };
- * To SWIG, that is equivalent to:
- * int method(struct __wt_xxx *self, WT_XXX *, ...otherargs...);
- * and we use consecutive argument matching of typemaps to convert two args to
- * one.
- */
-%typemap(in, numinputs=0) type *name {
- $1 = *(type **)&jarg1;
- NULL_CHECK($1, $1_name)
-}
-
-%typemap(in) class ## _NULLABLE * {
- $1 = *(type **)&$input;
-}
-
-%typemap(in) type * {
- $1 = *(type **)&$input;
- NULL_CHECK($1, $1_name)
-}
-
-%typemap(javaimports) type "
-/**
- * @copydoc class
- * @ingroup wt_java
- */"
-%enddef
-
-/*
- * Declare a WT_CLASS so that close methods call a specified closeHandler,
- * after the WT core close function has completed. Arguments to the
- * closeHandler are saved in advance since, as macro args, they may refer to
- * values that are freed/zeroed by the close.
- */
-%define WT_CLASS_WITH_CLOSE_HANDLER(type, class, name, closeHandler,
- sess, priv)
-WT_CLASS(type, class, name)
-
-/*
- * This typemap recognizes a close function via a special declaration on its
- * first argument. See WT_HANDLE_CLOSED in wiredtiger.h . Like
- * WT_CURSOR_NULLABLE, the WT_{CURSOR,SESSION,CONNECTION}_CLOSED typedefs
- * are only visible to the SWIG parser.
- */
-%typemap(in, numinputs=0) class ## _CLOSED *name (
- WT_SESSION *savesess, JAVA_CALLBACK *jcb) {
- $1 = *(type **)&jarg1;
- NULL_CHECK($1, $1_name)
- savesess = sess;
- jcb = (JAVA_CALLBACK *)(priv);
-}
-
-%typemap(freearg, numinputs=0) class ## _CLOSED *name {
- closeHandler(jenv, savesess2, jcb2);
-}
-
-%enddef
-
-%pragma(java) moduleimports=%{
-/**
- * @defgroup wt_java WiredTiger Java API
- *
- * Java wrappers around the WiredTiger C API.
- */
-
-/**
- * @ingroup wt_java
- */
-%}
-
-WT_CLASS_WITH_CLOSE_HANDLER(struct __wt_connection, WT_CONNECTION, connection,
- closeHandler, NULL, ((WT_CONNECTION_IMPL *)$1)->lang_private)
-WT_CLASS_WITH_CLOSE_HANDLER(struct __wt_session, WT_SESSION, session,
- closeHandler, $1, ((WT_SESSION_IMPL *)$1)->lang_private)
-WT_CLASS_WITH_CLOSE_HANDLER(struct __wt_cursor, WT_CURSOR, cursor,
- cursorCloseHandler, $1->session, ((WT_CURSOR *)$1)->lang_private)
-
-%define COPYDOC(SIGNATURE_CLASS, CLASS, METHOD)
-%javamethodmodifiers SIGNATURE_CLASS::METHOD "
- /**
- * @copydoc CLASS::METHOD
- */
- public ";
-%enddef
-
-%include "java_doc.i"
-
-/* WT_CURSOR customization. */
-/* First, replace the varargs get / set methods with Java equivalents. */
-%ignore __wt_cursor::get_key;
-%ignore __wt_cursor::get_value;
-%ignore __wt_cursor::set_key;
-%ignore __wt_cursor::set_value;
-%ignore __wt_cursor::insert;
-%ignore __wt_cursor::remove;
-%ignore __wt_cursor::reset;
-%ignore __wt_cursor::search;
-%ignore __wt_cursor::search_near;
-%ignore __wt_cursor::update;
-%javamethodmodifiers __wt_cursor::next "protected";
-%rename (next_wrap) __wt_cursor::next;
-%javamethodmodifiers __wt_cursor::prev "protected";
-%rename (prev_wrap) __wt_cursor::prev;
-%javamethodmodifiers __wt_cursor::key_format "protected";
-%javamethodmodifiers __wt_cursor::value_format "protected";
-%ignore __wt_modify::data;
-%ignore __wt_modify::position;
-%ignore __wt_modify::size;
-%ignore __wt_cursor::modify;
-%ignore wiredtiger_calc_modify;
-
-%ignore __wt_cursor::compare(WT_CURSOR *, WT_CURSOR *, int *);
-%rename (compare_wrap) __wt_cursor::compare;
-%ignore __wt_cursor::equals(WT_CURSOR *, WT_CURSOR *, int *);
-%rename (equals_wrap) __wt_cursor::equals;
-
-/*
- * Special cases: override the out typemap, return checking is done in the
- * wrapper.
- */
-%typemap(out) int __wt_cursor::compare_wrap,
- int __wt_cursor::equals_wrap %{
- $result = $1;
-%}
-
-/* SWIG magic to turn Java byte strings into data / size. */
-%apply (char *STRING, int LENGTH) { (char *data, int size) };
-
-/* Status from search_near */
-%javaconst(1);
-%inline %{
-enum SearchStatus { FOUND, NOTFOUND, SMALLER, LARGER };
-%}
-
-%wrapper %{
-/* Zero out SWIG's pointer to the C object,
- * equivalent to 'jobj.swigCPtr = 0;' in java.
- * We expect that either env in non-null (if called
- * via an explicit session/cursor close() call), or
- * that session is non-null (if called implicitly
- * as part of connection/session close).
- */
-static int
-javaClose(JNIEnv *env, WT_SESSION *session, JAVA_CALLBACK *jcb, jfieldID *pfid)
-{
- jclass cls;
- jfieldID fid;
- WT_CONNECTION_IMPL *conn;
-
- /* If we were not called via an implicit close call,
- * we won't have a JNIEnv yet. Get one from the connection,
- * since the thread that started the session may have
- * terminated.
- */
- if (env == NULL) {
- conn = (WT_CONNECTION_IMPL *)session->connection;
- env = ((JAVA_CALLBACK *)conn->lang_private)->jnienv;
- }
- if (pfid == NULL || *pfid == NULL) {
- cls = (*env)->GetObjectClass(env, jcb->jobj);
- fid = (*env)->GetFieldID(env, cls, "swigCPtr", "J");
- if (pfid != NULL)
- *pfid = fid;
- } else
- fid = *pfid;
-
- (*env)->SetLongField(env, jcb->jobj, fid, 0L);
- (*env)->DeleteGlobalRef(env, jcb->jobj);
- __wt_free(jcb->session, jcb);
- return (0);
-}
-
-/* Connection and Session close handler. */
-static int
-closeHandler(JNIEnv *env, WT_SESSION *session, JAVA_CALLBACK *jcb)
-{
- return (javaClose(env, session, jcb, NULL));
-}
-
-/* Cursor specific close handler. */
-static int
-cursorCloseHandler(JNIEnv *env, WT_SESSION *wt_session, JAVA_CALLBACK *jcb)
-{
- int ret;
- JAVA_CALLBACK *sess_jcb;
- WT_SESSION_IMPL *session;
-
- session = (WT_SESSION_IMPL *)wt_session;
- sess_jcb = (JAVA_CALLBACK *)session->lang_private;
- ret = javaClose(env, wt_session, jcb,
- sess_jcb ? &sess_jcb->cptr_fid : NULL);
-
- return (ret);
-}
-
-/* Add event handler support. */
-static int
-javaCloseHandler(WT_EVENT_HANDLER *handler, WT_SESSION *session,
- WT_CURSOR *cursor)
-{
- int ret;
- JAVA_CALLBACK *jcb;
-
- WT_UNUSED(handler);
-
- ret = 0;
- if (cursor != NULL) {
- if ((jcb = (JAVA_CALLBACK *)cursor->lang_private) != NULL) {
- ret = cursorCloseHandler(NULL, session, jcb);
- cursor->lang_private = NULL;
- }
- } else if ((jcb = ((WT_SESSION_IMPL *)session)->lang_private) != NULL) {
- ret = closeHandler(NULL, session, jcb);
- ((WT_SESSION_IMPL *)session)->lang_private = NULL;
- }
- return (ret);
-}
-
-WT_EVENT_HANDLER javaApiEventHandler = {NULL, NULL, NULL, javaCloseHandler};
-%}
-
-%extend __wt_cursor {
-
- %javamethodmodifiers get_key_wrap "protected";
- WT_ITEM get_key_wrap(JNIEnv *jenv) {
- WT_ITEM k;
- int ret;
- k.data = NULL;
- if ((ret = $self->get_key($self, &k)) != 0)
- throwWiredTigerException(jenv, ret);
- return (k);
- }
-
- %javamethodmodifiers get_value_wrap "protected";
- WT_ITEM get_value_wrap(JNIEnv *jenv) {
- WT_ITEM v;
- int ret;
- v.data = NULL;
- if ((ret = $self->get_value($self, &v)) != 0)
- throwWiredTigerException(jenv, ret);
- return (v);
- }
-
- %javamethodmodifiers insert_wrap "protected";
- int insert_wrap(WT_ITEM *k, WT_ITEM *v) {
- $self->set_key($self, k);
- $self->set_value($self, v);
- return ($self->insert($self));
- }
-
- %javamethodmodifiers remove_wrap "protected";
- int remove_wrap(WT_ITEM *k) {
- $self->set_key($self, k);
- return ($self->remove($self));
- }
-
- %javamethodmodifiers reset_wrap "protected";
- int reset_wrap() {
- return $self->reset($self);
- }
-
- %javamethodmodifiers search_wrap "protected";
- int search_wrap(WT_ITEM *k) {
- $self->set_key($self, k);
- return ($self->search($self));
- }
-
- %javamethodmodifiers search_near_wrap "protected";
- enum SearchStatus search_near_wrap(JNIEnv *jenv, WT_ITEM *k) {
- int cmp, ret;
-
- $self->set_key($self, k);
- ret = $self->search_near(self, &cmp);
- if (ret != 0 && ret != WT_NOTFOUND)
- throwWiredTigerException(jenv, ret);
- if (ret == 0)
- return (cmp == 0 ? FOUND : cmp < 0 ? SMALLER : LARGER);
- return (NOTFOUND);
- }
-
- %javamethodmodifiers update_wrap "protected";
- int update_wrap(WT_ITEM *k, WT_ITEM *v) {
- $self->set_key($self, k);
- $self->set_value($self, v);
- return ($self->update($self));
- }
-
- %javamethodmodifiers compare_wrap "protected";
- int compare_wrap(JNIEnv *jenv, WT_CURSOR *other) {
- int cmp, ret = $self->compare($self, other, &cmp);
- if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return (cmp);
- }
-
- %javamethodmodifiers equals_wrap "protected";
- int equals_wrap(JNIEnv *jenv, WT_CURSOR *other) {
- int cmp, ret = $self->equals($self, other, &cmp);
- if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return (cmp);
- }
-
- %javamethodmodifiers _java_raw "protected";
- bool _java_raw(JNIEnv *jenv) {
- (void)jenv;
- JAVA_CALLBACK *jcb = (JAVA_CALLBACK *)$self->lang_private;
- return (jcb->cursor_raw);
- }
-
- %javamethodmodifiers _java_init "protected";
- int _java_init(jobject jcursor) {
- JAVA_CALLBACK *jcb = (JAVA_CALLBACK *)$self->lang_private;
- jcb->jobj = JCALL1(NewGlobalRef, jcb->jnienv, jcursor);
- JCALL1(DeleteLocalRef, jcb->jnienv, jcursor);
- return (0);
- }
-
- int modify_wrap(WT_MODIFY_LIST *list, WT_ITEM *k) {
- int ret;
-
- $self->set_key($self, k);
- ret = $self->modify(self, list->mod_array, list->count);
- modify_list_release(list);
- return (ret);
- }
-
- /*
- * Called internally after a new call. The artificial constructor for
- * WT_MODIFY_LIST has no opportunity to throw an exception on a memory
- * allocation failure, so the the null check must be made within a
- * method on WT_CURSOR.
- */
- bool _new_check_modify_list(WT_MODIFY_LIST *list) {
- JAVA_CALLBACK *jcb;
- if (list == NULL) {
- jcb = (JAVA_CALLBACK *)$self->lang_private;
- throwWiredTigerException(jcb->jnienv, ENOMEM);
- return (false);
- }
- return (true);
- }
-
- /*
- * Called internally after a new call. The artificial constructor for
- * WT_MODIFY has no opportunity to throw an exception on a memory
- * allocation failure, so the the null check must be made within a
- * method on WT_CURSOR.
- */
- bool _new_check_modify(WT_MODIFY *mod) {
- JAVA_CALLBACK *jcb;
- if (mod == NULL) {
- jcb = (JAVA_CALLBACK *)$self->lang_private;
- throwWiredTigerException(jcb->jnienv, ENOMEM);
- return (false);
- }
- return (true);
- }
-}
-
-/* Cache key/value formats in Cursor */
-%typemap(javabody) struct __wt_cursor %{
- private long swigCPtr;
- protected boolean swigCMemOwn;
- protected String keyFormat;
- protected String valueFormat;
- protected PackOutputStream keyPacker;
- protected PackOutputStream valuePacker;
- protected PackInputStream keyUnpacker;
- protected PackInputStream valueUnpacker;
-
- protected $javaclassname(long cPtr, boolean cMemoryOwn) {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = cPtr;
- keyFormat = getKey_format();
- valueFormat = getValue_format();
- keyPacker = new PackOutputStream(keyFormat, _java_raw());
- valuePacker = new PackOutputStream(valueFormat, _java_raw());
- wiredtigerJNI.Cursor__java_init(swigCPtr, this, this);
- }
-
- protected static long getCPtr($javaclassname obj) {
- return (obj == null) ? 0 : obj.swigCPtr;
- }
-%}
-
-%typemap(javacode) struct __wt_cursor %{
-
- /**
- * Retrieve the format string for this cursor's key.
- */
- public String getKeyFormat() {
- return keyFormat;
- }
-
- /**
- * Retrieve the format string for this cursor's value.
- */
- public String getValueFormat() {
- return valueFormat;
- }
-
- /**
- * Append a byte to the cursor's key.
- *
- * \param value The value to append.
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyByte(byte value)
- throws WiredTigerPackingException {
- keyPacker.addByte(value);
- return this;
- }
-
- /**
- * Append a byte array to the cursor's key.
- *
- * \param value The value to append.
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyByteArray(byte[] value)
- throws WiredTigerPackingException {
- this.putKeyByteArray(value, 0, value.length);
- return this;
- }
-
- /**
- * Append a byte array to the cursor's key.
- *
- * \param value The value to append.
- * \param off The offset into value at which to start.
- * \param len The length of the byte array.
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyByteArray(byte[] value, int off, int len)
- throws WiredTigerPackingException {
- keyPacker.addByteArray(value, off, len);
- return this;
- }
-
- /**
- * Append an integer to the cursor's key.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyInt(int value)
- throws WiredTigerPackingException {
- keyPacker.addInt(value);
- return this;
- }
-
- /**
- * Append a long to the cursor's key.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyLong(long value)
- throws WiredTigerPackingException {
- keyPacker.addLong(value);
- return this;
- }
-
- /**
- * Append a record number to the cursor's key.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyRecord(long value)
- throws WiredTigerPackingException {
- keyPacker.addRecord(value);
- return this;
- }
-
- /**
- * Append a short integer to the cursor's key.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyShort(short value)
- throws WiredTigerPackingException {
- keyPacker.addShort(value);
- return this;
- }
-
- /**
- * Append a string to the cursor's key.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putKeyString(String value)
- throws WiredTigerPackingException {
- keyPacker.addString(value);
- return this;
- }
-
- /**
- * Append a byte to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueByte(byte value)
- throws WiredTigerPackingException {
- valuePacker.addByte(value);
- return this;
- }
-
- /**
- * Append a byte array to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueByteArray(byte[] value)
- throws WiredTigerPackingException {
- this.putValueByteArray(value, 0, value.length);
- return this;
- }
-
- /**
- * Append a byte array to the cursor's value.
- *
- * \param value The value to append
- * \param off The offset into value at which to start.
- * \param len The length of the byte array.
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueByteArray(byte[] value, int off, int len)
- throws WiredTigerPackingException {
- valuePacker.addByteArray(value, off, len);
- return this;
- }
-
- /**
- * Append an integer to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueInt(int value)
- throws WiredTigerPackingException {
- valuePacker.addInt(value);
- return this;
- }
-
- /**
- * Append a long to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueLong(long value)
- throws WiredTigerPackingException {
- valuePacker.addLong(value);
- return this;
- }
-
- /**
- * Append a record number to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueRecord(long value)
- throws WiredTigerPackingException {
- valuePacker.addRecord(value);
- return this;
- }
-
- /**
- * Append a short integer to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueShort(short value)
- throws WiredTigerPackingException {
- valuePacker.addShort(value);
- return this;
- }
-
- /**
- * Append a string to the cursor's value.
- *
- * \param value The value to append
- * \return This cursor object, so put calls can be chained.
- */
- public Cursor putValueString(String value)
- throws WiredTigerPackingException {
- valuePacker.addString(value);
- return this;
- }
-
- /**
- * Retrieve a byte from the cursor's key.
- *
- * \return The requested value.
- */
- public byte getKeyByte()
- throws WiredTigerPackingException {
- return keyUnpacker.getByte();
- }
-
- /**
- * Retrieve a byte array from the cursor's key.
- *
- * \param output The byte array where the returned value will be stored.
- * The array should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getKeyByteArray(byte[] output)
- throws WiredTigerPackingException {
- this.getKeyByteArray(output, 0, output.length);
- }
-
- /**
- * Retrieve a byte array from the cursor's key.
- *
- * \param output The byte array where the returned value will be stored.
- * \param off Offset into the destination buffer to start copying into.
- * \param len The length should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getKeyByteArray(byte[] output, int off, int len)
- throws WiredTigerPackingException {
- keyUnpacker.getByteArray(output, off, len);
- }
-
- /**
- * Retrieve a byte array from the cursor's key.
- *
- * \return The requested value.
- */
- public byte[] getKeyByteArray()
- throws WiredTigerPackingException {
- return keyUnpacker.getByteArray();
- }
-
- /**
- * Retrieve an integer from the cursor's key.
- *
- * \return The requested value.
- */
- public int getKeyInt()
- throws WiredTigerPackingException {
- return keyUnpacker.getInt();
- }
-
- /**
- * Retrieve a long from the cursor's key.
- *
- * \return The requested value.
- */
- public long getKeyLong()
- throws WiredTigerPackingException {
- return keyUnpacker.getLong();
- }
-
- /**
- * Retrieve a record number from the cursor's key.
- *
- * \return The requested value.
- */
- public long getKeyRecord()
- throws WiredTigerPackingException {
- return keyUnpacker.getRecord();
- }
-
- /**
- * Retrieve a short integer from the cursor's key.
- *
- * \return The requested value.
- */
- public short getKeyShort()
- throws WiredTigerPackingException {
- return keyUnpacker.getShort();
- }
-
- /**
- * Retrieve a string from the cursor's key.
- *
- * \return The requested value.
- */
- public String getKeyString()
- throws WiredTigerPackingException {
- return keyUnpacker.getString();
- }
-
- /**
- * Retrieve a byte from the cursor's value.
- *
- * \return The requested value.
- */
- public byte getValueByte()
- throws WiredTigerPackingException {
- return valueUnpacker.getByte();
- }
-
- /**
- * Retrieve a byte array from the cursor's value.
- *
- * \param output The byte array where the returned value will be stored.
- * The array should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getValueByteArray(byte[] output)
- throws WiredTigerPackingException {
- this.getValueByteArray(output, 0, output.length);
- }
-
- /**
- * Retrieve a byte array from the cursor's value.
- *
- * \param output The byte array where the returned value will be stored.
- * \param off Offset into the destination buffer to start copying into.
- * \param len The length should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getValueByteArray(byte[] output, int off, int len)
- throws WiredTigerPackingException {
- valueUnpacker.getByteArray(output, off, len);
- }
-
- /**
- * Retrieve a byte array from the cursor's value.
- *
- * \return The requested value.
- */
- public byte[] getValueByteArray()
- throws WiredTigerPackingException {
- return valueUnpacker.getByteArray();
- }
-
- /**
- * Retrieve an integer from the cursor's value.
- *
- * \return The requested value.
- */
- public int getValueInt()
- throws WiredTigerPackingException {
- return valueUnpacker.getInt();
- }
-
- /**
- * Retrieve a long from the cursor's value.
- *
- * \return The requested value.
- */
- public long getValueLong()
- throws WiredTigerPackingException {
- return valueUnpacker.getLong();
- }
-
- /**
- * Retrieve a record number from the cursor's value.
- *
- * \return The requested value.
- */
- public long getValueRecord()
- throws WiredTigerPackingException {
- return valueUnpacker.getRecord();
- }
-
- /**
- * Retrieve a short integer from the cursor's value.
- *
- * \return The requested value.
- */
- public short getValueShort()
- throws WiredTigerPackingException {
- return valueUnpacker.getShort();
- }
-
- /**
- * Retrieve a string from the cursor's value.
- *
- * \return The requested value.
- */
- public String getValueString()
- throws WiredTigerPackingException {
- return valueUnpacker.getString();
- }
-
- /**
- * Insert the cursor's current key/value into the table.
- *
- * \return The status of the operation.
- */
- public int insert()
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- byte[] value = valuePacker.getValue();
- keyPacker.reset();
- valuePacker.reset();
- return insert_wrap(key, value);
- }
-
- /**
- * Update the cursor's current key/value into the table.
- *
- * \return The status of the operation.
- */
- public int update()
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- byte[] value = valuePacker.getValue();
- keyPacker.reset();
- valuePacker.reset();
- return update_wrap(key, value);
- }
-
- /**
- * Remove the cursor's current key/value into the table.
- *
- * \return The status of the operation.
- */
- public int remove()
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- keyPacker.reset();
- return remove_wrap(key);
- }
-
- /**
- * Compare this cursor's position to another Cursor.
- *
- * \return The result of the comparison.
- */
- public int compare(Cursor other)
- throws WiredTigerException {
- return compare_wrap(other);
- }
-
- /**
- * Compare this cursor's position to another Cursor.
- *
- * \return The result of the comparison.
- */
- public int equals(Cursor other)
- throws WiredTigerException {
- return equals_wrap(other);
- }
-
- /**
- * Retrieve the next item in the table.
- *
- * \return The result of the comparison.
- */
- public int next()
- throws WiredTigerException {
- int ret = next_wrap();
- keyPacker.reset();
- valuePacker.reset();
- keyUnpacker = initKeyUnpacker(ret == 0);
- valueUnpacker = initValueUnpacker(ret == 0);
- return ret;
- }
-
- /**
- * Retrieve the previous item in the table.
- *
- * \return The result of the comparison.
- */
- public int prev()
- throws WiredTigerException {
- int ret = prev_wrap();
- keyPacker.reset();
- valuePacker.reset();
- keyUnpacker = initKeyUnpacker(ret == 0);
- valueUnpacker = initValueUnpacker(ret == 0);
- return ret;
- }
-
- /**
- * Reset a cursor.
- *
- * \return The status of the operation.
- */
- public int reset()
- throws WiredTigerException {
- int ret = reset_wrap();
- keyPacker.reset();
- valuePacker.reset();
- keyUnpacker = null;
- valueUnpacker = null;
- return ret;
- }
-
- /**
- * Search for an item in the table.
- *
- * \return The result of the comparison.
- */
- public int search()
- throws WiredTigerException {
- int ret = search_wrap(keyPacker.getValue());
- keyPacker.reset();
- valuePacker.reset();
- keyUnpacker = initKeyUnpacker(ret == 0);
- valueUnpacker = initValueUnpacker(ret == 0);
- return ret;
- }
-
- /**
- * Search for an item in the table.
- *
- * \return The result of the comparison.
- */
- public SearchStatus search_near()
- throws WiredTigerException {
- SearchStatus ret = search_near_wrap(keyPacker.getValue());
- keyPacker.reset();
- valuePacker.reset();
- keyUnpacker = initKeyUnpacker(ret != SearchStatus.NOTFOUND);
- valueUnpacker = initValueUnpacker(ret != SearchStatus.NOTFOUND);
- return ret;
- }
-
- /**
- * Initialize a key unpacker after an operation that changes
- * the cursor position.
- *
- * \param success Whether the associated operation succeeded.
- * \return The key unpacker.
- */
- private PackInputStream initKeyUnpacker(boolean success)
- throws WiredTigerException {
- if (!success || keyFormat.equals(""))
- return null;
- else
- return new PackInputStream(keyFormat,
- get_key_wrap(), _java_raw());
- }
-
- /**
- * Initialize a value unpacker after an operation that changes
- * the cursor position.
- *
- * \param success Whether the associated operation succeeded.
- * \return The value unpacker.
- */
- private PackInputStream initValueUnpacker(boolean success)
- throws WiredTigerException {
- if (!success || valueFormat.equals(""))
- return null;
- else
- return new PackInputStream(valueFormat,
- get_value_wrap(), _java_raw());
- }
-
- /**
- * Modify an existing record.
- *
- * The cursor must already be positioned, and the key's value will be
- * updated.
- *
- * \param mods an array of modifications.
- * \return 0 on success, errno on error.
- */
- public int modify(Modify mods[])
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- keyPacker.reset();
-
- WT_MODIFY_LIST l = new WT_MODIFY_LIST(mods.length);
- if (!_new_check_modify_list(l))
- return (0); // exception is already thrown
- int pos = 0;
-
- for (Modify m : mods) {
- if (!_new_check_modify(m))
- return (0); // exception is already thrown
- l.set(pos, m);
- pos++;
- }
- return modify_wrap(l, key);
- }
-%}
-
-/*
- * Support for WT_CURSOR.modify.
- */
-
-%inline %{
-typedef struct __wt_java_item_hold {
-#ifndef SWIG
- void *data;
- size_t size;
- JNIEnv *jnienv;
- jobject ref;
-#endif
-} WT_ITEM_HOLD;
-
-/*
- * An internal Java class encapsulates a list of Modify objects (stored as a
- * WT_MODIFY array in C).
- */
-typedef struct __wt_java_modify_list {
-#ifndef SWIG
- WT_MODIFY *mod_array;
- jobject *ref_array;
- JNIEnv *jnienv;
- int count;
-#endif
-} WT_MODIFY_LIST;
-%}
-%extend __wt_java_modify_list {
- __wt_java_modify_list(int count) {
- WT_MODIFY_LIST *self;
- if (__wt_calloc_def(NULL, 1, &self) != 0)
- return (NULL);
- if (__wt_calloc_def(NULL, (size_t)count,
- &self->mod_array) != 0) {
- __wt_free(NULL, self);
- return (NULL);
- }
- if (__wt_calloc_def(NULL, (size_t)count,
- &self->ref_array) != 0) {
- __wt_free(NULL, self->mod_array);
- __wt_free(NULL, self);
- return (NULL);
- }
- self->count = count;
- return (self);
- }
- ~__wt_java_modify_list() {
- modify_list_release(self);
- __wt_free(NULL, self);
- }
- void set(int i, WT_MODIFY *m) {
- WT_MODIFY_IMPL *impl = (WT_MODIFY_IMPL *)m;
- self->mod_array[i] = *m;
- self->ref_array[i] = impl->ref;
- impl->ref = (jobject)0;
- self->jnienv = impl->jnienv;
- }
-};
-
-%extend __wt_modify {
- __wt_modify() {
- WT_MODIFY_IMPL *self;
- if (__wt_calloc_def(NULL, 1, &self) != 0)
- return (NULL);
- self->modify.data.data = NULL;
- self->modify.data.size = 0;
- self->modify.offset = 0;
- self->modify.size = 0;
- return (&self->modify);
- }
- __wt_modify(WT_ITEM_HOLD *itemdata,
- size_t offset, size_t size) {
- WT_MODIFY_IMPL *self;
- if (__wt_calloc_def(NULL, 1, &self) != 0)
- return (NULL);
- self->modify.data.data = itemdata->data;
- self->modify.data.size = itemdata->size;
- self->modify.offset = offset;
- self->modify.size = size;
- self->ref = itemdata->ref;
- self->jnienv = itemdata->jnienv;
- return (&self->modify);
- }
- ~__wt_modify() {
- modify_impl_release((WT_MODIFY_IMPL *)self);
- __wt_free(NULL, self);
- }
-};
-
-%{
-static void modify_list_release(WT_MODIFY_LIST *list) {
- for (int i = 0; i < list->count; i++)
- if (list->ref_array[i] != (jobject)0) {
- (*list->jnienv)->ReleaseByteArrayElements(
- list->jnienv, list->ref_array[i],
- (jbyte *)list->mod_array[i].data.data, 0);
- (*list->jnienv)->DeleteGlobalRef(
- list->jnienv, list->ref_array[i]);
- }
- __wt_free(NULL, list->ref_array);
- __wt_free(NULL, list->mod_array);
- list->count = 0;
-}
-
-static void modify_impl_release(WT_MODIFY_IMPL *impl) {
- if (impl->ref != (jobject)0) {
- (*impl->jnienv)->ReleaseByteArrayElements(
- impl->jnienv, impl->ref,
- (jbyte *)impl->modify.data.data, 0);
- (*impl->jnienv)->DeleteGlobalRef(impl->jnienv, impl->ref);
- impl->ref = (jobject)0;
- }
-}
-%}
-
-/* Put a WiredTigerException on all wrapped methods. We'd like this
- * to only apply to methods returning int. SWIG doesn't have a way
- * to do this, so we remove the exception for simple getters and such.
- */
-%javaexception("com.wiredtiger.db.WiredTigerException") { $action; }
-%javaexception("") wiredtiger_strerror { $action; }
-%javaexception("") __wt_connection::_java_init { $action; }
-%javaexception("") __wt_connection::get_home { $action; }
-%javaexception("") __wt_connection::is_new { $action; }
-%javaexception("") __wt_cursor::_java_raw { $action; }
-%javaexception("") __wt_cursor::key_format { $action; }
-%javaexception("") __wt_cursor::session { $action; }
-%javaexception("") __wt_cursor::uri { $action; }
-%javaexception("") __wt_cursor::value_format { $action; }
-%javaexception("") __wt_session::_java_init { $action; }
-%javaexception("") __wt_session::connection { $action; }
-
-/* Remove / rename parts of the C API that we don't want in Java. */
-%immutable __wt_cursor::session;
-%immutable __wt_cursor::uri;
-%immutable __wt_cursor::key_format;
-%immutable __wt_cursor::value_format;
-%immutable __wt_session::connection;
-
-%ignore __wt_collator;
-%ignore __wt_connection::add_collator;
-%ignore __wt_compressor;
-%ignore __wt_connection::add_compressor;
-%ignore __wt_data_source;
-%ignore __wt_connection::add_data_source;
-%ignore __wt_encryptor;
-%ignore __wt_connection::add_encryptor;
-%ignore __wt_event_handler;
-%ignore __wt_extractor;
-%ignore __wt_connection::add_extractor;
-%ignore __wt_file_system;
-%ignore __wt_file_handle;
-%ignore __wt_connection::set_file_system;
-%ignore __wt_item;
-%ignore __wt_lsn;
-%ignore __wt_session::msg_printf;
-
-%ignore wiredtiger_struct_pack;
-%ignore wiredtiger_struct_size;
-%ignore wiredtiger_struct_unpack;
-
-%ignore wiredtiger_version;
-
-%ignore __wt_connection::get_extension_api;
-%ignore wiredtiger_extension_init;
-%ignore wiredtiger_extension_terminate;
-
-%define REQUIRE_WRAP(typedefname, name, javaname)
-%ignore name;
-%javamethodmodifiers name##_wrap "
- /**
- * @copydoc typedefname
- */
- public ";
-%rename(javaname) name##_wrap;
-%enddef
-
-REQUIRE_WRAP(::wiredtiger_open, wiredtiger_open, open)
-REQUIRE_WRAP(WT_CONNECTION::open_session,
- __wt_connection::open_session, open_session)
-REQUIRE_WRAP(WT_SESSION::transaction_pinned_range,
- __wt_session::transaction_pinned_range, transaction_pinned_range)
-REQUIRE_WRAP(WT_SESSION::open_cursor, __wt_session::open_cursor, open_cursor)
-
-%rename(Cursor) __wt_cursor;
-%rename(Modify) __wt_modify;
-%rename(Session) __wt_session;
-%rename(Connection) __wt_connection;
-
-%define TRACKED_CLASS(jclassname, ctypename, java_init_fcn, implclass)
-%ignore jclassname::jclassname();
-
-%typemap(javabody) struct ctypename %{
- private long swigCPtr;
- protected boolean swigCMemOwn;
-
- protected $javaclassname(long cPtr, boolean cMemoryOwn) {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = cPtr;
- java_init_fcn(swigCPtr, this, this);
- }
-
- protected static long getCPtr($javaclassname obj) {
- return (obj == null) ? 0 : obj.swigCPtr;
- }
-%}
-
-%extend ctypename {
- %javamethodmodifiers _java_init "protected";
- int _java_init(jobject jsess) {
- implclass *session = (implclass *)$self;
- JAVA_CALLBACK *jcb = (JAVA_CALLBACK *)session->lang_private;
- jcb->jobj = JCALL1(NewGlobalRef, jcb->jnienv, jsess);
- JCALL1(DeleteLocalRef, jcb->jnienv, jsess);
- return (0);
- }
-}
-%enddef
-
-TRACKED_CLASS(Session, __wt_session, wiredtigerJNI.Session__java_init, WT_SESSION_IMPL)
-TRACKED_CLASS(Connection, __wt_connection, wiredtigerJNI.Connection__java_init, WT_CONNECTION_IMPL)
-/* Note: Cursor incorporates the elements of TRACKED_CLASS into its
- * custom constructor and %extend clause.
- */
-
-%include "wiredtiger.h"
-
-/* Return new connections, sessions and cursors. */
-%inline {
-WT_CONNECTION *wiredtiger_open_wrap(JNIEnv *jenv, const char *home, const char *config) {
- extern WT_EVENT_HANDLER javaApiEventHandler;
- WT_CONNECTION *conn = NULL;
- WT_CONNECTION_IMPL *connimpl;
- JAVA_CALLBACK *jcb;
- int ret;
- if ((ret = wiredtiger_open(home, &javaApiEventHandler, config, &conn)) != 0)
- goto err;
-
- connimpl = (WT_CONNECTION_IMPL *)conn;
- if ((ret = __wt_calloc_def(connimpl->default_session, 1, &jcb)) != 0)
- goto err;
-
- jcb->jnienv = jenv;
- connimpl->lang_private = jcb;
-
-err: if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return (conn);
-}
-}
-
-%extend __wt_connection {
- WT_SESSION *open_session_wrap(JNIEnv *jenv, const char *config) {
- extern WT_EVENT_HANDLER javaApiEventHandler;
- WT_SESSION *session = NULL;
- WT_SESSION_IMPL *sessionimpl;
- JAVA_CALLBACK *jcb;
- int ret;
-
- if ((ret = $self->open_session($self, &javaApiEventHandler, config, &session)) != 0)
- goto err;
-
- sessionimpl = (WT_SESSION_IMPL *)session;
- if ((ret = __wt_calloc_def(sessionimpl, 1, &jcb)) != 0)
- goto err;
-
- jcb->jnienv = jenv;
- sessionimpl->lang_private = jcb;
-
-err: if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return (session);
- }
-}
-
-%extend __wt_session {
- WT_CURSOR *open_cursor_wrap(JNIEnv *jenv, const char *uri, WT_CURSOR_NULLABLE *to_dup, const char *config) {
- WT_CURSOR *cursor = NULL;
- JAVA_CALLBACK *jcb;
- int ret;
-
- if ((ret = $self->open_cursor($self, uri, to_dup, config, &cursor)) != 0)
- goto err;
-
- if ((ret = __wt_calloc_def(CUR2S(cursor), 1, &jcb)) != 0)
- goto err;
-
- if ((cursor->flags & WT_CURSTD_RAW) != 0)
- jcb->cursor_raw = true;
- if ((cursor->flags & WT_CURSTD_DUMP_JSON) == 0)
- cursor->flags |= WT_CURSTD_RAW;
-
- jcb->jnienv = jenv;
- jcb->session = CUR2S(cursor);
- cursor->lang_private = jcb;
-
-err: if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return (cursor);
- }
-}
-
-%extend __wt_session {
- long transaction_pinned_range_wrap(JNIEnv *jenv) {
- int ret;
- uint64_t range = 0;
- ret = self->transaction_pinned_range(self, &range);
- if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return ((long)range);
- }
-}
diff --git a/src/third_party/wiredtiger/src/btree/bt_handle.c b/src/third_party/wiredtiger/src/btree/bt_handle.c
index 2dac56ee485..42139969802 100644
--- a/src/third_party/wiredtiger/src/btree/bt_handle.c
+++ b/src/third_party/wiredtiger/src/btree/bt_handle.c
@@ -518,11 +518,20 @@ __btree_conf(WT_SESSION_IMPL *session, WT_CKPT *ckpt)
btree->modified = false; /* Clean */
- btree->syncing = WT_BTREE_SYNC_OFF; /* Not syncing */
- /* Checkpoint generation */
- btree->checkpoint_gen = __wt_gen(session, WT_GEN_CHECKPOINT);
- /* Write generation */
- btree->write_gen = WT_MAX(ckpt->write_gen, conn->base_write_gen);
+ btree->syncing = WT_BTREE_SYNC_OFF; /* Not syncing */
+ btree->checkpoint_gen = __wt_gen(session, WT_GEN_CHECKPOINT); /* Checkpoint generation */
+
+ /*
+ * In the regular case, we'll be initializing to the connection-wide base write generation since
+ * this is the largest of all btree write generations from the previous run. This has the nice
+ * property of ensuring that the range of write generations used by consecutive runs do not
+ * overlap which aids with debugging.
+ *
+ * In the import case, the btree write generation from the last run may actually be ahead of the
+ * connection-wide base write generation. In that case, we should initialize our write gen just
+ * ahead of our btree specific write generation.
+ */
+ btree->write_gen = btree->base_write_gen = WT_MAX(ckpt->write_gen + 1, conn->base_write_gen);
return (0);
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_vrfy.c b/src/third_party/wiredtiger/src/btree/bt_vrfy.c
index 840dd83df0b..660652a8ab2 100644
--- a/src/third_party/wiredtiger/src/btree/bt_vrfy.c
+++ b/src/third_party/wiredtiger/src/btree/bt_vrfy.c
@@ -259,7 +259,7 @@ __wt_verify(WT_SESSION_IMPL *session, const char *cfg[])
*/
memset(&addr_unpack, 0, sizeof(addr_unpack));
WT_TIME_AGGREGATE_COPY(&addr_unpack.ta, &ckpt->ta);
- if (ckpt->write_gen <= S2C(session)->base_write_gen) {
+ if (ckpt->write_gen <= btree->base_write_gen) {
addr_unpack.ta.newest_txn = WT_TXN_NONE;
addr_unpack.ta.newest_stop_txn = WT_TXN_MAX;
}
diff --git a/src/third_party/wiredtiger/src/cursor/cur_metadata.c b/src/third_party/wiredtiger/src/cursor/cur_metadata.c
index 543f6221333..66e2ec5b77b 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_metadata.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_metadata.c
@@ -60,8 +60,9 @@ err:
* __schema_create_collapse --
* Discard any configuration information from a schema entry that is not applicable to an
* session.create call. For a table URI that contains no named column groups, fold in the
- * configuration from the implicit column group and its source. For a named column group URI,
- * fold in its source.
+ * configuration from the implicit column group and its source. For a named column group or
+ * index URI, fold in its source. For a table URI that contains named column groups, we return
+ * only the table portion.
*/
static int
__schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, const char *key,
@@ -79,14 +80,17 @@ __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, cons
c = NULL;
if (key != NULL && WT_PREFIX_SKIP(key, "table:")) {
/*
- * Check if the table has declared column groups. If it does, don't attempt to open the
- * automatically created column group for simple tables.
+ * Check if the table has declared column groups. If it does, return just the table info.
+ * One can get the creation metadata for an index or column group table itself or for simple
+ * tables.
*/
WT_RET(__wt_config_getones(session, value, "colgroups", &cgconf));
__wt_config_subinit(session, &cparser, &cgconf);
- if ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0)
+ if ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0) {
+ firstcfg = cfg;
goto skip;
+ }
WT_RET_NOTFOUND_OK(ret);
c = mdc->create_cursor;
@@ -103,7 +107,7 @@ __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, cons
WT_ERR(c->get_value(c, &v));
WT_ERR(__wt_strdup(session, v, --cfg));
WT_ERR(__schema_source_config(session, c, v, --cfg));
- } else if (key != NULL && WT_PREFIX_SKIP(key, "colgroup:")) {
+ } else if (key != NULL && (WT_PREFIX_SKIP(key, "colgroup:") || WT_PREFIX_SKIP(key, "index:"))) {
if (strchr(key, ':') != NULL) {
c = mdc->create_cursor;
WT_ERR(__wt_strdup(session, value, --cfg));
@@ -111,9 +115,9 @@ __schema_create_collapse(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc, cons
}
}
-skip:
firstcfg = cfg;
*--firstcfg = WT_CONFIG_BASE(session, WT_SESSION_create);
+skip:
WT_ERR(__wt_config_collapse(session, firstcfg, value_ret));
err:
diff --git a/src/third_party/wiredtiger/src/docs/Doxyfile b/src/third_party/wiredtiger/src/docs/Doxyfile
index 146e794c025..378b1fd5f50 100644
--- a/src/third_party/wiredtiger/src/docs/Doxyfile
+++ b/src/third_party/wiredtiger/src/docs/Doxyfile
@@ -719,7 +719,6 @@ FILE_PATTERNS = *.c \
*.cpp \
*.c++ \
*.d \
- *.java \
*.ii \
*.ixx \
*.ipp \
@@ -793,7 +792,6 @@ EXCLUDE_SYMBOLS = __F \
# the \include command).
EXAMPLE_PATH = ../../examples/c \
- ../../examples/java/com/wiredtiger/examples/ \
../../ext/compressors/nop \
../../ext/encryptors/nop \
../../ext/encryptors/rotn
diff --git a/src/third_party/wiredtiger/src/docs/arch-index.dox b/src/third_party/wiredtiger/src/docs/arch-index.dox
index 53a49de7ed3..f5430ccb7e7 100644
--- a/src/third_party/wiredtiger/src/docs/arch-index.dox
+++ b/src/third_party/wiredtiger/src/docs/arch-index.dox
@@ -1,15 +1,136 @@
/*! @page arch-index WiredTiger Architecture Guide
+WiredTiger is built as a library that is linked into the application. Applications
+use the API interface to direct WiredTiger's operations (see @ref basic_api).
+Here is an overview of the software components in WiredTiger and how they are organized.
+An arrow indicates the "from" component uses "to" component.
+
+@plantuml_start{wt_diagram.png}
+@startuml{wt_diagram.png}
+
+' We add spacing to the diagram in places to influence the layout.
+' To do this, we create some invisible components with hidden arrows
+' pointing to them. Since we don't otherwise use the "file" component,
+' we set all its parts to be transparent, and any use of "file" results
+' in an invisible spacer whose width is directed by the length of its label.
+' When modifying this diagram, it's sometimes useful to comment out the
+' following lines, and any [hidden] directives used below, to see how
+' the spacers influence the layout. Note that this may be fragile;
+' the spacers give hints to the layout, such hints will not always be honored.
+
+skinparam fileBorderColor Transparent
+skinparam fileBackgroundColor Transparent
+skinparam fileFontColor Transparent
+skinparam fileShadowing false
+
+' Our diagram is simple. First, we define lots of labeled rectangles
+' with most nesting within the "engine" rectangle.
+
+together {
+ rectangle "Python API" as python_api
+ ' "storage" displays as an oval.
+ storage " C/C++ \n applications " as application
+ rectangle "wt Utility" as utility
+}
+
+' Trailing spaces for this label puts the text to the left.
+rectangle "**WiredTiger Engine** " as wt_engine {
+ ' Leading and trailing spaces make a wide rectangle.
+ together {
+ file "____" as SPACE_api
+ rectangle " C API " as c_api
+ file "____" as SPACE_api2
+ }
+ rectangle "[[#component-schema Schema]]" as schema
+ rectangle "Cursor" as cursor
+ rectangle "Transactions" as txn
+ rectangle "Metadata" as meta
+ rectangle "[[#component-dhandle dhandle/\n Btree]]" as btree
+ rectangle " Row\n storage" as row
+ rectangle " Column\n storage" as column
+ rectangle "History\n Store" as history
+ rectangle "Snapshots" as snapshot
+ rectangle "Cache" as cache
+ rectangle "Eviction" as evict
+
+ together {
+ rectangle " Block\n Manager" as block
+ file "__________" as SPACE_log
+ rectangle "Logging" as log
+ file "___" as SPACE_log2
+ }
+ rectangle " File System & OS \n interface" as os
+}
+together {
+ database "Database\n Files" as wt_file
+ database " Log \n Files" as log_file
+}
+
+' Influence the ordering at the top using (hidden) directed labels
+python_api -[hidden]right-> application
+application -[hidden]right-> utility
+
+python_api -down-> c_api
+application -down-> c_api
+utility -down-> c_api
+
+c_api -down-> schema
+c_api -down-> cursor
+c_api -down-> txn
+SPACE_api -[hidden]right-> c_api
+c_api -[hidden]right-> SPACE_api2
+
+schema -down-> meta
+schema -down-> btree
+cursor -down-> btree
+btree -down-> row
+btree -down-> column
+meta -up-> cursor
+' The hidden arrow helps our boxes to line up in a better way.
+meta -[hidden]right-> btree
+cursor -[hidden]right-> txn
+txn -down-> snapshot
+row -down-> cache
+column -down-> cache
+cache -down-> history
+evict -down-> history
+history -up-> cursor
+snapshot -down-> evict
+cache -right-> evict
+cache -down-> block
+evict -down-> block
+txn -down-> log
+
+block -[hidden]right-> SPACE_log
+cache -[hidden]down-> SPACE_log
+evict -[hidden]down-> SPACE_log
+SPACE_log -[hidden]right-> log
+log -[hidden]right-> SPACE_log2
+
+block -down-> os
+log -down-> os
+os -down-> wt_file
+os -down-> log_file
+
+wt_file -[hidden]right-> log_file
+
+@enduml
+@plantuml_end
+
+We go into some detail for some of the internal components.
+
@subpage arch-glossary
WiredTiger assigns specific meanings to certain words. Here we decode them.
+\anchor component-schema
@subpage arch-schema
Most applications begin to make use of WiredTiger by creating a table (or other
data object) to store their data in. Create is one of several schema operations
available in WiredTiger.
+\anchor component-dhandle
@subpage arch-dhandle-lifecycle
An internal structure called Data Handle (dhandle) is used to represent and
diff --git a/src/third_party/wiredtiger/src/docs/backup.dox b/src/third_party/wiredtiger/src/docs/backup.dox
index ac18263eff0..01223283e60 100644
--- a/src/third_party/wiredtiger/src/docs/backup.dox
+++ b/src/third_party/wiredtiger/src/docs/backup.dox
@@ -10,7 +10,7 @@ apply to data files which don't appear in the backup.
*/
-/*! @m_page{{c,java},backup,Backups}
+/*! @page backup Backups
WiredTiger cursors provide access to data from a variety of sources.
One of these sources is the list of files required to perform a backup
diff --git a/src/third_party/wiredtiger/src/docs/basic-api.dox b/src/third_party/wiredtiger/src/docs/basic-api.dox
index dceb82b06ba..1a02de74fe8 100644
--- a/src/third_party/wiredtiger/src/docs/basic-api.dox
+++ b/src/third_party/wiredtiger/src/docs/basic-api.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},basic_api,Getting Started with the API}
+/*! @page basic_api Getting Started with the API
WiredTiger applications will generally use the following classes to access
and manage data:
@@ -28,11 +28,7 @@ languages (among others).
By default, WiredTiger works as a traditional key/value store, where the
keys and values are
-@m_if{c}
raw byte arrays accessed using a WT_ITEM structure.
-@m_else
-raw byte arrays.
-@m_endif
Keys and values may be up to (4GB - 512B) bytes in size, but depending
on how WT_SESSION::create "maximum item sizes" are configured,
large key and value items will be stored on overflow pages.
@@ -56,17 +52,11 @@ for the single thread accessing the database:
The configuration string @c "create" is passed to ::wiredtiger_open to
indicate the database should be created if it does not already exist.
-@m_if{c}
The code block above also shows simple error handling with
::wiredtiger_strerror (a function that returns a string describing an
error code passed as its argument). More complex error handling can be
configured by passing an implementation of WT_EVENT_HANDLER to
::wiredtiger_open or WT_CONNECTION::open_session.
-@m_endif
-@m_if{java}
-The code block above also shows simple error handling by catching
-WiredTigerException.
-@m_endif
@section basic_create_table Creating a table
diff --git a/src/third_party/wiredtiger/src/docs/build-javadoc.sh b/src/third_party/wiredtiger/src/docs/build-javadoc.sh
deleted file mode 100755
index 421f034c93f..00000000000
--- a/src/third_party/wiredtiger/src/docs/build-javadoc.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-DOCS=`dirname $0`
-TOP=$DOCS/..
-. $TOP/config.sh
-
-CLASSPATH=$THRIFT_HOME/libthrift.jar:$SLF4J_JAR javadoc -public -d $DOCS/java \
- -source 1.5 \
- -sourcepath $TOP/lang/java/src:$TOP/src/server/gen-java \
- -stylesheetfile $DOCS/style/javadoc.css \
- -use -link http://java.sun.com/j2se/1.5.0/docs/api/ \
- -header '<b>WiredTiger API</b><br><font size="-1"> version '$WT_VERSION'</font>' \
- -windowtitle 'WiredTiger Java API' -bottom '<font size=1>Copyright (c) 2008-2020 MongoDB, Inc. All rights reserved.</font>' \
- com.wiredtiger com.wiredtiger.util
diff --git a/src/third_party/wiredtiger/src/docs/build-posix.dox b/src/third_party/wiredtiger/src/docs/build-posix.dox
index 9f612ce95f6..2b263139ad9 100644
--- a/src/third_party/wiredtiger/src/docs/build-posix.dox
+++ b/src/third_party/wiredtiger/src/docs/build-posix.dox
@@ -120,10 +120,6 @@ Configure WiredTiger to sleep and wait for a debugger to attach on failure.
Configure WiredTiger to perform various run-time diagnostic tests.
<b>DO NOT</b> configure this option in production environments.
-@par \c --enable-java
-Build the WiredTiger Java API; requires <a href="http://swig.org">SWIG</a>
-and Java JDK.
-
@par \c --enable-lz4
Configure WiredTiger for <a href="https://github.com/Cyan4973/lz4">LZ4</a>
compression; see @ref compression for more information.
diff --git a/src/third_party/wiredtiger/src/docs/build-windows.dox b/src/third_party/wiredtiger/src/docs/build-windows.dox
index dcd16e30ad1..724fe9bc589 100644
--- a/src/third_party/wiredtiger/src/docs/build-windows.dox
+++ b/src/third_party/wiredtiger/src/docs/build-windows.dox
@@ -89,10 +89,6 @@ Configure WiredTiger to sleep and wait for a debugger to attach on failure.
Configure WiredTiger to perform various run-time diagnostic tests.
<b>DO NOT</b> configure this option in production environments.
-@par \c --enable-java
-Build the WiredTiger <a href="http://www.java.com">Java</a> API,
-requires path to swig.exe and path to Java JDK directory, comma separated.
-
@par \c --enable-python
Build the WiredTiger <a href="http://www.python.org">Python</a> API,
requires path to swig.exe on Windows.
diff --git a/src/third_party/wiredtiger/src/docs/checkpoint.dox b/src/third_party/wiredtiger/src/docs/checkpoint.dox
index 2da3b1df272..184e344e40c 100644
--- a/src/third_party/wiredtiger/src/docs/checkpoint.dox
+++ b/src/third_party/wiredtiger/src/docs/checkpoint.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},checkpoint,Checkpoint durability}
+/*! @page checkpoint Checkpoint durability
WiredTiger supports checkpoint durability by default, and optionally
commit-level durability when logging is enabled. In most applications,
diff --git a/src/third_party/wiredtiger/src/docs/compact.dox b/src/third_party/wiredtiger/src/docs/compact.dox
index 9d37bf77214..46ff42b114f 100644
--- a/src/third_party/wiredtiger/src/docs/compact.dox
+++ b/src/third_party/wiredtiger/src/docs/compact.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},compact,Compaction}
+/*! @page compact Compaction
The WT_SESSION::compact method can be used to compact data sources.
diff --git a/src/third_party/wiredtiger/src/docs/compression.dox b/src/third_party/wiredtiger/src/docs/compression.dox
index 147c4fe2936..bfaba7cec20 100644
--- a/src/third_party/wiredtiger/src/docs/compression.dox
+++ b/src/third_party/wiredtiger/src/docs/compression.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},compression,Compressors}
+/*! @page compression Compressors
This section explains how to configure WiredTiger's builtin support for
the lz4, snappy, zlib and zstd compression engines.
diff --git a/src/third_party/wiredtiger/src/docs/config-strings.dox b/src/third_party/wiredtiger/src/docs/config-strings.dox
index d6291d5b4ba..6348fdde4f2 100644
--- a/src/third_party/wiredtiger/src/docs/config-strings.dox
+++ b/src/third_party/wiredtiger/src/docs/config-strings.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},config_strings,Configuration Strings}
+/*! @page config_strings Configuration Strings
@section config_intro Introduction
@@ -77,14 +77,8 @@ Superfluous commas and whitespace in the configuration string are ignored
combine two configuration strings by concatenating them with a comma in
between.
-@m_if{c}
Empty configuration strings may be represented in C or C++ by passing
<code>NULL</code>.
-@m_endif
-@m_if{java}
-Empty configuration strings may be represented in Java by passing
-<code>null</code>.
-@m_endif
@section config_json JavaScript Object Notation (JSON) compatibility
diff --git a/src/third_party/wiredtiger/src/docs/cursor-join.dox b/src/third_party/wiredtiger/src/docs/cursor-join.dox
index 5ea064a250b..eeceedc2ec2 100644
--- a/src/third_party/wiredtiger/src/docs/cursor-join.dox
+++ b/src/third_party/wiredtiger/src/docs/cursor-join.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},cursor_join,Join cursors}
+/*! @page cursor_join Join cursors
Join cursors provide a way to iterate over a subset of a table, where the subset is specified by relationships with reference cursors.
diff --git a/src/third_party/wiredtiger/src/docs/cursor-log.dox b/src/third_party/wiredtiger/src/docs/cursor-log.dox
index cb54e8b086f..529176c0cb2 100644
--- a/src/third_party/wiredtiger/src/docs/cursor-log.dox
+++ b/src/third_party/wiredtiger/src/docs/cursor-log.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},cursor_log,Log cursors}
+/*! @page cursor_log Log cursors
WiredTiger cursors provide access to data from a variety of sources, and
one of these sources is the records in the transaction log files. Log
@@ -25,11 +25,7 @@ To open a log cursor on the database:
@snippet ex_log.c log cursor open
A log cursor's key is a unique log record identifier, plus a
-@m_if{c}
-uint32_t
-@m_else
-int
-@m_endif
+\c uint32_t
operation counter within that log record. When a log record reflects
something log record that is not a transaction, such as the start of
a checkpoint, the operation counter
@@ -51,17 +47,10 @@ Here is an example of getting the log cursor's key:
The log cursor's value is comprised of six fields:
-@m_if{c}
- a \c uint64_t transaction ID (set for commit records only, otherwise 0),
- a \c uint32_t log record type
- a \c uint32_t operation type (set for commit records only, otherwise 0)
- a \c uint32_t file id (if applicable, otherwise 0)
-@m_else
-- a \c long transaction ID (set for commit records only, otherwise 0),
-- a \c int record type
-- a \c int operation type (set for commit records only, otherwise 0)
-- a \c int file id (if applicable, otherwise 0)
-@m_endif
- the operation key (commit records only, otherwise empty)
- the operation value
diff --git a/src/third_party/wiredtiger/src/docs/cursor-ops.dox b/src/third_party/wiredtiger/src/docs/cursor-ops.dox
index e479ff29191..c9d75295ddc 100644
--- a/src/third_party/wiredtiger/src/docs/cursor-ops.dox
+++ b/src/third_party/wiredtiger/src/docs/cursor-ops.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},cursor_ops,Cursor operations}
+/*! @page cursor_ops Cursor operations
Common operations in WiredTiger are performed using WT_CURSOR handles.
A cursor includes:
@@ -136,7 +136,6 @@ WT_CURSOR::set_value again. That is, the cursor may still reference the
application-supplied memory until the cursor is successfully positioned,
underlying data is modified, or the cursor is closed or reset.
-@m_if{c}
Any pointers returned by WT_CURSOR::get_key or WT_CURSOR::get_value are
only valid until a subsequent cursor call that successfully positions
the cursor, modifies the underlying data, or the cursor is reset or
@@ -145,5 +144,4 @@ that may not be modified or freed by the application. If a longer scope
is required, the application must make a copy of the memory before the
cursor is re-used, closed or reset.
-@m_endif
*/
diff --git a/src/third_party/wiredtiger/src/docs/cursor-random.dox b/src/third_party/wiredtiger/src/docs/cursor-random.dox
index b6434e3d161..e4d075993d9 100644
--- a/src/third_party/wiredtiger/src/docs/cursor-random.dox
+++ b/src/third_party/wiredtiger/src/docs/cursor-random.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},cursor_random,Cursor random}
+/*! @page cursor_random Cursor random
The \c next_random configuration to the WT_SESSION::open_cursor method
configures the cursor to return a pseudo-random record from a row-store
diff --git a/src/third_party/wiredtiger/src/docs/cursors.dox b/src/third_party/wiredtiger/src/docs/cursors.dox
index 6244f02514a..5b067b83b05 100644
--- a/src/third_party/wiredtiger/src/docs/cursors.dox
+++ b/src/third_party/wiredtiger/src/docs/cursors.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},cursors,Cursors}
+/*! @page cursors Cursors
Common operations in WiredTiger are performed using WT_CURSOR handles.
A cursor includes:
@@ -90,15 +90,10 @@ Cursors can be configured for raw mode by specifying the \c "raw" config
keyword to WT_SESSION::open_cursor. In this mode, the methods
WT_CURSOR::get_key, WT_CURSOR::get_value, WT_CURSOR::set_key and
WT_CURSOR::set_value all take a single
-@m_if{c}
WT_ITEM
-@m_else
-byte array
-@m_endif
in the variable-length
argument list instead of a separate argument for each column.
-@m_if{c}
WT_ITEM structures do not need to be cleared before use.
For WT_CURSOR::get_key and WT_CURSOR::get_value in raw mode, the WT_ITEM
@@ -111,7 +106,6 @@ cursor's \c key_format or \c value_format, respectively.
The @ex_ref{ex_schema.c} example creates a table where the value format is
\c "5sHq", where the initial string is the country, the short is a year,
and the long is a population.
-@m_endif
The following example lists the table record
values, using raw mode:
diff --git a/src/third_party/wiredtiger/src/docs/data-sources.dox b/src/third_party/wiredtiger/src/docs/data-sources.dox
index aaee4adc04a..f14886eccf9 100644
--- a/src/third_party/wiredtiger/src/docs/data-sources.dox
+++ b/src/third_party/wiredtiger/src/docs/data-sources.dox
@@ -58,7 +58,7 @@ Advanced applications may also open the following low-level cursor types:
/* ----------------- */
-/*! @m_page{{c,java},data_sources,Data Sources}
+/*! @page data_sources Data Sources
WiredTiger provides access to data from a variety of sources. At the
lowest level, data may be stored in a file using a tree structure. A
diff --git a/src/third_party/wiredtiger/src/docs/durability.dox b/src/third_party/wiredtiger/src/docs/durability.dox
index 68ad68d72e2..ad2950db9ab 100644
--- a/src/third_party/wiredtiger/src/docs/durability.dox
+++ b/src/third_party/wiredtiger/src/docs/durability.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},durability,Commit-level durability}
+/*! @page durability Commit-level durability
WiredTiger supports checkpoint durability by default, and optionally
commit-level durability when logging is enabled. In most applications,
diff --git a/src/third_party/wiredtiger/src/docs/encryption.dox b/src/third_party/wiredtiger/src/docs/encryption.dox
index e3051cf25e9..31a6ce098af 100644
--- a/src/third_party/wiredtiger/src/docs/encryption.dox
+++ b/src/third_party/wiredtiger/src/docs/encryption.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},encryption,Encryptors}
+/*! @page encryption Encryptors
@section encryption_overview Overview of Encryption in WiredTiger
@ref encryption_custom "Custom encryption engines" may be used to
diff --git a/src/third_party/wiredtiger/src/docs/error-handling.dox b/src/third_party/wiredtiger/src/docs/error-handling.dox
index 0fc3405bc98..a83363f026b 100644
--- a/src/third_party/wiredtiger/src/docs/error-handling.dox
+++ b/src/third_party/wiredtiger/src/docs/error-handling.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},error_handling,Error handling}
+/*! @page error_handling Error handling
WiredTiger operations return a value of 0 on success and a non-zero
value on error. Error codes may be either positive or negative:
@@ -9,28 +9,6 @@ codes are WiredTiger-specific (for example, \c WT_ROLLBACK).
WiredTiger-specific error codes always appear in the -31,800 to -31,999
range, inclusive.
-@m_if{java}
-Informational return values, like <code>wiredtiger.WT_NOTFOUND</code>
-or <code>wiredtiger.WT_DUPLICATE_KEY</code> or 0 (success),
-are directly returned by APIs. More severe errors
-are thrown as \c WiredTigerException, which may be caught by the
-application.
-
-The \c WiredTigerRollbackException is a specific type of \c WiredTigerException,
-thrown when there is a conflict between concurrent operations.
-An application that catches this exception should call rollback() on
-the relevant transaction, and retry as necessary.
-
-The \c WiredTigerPanicException is a specific type of \c WiredTigerException,
-thrown when there is a fatal error requiring database restart. Applications
-will normally handle \c WiredTigerPanicException as a special case. A
-correctly-written WiredTiger application will likely catch
-\c WiredTigerPanicException and immediately exit or otherwise handle fatal
-errors. Note that no further WiredTiger calls are required after
-\c WiredTigerPanicException is caught (and further calls will themselves
-immediately fail).
-@m_endif
-
WiredTiger returns \c EBUSY for operations requiring exclusive access, when
an object is not available for exclusive access. For example, the
WT_SESSION::drop or WT_SESSION::verify methods will fail if the object
@@ -39,13 +17,8 @@ open cursors on objects (for example, threads performing operations like
statistics logging), and operations may temporarily fail and return \c EBUSY
when there are no application cursors open on the object.
-@m_if{java}
-The following is a complete list of the WiredTiger-specific return
-values, all constants defined in the com.wiredtiger.db.wiredtiger class:
-@m_else
The following is a complete list of the WiredTiger-specific return
values:
-@m_endif
@if IGNORE_BUILT_BY_API_ERR_BEGIN
@endif
@@ -107,7 +80,6 @@ standard API.
Note that ::wiredtiger_strerror is not thread-safe.
-@m_if{c}
@section event_message_handling Message handling using the WT_EVENT_HANDLER
Specific error and other message handling can be configured by passing an
@@ -133,6 +105,4 @@ fail).
@snippet ex_event_handler.c Function event_handler
@snippet ex_event_handler.c Configure event_handler
-@m_endif
-
*/
diff --git a/src/third_party/wiredtiger/src/docs/eviction.dox b/src/third_party/wiredtiger/src/docs/eviction.dox
index 3519e4ca7f4..5e8822cee8b 100644
--- a/src/third_party/wiredtiger/src/docs/eviction.dox
+++ b/src/third_party/wiredtiger/src/docs/eviction.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},eviction, Eviction}
+/*! @page eviction Eviction
All the operations performed in WiredTiger are on the data read into
pre-configured amount of memory. WiredTiger uses memory as a cache for
diff --git a/src/third_party/wiredtiger/src/docs/file-formats.dox b/src/third_party/wiredtiger/src/docs/file-formats.dox
index 21dc4580bc2..9e66293365a 100644
--- a/src/third_party/wiredtiger/src/docs/file-formats.dox
+++ b/src/third_party/wiredtiger/src/docs/file-formats.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},file_formats,File formats and compression}
+/*! @page file_formats File formats and compression
@section file_formats_formats File formats
@@ -110,7 +110,7 @@ considered. (See @subpage_single huffman for details.)
compressing blocks of the backing object's file. The cost is additional
CPU and memory use when reading and writing pages to disk. Note the
additional CPU cost of block compression can be high, and should be
-considered. (See @x_ref compression_considerations for details.)
+considered. (See @ref compression_considerations for details.)
Block compression is disabled by default.
@@ -146,7 +146,7 @@ Huffman encoding can be high, and should be considered.
compressing blocks of the backing object's file. The cost is additional
CPU and memory use when reading and writing pages to disk. Note the
additional CPU cost of block compression can be high, and should be
-considered. (See @x_ref compression_considerations for details.)
+considered. (See @ref compression_considerations for details.)
Block compression is disabled by default.
@@ -157,7 +157,7 @@ compression: block compression.
compressing blocks of the backing object's file. The cost is additional
CPU and memory use when reading and writing pages to disk. Note the
additional CPU cost of block compression can be high, and should be
-considered. (See @x_ref compression_considerations for details.)
+considered. (See @ref compression_considerations for details.)
Block compression is disabled by default.
diff --git a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_create.png b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_create.png
index d2699646e9c..d2fc00448f0 100644
--- a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_create.png
+++ b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_create.png
Binary files differ
diff --git a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_generic.png b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_generic.png
index 790584b3f7b..f046734ce52 100644
--- a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_generic.png
+++ b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_generic.png
Binary files differ
diff --git a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_rename.png b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_rename.png
index b0aa560946e..65ac52d6fa1 100644
--- a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_rename.png
+++ b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/schema_rename.png
Binary files differ
diff --git a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.cmapx b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.cmapx
new file mode 100644
index 00000000000..411d3905b8e
--- /dev/null
+++ b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.cmapx
@@ -0,0 +1,4 @@
+<map id="wt_diagram_map" name="wt_diagram_map">
+<area shape="rect" id="id1" href="#component-schema" title="#component-schema" alt="" coords="98,224,151,241"/>
+<area shape="rect" id="id2" href="#component-dhandle" title="#component-dhandle" alt="" coords="181,320,244,353"/>
+</map>
diff --git a/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.png b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.png
new file mode 100644
index 00000000000..57480c2156f
--- /dev/null
+++ b/src/third_party/wiredtiger/src/docs/images/plantuml_gen_img/wt_diagram.png
Binary files differ
diff --git a/src/third_party/wiredtiger/src/docs/in-memory.dox b/src/third_party/wiredtiger/src/docs/in-memory.dox
index df221dc34d6..02725097e20 100644
--- a/src/third_party/wiredtiger/src/docs/in-memory.dox
+++ b/src/third_party/wiredtiger/src/docs/in-memory.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},in_memory,In-memory databases}
+/*! @page in_memory In-memory databases
The ::wiredtiger_open \c in_memory configuration changes WiredTiger to
run in cache without writing to a backing disk. Data is limited to the
diff --git a/src/third_party/wiredtiger/src/docs/introduction.dox b/src/third_party/wiredtiger/src/docs/introduction.dox
index 52d1921996a..5e9543cdad6 100644
--- a/src/third_party/wiredtiger/src/docs/introduction.dox
+++ b/src/third_party/wiredtiger/src/docs/introduction.dox
@@ -31,9 +31,6 @@ For more information about building and installing WiredTiger, see:
For more information about writing WiredTiger applications, see:
- @subpage programming
-- @subpage programming_lang_java
-(The Java API is not available on Windows.)
-- @ref wt "WiredTiger API reference manual"
For more information about the architecture and internals of WiredTiger, see:
diff --git a/src/third_party/wiredtiger/src/docs/lsm.dox b/src/third_party/wiredtiger/src/docs/lsm.dox
index 9ee8d52fed6..a5a4f512b61 100644
--- a/src/third_party/wiredtiger/src/docs/lsm.dox
+++ b/src/third_party/wiredtiger/src/docs/lsm.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},lsm,Log-Structured Merge Trees}
+/*! @page lsm Log-Structured Merge Trees
@section lsm_background Background
@@ -42,18 +42,13 @@ An LSM tree can be created as follows, in much the same way as a
WiredTiger btree file:
@code
-@m_if{c}
session->create(session, "table:bucket", "type=lsm,key_format=S,value_format=S");
-@m_else
-session.create("table:bucket", "type=lsm,key_format=S,value_format=S");
-@m_endif
@endcode
Once created, the LSM tree can be accessed using the same cursor interface
as other data sources in WiredTiger:
@code
-@m_if{c}
WT_CURSOR *c;
session->open_cursor(session, "table:bucket", NULL, NULL, &c);
@@ -62,14 +57,6 @@ for(;;) {
c->set_value(c, "value");
c->insert(c);
}
-@m_else
-Cursor c = session.open_cursor("table:bucket", null, null);
-for(;;) {
- c.putKeyString("key");
- c.putValueString("value");
- c.insert();
-}
-@m_endif
@endcode
If an LSM cursor is configured with \c "overwrite=false" passed to
@@ -104,11 +91,7 @@ Tables or indices can be stored using LSM trees. Schema support is provided
for LSM as an extension to the WT_SESSION::create method:
@code
-@m_if{c}
session->create(session, "table:T", "type=lsm");
-@m_else
-session.create("table:T", "type=lsm");
-@m_endif
@endcode
@section lsm_caveats Caveats
diff --git a/src/third_party/wiredtiger/src/docs/namespace.dox b/src/third_party/wiredtiger/src/docs/namespace.dox
index 8657338e369..2fb90d33002 100644
--- a/src/third_party/wiredtiger/src/docs/namespace.dox
+++ b/src/third_party/wiredtiger/src/docs/namespace.dox
@@ -1,10 +1,9 @@
-/*! @m_page{{c,java},namespace,Name spaces}
+/*! @page namespace Name spaces
@section namespace_env Process' environment name space
WiredTiger's environment variables begin with the string "WIREDTIGER".
-@m_if{c}
@section namespace_c C language name space
WiredTiger's public function names begin with the string "wiredtiger".
@@ -13,27 +12,15 @@ WiredTiger's public \c \#define and structure \c typedef declarations
begin with the string "WT_".
WiredTiger's private function names begin with the string "__wt_".
-@m_endif
-
-@m_if{java}
-@section namespace_c Java language name space
-
-WiredTiger's public classes are in the \c com.wiredtiger.db package.
-
-The \c com.wiredtiger.db.wiredtiger class contains static methods
-and inherited constants.
-@m_endif
@section namespace_filesystem File system name space
WiredTiger's files begin with the string "WiredTiger"; applications
should not create files in the WiredTiger file system name space.
-@m_if{c}
@section namespace_error Error return name space
WiredTiger reserves all values from -31,800 to -31,999 as possible error
return values.
-@m_endif
*/
diff --git a/src/third_party/wiredtiger/src/docs/operation_tracking.dox b/src/third_party/wiredtiger/src/docs/operation_tracking.dox
index b49ec1aa91a..4a75e768747 100644
--- a/src/third_party/wiredtiger/src/docs/operation_tracking.dox
+++ b/src/third_party/wiredtiger/src/docs/operation_tracking.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},operation_tracking,Track function calls}
+/*! @page operation_tracking Track function calls
When this option is enabled, WiredTiger tracks all API calls as well as certain
functions that are deemed important for performance, such as eviction-related
diff --git a/src/third_party/wiredtiger/src/docs/packing.dox b/src/third_party/wiredtiger/src/docs/packing.dox
index aca9cd72b46..ca857d1b90d 100644
--- a/src/third_party/wiredtiger/src/docs/packing.dox
+++ b/src/third_party/wiredtiger/src/docs/packing.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},packing,Packing and Unpacking Data}
+/*! @page packing Packing and Unpacking Data
WiredTiger's data packing uses format strings similar to those specified in the
Python struct module:
@@ -27,7 +27,6 @@ The remaining characters in the format string specify the type of each field
to be packed into or unpacked from a byte array. See @ref schema_column_types
for the list of supported types.
-@m_if{c}
@todo Describe the variable-length integer packing in sufficient detail that it can be re-implemented in other programming languages or in network clients.
@section config_examples Code samples
@@ -35,10 +34,5 @@ for the list of supported types.
The code below is taken from the complete example program @ex_ref{ex_pack.c}. It demonstrates how to pack three integer values into a buffer and then unpack them again.
@snippet ex_pack.c packing
-@m_else
-In Java, data is packed and unpacked using cursor put* and get* operations,
-for example:
-@snippet ex_schema.c Insert and list records
-@m_endif
*/
diff --git a/src/third_party/wiredtiger/src/docs/programming.dox b/src/third_party/wiredtiger/src/docs/programming.dox
index ae3d3337860..9be7337ca06 100644
--- a/src/third_party/wiredtiger/src/docs/programming.dox
+++ b/src/third_party/wiredtiger/src/docs/programming.dox
@@ -1,11 +1,7 @@
-/*! @m_page{{c,java},programming,Writing WiredTiger applications}
+/*! @page programming Writing WiredTiger applications
This section covers topics of interest for programmers writing
-@m_if{c}
WiredTiger applications.
-@m_else
-WiredTiger applications in Java.
-@m_endif
We follow SQL terminology: a database is set of tables managed together.
Tables consist of rows, where each row is a key and its associated
@@ -31,9 +27,7 @@ each of which is ordered by one or more columns.
- @subpage threads
- @subpage namespace
- @subpage readonly
-@m_if{c}
- @subpage signals
-@m_endif
<h2>Advanced topics</h2>
- @subpage backup
@@ -49,14 +43,12 @@ each of which is ordered by one or more columns.
- @subpage statistics
- @subpage_single upgrade
-@m_if{c}
<h2>Extending WiredTiger</h2>
- @subpage extensions
- @subpage custom_collators
- @subpage custom_extractors
- @subpage custom_data_sources
- @subpage custom_file_systems
-@m_endif
<h2>Performance monitoring and tuning</h2>
- @subpage_single tune_statistics
diff --git a/src/third_party/wiredtiger/src/docs/readonly.dox b/src/third_party/wiredtiger/src/docs/readonly.dox
index 35378cf9567..b15d6d2f42b 100644
--- a/src/third_party/wiredtiger/src/docs/readonly.dox
+++ b/src/third_party/wiredtiger/src/docs/readonly.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},readonly,Database read-only mode}
+/*! @page readonly Database read-only mode
WiredTiger supports read-only mode databases. When a database is opened
in read-only mode, all modifications are disabled on the WT_CONNECTION
diff --git a/src/third_party/wiredtiger/src/docs/schema.dox b/src/third_party/wiredtiger/src/docs/schema.dox
index 4427111ba2a..1ae24d1f759 100644
--- a/src/third_party/wiredtiger/src/docs/schema.dox
+++ b/src/third_party/wiredtiger/src/docs/schema.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},schema,Schema, Columns, Column Groups, Indices and Projections}
+/*! @page schema Schema, Columns, Column Groups, Indices and Projections
While many tables have simple key/value pairs for records, WiredTiger
also supports more complex data patterns.
@@ -98,19 +98,14 @@ NUL character. When preceded by a size, that indicates the maximum number of
bytes the string can store. In a string with characters less than the
specified size, the remaining bytes are NUL padded. If the supplied string
is longer than the specified size, it will be stored without a trailing NUL.
-@m_if{java}
-Because of this, the associated Java String may not contain the NUL character.
-@m_endif
The \c 't' type is used for fixed-length bit field values. If
it is preceded by a size, that indicates the number of bits to store,
between 1 and 8. That number of low-order bits will be stored in the
table. The default is a size of 1 bit: that is, a boolean.
-@m_if{c}
C applications must always use a \c uint8_t type (or equivalently,
<code>unsigned char</code>) for calls to WT_CURSOR::set_value, and a
pointer to the same for calls to WT_CURSOR::get_value.
-@m_endif
If a bit field
value is combined with other types in a packing format, it is equivalent to
\c 'B', and a full byte is used to store it.
@@ -140,11 +135,7 @@ natural integer ordering under the default collator.
See @subpage packing for details of WiredTiger's packing format.
WiredTiger can also be extended with custom collators by implementing the
-@m_if{c}
WT_COLLATOR interface.
-@m_else
-WT_COLLATOR interface (C only).
-@m_endif
@section schema_key_and_value_formats Key and value formats
@@ -166,15 +157,9 @@ follows:
@section schema_cursor_formats Cursor formats
Cursors for a table have the same key format as the table itself.
-@m_if{c}
The key columns of a cursor are set with WT_CURSOR::set_key and accessed with
WT_CURSOR::get_key. WT_CURSOR::set_key is analogous to \c printf,
and takes a list of value
-@m_else
-The key columns of a cursor are set with the \c Cursor.putKey* methods
-and accessed with the \c Cursor.getKey* methods. \c Cursor.putKey* methods
-must be called
-@m_endif
in the order the key columns are configured in \c
key_format.
@@ -194,12 +179,8 @@ the key_format was \c "SiH", would be done as follows:
@snippet ex_all.c Set the cursor's composite key
The key's values are accessed with
-@m_if{c}
WT_CURSOR::get_key, which is analogous
to \c scanf, and takes a list of pointers to values in the same order:
-@m_else
-successive calls to \c Cursor.getKey* methods:
-@m_endif
@snippet ex_all.c Get the cursor's string key
@snippet ex_all.c Get the cursor's record number key
@@ -209,15 +190,9 @@ Cursors for a table have the same value format as the table, unless a
projection is configured with WT_SESSION::open_cursor. See
@ref cursor_projections for more information.
-@m_if{c}
WT_CURSOR::set_value is used to set value columns, and
WT_CURSOR::get_value is used to get value columns, in the same way as
described for WT_CURSOR::set_key and WT_CURSOR::get_key.
-@m_else
-\c The Cursor.putValue* methods are used to set value columns, and
-\c Cursor.getValue* are used to get value columns, in the same way as
-described for \c Cursor.putKey* and \c Cursor.getKey*.
-@m_endif
@section schema_columns Columns
@@ -307,11 +282,7 @@ Cursors are opened on indices by passing the index's URI to the
WT_SESSION::open_cursor method.
Index cursors use the specified index key columns for
-@m_if{c}
WT_CURSOR::get_key and WT_CURSOR::set_key.
-@m_else
-\c Cursor.getKey* and \c Cursor.putKey* calls.
-@m_endif
For example, we can retrieve information from
the \c country index as follows:
@@ -323,11 +294,7 @@ to the WT_SESSION::create call:
@snippet ex_schema.c Create an index with a composite key
To retrieve information from a composite index requires a more complicated
-@m_if{c}
WT_CURSOR::set_key call,
-@m_else
-set of \c Cursor.putKey* calls,
-@m_endif
but is otherwise the same:
@snippet ex_schema.c Search in a composite index
@@ -350,18 +317,10 @@ An example of using an immutable index is:
@section schema_index_projections Index cursor projections
By default, index cursors return all of the table's value columns from
-@m_if{c}
WT_CURSOR::get_value.
-@m_else
-\c Cursor.getValue* calls.
-@m_endif
The application can specify that a subset of the
usual columns should be returned in calls to
-@m_if{c}
WT_CURSOR::get_value
-@m_else
-\c Cursor.getValue
-@m_endif
by appending a list of columns to the \c uri parameter of the
WT_SESSION::open_cursor call. This is called a \em projection, see
@ref cursor_projections for more details.
diff --git a/src/third_party/wiredtiger/src/docs/shared-cache.dox b/src/third_party/wiredtiger/src/docs/shared-cache.dox
index 95422caabda..57efe92f7bf 100644
--- a/src/third_party/wiredtiger/src/docs/shared-cache.dox
+++ b/src/third_party/wiredtiger/src/docs/shared-cache.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},shared_cache,Per-process shared caches}
+/*! @page shared_cache Per-process shared caches
WiredTiger supports sharing a single cache among multiple databases within
a process.
diff --git a/src/third_party/wiredtiger/src/docs/spell.ok b/src/third_party/wiredtiger/src/docs/spell.ok
index 26f40b5e099..b153ba12668 100644
--- a/src/third_party/wiredtiger/src/docs/spell.ok
+++ b/src/third_party/wiredtiger/src/docs/spell.ok
@@ -246,6 +246,10 @@ fdatasync
fextend
fh
fieldname
+fileBackgroundColor
+fileBorderColor
+fileFontColor
+fileShadowing
fileID
fileformats
fileid
@@ -481,6 +485,7 @@ seqno
serializable
sess
sid
+skinparam
skiplist
spinlock
spinlocks
diff --git a/src/third_party/wiredtiger/src/docs/statistics.dox b/src/third_party/wiredtiger/src/docs/statistics.dox
index 3735a009d56..9914ef46386 100644
--- a/src/third_party/wiredtiger/src/docs/statistics.dox
+++ b/src/third_party/wiredtiger/src/docs/statistics.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},statistics,Statistics}
+/*! @page statistics Statistics
WiredTiger can be configured to maintain a variety of run-time and
data-source statistics. As maintaining statistics may involve updating
diff --git a/src/third_party/wiredtiger/src/docs/threads.dox b/src/third_party/wiredtiger/src/docs/threads.dox
index 1021a1df81e..cc45d01a34a 100644
--- a/src/third_party/wiredtiger/src/docs/threads.dox
+++ b/src/third_party/wiredtiger/src/docs/threads.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},threads,Multithreading}
+/*! @page threads Multithreading
All WT_CONNECTION methods are thread safe, and WT_CONNECTION handles can
be shared between threads. Applications typically open a single
diff --git a/src/third_party/wiredtiger/src/docs/tools/doxfilter.py b/src/third_party/wiredtiger/src/docs/tools/doxfilter.py
index 26c8e07c691..efe5c3ca80a 100755
--- a/src/third_party/wiredtiger/src/docs/tools/doxfilter.py
+++ b/src/third_party/wiredtiger/src/docs/tools/doxfilter.py
@@ -31,8 +31,6 @@
# WiredTiger reference manual. It changes comments to Javadoc style
# (i.e., from "/*!" to "/**"), because the latter are configured to not
# search for brief descriptions at the beginning of pages.
-# It also processes any page marked with @m_page specially to create
-# multiple per-language versions of the page.
import re, sys
@@ -44,149 +42,8 @@ def err(arg):
sys.stderr.write(filename + ':' + str(linenum) + ': ERROR: ' + arg + '\n')
sys.exit(1)
-def java_post_substitutions(source):
- result = source
- for datatype in [['WT_CONNECTION', 'Connection'],
- ['WT_CURSOR', 'Cursor'],
- ['WT_SESSION', 'Session']]:
- fromdt = datatype[0]
- todt = datatype[1]
-
- # e.g. replace("WT_CONNECTION::", "Connection.").
- # replace("WT_CONNECTION", "Connection")
- # replace("::WT_CONNECTION", "Connection")
- # etc.
- result = result.replace(fromdt + '::', todt + '.')
- result = re.sub(r':*' + fromdt, todt, result)
-
- # We fix back any 'ref' entries, since we don't have
- # many java versions of these refered-to pages.
- #
- # Ideally, we'd have a way ('@m_ref'?) to indicate which
- # ones could refer to a Java version.
- result = result.replace('ref ' + todt + '.', 'ref ' + fromdt + '::')
- result = result.replace('::wiredtiger_open', '\c wiredtiger.open')
- return result
-
-def process_lang(lang, lines):
- result = ''
- lang_ext = '.' + lang
- class_suffix = None
- if lang == 'c':
- lang_suffix = ""
- lang_desc=""
- elif lang == 'java':
- lang_suffix = "_lang_java"
- lang_desc=" in Java"
- else:
- err('@m_page contains illegal lang: ' + lang)
- condstack = [True]
- linenum = 0
- mif_pat = re.compile(r'^\s*@m_if{([^,}]*)}')
- melse_pat = re.compile(r'^\s*@m_else\s*$')
- mendif_pat = re.compile(r'^\s*@m_endif\s*$')
- mpage_pat = re.compile(r'@m_page{{([^}]*)},([^,}]*),([^}]*)}')
- mpage_rep = r'@page \2' + lang_suffix + r' \3 ' + lang_desc
- ref_pat = re.compile(r'@ref\s+(\w*)')
- ref_rep = r'@ref \1' + lang_suffix
- snip_pat = re.compile(r'@snippet ex_([^.]*)[.]c\s+(.*)')
- snip_rep = r'@snippet ex_\1' + lang_ext + r' \2'
- section_pat = re.compile(r'(^@\w*section)\s+(\w*)')
- section_rep = r'\1 \2' + lang_suffix
- subpage_pat = re.compile(r'@subpage\s+(\w*)')
- subpage_rep = r'@subpage \1' + lang_suffix
- exref_pat = re.compile(r'@ex_ref{ex_([^.]*)[.]c}')
- # Add some ability to have non-language references
- x_ref_pat = re.compile(r'@x_ref\s+(\w*)')
- x_ref_rep = r'@ref \1'
- if lang == 'c':
- exref_rep = r'@ex_ref{ex_\1' + lang_ext + '}'
- else:
- # Though we have java examples, we don't have references
- # to them working yet, so strip the @ex_ref.
- exref_rep = r'ex_\1' + lang_ext
-
- # Any remaining @m_foo{...} aliases are
- # diverted to @c_foo{...} or @java_foo{...}
- mgeneric_pat = re.compile(r'@m_([^ }]*)')
- mgeneric_rep = r'@' + lang + r'_\1'
- for line in lines:
- linenum += 1
- if lang != 'c':
- line = re.sub(exref_pat, exref_rep, line)
- line = re.sub(ref_pat, ref_rep, line)
- line = re.sub(section_pat, section_rep, line)
- line = re.sub(snip_pat, snip_rep, line)
- line = re.sub(mpage_pat, mpage_rep, line)
- line = re.sub(subpage_pat, subpage_rep, line)
- line = re.sub(x_ref_pat, x_ref_rep, line)
- if '@m_if' in line:
- m = re.search(mif_pat, line)
- if not m:
- err('@m_if incorrect syntax')
- iflang = m.groups()[0]
- if iflang != 'java' and iflang != 'c':
- err('@m_if unknown language')
- condstack.append(iflang == lang)
- elif '@m_else' in line:
- if not re.search(melse_pat, line):
- err('@m_else has extraneous stuff')
- if len(condstack) <= 1:
- err('@m_else missing if')
- condstack[-1] = not condstack[-1]
- elif '@m_endif' in line:
- if not re.search(mendif_pat, line):
- err('@m_endif has extraneous stuff')
- if len(condstack) <= 1:
- err('@m_endif missing if')
- condstack.pop()
- else:
- if condstack[-1]:
- # Do generic @m_... macros last
- line = re.sub(mgeneric_pat,
- mgeneric_rep, line)
- result += line + '\n'
- if lang == 'java':
- result = java_post_substitutions(result)
- if len(condstack) != 1:
- err('non matching @m_if/@m_endif')
- return result
-
-# Collect all lines between @m_page and the comment end to
-# be processed multiple times, once for each language.
-def process_multilang(source):
- result = ''
- in_mpage = False
- mpage_content = []
- mpage_pat = re.compile(r'@m_page{{([^}]*)},([^,}]*),([^}]*)}')
- mpage_end_pat = re.compile(r'\*/')
- for line in source.split('\n'):
- m = re.search(mpage_pat, line)
- if line.count('@m_page') > 0 and not m:
- err('@m_page incorrect syntax')
- if m:
- if in_mpage:
- err('multiple @m_page without end of comment')
- else:
- in_mpage = True
- langs = m.groups()[0].split(',')
- if in_mpage:
- mpage_content.append(line)
- else:
- result += line + '\n'
- if re.search(mpage_end_pat, line):
- if in_mpage:
- in_mpage = False
- for lang in langs:
- result += process_lang(lang, mpage_content)
- mpage_content = []
- return result
-
def process(source):
- source = source.replace(r'/*!', r'/**')
- if '@m_' in source:
- source = process_multilang(source)
- return source
+ return source.replace(r'/*!', r'/**')
if __name__ == '__main__':
for f in sys.argv[1:]:
diff --git a/src/third_party/wiredtiger/src/docs/transactions.dox b/src/third_party/wiredtiger/src/docs/transactions.dox
index 870e4735f54..2411c65beca 100644
--- a/src/third_party/wiredtiger/src/docs/transactions.dox
+++ b/src/third_party/wiredtiger/src/docs/transactions.dox
@@ -1,4 +1,4 @@
-/*! @m_page{{c,java},transactions,Transactions}
+/*! @page transactions Transactions
@section transactions_acid ACID properties
diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c
index dff2a235625..3195928ac77 100644
--- a/src/third_party/wiredtiger/src/evict/evict_page.c
+++ b/src/third_party/wiredtiger/src/evict/evict_page.c
@@ -259,6 +259,10 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, uint8_t previous_state, uint32
WT_STAT_DATA_INCR(session, cache_eviction_dirty);
}
+ /* Count page evictions in parallel with checkpoint. */
+ if (conn->txn_global.checkpoint_running)
+ WT_STAT_CONN_INCR(session, cache_eviction_pages_in_parallel_with_checkpoint);
+
if (0) {
err:
if (!closing)
diff --git a/src/third_party/wiredtiger/src/history/hs_rec.c b/src/third_party/wiredtiger/src/history/hs_rec.c
index a03b8e31739..2c5e48e1ca6 100644
--- a/src/third_party/wiredtiger/src/history/hs_rec.c
+++ b/src/third_party/wiredtiger/src/history/hs_rec.c
@@ -847,10 +847,11 @@ __hs_fixup_out_of_order_from_pos(WT_SESSION_IMPL *session, WT_CURSOR *hs_cursor,
WT_CURSOR_BTREE *hs_cbt;
WT_DECL_RET;
WT_HS_TIME_POINT start_time_point, stop_time_point;
- WT_ITEM hs_key;
+ WT_ITEM hs_key, hs_value;
+ WT_TIME_WINDOW tw;
WT_UPDATE *tombstone;
wt_timestamp_t hs_ts;
- uint64_t hs_counter;
+ uint64_t hs_counter, hs_upd_type;
uint32_t hs_btree_id;
int cmp;
char ts_string[5][WT_TS_INT_STRING_SIZE];
@@ -859,6 +860,7 @@ __hs_fixup_out_of_order_from_pos(WT_SESSION_IMPL *session, WT_CURSOR *hs_cursor,
insert_cursor = NULL;
hs_cbt = (WT_CURSOR_BTREE *)hs_cursor;
WT_CLEAR(hs_key);
+ WT_CLEAR(hs_value);
tombstone = NULL;
/*
@@ -973,9 +975,13 @@ __hs_fixup_out_of_order_from_pos(WT_SESSION_IMPL *session, WT_CURSOR *hs_cursor,
stop_time_point.ts = stop_time_point.durable_ts = ts;
stop_time_point.txnid = hs_cbt->upd_value->tw.stop_txn;
+ /* Extract the underlying value for reinsertion. */
+ WT_ERR(hs_cursor->get_value(
+ hs_cursor, &tw.durable_stop_ts, &tw.durable_start_ts, &hs_upd_type, &hs_value));
+
/* Reinsert entry with earlier timestamp. */
while ((ret = __hs_insert_record_with_btree_int(session, insert_cursor, btree, key,
- WT_UPDATE_STANDARD, &hs_cursor->value, &start_time_point, &stop_time_point,
+ (uint8_t)hs_upd_type, &hs_value, &start_time_point, &stop_time_point,
*counter)) == WT_RESTART)
;
WT_ERR(ret);
diff --git a/src/third_party/wiredtiger/src/include/btree.h b/src/third_party/wiredtiger/src/include/btree.h
index 11d05c1f327..238cb7e6fd1 100644
--- a/src/third_party/wiredtiger/src/include/btree.h
+++ b/src/third_party/wiredtiger/src/include/btree.h
@@ -166,8 +166,9 @@ struct __wt_btree {
WT_BM *bm; /* Block manager reference */
u_int block_header; /* WT_PAGE_HEADER_BYTE_SIZE */
- uint64_t write_gen; /* Write generation */
- uint64_t rec_max_txn; /* Maximum txn seen (clean trees) */
+ uint64_t write_gen; /* Write generation */
+ uint64_t base_write_gen; /* Write generation on startup. */
+ uint64_t rec_max_txn; /* Maximum txn seen (clean trees) */
wt_timestamp_t rec_max_timestamp;
uint64_t checkpoint_gen; /* Checkpoint generation */
diff --git a/src/third_party/wiredtiger/src/include/cell_inline.h b/src/third_party/wiredtiger/src/include/cell_inline.h
index e0dfecdf89c..37a8f31305e 100644
--- a/src/third_party/wiredtiger/src/include/cell_inline.h
+++ b/src/third_party/wiredtiger/src/include/cell_inline.h
@@ -970,7 +970,7 @@ __cell_unpack_window_cleanup(WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk
* No delete txnid=MAX, ts=MAX, txnid=MAX, ts=MAX,
* durable_ts=NONE durable_ts=NONE
*/
- if (dsk->write_gen == 0 || dsk->write_gen > S2C(session)->base_write_gen)
+ if (dsk->write_gen == 0 || dsk->write_gen > S2BT(session)->base_write_gen)
return;
/* Tell reconciliation we cleared the transaction ids and the cell needs to be rebuilt. */
diff --git a/src/third_party/wiredtiger/src/include/gcc.h b/src/third_party/wiredtiger/src/include/gcc.h
index be4503f3492..85ba3214d3e 100644
--- a/src/third_party/wiredtiger/src/include/gcc.h
+++ b/src/third_party/wiredtiger/src/include/gcc.h
@@ -218,17 +218,28 @@ WT_ATOMIC_FUNC(size, size_t, size_t *vp, size_t v)
#elif defined(__aarch64__)
#define WT_PAUSE() __asm__ volatile("yield" ::: "memory")
-#define WT_FULL_BARRIER() \
- do { \
- __asm__ volatile("dsb sy" ::: "memory"); \
+
+/*
+ * dmb are chosen here because they are sufficient to guarantee the ordering described above. We
+ * don't want to use dsbs because they provide a much stronger guarantee of completion which isn't
+ * required. Additionally, dsbs synchronize other system activities such as tlb and cache
+ * maintenance instructions which is not required in this case.
+ *
+ * A shareability domain of inner-shareable is selected because all the entities participating in
+ * the ordering requirements are CPUs and ordering with respect to other devices or memory-types
+ * isn't required.
+ */
+#define WT_FULL_BARRIER() \
+ do { \
+ __asm__ volatile("dmb ish" ::: "memory"); \
} while (0)
-#define WT_READ_BARRIER() \
- do { \
- __asm__ volatile("dsb ld" ::: "memory"); \
+#define WT_READ_BARRIER() \
+ do { \
+ __asm__ volatile("dsb ishld" ::: "memory"); \
} while (0)
-#define WT_WRITE_BARRIER() \
- do { \
- __asm__ volatile("dsb st" ::: "memory"); \
+#define WT_WRITE_BARRIER() \
+ do { \
+ __asm__ volatile("dsb ishst" ::: "memory"); \
} while (0)
#elif defined(__s390x__)
diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h
index 0cce228d4b5..8b02e97779c 100644
--- a/src/third_party/wiredtiger/src/include/stat.h
+++ b/src/third_party/wiredtiger/src/include/stat.h
@@ -422,6 +422,7 @@ struct __wt_connection_stats {
int64_t cache_write_hs;
int64_t cache_pages_inuse;
int64_t cache_eviction_app;
+ int64_t cache_eviction_pages_in_parallel_with_checkpoint;
int64_t cache_eviction_pages_queued;
int64_t cache_eviction_pages_queued_post_lru;
int64_t cache_eviction_pages_queued_urgent;
diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in
index 7212eea989e..24fbbeb1f24 100644
--- a/src/third_party/wiredtiger/src/include/wiredtiger.in
+++ b/src/third_party/wiredtiger/src/include/wiredtiger.in
@@ -4969,823 +4969,825 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
#define WT_STAT_CONN_CACHE_PAGES_INUSE 1125
/*! cache: pages evicted by application threads */
#define WT_STAT_CONN_CACHE_EVICTION_APP 1126
+/*! cache: pages evicted in parallel with checkpoint */
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_IN_PARALLEL_WITH_CHECKPOINT 1127
/*! cache: pages queued for eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1127
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED 1128
/*! cache: pages queued for eviction post lru sorting */
-#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_POST_LRU 1128
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_POST_LRU 1129
/*! cache: pages queued for urgent eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1129
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_URGENT 1130
/*! cache: pages queued for urgent eviction during walk */
-#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1130
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_QUEUED_OLDEST 1131
/*! cache: pages read into cache */
-#define WT_STAT_CONN_CACHE_READ 1131
+#define WT_STAT_CONN_CACHE_READ 1132
/*! cache: pages read into cache after truncate */
-#define WT_STAT_CONN_CACHE_READ_DELETED 1132
+#define WT_STAT_CONN_CACHE_READ_DELETED 1133
/*! cache: pages read into cache after truncate in prepare state */
-#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1133
+#define WT_STAT_CONN_CACHE_READ_DELETED_PREPARED 1134
/*! cache: pages requested from the cache */
-#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1134
+#define WT_STAT_CONN_CACHE_PAGES_REQUESTED 1135
/*! cache: pages seen by eviction walk */
-#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1135
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_SEEN 1136
/*! cache: pages seen by eviction walk that are already queued */
-#define WT_STAT_CONN_CACHE_EVICTION_PAGES_ALREADY_QUEUED 1136
+#define WT_STAT_CONN_CACHE_EVICTION_PAGES_ALREADY_QUEUED 1137
/*! cache: pages selected for eviction unable to be evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1137
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1138
/*!
* cache: pages selected for eviction unable to be evicted as the parent
* page has overflow items
*/
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL_PARENT_HAS_OVERFLOW_ITEMS 1138
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL_PARENT_HAS_OVERFLOW_ITEMS 1139
/*!
* cache: pages selected for eviction unable to be evicted because of
* active children on an internal page
*/
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL_ACTIVE_CHILDREN_ON_AN_INTERNAL_PAGE 1139
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL_ACTIVE_CHILDREN_ON_AN_INTERNAL_PAGE 1140
/*!
* cache: pages selected for eviction unable to be evicted because of
* failure in reconciliation
*/
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL_IN_RECONCILIATION 1140
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL_IN_RECONCILIATION 1141
/*! cache: pages walked for eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_WALK 1141
+#define WT_STAT_CONN_CACHE_EVICTION_WALK 1142
/*! cache: pages written from cache */
-#define WT_STAT_CONN_CACHE_WRITE 1142
+#define WT_STAT_CONN_CACHE_WRITE 1143
/*! cache: pages written requiring in-memory restoration */
-#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1143
+#define WT_STAT_CONN_CACHE_WRITE_RESTORE 1144
/*! cache: percentage overhead */
-#define WT_STAT_CONN_CACHE_OVERHEAD 1144
+#define WT_STAT_CONN_CACHE_OVERHEAD 1145
/*! cache: tracked bytes belonging to internal pages in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1145
+#define WT_STAT_CONN_CACHE_BYTES_INTERNAL 1146
/*! cache: tracked bytes belonging to leaf pages in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_LEAF 1146
+#define WT_STAT_CONN_CACHE_BYTES_LEAF 1147
/*! cache: tracked dirty bytes in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1147
+#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1148
/*! cache: tracked dirty pages in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1148
+#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1149
/*! cache: unmodified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1149
+#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1150
/*! capacity: background fsync file handles considered */
-#define WT_STAT_CONN_FSYNC_ALL_FH_TOTAL 1150
+#define WT_STAT_CONN_FSYNC_ALL_FH_TOTAL 1151
/*! capacity: background fsync file handles synced */
-#define WT_STAT_CONN_FSYNC_ALL_FH 1151
+#define WT_STAT_CONN_FSYNC_ALL_FH 1152
/*! capacity: background fsync time (msecs) */
-#define WT_STAT_CONN_FSYNC_ALL_TIME 1152
+#define WT_STAT_CONN_FSYNC_ALL_TIME 1153
/*! capacity: bytes read */
-#define WT_STAT_CONN_CAPACITY_BYTES_READ 1153
+#define WT_STAT_CONN_CAPACITY_BYTES_READ 1154
/*! capacity: bytes written for checkpoint */
-#define WT_STAT_CONN_CAPACITY_BYTES_CKPT 1154
+#define WT_STAT_CONN_CAPACITY_BYTES_CKPT 1155
/*! capacity: bytes written for eviction */
-#define WT_STAT_CONN_CAPACITY_BYTES_EVICT 1155
+#define WT_STAT_CONN_CAPACITY_BYTES_EVICT 1156
/*! capacity: bytes written for log */
-#define WT_STAT_CONN_CAPACITY_BYTES_LOG 1156
+#define WT_STAT_CONN_CAPACITY_BYTES_LOG 1157
/*! capacity: bytes written total */
-#define WT_STAT_CONN_CAPACITY_BYTES_WRITTEN 1157
+#define WT_STAT_CONN_CAPACITY_BYTES_WRITTEN 1158
/*! capacity: threshold to call fsync */
-#define WT_STAT_CONN_CAPACITY_THRESHOLD 1158
+#define WT_STAT_CONN_CAPACITY_THRESHOLD 1159
/*! capacity: time waiting due to total capacity (usecs) */
-#define WT_STAT_CONN_CAPACITY_TIME_TOTAL 1159
+#define WT_STAT_CONN_CAPACITY_TIME_TOTAL 1160
/*! capacity: time waiting during checkpoint (usecs) */
-#define WT_STAT_CONN_CAPACITY_TIME_CKPT 1160
+#define WT_STAT_CONN_CAPACITY_TIME_CKPT 1161
/*! capacity: time waiting during eviction (usecs) */
-#define WT_STAT_CONN_CAPACITY_TIME_EVICT 1161
+#define WT_STAT_CONN_CAPACITY_TIME_EVICT 1162
/*! capacity: time waiting during logging (usecs) */
-#define WT_STAT_CONN_CAPACITY_TIME_LOG 1162
+#define WT_STAT_CONN_CAPACITY_TIME_LOG 1163
/*! capacity: time waiting during read (usecs) */
-#define WT_STAT_CONN_CAPACITY_TIME_READ 1163
+#define WT_STAT_CONN_CAPACITY_TIME_READ 1164
/*! checkpoint-cleanup: pages added for eviction */
-#define WT_STAT_CONN_CC_PAGES_EVICT 1164
+#define WT_STAT_CONN_CC_PAGES_EVICT 1165
/*! checkpoint-cleanup: pages removed */
-#define WT_STAT_CONN_CC_PAGES_REMOVED 1165
+#define WT_STAT_CONN_CC_PAGES_REMOVED 1166
/*! checkpoint-cleanup: pages skipped during tree walk */
-#define WT_STAT_CONN_CC_PAGES_WALK_SKIPPED 1166
+#define WT_STAT_CONN_CC_PAGES_WALK_SKIPPED 1167
/*! checkpoint-cleanup: pages visited */
-#define WT_STAT_CONN_CC_PAGES_VISITED 1167
+#define WT_STAT_CONN_CC_PAGES_VISITED 1168
/*! connection: auto adjusting condition resets */
-#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1168
+#define WT_STAT_CONN_COND_AUTO_WAIT_RESET 1169
/*! connection: auto adjusting condition wait calls */
-#define WT_STAT_CONN_COND_AUTO_WAIT 1169
+#define WT_STAT_CONN_COND_AUTO_WAIT 1170
/*!
* connection: auto adjusting condition wait raced to update timeout and
* skipped updating
*/
-#define WT_STAT_CONN_COND_AUTO_WAIT_SKIPPED 1170
+#define WT_STAT_CONN_COND_AUTO_WAIT_SKIPPED 1171
/*! connection: detected system time went backwards */
-#define WT_STAT_CONN_TIME_TRAVEL 1171
+#define WT_STAT_CONN_TIME_TRAVEL 1172
/*! connection: files currently open */
-#define WT_STAT_CONN_FILE_OPEN 1172
+#define WT_STAT_CONN_FILE_OPEN 1173
/*! connection: hash bucket array size for data handles */
-#define WT_STAT_CONN_BUCKETS_DH 1173
+#define WT_STAT_CONN_BUCKETS_DH 1174
/*! connection: hash bucket array size general */
-#define WT_STAT_CONN_BUCKETS 1174
+#define WT_STAT_CONN_BUCKETS 1175
/*! connection: memory allocations */
-#define WT_STAT_CONN_MEMORY_ALLOCATION 1175
+#define WT_STAT_CONN_MEMORY_ALLOCATION 1176
/*! connection: memory frees */
-#define WT_STAT_CONN_MEMORY_FREE 1176
+#define WT_STAT_CONN_MEMORY_FREE 1177
/*! connection: memory re-allocations */
-#define WT_STAT_CONN_MEMORY_GROW 1177
+#define WT_STAT_CONN_MEMORY_GROW 1178
/*! connection: pthread mutex condition wait calls */
-#define WT_STAT_CONN_COND_WAIT 1178
+#define WT_STAT_CONN_COND_WAIT 1179
/*! connection: pthread mutex shared lock read-lock calls */
-#define WT_STAT_CONN_RWLOCK_READ 1179
+#define WT_STAT_CONN_RWLOCK_READ 1180
/*! connection: pthread mutex shared lock write-lock calls */
-#define WT_STAT_CONN_RWLOCK_WRITE 1180
+#define WT_STAT_CONN_RWLOCK_WRITE 1181
/*! connection: total fsync I/Os */
-#define WT_STAT_CONN_FSYNC_IO 1181
+#define WT_STAT_CONN_FSYNC_IO 1182
/*! connection: total read I/Os */
-#define WT_STAT_CONN_READ_IO 1182
+#define WT_STAT_CONN_READ_IO 1183
/*! connection: total write I/Os */
-#define WT_STAT_CONN_WRITE_IO 1183
+#define WT_STAT_CONN_WRITE_IO 1184
/*! cursor: Total number of entries skipped by cursor next calls */
-#define WT_STAT_CONN_CURSOR_NEXT_SKIP_TOTAL 1184
+#define WT_STAT_CONN_CURSOR_NEXT_SKIP_TOTAL 1185
/*! cursor: Total number of entries skipped by cursor prev calls */
-#define WT_STAT_CONN_CURSOR_PREV_SKIP_TOTAL 1185
+#define WT_STAT_CONN_CURSOR_PREV_SKIP_TOTAL 1186
/*!
* cursor: Total number of entries skipped to position the history store
* cursor
*/
-#define WT_STAT_CONN_CURSOR_SKIP_HS_CUR_POSITION 1186
+#define WT_STAT_CONN_CURSOR_SKIP_HS_CUR_POSITION 1187
/*! cursor: cached cursor count */
-#define WT_STAT_CONN_CURSOR_CACHED_COUNT 1187
+#define WT_STAT_CONN_CURSOR_CACHED_COUNT 1188
/*! cursor: cursor bulk loaded cursor insert calls */
-#define WT_STAT_CONN_CURSOR_INSERT_BULK 1188
+#define WT_STAT_CONN_CURSOR_INSERT_BULK 1189
/*! cursor: cursor close calls that result in cache */
-#define WT_STAT_CONN_CURSOR_CACHE 1189
+#define WT_STAT_CONN_CURSOR_CACHE 1190
/*! cursor: cursor create calls */
-#define WT_STAT_CONN_CURSOR_CREATE 1190
+#define WT_STAT_CONN_CURSOR_CREATE 1191
/*! cursor: cursor insert calls */
-#define WT_STAT_CONN_CURSOR_INSERT 1191
+#define WT_STAT_CONN_CURSOR_INSERT 1192
/*! cursor: cursor insert key and value bytes */
-#define WT_STAT_CONN_CURSOR_INSERT_BYTES 1192
+#define WT_STAT_CONN_CURSOR_INSERT_BYTES 1193
/*! cursor: cursor modify calls */
-#define WT_STAT_CONN_CURSOR_MODIFY 1193
+#define WT_STAT_CONN_CURSOR_MODIFY 1194
/*! cursor: cursor modify key and value bytes affected */
-#define WT_STAT_CONN_CURSOR_MODIFY_BYTES 1194
+#define WT_STAT_CONN_CURSOR_MODIFY_BYTES 1195
/*! cursor: cursor modify value bytes modified */
-#define WT_STAT_CONN_CURSOR_MODIFY_BYTES_TOUCH 1195
+#define WT_STAT_CONN_CURSOR_MODIFY_BYTES_TOUCH 1196
/*! cursor: cursor next calls */
-#define WT_STAT_CONN_CURSOR_NEXT 1196
+#define WT_STAT_CONN_CURSOR_NEXT 1197
/*!
* cursor: cursor next calls that skip due to a globally visible history
* store tombstone
*/
-#define WT_STAT_CONN_CURSOR_NEXT_HS_TOMBSTONE 1197
+#define WT_STAT_CONN_CURSOR_NEXT_HS_TOMBSTONE 1198
/*!
* cursor: cursor next calls that skip due to a globally visible history
* store tombstone in rollback to stable
*/
-#define WT_STAT_CONN_CURSOR_NEXT_HS_TOMBSTONE_RTS 1198
+#define WT_STAT_CONN_CURSOR_NEXT_HS_TOMBSTONE_RTS 1199
/*!
* cursor: cursor next calls that skip greater than or equal to 100
* entries
*/
-#define WT_STAT_CONN_CURSOR_NEXT_SKIP_GE_100 1199
+#define WT_STAT_CONN_CURSOR_NEXT_SKIP_GE_100 1200
/*! cursor: cursor next calls that skip less than 100 entries */
-#define WT_STAT_CONN_CURSOR_NEXT_SKIP_LT_100 1200
+#define WT_STAT_CONN_CURSOR_NEXT_SKIP_LT_100 1201
/*! cursor: cursor operation restarted */
-#define WT_STAT_CONN_CURSOR_RESTART 1201
+#define WT_STAT_CONN_CURSOR_RESTART 1202
/*! cursor: cursor prev calls */
-#define WT_STAT_CONN_CURSOR_PREV 1202
+#define WT_STAT_CONN_CURSOR_PREV 1203
/*!
* cursor: cursor prev calls that skip due to a globally visible history
* store tombstone
*/
-#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE 1203
+#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE 1204
/*!
* cursor: cursor prev calls that skip due to a globally visible history
* store tombstone in rollback to stable
*/
-#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE_RTS 1204
+#define WT_STAT_CONN_CURSOR_PREV_HS_TOMBSTONE_RTS 1205
/*!
* cursor: cursor prev calls that skip greater than or equal to 100
* entries
*/
-#define WT_STAT_CONN_CURSOR_PREV_SKIP_GE_100 1205
+#define WT_STAT_CONN_CURSOR_PREV_SKIP_GE_100 1206
/*! cursor: cursor prev calls that skip less than 100 entries */
-#define WT_STAT_CONN_CURSOR_PREV_SKIP_LT_100 1206
+#define WT_STAT_CONN_CURSOR_PREV_SKIP_LT_100 1207
/*! cursor: cursor remove calls */
-#define WT_STAT_CONN_CURSOR_REMOVE 1207
+#define WT_STAT_CONN_CURSOR_REMOVE 1208
/*! cursor: cursor remove key bytes removed */
-#define WT_STAT_CONN_CURSOR_REMOVE_BYTES 1208
+#define WT_STAT_CONN_CURSOR_REMOVE_BYTES 1209
/*! cursor: cursor reserve calls */
-#define WT_STAT_CONN_CURSOR_RESERVE 1209
+#define WT_STAT_CONN_CURSOR_RESERVE 1210
/*! cursor: cursor reset calls */
-#define WT_STAT_CONN_CURSOR_RESET 1210
+#define WT_STAT_CONN_CURSOR_RESET 1211
/*! cursor: cursor search calls */
-#define WT_STAT_CONN_CURSOR_SEARCH 1211
+#define WT_STAT_CONN_CURSOR_SEARCH 1212
/*! cursor: cursor search history store calls */
-#define WT_STAT_CONN_CURSOR_SEARCH_HS 1212
+#define WT_STAT_CONN_CURSOR_SEARCH_HS 1213
/*! cursor: cursor search near calls */
-#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1213
+#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1214
/*! cursor: cursor sweep buckets */
-#define WT_STAT_CONN_CURSOR_SWEEP_BUCKETS 1214
+#define WT_STAT_CONN_CURSOR_SWEEP_BUCKETS 1215
/*! cursor: cursor sweep cursors closed */
-#define WT_STAT_CONN_CURSOR_SWEEP_CLOSED 1215
+#define WT_STAT_CONN_CURSOR_SWEEP_CLOSED 1216
/*! cursor: cursor sweep cursors examined */
-#define WT_STAT_CONN_CURSOR_SWEEP_EXAMINED 1216
+#define WT_STAT_CONN_CURSOR_SWEEP_EXAMINED 1217
/*! cursor: cursor sweeps */
-#define WT_STAT_CONN_CURSOR_SWEEP 1217
+#define WT_STAT_CONN_CURSOR_SWEEP 1218
/*! cursor: cursor truncate calls */
-#define WT_STAT_CONN_CURSOR_TRUNCATE 1218
+#define WT_STAT_CONN_CURSOR_TRUNCATE 1219
/*! cursor: cursor update calls */
-#define WT_STAT_CONN_CURSOR_UPDATE 1219
+#define WT_STAT_CONN_CURSOR_UPDATE 1220
/*! cursor: cursor update key and value bytes */
-#define WT_STAT_CONN_CURSOR_UPDATE_BYTES 1220
+#define WT_STAT_CONN_CURSOR_UPDATE_BYTES 1221
/*! cursor: cursor update value size change */
-#define WT_STAT_CONN_CURSOR_UPDATE_BYTES_CHANGED 1221
+#define WT_STAT_CONN_CURSOR_UPDATE_BYTES_CHANGED 1222
/*! cursor: cursors reused from cache */
-#define WT_STAT_CONN_CURSOR_REOPEN 1222
+#define WT_STAT_CONN_CURSOR_REOPEN 1223
/*! cursor: open cursor count */
-#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1223
+#define WT_STAT_CONN_CURSOR_OPEN_COUNT 1224
/*! data-handle: connection data handle size */
-#define WT_STAT_CONN_DH_CONN_HANDLE_SIZE 1224
+#define WT_STAT_CONN_DH_CONN_HANDLE_SIZE 1225
/*! data-handle: connection data handles currently active */
-#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1225
+#define WT_STAT_CONN_DH_CONN_HANDLE_COUNT 1226
/*! data-handle: connection sweep candidate became referenced */
-#define WT_STAT_CONN_DH_SWEEP_REF 1226
+#define WT_STAT_CONN_DH_SWEEP_REF 1227
/*! data-handle: connection sweep dhandles closed */
-#define WT_STAT_CONN_DH_SWEEP_CLOSE 1227
+#define WT_STAT_CONN_DH_SWEEP_CLOSE 1228
/*! data-handle: connection sweep dhandles removed from hash list */
-#define WT_STAT_CONN_DH_SWEEP_REMOVE 1228
+#define WT_STAT_CONN_DH_SWEEP_REMOVE 1229
/*! data-handle: connection sweep time-of-death sets */
-#define WT_STAT_CONN_DH_SWEEP_TOD 1229
+#define WT_STAT_CONN_DH_SWEEP_TOD 1230
/*! data-handle: connection sweeps */
-#define WT_STAT_CONN_DH_SWEEPS 1230
+#define WT_STAT_CONN_DH_SWEEPS 1231
/*! data-handle: session dhandles swept */
-#define WT_STAT_CONN_DH_SESSION_HANDLES 1231
+#define WT_STAT_CONN_DH_SESSION_HANDLES 1232
/*! data-handle: session sweep attempts */
-#define WT_STAT_CONN_DH_SESSION_SWEEPS 1232
+#define WT_STAT_CONN_DH_SESSION_SWEEPS 1233
/*! lock: checkpoint lock acquisitions */
-#define WT_STAT_CONN_LOCK_CHECKPOINT_COUNT 1233
+#define WT_STAT_CONN_LOCK_CHECKPOINT_COUNT 1234
/*! lock: checkpoint lock application thread wait time (usecs) */
-#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_APPLICATION 1234
+#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_APPLICATION 1235
/*! lock: checkpoint lock internal thread wait time (usecs) */
-#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_INTERNAL 1235
+#define WT_STAT_CONN_LOCK_CHECKPOINT_WAIT_INTERNAL 1236
/*! lock: dhandle lock application thread time waiting (usecs) */
-#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_APPLICATION 1236
+#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_APPLICATION 1237
/*! lock: dhandle lock internal thread time waiting (usecs) */
-#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_INTERNAL 1237
+#define WT_STAT_CONN_LOCK_DHANDLE_WAIT_INTERNAL 1238
/*! lock: dhandle read lock acquisitions */
-#define WT_STAT_CONN_LOCK_DHANDLE_READ_COUNT 1238
+#define WT_STAT_CONN_LOCK_DHANDLE_READ_COUNT 1239
/*! lock: dhandle write lock acquisitions */
-#define WT_STAT_CONN_LOCK_DHANDLE_WRITE_COUNT 1239
+#define WT_STAT_CONN_LOCK_DHANDLE_WRITE_COUNT 1240
/*!
* lock: durable timestamp queue lock application thread time waiting
* (usecs)
*/
-#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_APPLICATION 1240
+#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_APPLICATION 1241
/*!
* lock: durable timestamp queue lock internal thread time waiting
* (usecs)
*/
-#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_INTERNAL 1241
+#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WAIT_INTERNAL 1242
/*! lock: durable timestamp queue read lock acquisitions */
-#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_READ_COUNT 1242
+#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_READ_COUNT 1243
/*! lock: durable timestamp queue write lock acquisitions */
-#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WRITE_COUNT 1243
+#define WT_STAT_CONN_LOCK_DURABLE_TIMESTAMP_WRITE_COUNT 1244
/*! lock: metadata lock acquisitions */
-#define WT_STAT_CONN_LOCK_METADATA_COUNT 1244
+#define WT_STAT_CONN_LOCK_METADATA_COUNT 1245
/*! lock: metadata lock application thread wait time (usecs) */
-#define WT_STAT_CONN_LOCK_METADATA_WAIT_APPLICATION 1245
+#define WT_STAT_CONN_LOCK_METADATA_WAIT_APPLICATION 1246
/*! lock: metadata lock internal thread wait time (usecs) */
-#define WT_STAT_CONN_LOCK_METADATA_WAIT_INTERNAL 1246
+#define WT_STAT_CONN_LOCK_METADATA_WAIT_INTERNAL 1247
/*!
* lock: read timestamp queue lock application thread time waiting
* (usecs)
*/
-#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_APPLICATION 1247
+#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_APPLICATION 1248
/*! lock: read timestamp queue lock internal thread time waiting (usecs) */
-#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_INTERNAL 1248
+#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WAIT_INTERNAL 1249
/*! lock: read timestamp queue read lock acquisitions */
-#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_READ_COUNT 1249
+#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_READ_COUNT 1250
/*! lock: read timestamp queue write lock acquisitions */
-#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WRITE_COUNT 1250
+#define WT_STAT_CONN_LOCK_READ_TIMESTAMP_WRITE_COUNT 1251
/*! lock: schema lock acquisitions */
-#define WT_STAT_CONN_LOCK_SCHEMA_COUNT 1251
+#define WT_STAT_CONN_LOCK_SCHEMA_COUNT 1252
/*! lock: schema lock application thread wait time (usecs) */
-#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_APPLICATION 1252
+#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_APPLICATION 1253
/*! lock: schema lock internal thread wait time (usecs) */
-#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_INTERNAL 1253
+#define WT_STAT_CONN_LOCK_SCHEMA_WAIT_INTERNAL 1254
/*!
* lock: table lock application thread time waiting for the table lock
* (usecs)
*/
-#define WT_STAT_CONN_LOCK_TABLE_WAIT_APPLICATION 1254
+#define WT_STAT_CONN_LOCK_TABLE_WAIT_APPLICATION 1255
/*!
* lock: table lock internal thread time waiting for the table lock
* (usecs)
*/
-#define WT_STAT_CONN_LOCK_TABLE_WAIT_INTERNAL 1255
+#define WT_STAT_CONN_LOCK_TABLE_WAIT_INTERNAL 1256
/*! lock: table read lock acquisitions */
-#define WT_STAT_CONN_LOCK_TABLE_READ_COUNT 1256
+#define WT_STAT_CONN_LOCK_TABLE_READ_COUNT 1257
/*! lock: table write lock acquisitions */
-#define WT_STAT_CONN_LOCK_TABLE_WRITE_COUNT 1257
+#define WT_STAT_CONN_LOCK_TABLE_WRITE_COUNT 1258
/*! lock: txn global lock application thread time waiting (usecs) */
-#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_APPLICATION 1258
+#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_APPLICATION 1259
/*! lock: txn global lock internal thread time waiting (usecs) */
-#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_INTERNAL 1259
+#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WAIT_INTERNAL 1260
/*! lock: txn global read lock acquisitions */
-#define WT_STAT_CONN_LOCK_TXN_GLOBAL_READ_COUNT 1260
+#define WT_STAT_CONN_LOCK_TXN_GLOBAL_READ_COUNT 1261
/*! lock: txn global write lock acquisitions */
-#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WRITE_COUNT 1261
+#define WT_STAT_CONN_LOCK_TXN_GLOBAL_WRITE_COUNT 1262
/*! log: busy returns attempting to switch slots */
-#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1262
+#define WT_STAT_CONN_LOG_SLOT_SWITCH_BUSY 1263
/*! log: force archive time sleeping (usecs) */
-#define WT_STAT_CONN_LOG_FORCE_ARCHIVE_SLEEP 1263
+#define WT_STAT_CONN_LOG_FORCE_ARCHIVE_SLEEP 1264
/*! log: log bytes of payload data */
-#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1264
+#define WT_STAT_CONN_LOG_BYTES_PAYLOAD 1265
/*! log: log bytes written */
-#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1265
+#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1266
/*! log: log files manually zero-filled */
-#define WT_STAT_CONN_LOG_ZERO_FILLS 1266
+#define WT_STAT_CONN_LOG_ZERO_FILLS 1267
/*! log: log flush operations */
-#define WT_STAT_CONN_LOG_FLUSH 1267
+#define WT_STAT_CONN_LOG_FLUSH 1268
/*! log: log force write operations */
-#define WT_STAT_CONN_LOG_FORCE_WRITE 1268
+#define WT_STAT_CONN_LOG_FORCE_WRITE 1269
/*! log: log force write operations skipped */
-#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1269
+#define WT_STAT_CONN_LOG_FORCE_WRITE_SKIP 1270
/*! log: log records compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1270
+#define WT_STAT_CONN_LOG_COMPRESS_WRITES 1271
/*! log: log records not compressed */
-#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1271
+#define WT_STAT_CONN_LOG_COMPRESS_WRITE_FAILS 1272
/*! log: log records too small to compress */
-#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1272
+#define WT_STAT_CONN_LOG_COMPRESS_SMALL 1273
/*! log: log release advances write LSN */
-#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1273
+#define WT_STAT_CONN_LOG_RELEASE_WRITE_LSN 1274
/*! log: log scan operations */
-#define WT_STAT_CONN_LOG_SCANS 1274
+#define WT_STAT_CONN_LOG_SCANS 1275
/*! log: log scan records requiring two reads */
-#define WT_STAT_CONN_LOG_SCAN_REREADS 1275
+#define WT_STAT_CONN_LOG_SCAN_REREADS 1276
/*! log: log server thread advances write LSN */
-#define WT_STAT_CONN_LOG_WRITE_LSN 1276
+#define WT_STAT_CONN_LOG_WRITE_LSN 1277
/*! log: log server thread write LSN walk skipped */
-#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1277
+#define WT_STAT_CONN_LOG_WRITE_LSN_SKIP 1278
/*! log: log sync operations */
-#define WT_STAT_CONN_LOG_SYNC 1278
+#define WT_STAT_CONN_LOG_SYNC 1279
/*! log: log sync time duration (usecs) */
-#define WT_STAT_CONN_LOG_SYNC_DURATION 1279
+#define WT_STAT_CONN_LOG_SYNC_DURATION 1280
/*! log: log sync_dir operations */
-#define WT_STAT_CONN_LOG_SYNC_DIR 1280
+#define WT_STAT_CONN_LOG_SYNC_DIR 1281
/*! log: log sync_dir time duration (usecs) */
-#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1281
+#define WT_STAT_CONN_LOG_SYNC_DIR_DURATION 1282
/*! log: log write operations */
-#define WT_STAT_CONN_LOG_WRITES 1282
+#define WT_STAT_CONN_LOG_WRITES 1283
/*! log: logging bytes consolidated */
-#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1283
+#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1284
/*! log: maximum log file size */
-#define WT_STAT_CONN_LOG_MAX_FILESIZE 1284
+#define WT_STAT_CONN_LOG_MAX_FILESIZE 1285
/*! log: number of pre-allocated log files to create */
-#define WT_STAT_CONN_LOG_PREALLOC_MAX 1285
+#define WT_STAT_CONN_LOG_PREALLOC_MAX 1286
/*! log: pre-allocated log files not ready and missed */
-#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1286
+#define WT_STAT_CONN_LOG_PREALLOC_MISSED 1287
/*! log: pre-allocated log files prepared */
-#define WT_STAT_CONN_LOG_PREALLOC_FILES 1287
+#define WT_STAT_CONN_LOG_PREALLOC_FILES 1288
/*! log: pre-allocated log files used */
-#define WT_STAT_CONN_LOG_PREALLOC_USED 1288
+#define WT_STAT_CONN_LOG_PREALLOC_USED 1289
/*! log: records processed by log scan */
-#define WT_STAT_CONN_LOG_SCAN_RECORDS 1289
+#define WT_STAT_CONN_LOG_SCAN_RECORDS 1290
/*! log: slot close lost race */
-#define WT_STAT_CONN_LOG_SLOT_CLOSE_RACE 1290
+#define WT_STAT_CONN_LOG_SLOT_CLOSE_RACE 1291
/*! log: slot close unbuffered waits */
-#define WT_STAT_CONN_LOG_SLOT_CLOSE_UNBUF 1291
+#define WT_STAT_CONN_LOG_SLOT_CLOSE_UNBUF 1292
/*! log: slot closures */
-#define WT_STAT_CONN_LOG_SLOT_CLOSES 1292
+#define WT_STAT_CONN_LOG_SLOT_CLOSES 1293
/*! log: slot join atomic update races */
-#define WT_STAT_CONN_LOG_SLOT_RACES 1293
+#define WT_STAT_CONN_LOG_SLOT_RACES 1294
/*! log: slot join calls atomic updates raced */
-#define WT_STAT_CONN_LOG_SLOT_YIELD_RACE 1294
+#define WT_STAT_CONN_LOG_SLOT_YIELD_RACE 1295
/*! log: slot join calls did not yield */
-#define WT_STAT_CONN_LOG_SLOT_IMMEDIATE 1295
+#define WT_STAT_CONN_LOG_SLOT_IMMEDIATE 1296
/*! log: slot join calls found active slot closed */
-#define WT_STAT_CONN_LOG_SLOT_YIELD_CLOSE 1296
+#define WT_STAT_CONN_LOG_SLOT_YIELD_CLOSE 1297
/*! log: slot join calls slept */
-#define WT_STAT_CONN_LOG_SLOT_YIELD_SLEEP 1297
+#define WT_STAT_CONN_LOG_SLOT_YIELD_SLEEP 1298
/*! log: slot join calls yielded */
-#define WT_STAT_CONN_LOG_SLOT_YIELD 1298
+#define WT_STAT_CONN_LOG_SLOT_YIELD 1299
/*! log: slot join found active slot closed */
-#define WT_STAT_CONN_LOG_SLOT_ACTIVE_CLOSED 1299
+#define WT_STAT_CONN_LOG_SLOT_ACTIVE_CLOSED 1300
/*! log: slot joins yield time (usecs) */
-#define WT_STAT_CONN_LOG_SLOT_YIELD_DURATION 1300
+#define WT_STAT_CONN_LOG_SLOT_YIELD_DURATION 1301
/*! log: slot transitions unable to find free slot */
-#define WT_STAT_CONN_LOG_SLOT_NO_FREE_SLOTS 1301
+#define WT_STAT_CONN_LOG_SLOT_NO_FREE_SLOTS 1302
/*! log: slot unbuffered writes */
-#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1302
+#define WT_STAT_CONN_LOG_SLOT_UNBUFFERED 1303
/*! log: total in-memory size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_MEM 1303
+#define WT_STAT_CONN_LOG_COMPRESS_MEM 1304
/*! log: total log buffer size */
-#define WT_STAT_CONN_LOG_BUFFER_SIZE 1304
+#define WT_STAT_CONN_LOG_BUFFER_SIZE 1305
/*! log: total size of compressed records */
-#define WT_STAT_CONN_LOG_COMPRESS_LEN 1305
+#define WT_STAT_CONN_LOG_COMPRESS_LEN 1306
/*! log: written slots coalesced */
-#define WT_STAT_CONN_LOG_SLOT_COALESCED 1306
+#define WT_STAT_CONN_LOG_SLOT_COALESCED 1307
/*! log: yields waiting for previous log file close */
-#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1307
+#define WT_STAT_CONN_LOG_CLOSE_YIELDS 1308
/*! perf: file system read latency histogram (bucket 1) - 10-49ms */
-#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT50 1308
+#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT50 1309
/*! perf: file system read latency histogram (bucket 2) - 50-99ms */
-#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT100 1309
+#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT100 1310
/*! perf: file system read latency histogram (bucket 3) - 100-249ms */
-#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT250 1310
+#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT250 1311
/*! perf: file system read latency histogram (bucket 4) - 250-499ms */
-#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT500 1311
+#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT500 1312
/*! perf: file system read latency histogram (bucket 5) - 500-999ms */
-#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT1000 1312
+#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_LT1000 1313
/*! perf: file system read latency histogram (bucket 6) - 1000ms+ */
-#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_GT1000 1313
+#define WT_STAT_CONN_PERF_HIST_FSREAD_LATENCY_GT1000 1314
/*! perf: file system write latency histogram (bucket 1) - 10-49ms */
-#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT50 1314
+#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT50 1315
/*! perf: file system write latency histogram (bucket 2) - 50-99ms */
-#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT100 1315
+#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT100 1316
/*! perf: file system write latency histogram (bucket 3) - 100-249ms */
-#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT250 1316
+#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT250 1317
/*! perf: file system write latency histogram (bucket 4) - 250-499ms */
-#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT500 1317
+#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT500 1318
/*! perf: file system write latency histogram (bucket 5) - 500-999ms */
-#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT1000 1318
+#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_LT1000 1319
/*! perf: file system write latency histogram (bucket 6) - 1000ms+ */
-#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_GT1000 1319
+#define WT_STAT_CONN_PERF_HIST_FSWRITE_LATENCY_GT1000 1320
/*! perf: operation read latency histogram (bucket 1) - 100-249us */
-#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT250 1320
+#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT250 1321
/*! perf: operation read latency histogram (bucket 2) - 250-499us */
-#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT500 1321
+#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT500 1322
/*! perf: operation read latency histogram (bucket 3) - 500-999us */
-#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT1000 1322
+#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT1000 1323
/*! perf: operation read latency histogram (bucket 4) - 1000-9999us */
-#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT10000 1323
+#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_LT10000 1324
/*! perf: operation read latency histogram (bucket 5) - 10000us+ */
-#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_GT10000 1324
+#define WT_STAT_CONN_PERF_HIST_OPREAD_LATENCY_GT10000 1325
/*! perf: operation write latency histogram (bucket 1) - 100-249us */
-#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT250 1325
+#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT250 1326
/*! perf: operation write latency histogram (bucket 2) - 250-499us */
-#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT500 1326
+#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT500 1327
/*! perf: operation write latency histogram (bucket 3) - 500-999us */
-#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT1000 1327
+#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT1000 1328
/*! perf: operation write latency histogram (bucket 4) - 1000-9999us */
-#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT10000 1328
+#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_LT10000 1329
/*! perf: operation write latency histogram (bucket 5) - 10000us+ */
-#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_GT10000 1329
+#define WT_STAT_CONN_PERF_HIST_OPWRITE_LATENCY_GT10000 1330
/*! reconciliation: approximate byte size of timestamps in pages written */
-#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TS 1330
+#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TS 1331
/*!
* reconciliation: approximate byte size of transaction IDs in pages
* written
*/
-#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TXN 1331
+#define WT_STAT_CONN_REC_TIME_WINDOW_BYTES_TXN 1332
/*! reconciliation: fast-path pages deleted */
-#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1332
+#define WT_STAT_CONN_REC_PAGE_DELETE_FAST 1333
/*! reconciliation: maximum seconds spent in a reconciliation call */
-#define WT_STAT_CONN_REC_MAXIMUM_SECONDS 1333
+#define WT_STAT_CONN_REC_MAXIMUM_SECONDS 1334
/*! reconciliation: page reconciliation calls */
-#define WT_STAT_CONN_REC_PAGES 1334
+#define WT_STAT_CONN_REC_PAGES 1335
/*! reconciliation: page reconciliation calls for eviction */
-#define WT_STAT_CONN_REC_PAGES_EVICTION 1335
+#define WT_STAT_CONN_REC_PAGES_EVICTION 1336
/*!
* reconciliation: page reconciliation calls that resulted in values with
* prepared transaction metadata
*/
-#define WT_STAT_CONN_REC_PAGES_WITH_PREPARE 1336
+#define WT_STAT_CONN_REC_PAGES_WITH_PREPARE 1337
/*!
* reconciliation: page reconciliation calls that resulted in values with
* timestamps
*/
-#define WT_STAT_CONN_REC_PAGES_WITH_TS 1337
+#define WT_STAT_CONN_REC_PAGES_WITH_TS 1338
/*!
* reconciliation: page reconciliation calls that resulted in values with
* transaction ids
*/
-#define WT_STAT_CONN_REC_PAGES_WITH_TXN 1338
+#define WT_STAT_CONN_REC_PAGES_WITH_TXN 1339
/*! reconciliation: pages deleted */
-#define WT_STAT_CONN_REC_PAGE_DELETE 1339
+#define WT_STAT_CONN_REC_PAGE_DELETE 1340
/*!
* reconciliation: pages written including an aggregated newest start
* durable timestamp
*/
-#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 1340
+#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_START_DURABLE_TS 1341
/*!
* reconciliation: pages written including an aggregated newest stop
* durable timestamp
*/
-#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 1341
+#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_DURABLE_TS 1342
/*!
* reconciliation: pages written including an aggregated newest stop
* timestamp
*/
-#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TS 1342
+#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TS 1343
/*!
* reconciliation: pages written including an aggregated newest stop
* transaction ID
*/
-#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TXN 1343
+#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_STOP_TXN 1344
/*!
* reconciliation: pages written including an aggregated newest
* transaction ID
*/
-#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_TXN 1344
+#define WT_STAT_CONN_REC_TIME_AGGR_NEWEST_TXN 1345
/*!
* reconciliation: pages written including an aggregated oldest start
* timestamp
*/
-#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TS 1345
+#define WT_STAT_CONN_REC_TIME_AGGR_OLDEST_START_TS 1346
/*! reconciliation: pages written including an aggregated prepare */
-#define WT_STAT_CONN_REC_TIME_AGGR_PREPARED 1346
+#define WT_STAT_CONN_REC_TIME_AGGR_PREPARED 1347
/*! reconciliation: pages written including at least one prepare state */
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_PREPARED 1347
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_PREPARED 1348
/*!
* reconciliation: pages written including at least one start durable
* timestamp
*/
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 1348
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_START_TS 1349
/*! reconciliation: pages written including at least one start timestamp */
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TS 1349
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TS 1350
/*!
* reconciliation: pages written including at least one start transaction
* ID
*/
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TXN 1350
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_START_TXN 1351
/*!
* reconciliation: pages written including at least one stop durable
* timestamp
*/
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 1351
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_DURABLE_STOP_TS 1352
/*! reconciliation: pages written including at least one stop timestamp */
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TS 1352
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TS 1353
/*!
* reconciliation: pages written including at least one stop transaction
* ID
*/
-#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TXN 1353
+#define WT_STAT_CONN_REC_TIME_WINDOW_PAGES_STOP_TXN 1354
/*! reconciliation: records written including a prepare state */
-#define WT_STAT_CONN_REC_TIME_WINDOW_PREPARED 1354
+#define WT_STAT_CONN_REC_TIME_WINDOW_PREPARED 1355
/*! reconciliation: records written including a start durable timestamp */
-#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_START_TS 1355
+#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_START_TS 1356
/*! reconciliation: records written including a start timestamp */
-#define WT_STAT_CONN_REC_TIME_WINDOW_START_TS 1356
+#define WT_STAT_CONN_REC_TIME_WINDOW_START_TS 1357
/*! reconciliation: records written including a start transaction ID */
-#define WT_STAT_CONN_REC_TIME_WINDOW_START_TXN 1357
+#define WT_STAT_CONN_REC_TIME_WINDOW_START_TXN 1358
/*! reconciliation: records written including a stop durable timestamp */
-#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_STOP_TS 1358
+#define WT_STAT_CONN_REC_TIME_WINDOW_DURABLE_STOP_TS 1359
/*! reconciliation: records written including a stop timestamp */
-#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TS 1359
+#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TS 1360
/*! reconciliation: records written including a stop transaction ID */
-#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TXN 1360
+#define WT_STAT_CONN_REC_TIME_WINDOW_STOP_TXN 1361
/*! reconciliation: split bytes currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1361
+#define WT_STAT_CONN_REC_SPLIT_STASHED_BYTES 1362
/*! reconciliation: split objects currently awaiting free */
-#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1362
+#define WT_STAT_CONN_REC_SPLIT_STASHED_OBJECTS 1363
/*! session: open session count */
-#define WT_STAT_CONN_SESSION_OPEN 1363
+#define WT_STAT_CONN_SESSION_OPEN 1364
/*! session: session query timestamp calls */
-#define WT_STAT_CONN_SESSION_QUERY_TS 1364
+#define WT_STAT_CONN_SESSION_QUERY_TS 1365
/*! session: table alter failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_ALTER_FAIL 1365
+#define WT_STAT_CONN_SESSION_TABLE_ALTER_FAIL 1366
/*! session: table alter successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_ALTER_SUCCESS 1366
+#define WT_STAT_CONN_SESSION_TABLE_ALTER_SUCCESS 1367
/*! session: table alter unchanged and skipped */
-#define WT_STAT_CONN_SESSION_TABLE_ALTER_SKIP 1367
+#define WT_STAT_CONN_SESSION_TABLE_ALTER_SKIP 1368
/*! session: table compact failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1368
+#define WT_STAT_CONN_SESSION_TABLE_COMPACT_FAIL 1369
/*! session: table compact successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1369
+#define WT_STAT_CONN_SESSION_TABLE_COMPACT_SUCCESS 1370
/*! session: table create failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1370
+#define WT_STAT_CONN_SESSION_TABLE_CREATE_FAIL 1371
/*! session: table create successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1371
+#define WT_STAT_CONN_SESSION_TABLE_CREATE_SUCCESS 1372
/*! session: table drop failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1372
+#define WT_STAT_CONN_SESSION_TABLE_DROP_FAIL 1373
/*! session: table drop successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1373
+#define WT_STAT_CONN_SESSION_TABLE_DROP_SUCCESS 1374
/*! session: table rename failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1374
+#define WT_STAT_CONN_SESSION_TABLE_RENAME_FAIL 1375
/*! session: table rename successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1375
+#define WT_STAT_CONN_SESSION_TABLE_RENAME_SUCCESS 1376
/*! session: table salvage failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1376
+#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_FAIL 1377
/*! session: table salvage successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1377
+#define WT_STAT_CONN_SESSION_TABLE_SALVAGE_SUCCESS 1378
/*! session: table truncate failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1378
+#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_FAIL 1379
/*! session: table truncate successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1379
+#define WT_STAT_CONN_SESSION_TABLE_TRUNCATE_SUCCESS 1380
/*! session: table verify failed calls */
-#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1380
+#define WT_STAT_CONN_SESSION_TABLE_VERIFY_FAIL 1381
/*! session: table verify successful calls */
-#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1381
+#define WT_STAT_CONN_SESSION_TABLE_VERIFY_SUCCESS 1382
/*! thread-state: active filesystem fsync calls */
-#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1382
+#define WT_STAT_CONN_THREAD_FSYNC_ACTIVE 1383
/*! thread-state: active filesystem read calls */
-#define WT_STAT_CONN_THREAD_READ_ACTIVE 1383
+#define WT_STAT_CONN_THREAD_READ_ACTIVE 1384
/*! thread-state: active filesystem write calls */
-#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1384
+#define WT_STAT_CONN_THREAD_WRITE_ACTIVE 1385
/*! thread-yield: application thread time evicting (usecs) */
-#define WT_STAT_CONN_APPLICATION_EVICT_TIME 1385
+#define WT_STAT_CONN_APPLICATION_EVICT_TIME 1386
/*! thread-yield: application thread time waiting for cache (usecs) */
-#define WT_STAT_CONN_APPLICATION_CACHE_TIME 1386
+#define WT_STAT_CONN_APPLICATION_CACHE_TIME 1387
/*!
* thread-yield: connection close blocked waiting for transaction state
* stabilization
*/
-#define WT_STAT_CONN_TXN_RELEASE_BLOCKED 1387
+#define WT_STAT_CONN_TXN_RELEASE_BLOCKED 1388
/*! thread-yield: connection close yielded for lsm manager shutdown */
-#define WT_STAT_CONN_CONN_CLOSE_BLOCKED_LSM 1388
+#define WT_STAT_CONN_CONN_CLOSE_BLOCKED_LSM 1389
/*! thread-yield: data handle lock yielded */
-#define WT_STAT_CONN_DHANDLE_LOCK_BLOCKED 1389
+#define WT_STAT_CONN_DHANDLE_LOCK_BLOCKED 1390
/*!
* thread-yield: get reference for page index and slot time sleeping
* (usecs)
*/
-#define WT_STAT_CONN_PAGE_INDEX_SLOT_REF_BLOCKED 1390
+#define WT_STAT_CONN_PAGE_INDEX_SLOT_REF_BLOCKED 1391
/*! thread-yield: log server sync yielded for log write */
-#define WT_STAT_CONN_LOG_SERVER_SYNC_BLOCKED 1391
+#define WT_STAT_CONN_LOG_SERVER_SYNC_BLOCKED 1392
/*! thread-yield: page access yielded due to prepare state change */
-#define WT_STAT_CONN_PREPARED_TRANSITION_BLOCKED_PAGE 1392
+#define WT_STAT_CONN_PREPARED_TRANSITION_BLOCKED_PAGE 1393
/*! thread-yield: page acquire busy blocked */
-#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1393
+#define WT_STAT_CONN_PAGE_BUSY_BLOCKED 1394
/*! thread-yield: page acquire eviction blocked */
-#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1394
+#define WT_STAT_CONN_PAGE_FORCIBLE_EVICT_BLOCKED 1395
/*! thread-yield: page acquire locked blocked */
-#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1395
+#define WT_STAT_CONN_PAGE_LOCKED_BLOCKED 1396
/*! thread-yield: page acquire read blocked */
-#define WT_STAT_CONN_PAGE_READ_BLOCKED 1396
+#define WT_STAT_CONN_PAGE_READ_BLOCKED 1397
/*! thread-yield: page acquire time sleeping (usecs) */
-#define WT_STAT_CONN_PAGE_SLEEP 1397
+#define WT_STAT_CONN_PAGE_SLEEP 1398
/*!
* thread-yield: page delete rollback time sleeping for state change
* (usecs)
*/
-#define WT_STAT_CONN_PAGE_DEL_ROLLBACK_BLOCKED 1398
+#define WT_STAT_CONN_PAGE_DEL_ROLLBACK_BLOCKED 1399
/*! thread-yield: page reconciliation yielded due to child modification */
-#define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1399
+#define WT_STAT_CONN_CHILD_MODIFY_BLOCKED_PAGE 1400
/*! transaction: Number of prepared updates */
-#define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1400
+#define WT_STAT_CONN_TXN_PREPARED_UPDATES_COUNT 1401
/*! transaction: durable timestamp queue entries walked */
-#define WT_STAT_CONN_TXN_DURABLE_QUEUE_WALKED 1401
+#define WT_STAT_CONN_TXN_DURABLE_QUEUE_WALKED 1402
/*! transaction: durable timestamp queue insert to empty */
-#define WT_STAT_CONN_TXN_DURABLE_QUEUE_EMPTY 1402
+#define WT_STAT_CONN_TXN_DURABLE_QUEUE_EMPTY 1403
/*! transaction: durable timestamp queue inserts to head */
-#define WT_STAT_CONN_TXN_DURABLE_QUEUE_HEAD 1403
+#define WT_STAT_CONN_TXN_DURABLE_QUEUE_HEAD 1404
/*! transaction: durable timestamp queue inserts total */
-#define WT_STAT_CONN_TXN_DURABLE_QUEUE_INSERTS 1404
+#define WT_STAT_CONN_TXN_DURABLE_QUEUE_INSERTS 1405
/*! transaction: durable timestamp queue length */
-#define WT_STAT_CONN_TXN_DURABLE_QUEUE_LEN 1405
+#define WT_STAT_CONN_TXN_DURABLE_QUEUE_LEN 1406
/*! transaction: prepared transactions */
-#define WT_STAT_CONN_TXN_PREPARE 1406
+#define WT_STAT_CONN_TXN_PREPARE 1407
/*! transaction: prepared transactions committed */
-#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1407
+#define WT_STAT_CONN_TXN_PREPARE_COMMIT 1408
/*! transaction: prepared transactions currently active */
-#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1408
+#define WT_STAT_CONN_TXN_PREPARE_ACTIVE 1409
/*! transaction: prepared transactions rolled back */
-#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1409
+#define WT_STAT_CONN_TXN_PREPARE_ROLLBACK 1410
/*! transaction: query timestamp calls */
-#define WT_STAT_CONN_TXN_QUERY_TS 1410
+#define WT_STAT_CONN_TXN_QUERY_TS 1411
/*! transaction: race to read prepared update retry */
-#define WT_STAT_CONN_TXN_READ_RACE_PREPARE_UPDATE 1411
+#define WT_STAT_CONN_TXN_READ_RACE_PREPARE_UPDATE 1412
/*! transaction: read timestamp queue entries walked */
-#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1412
+#define WT_STAT_CONN_TXN_READ_QUEUE_WALKED 1413
/*! transaction: read timestamp queue insert to empty */
-#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1413
+#define WT_STAT_CONN_TXN_READ_QUEUE_EMPTY 1414
/*! transaction: read timestamp queue inserts to head */
-#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1414
+#define WT_STAT_CONN_TXN_READ_QUEUE_HEAD 1415
/*! transaction: read timestamp queue inserts total */
-#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1415
+#define WT_STAT_CONN_TXN_READ_QUEUE_INSERTS 1416
/*! transaction: read timestamp queue length */
-#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1416
+#define WT_STAT_CONN_TXN_READ_QUEUE_LEN 1417
/*! transaction: rollback to stable calls */
-#define WT_STAT_CONN_TXN_RTS 1417
+#define WT_STAT_CONN_TXN_RTS 1418
/*!
* transaction: rollback to stable hs records with stop timestamps older
* than newer records
*/
-#define WT_STAT_CONN_TXN_RTS_HS_STOP_OLDER_THAN_NEWER_START 1418
+#define WT_STAT_CONN_TXN_RTS_HS_STOP_OLDER_THAN_NEWER_START 1419
/*! transaction: rollback to stable keys removed */
-#define WT_STAT_CONN_TXN_RTS_KEYS_REMOVED 1419
+#define WT_STAT_CONN_TXN_RTS_KEYS_REMOVED 1420
/*! transaction: rollback to stable keys restored */
-#define WT_STAT_CONN_TXN_RTS_KEYS_RESTORED 1420
+#define WT_STAT_CONN_TXN_RTS_KEYS_RESTORED 1421
/*! transaction: rollback to stable pages visited */
-#define WT_STAT_CONN_TXN_RTS_PAGES_VISITED 1421
+#define WT_STAT_CONN_TXN_RTS_PAGES_VISITED 1422
/*! transaction: rollback to stable restored tombstones from history store */
-#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_TOMBSTONES 1422
+#define WT_STAT_CONN_TXN_RTS_HS_RESTORE_TOMBSTONES 1423
/*! transaction: rollback to stable sweeping history store keys */
-#define WT_STAT_CONN_TXN_RTS_SWEEP_HS_KEYS 1423
+#define WT_STAT_CONN_TXN_RTS_SWEEP_HS_KEYS 1424
/*! transaction: rollback to stable tree walk skipping pages */
-#define WT_STAT_CONN_TXN_RTS_TREE_WALK_SKIP_PAGES 1424
+#define WT_STAT_CONN_TXN_RTS_TREE_WALK_SKIP_PAGES 1425
/*! transaction: rollback to stable updates aborted */
-#define WT_STAT_CONN_TXN_RTS_UPD_ABORTED 1425
+#define WT_STAT_CONN_TXN_RTS_UPD_ABORTED 1426
/*! transaction: rollback to stable updates removed from history store */
-#define WT_STAT_CONN_TXN_RTS_HS_REMOVED 1426
+#define WT_STAT_CONN_TXN_RTS_HS_REMOVED 1427
/*! transaction: set timestamp calls */
-#define WT_STAT_CONN_TXN_SET_TS 1427
+#define WT_STAT_CONN_TXN_SET_TS 1428
/*! transaction: set timestamp durable calls */
-#define WT_STAT_CONN_TXN_SET_TS_DURABLE 1428
+#define WT_STAT_CONN_TXN_SET_TS_DURABLE 1429
/*! transaction: set timestamp durable updates */
-#define WT_STAT_CONN_TXN_SET_TS_DURABLE_UPD 1429
+#define WT_STAT_CONN_TXN_SET_TS_DURABLE_UPD 1430
/*! transaction: set timestamp oldest calls */
-#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1430
+#define WT_STAT_CONN_TXN_SET_TS_OLDEST 1431
/*! transaction: set timestamp oldest updates */
-#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1431
+#define WT_STAT_CONN_TXN_SET_TS_OLDEST_UPD 1432
/*! transaction: set timestamp stable calls */
-#define WT_STAT_CONN_TXN_SET_TS_STABLE 1432
+#define WT_STAT_CONN_TXN_SET_TS_STABLE 1433
/*! transaction: set timestamp stable updates */
-#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1433
+#define WT_STAT_CONN_TXN_SET_TS_STABLE_UPD 1434
/*! transaction: transaction begins */
-#define WT_STAT_CONN_TXN_BEGIN 1434
+#define WT_STAT_CONN_TXN_BEGIN 1435
/*! transaction: transaction checkpoint currently running */
-#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1435
+#define WT_STAT_CONN_TXN_CHECKPOINT_RUNNING 1436
/*! transaction: transaction checkpoint generation */
-#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1436
+#define WT_STAT_CONN_TXN_CHECKPOINT_GENERATION 1437
/*!
* transaction: transaction checkpoint history store file duration
* (usecs)
*/
-#define WT_STAT_CONN_TXN_HS_CKPT_DURATION 1437
+#define WT_STAT_CONN_TXN_HS_CKPT_DURATION 1438
/*! transaction: transaction checkpoint max time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1438
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MAX 1439
/*! transaction: transaction checkpoint min time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1439
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_MIN 1440
/*!
* transaction: transaction checkpoint most recent duration for gathering
* all handles (usecs)
*/
-#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION 1440
+#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION 1441
/*!
* transaction: transaction checkpoint most recent duration for gathering
* applied handles (usecs)
*/
-#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_APPLY 1441
+#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_APPLY 1442
/*!
* transaction: transaction checkpoint most recent duration for gathering
* skipped handles (usecs)
*/
-#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_SKIP 1442
+#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_DURATION_SKIP 1443
/*! transaction: transaction checkpoint most recent handles applied */
-#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_APPLIED 1443
+#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_APPLIED 1444
/*! transaction: transaction checkpoint most recent handles skipped */
-#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_SKIPPED 1444
+#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_SKIPPED 1445
/*! transaction: transaction checkpoint most recent handles walked */
-#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_WALKED 1445
+#define WT_STAT_CONN_TXN_CHECKPOINT_HANDLE_WALKED 1446
/*! transaction: transaction checkpoint most recent time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1446
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_RECENT 1447
/*! transaction: transaction checkpoint prepare currently running */
-#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RUNNING 1447
+#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RUNNING 1448
/*! transaction: transaction checkpoint prepare max time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MAX 1448
+#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MAX 1449
/*! transaction: transaction checkpoint prepare min time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MIN 1449
+#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_MIN 1450
/*! transaction: transaction checkpoint prepare most recent time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RECENT 1450
+#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_RECENT 1451
/*! transaction: transaction checkpoint prepare total time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_TOTAL 1451
+#define WT_STAT_CONN_TXN_CHECKPOINT_PREP_TOTAL 1452
/*! transaction: transaction checkpoint scrub dirty target */
-#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1452
+#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TARGET 1453
/*! transaction: transaction checkpoint scrub time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1453
+#define WT_STAT_CONN_TXN_CHECKPOINT_SCRUB_TIME 1454
/*! transaction: transaction checkpoint total time (msecs) */
-#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1454
+#define WT_STAT_CONN_TXN_CHECKPOINT_TIME_TOTAL 1455
/*! transaction: transaction checkpoints */
-#define WT_STAT_CONN_TXN_CHECKPOINT 1455
+#define WT_STAT_CONN_TXN_CHECKPOINT 1456
/*!
* transaction: transaction checkpoints skipped because database was
* clean
*/
-#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1456
+#define WT_STAT_CONN_TXN_CHECKPOINT_SKIPPED 1457
/*! transaction: transaction failures due to history store */
-#define WT_STAT_CONN_TXN_FAIL_CACHE 1457
+#define WT_STAT_CONN_TXN_FAIL_CACHE 1458
/*!
* transaction: transaction fsync calls for checkpoint after allocating
* the transaction ID
*/
-#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1458
+#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST 1459
/*!
* transaction: transaction fsync duration for checkpoint after
* allocating the transaction ID (usecs)
*/
-#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1459
+#define WT_STAT_CONN_TXN_CHECKPOINT_FSYNC_POST_DURATION 1460
/*! transaction: transaction range of IDs currently pinned */
-#define WT_STAT_CONN_TXN_PINNED_RANGE 1460
+#define WT_STAT_CONN_TXN_PINNED_RANGE 1461
/*! transaction: transaction range of IDs currently pinned by a checkpoint */
-#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1461
+#define WT_STAT_CONN_TXN_PINNED_CHECKPOINT_RANGE 1462
/*! transaction: transaction range of timestamps currently pinned */
-#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1462
+#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP 1463
/*! transaction: transaction range of timestamps pinned by a checkpoint */
-#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1463
+#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_CHECKPOINT 1464
/*!
* transaction: transaction range of timestamps pinned by the oldest
* active read timestamp
*/
-#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_READER 1464
+#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_READER 1465
/*!
* transaction: transaction range of timestamps pinned by the oldest
* timestamp
*/
-#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1465
+#define WT_STAT_CONN_TXN_PINNED_TIMESTAMP_OLDEST 1466
/*! transaction: transaction read timestamp of the oldest active reader */
-#define WT_STAT_CONN_TXN_TIMESTAMP_OLDEST_ACTIVE_READ 1466
+#define WT_STAT_CONN_TXN_TIMESTAMP_OLDEST_ACTIVE_READ 1467
/*! transaction: transaction sync calls */
-#define WT_STAT_CONN_TXN_SYNC 1467
+#define WT_STAT_CONN_TXN_SYNC 1468
/*! transaction: transactions committed */
-#define WT_STAT_CONN_TXN_COMMIT 1468
+#define WT_STAT_CONN_TXN_COMMIT 1469
/*! transaction: transactions rolled back */
-#define WT_STAT_CONN_TXN_ROLLBACK 1469
+#define WT_STAT_CONN_TXN_ROLLBACK 1470
/*! transaction: update conflicts */
-#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1470
+#define WT_STAT_CONN_TXN_UPDATE_CONFLICT 1471
/*!
* @}
diff --git a/src/third_party/wiredtiger/src/schema/schema_create.c b/src/third_party/wiredtiger/src/schema/schema_create.c
index e6dfc4d8b4e..84af4dffa0a 100644
--- a/src/third_party/wiredtiger/src/schema/schema_create.c
+++ b/src/third_party/wiredtiger/src/schema/schema_create.c
@@ -109,11 +109,11 @@ __create_file(
WT_DECL_RET;
const char *filename, **p,
*filecfg[] = {WT_CONFIG_BASE(session, file_meta), config, NULL, NULL, NULL};
- char *fileconf;
+ char *fileconf, *filemeta;
uint32_t allocsize;
bool exists, import_repair, is_metadata;
- fileconf = NULL;
+ fileconf = filemeta = NULL;
import_repair = false;
is_metadata = strcmp(uri, WT_METAFILE_URI) == 0;
@@ -175,7 +175,8 @@ __create_file(
cval.str++;
cval.len -= 2;
}
- WT_ERR(__wt_strndup(session, cval.str, cval.len, &filecfg[2]));
+ WT_ERR(__wt_strndup(session, cval.str, cval.len, &filemeta));
+ filecfg[2] = filemeta;
} else {
/*
* If there is no file metadata provided, the user should be specifying a "repair".
@@ -248,6 +249,7 @@ __create_file(
err:
__wt_scr_free(session, &val);
__wt_free(session, fileconf);
+ __wt_free(session, filemeta);
return (ret);
}
diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c
index ef861fca3da..146643130db 100644
--- a/src/third_party/wiredtiger/src/support/stat.c
+++ b/src/third_party/wiredtiger/src/support/stat.c
@@ -972,6 +972,7 @@ static const char *const __stats_connection_desc[] = {
"cache: page written requiring history store records",
"cache: pages currently held in the cache",
"cache: pages evicted by application threads",
+ "cache: pages evicted in parallel with checkpoint",
"cache: pages queued for eviction",
"cache: pages queued for eviction post lru sorting",
"cache: pages queued for urgent eviction",
@@ -1488,6 +1489,7 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats)
stats->cache_write_hs = 0;
/* not clearing cache_pages_inuse */
stats->cache_eviction_app = 0;
+ stats->cache_eviction_pages_in_parallel_with_checkpoint = 0;
stats->cache_eviction_pages_queued = 0;
stats->cache_eviction_pages_queued_post_lru = 0;
stats->cache_eviction_pages_queued_urgent = 0;
@@ -1989,6 +1991,8 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS *
to->cache_write_hs += WT_STAT_READ(from, cache_write_hs);
to->cache_pages_inuse += WT_STAT_READ(from, cache_pages_inuse);
to->cache_eviction_app += WT_STAT_READ(from, cache_eviction_app);
+ to->cache_eviction_pages_in_parallel_with_checkpoint +=
+ WT_STAT_READ(from, cache_eviction_pages_in_parallel_with_checkpoint);
to->cache_eviction_pages_queued += WT_STAT_READ(from, cache_eviction_pages_queued);
to->cache_eviction_pages_queued_post_lru +=
WT_STAT_READ(from, cache_eviction_pages_queued_post_lru);
diff --git a/src/third_party/wiredtiger/src/utilities/util_dump.c b/src/third_party/wiredtiger/src/utilities/util_dump.c
index 82e6ac54d17..2cece102729 100755
--- a/src/third_party/wiredtiger/src/utilities/util_dump.c
+++ b/src/third_party/wiredtiger/src/utilities/util_dump.c
@@ -266,6 +266,12 @@ dump_config(WT_SESSION *session, const char *uri, WT_CURSOR *cursor, bool hex, b
ret = 1;
} else if (ret == WT_NOTFOUND)
ret = util_err(session, 0, "%s: No such object exists", uri);
+ else if (ret == ENOTSUP)
+ /*
+ * Ignore ENOTSUP error. We return that for getting the creation metadata for a complex
+ * table because the meaning of that is undefined. It does mean the table exists.
+ */
+ ret = 0;
else
ret = util_err(session, ret, "%s", uri);
diff --git a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c
index e99206309b3..0179adddf46 100644
--- a/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c
+++ b/src/third_party/wiredtiger/test/csuite/timestamp_abort/main.c
@@ -230,9 +230,11 @@ thread_ckpt_run(void *arg)
fflush(stdout);
/*
* Create the checkpoint file so that the parent process knows at least one checkpoint has
- * finished and can start its timer.
+ * finished and can start its timer. If running with timestamps, wait until the stable
+ * timestamp has moved past WT_TS_NONE to give writer threads a chance to add something to
+ * the database.
*/
- if (first_ckpt) {
+ if (first_ckpt && (!use_ts || stable != WT_TS_NONE)) {
testutil_checksys((fp = fopen(ckpt_file, "w")) == NULL);
first_ckpt = false;
testutil_checksys(fclose(fp) != 0);
diff --git a/src/third_party/wiredtiger/test/evergreen/configure_combinations.sh b/src/third_party/wiredtiger/test/evergreen/configure_combinations.sh
index f335cb4c0e6..2423a248dfb 100755
--- a/src/third_party/wiredtiger/test/evergreen/configure_combinations.sh
+++ b/src/third_party/wiredtiger/test/evergreen/configure_combinations.sh
@@ -12,10 +12,9 @@ CC=clang CFLAGS=\"-Wall -Werror -Qunused-arguments -Wno-self-assign -Wno-parenth
options="--enable-diagnostic
--disable-shared
--disable-static --enable-python
---enable-java --enable-python
--enable-snappy --enable-zlib --enable-lz4
--with-builtins=lz4,snappy,zlib
---enable-diagnostic --enable-java --enable-python
+--enable-diagnostic --enable-python
--enable-strict --disable-shared"
saved_IFS=$IFS
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/AutoCloseTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/AutoCloseTest.java
deleted file mode 100644
index c576954c83a..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/AutoCloseTest.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.After;
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-public class AutoCloseTest {
-
- /*
- * Inner class to hold a session and cursor created in
- * in a thread that may be closed in another thread.
- */
- static class OpenSession extends Thread {
- private final Connection conn;
- private Session sess;
- private Cursor cur;
- private int threadnum;
- public OpenSession(Connection conn, int threadnum) {
- this.conn = conn;
- this.threadnum = threadnum;
- }
-
- public void run() {
- sess = conn.open_session(null);
- sess.create("table:autoclose", "key_format=S,value_format=S");
- cur = sess.open_cursor("table:autoclose", null, null);
- cur.putKeyString("key" + threadnum);
- cur.putValueString("value" + threadnum);
- cur.insert();
- }
-
- public void close() {
- cur.close();
- sess.close(null);
- }
- }
-
- /*
- * Connvalid tells us that we really closed the connection.
- * That allows teardown to reliably clean up so that
- * a single failure in one test does not cascade.
- */
- Connection conn;
- boolean connvalid = false;
-
- private Session sessionSetup() {
- String keyFormat = "S";
- String valueFormat = "u";
-
- conn = wiredtiger.open("WT_HOME", "create");
- connvalid = true;
- Session s = conn.open_session(null);
- s.create("table:t",
- "key_format=" + keyFormat + ",value_format=" + valueFormat);
- return s;
- }
-
- private Cursor populate(Session s)
- throws WiredTigerPackingException {
- Cursor c = s.open_cursor("table:t", null, null);
- c.putKeyString("bar");
- c.putValueByteArray("foo".getBytes());
- c.insert();
- return c;
- }
-
- @Test
- public void autoCloseCursor01()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- c.close();
-
- boolean caught = false;
- try {
- // Error: cursor used after close
- c.next();
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("cursor is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
-
- s.close("");
- conn.close("");
- connvalid = false;
- }
-
- @Test
- public void autoCloseCursor02()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- s.close("");
-
- boolean caught = false;
- try {
- // Error: cursor used after session closed
- c.next();
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("cursor is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
-
- conn.close("");
- connvalid = false;
- }
-
- @Test
- public void autoCloseCursor03()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- conn.close("");
- connvalid = false;
-
- boolean caught = false;
- try {
- // Error: cursor used after connection close
- c.close();
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("cursor is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
- }
-
- @Test
- public void autoCloseCursor04()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
-
- // The truncate call allows both of its cursor args
- // to be null, so we don't expect null checking.
-
- Cursor cbegin = s.open_cursor("table:t", null, null);
- cbegin.putKeyString("bar");
- cbegin.search();
- Cursor cend = s.open_cursor(null, cbegin, null);
- s.truncate(null, cbegin, cend, "");
- cbegin.close();
- cend.close();
-
- s.truncate("table:t", null, null, null);
-
- conn.close("");
- connvalid = false;
- }
-
- @Test
- public void autoCloseCursor05()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- // Allowable compare call
- c.putKeyString("bar");
- c.search();
- Cursor c2 = s.open_cursor(null, c, null);
- c.compare(c2);
-
- boolean caught = false;
- try {
- // Error: cursor arg should not be null
- c.compare(null);
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("other is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
- conn.close("");
- connvalid = false;
- }
-
- @Test
- public void autoCloseSession01()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- s.close("");
-
- boolean caught = false;
- try {
- // Error: session used after close
- s.drop("table:t", "");
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("session is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
-
- conn.close("");
- connvalid = false;
- }
-
- @Test
- public void autoCloseSession02()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- conn.close("");
- connvalid = false;
-
- boolean caught = false;
- try {
- // Error: session used after connection close
- s.close("");
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("session is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
- }
-
- @Test
- public void autoCloseSession03()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- s.close("");
-
- boolean caught = false;
- try {
- // Error: session used after close, using open call
- s.open_cursor("table:t", null, null);
- }
- catch (NullPointerException iae) {
- // The exception message is different, but still informative.
- assertEquals(iae.toString().contains("self is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
-
- conn.close("");
- connvalid = false;
- }
-
- @Test
- public void autoCloseConnection01()
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- conn.close("");
- connvalid = false;
-
- boolean caught = false;
- try {
- // Error: connection used after close
- conn.close("");
- }
- catch (NullPointerException iae) {
- assertEquals(iae.toString().contains("connection is null"), true);
- caught = true;
- }
- assertEquals(caught, true);
- }
-
- public void multithreadedHelper(boolean explicitClose, int nthreads)
- throws WiredTigerPackingException {
- Session s = sessionSetup();
- Cursor c = populate(s);
-
- OpenSession[] threads = new OpenSession[nthreads];
- for (int i = 0; i < nthreads; i++) {
- threads[i] = new OpenSession(conn, i);
- threads[i].start();
- }
-
- for (int i = 0; i < nthreads; i++) {
- try {
- threads[i].join();
- if (explicitClose)
- threads[i].close();
- } catch (InterruptedException e) {
- }
- }
-
- try {
- conn.close("");
- connvalid = false;
- }
- catch (Exception e) {
- // nothing
- }
- assertEquals(connvalid, false);
- }
-
- @Test
- public void autoCloseConnection02()
- throws WiredTigerPackingException {
- multithreadedHelper(false, 2);
- }
-
- @Test
- public void autoCloseConnection03()
- throws WiredTigerPackingException {
- multithreadedHelper(true, 2);
- }
-
- @Test
- public void autoCloseConnection04()
- throws WiredTigerPackingException {
- multithreadedHelper(false, 10);
- }
-
- @Test
- public void autoCloseConnection05()
- throws WiredTigerPackingException {
- multithreadedHelper(true, 10);
- }
-
- @After
- public void teardown() {
- if (connvalid) {
- conn.close("");
- }
- }
-
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/BackupCursorTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/BackupCursorTest.java
deleted file mode 100644
index 5d0196f6708..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/BackupCursorTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-public class BackupCursorTest {
- Connection conn;
- Session s;
- public final static int N_TABLES = 10;
-
- @Test
- public void backupCursor01()
- throws WiredTigerPackingException {
- setup();
-
- Cursor c = s.open_cursor("backup:", null, null);
- int ntables = 0;
-
- /*
- * Note: there may be additional files left over from
- * other tests in the suite, ignore them.
- */
- while (c.next() == 0) {
- String backupFile = c.getKeyString();
- if (backupFile.startsWith("backupc"))
- ntables++;
- }
-
- Assert.assertEquals(N_TABLES, ntables);
- c.close();
- teardown();
- }
-
- private void setup() {
- conn = wiredtiger.open("WT_HOME", "create");
- s = conn.open_session(null);
- for (int i = 0; i < N_TABLES; i++)
- s.create("table:backupc" + i, "key_format=S,value_format=S");
- }
-
- private void teardown() {
- for (int i = 0; i < N_TABLES; i++)
- s.drop("table:backupc" + i, "");
- s.close("");
- conn.close("");
- }
-
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConcurrentCloseTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConcurrentCloseTest.java
deleted file mode 100644
index da69456b639..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConcurrentCloseTest.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/*
- * Test multiple threads concurrently inserting and reading.
- * Each insert thread opens and closes for each record, so the
- * test stresses the concurrency of these calls in particular.
- * This is a test case for a problem reported in WT-2788.
- */
-class InsertThread extends Thread {
- private Connection conn;
- private int threadId;
-
- public InsertThread(Connection conn, int threadId) {
- this.conn = conn;
- this.threadId = threadId;
- }
-
- public void run()
- {
- try {
- int ret;
- for (int i = 0; i < 500; i++) {
- Session session = conn.open_session(null);
- Cursor cursor = session.open_cursor("table:cclose", null,
- "overwrite");
- cursor.putKeyString("key" + threadId + "-" + i);
- cursor.putValueString("value1");
- ret = cursor.insert();
- cursor.close();
- ret = session.close(null);
- }
- } catch (WiredTigerException wte) {
- System.err.println("Exception " + wte);
- }
- }
-}
-
-class ScanThread extends Thread {
- private Connection conn;
-
- public ScanThread(Connection conn) {
- this.conn = conn;
- }
-
- public void run()
- {
- try {
- int ret;
-
- Session session = conn.open_session(null);
- Cursor cursor = session.open_cursor("table:cclose", null, null);
-
- /* Show all records. */
- while ((ret = cursor.next()) == 0) {
- String key = cursor.getKeyString();
- String value = cursor.getValueString();
- System.out.println("Got record: " + key + " : " + value);
- }
- if (ret != wiredtiger.WT_NOTFOUND)
- System.err.println("Cursor.next: " +
- wiredtiger.wiredtiger_strerror(ret));
- cursor.close();
- session.close(null);
- } catch (WiredTigerException wte) {
- System.err.println("Exception " + wte);
- }
- }
-}
-
-public class ConcurrentCloseTest {
- Connection conn;
- Session session;
-
- public static String home;
-
- public static final int NUM_THREADS = 10;
-
- @Test
- public void test_threads()
- {
- setup();
- try {
- List<Thread> threads = new ArrayList<Thread>();
- int i;
-
- assertEquals(0, session.create("table:cclose",
- "key_format=S,value_format=S"));
- Cursor cursor = session.open_cursor("table:cclose", null,
- "overwrite");
- cursor.putKeyString("key1");
- cursor.putValueString("value1");
- assertEquals(0, cursor.insert());
- cursor.close();
- assertEquals(0, session.close(null));
-
- for (i = 0; i < NUM_THREADS; i++) {
- Thread insertThread = new InsertThread(conn, i);
- Thread scanThread = new ScanThread(conn);
- insertThread.start();
- scanThread.start();
- threads.add(insertThread);
- threads.add(scanThread);
- }
- for (Thread thread : threads)
- try {
- thread.join();
- }
- catch (InterruptedException ie) {
- fail();
- }
-
- assertEquals(0, conn.close(null));
- System.exit(0);
- }
- catch (WiredTigerException wte) {
- System.err.println("Exception: " + wte);
- wte.printStackTrace();
- System.exit(1);
- }
- }
-
- private void setup() {
- conn = wiredtiger.open("WT_HOME", "create");
- session = conn.open_session(null);
- }
-
- private void teardown() {
- session.close("");
- conn.close("");
- }
-
-
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConfigTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConfigTest.java
deleted file mode 100644
index 1e712dbfaf9..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ConfigTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-public class ConfigTest {
- Connection conn;
- Session session;
-
- public static final String uri = "table:test_config06";
- public static final String key = "keyABCDEFGHIJKLMNOPQRSTUVWXYZ";
- public static final String value = "valueABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- public void session_config(String config) {
- Exception e = null;
-
- try {
- session.create(uri, config);
- }
- catch (WiredTigerException wte) {
- e = wte;
- }
-
- Assert.assertTrue(e != null &&
- e.toString().indexOf("Invalid argument") >= 0);
- }
-
- // Edge cases for key/value formats.
- @Test
- public void test_session_config()
- throws WiredTigerException {
- setup();
- System.err.println("\n-- expect error output --");
- session_config("key_format=A,value_format=S");
- session_config("key_format=S,value_format=A");
- session_config("key_format=0s,value_format=s");
- session_config("key_format=s,value_format=0s");
- session_config("key_format=0t,value_format=4t");
- session_config("key_format=4t,value_format=0t");
- System.err.println("-- end expected error output --");
- teardown();
- }
-
- // Smoke-test the string formats with length specifiers; both formats should
- // ignore trailing bytes, verify that.
- public void format_string(String fmt, int len)
- throws WiredTigerException {
- setup();
- session.create(uri, "key_format=" + len + fmt +
- ",value_format=" + len + fmt);
- Cursor cursor = session.open_cursor(uri, null, null);
- cursor.putKeyString(key);
- cursor.putValueString(value);
- cursor.insert();
- cursor.putKeyString(key.substring(0,len));
- assertEquals(0, cursor.search());
- assertEquals(value.substring(0,len), cursor.getValueString());
- cursor.close();
- session.drop(uri, null);
- teardown();
- }
-
- @Test
- public void test_format_string_S_1()
- throws WiredTigerException {
- format_string("S", 1);
- }
- @Test
- public void test_format_string_S_4()
- throws WiredTigerException {
- format_string("S", 4);
- }
- @Test
- public void test_format_string_S_10()
- throws WiredTigerException {
- format_string("S", 10);
- }
- @Test
- public void test_format_string_s_1()
- throws WiredTigerException {
- format_string("s", 1);
- }
- @Test
- public void test_format_string_s_4()
- throws WiredTigerException {
- format_string("s", 4);
- }
- @Test
- public void test_format_string_s_10()
- throws WiredTigerException {
- format_string("s", 10);
- }
-
- @Test
- public void test_format_string_S_default()
- throws WiredTigerException {
- setup();
- session.create(uri, "key_format=S,value_format=S");
- Cursor cursor = session.open_cursor(uri, null, null);
- cursor.putKeyString(key);
- cursor.putValueString(value);
- cursor.insert();
- cursor.putKeyString(key);
- assertEquals(0, cursor.search());
- assertEquals(value, cursor.getValueString());
- cursor.close();
- session.drop(uri, null);
- teardown();
- }
-
- @Test
- public void test_format_string_s_default()
- throws WiredTigerException {
- setup();
- session.create(uri, "key_format=s,value_format=s");
- Cursor cursor = session.open_cursor(uri, null, null);
- cursor.putKeyString(key);
- cursor.putValueString(value);
- cursor.insert();
- cursor.putKeyString(key.substring(0,1));
- assertEquals(0, cursor.search());
- assertEquals(value.substring(0,1), cursor.getValueString());
- cursor.close();
- session.drop(uri, null);
- teardown();
- }
-
- public static void main(String[] args) {
- ConfigTest tester = new ConfigTest();
- try {
- tester.test_session_config();
- tester.test_format_string_S_1();
- tester.test_format_string_S_4();
- tester.test_format_string_S_10();
- tester.test_format_string_s_1();
- tester.test_format_string_s_4();
- tester.test_format_string_s_10();
- tester.test_format_string_S_default();
- tester.test_format_string_s_default();
- } catch (WiredTigerException wte) {
- System.err.println("WiredTigerException: " + wte);
- }
- }
-
- private void setup() {
- conn = wiredtiger.open("WT_HOME", "create");
- session = conn.open_session(null);
- }
-
- private void teardown() {
- session.close("");
- conn.close("");
- }
-
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest.java
deleted file mode 100644
index ce3717ab55c..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-public class CursorTest {
- Connection conn;
- Session s;
-
- @Test
- public void cursor01()
- throws WiredTigerPackingException {
- String keyFormat = "S";
- String valueFormat = "u";
- setup(keyFormat, valueFormat);
-
- Cursor c = s.open_cursor("table:t", null, null);
- c.putKeyString("bar");
- c.putValueByteArray("foo".getBytes());
- c.insert();
- c.close();
- teardown();
- }
-
- @Test
- public void cursor02()
- throws WiredTigerPackingException {
- String keyFormat = "S";
- String valueFormat = "u";
- setup(keyFormat, valueFormat);
-
- Cursor c = s.open_cursor("table:t", null, null);
- c.putKeyString("bar");
- c.putValueByteArray("foo".getBytes());
- c.insert();
- c.putKeyString("bar");
- c.search();
- Assert.assertEquals(c.getKeyString(), "bar");
- Assert.assertEquals(new String(c.getValueByteArray()), "foo");
- c.close();
- teardown();
- }
-
- @Test
- public void cursor03()
- throws WiredTigerPackingException {
- String keyFormat = "S";
- String valueFormat = "uiSu";
- setup(keyFormat, valueFormat);
-
- Cursor c = s.open_cursor("table:t", null, null);
- c.putKeyString("bar");
- c.putValueByteArray("aaaaa".getBytes()).putValueInt(123);
- c.putValueString("eeeee").putValueByteArray("iiiii".getBytes());
-
- c.insert();
- c.putKeyString("bar");
- c.search();
- Assert.assertEquals(c.getKeyString(), "bar");
- Assert.assertEquals(new String(c.getValueByteArray()), "aaaaa");
- Assert.assertEquals(c.getValueInt(), 123);
- Assert.assertEquals(c.getValueString(), "eeeee");
- Assert.assertEquals(new String(c.getValueByteArray()), "iiiii");
- c.close();
- teardown();
- }
-
- private void setup(String keyFormat, String valueFormat) {
- conn = wiredtiger.open("WT_HOME", "create");
- s = conn.open_session(null);
- s.create("table:t",
- "key_format=" + keyFormat + ",value_format=" + valueFormat);
- }
-
- private void teardown() {
- s.drop("table:t", "");
- s.close("");
- conn.close("");
- }
-
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest02.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest02.java
deleted file mode 100644
index d63e0a2dfad..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest02.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/* More advanced Cursor test cases. */
-public class CursorTest02 {
- Connection conn;
- Session s;
-
- /*
- * Test for Git issue 493:
- * https://github.com/wiredtiger/wiredtiger/issues/493
- */
- @Test
- public void cursor01()
- throws WiredTigerPackingException {
- String keyFormat = "S";
- String valueFormat = "S";
- setup(keyFormat, valueFormat, ",columns=(id,val)");
-
- Cursor c = s.open_cursor("table:t", null, null);
- c.putKeyString("foo");
- c.putValueString("bar");
- c.insert();
- c.reset();
- while (c.next() == 0) {
- Assert.assertEquals(c.getKeyFormat(), keyFormat);
- Assert.assertEquals(c.getKeyString(), "foo");
- Assert.assertEquals(c.getValueString(), "bar");
- }
-
- c.close();
- teardown();
- }
-
- private void setup(String keyFormat, String valueFormat, String options) {
- conn = wiredtiger.open("WT_HOME", "create");
- s = conn.open_session(null);
- s.create("table:t",
- "key_format=" + keyFormat + ",value_format=" + valueFormat);
- }
-
- private void teardown() {
- s.drop("table:t", "");
- s.close("");
- conn.close("");
- }
-
-}
-
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest03.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest03.java
deleted file mode 100644
index a81154055cf..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/CursorTest03.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.SearchStatus;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.WiredTigerException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/*
- * Test cases for WT-3238.
- *
- * Most WiredTiger methods return int, and our SWIG typemaps for Java add
- * checking that throws exceptions for non-zero returns. Certain methods
- * (Cursor.compare, Cursor.equals) are declared as returning int in Java,
- * but should not throw exceptions for normal returns (which may be
- * non-zero).
- */
-public class CursorTest03 {
- Connection conn;
- Session s;
- static String values[] = { "key0", "key1" };
-
- @Test
- public void cursor_int_methods()
- throws WiredTigerPackingException {
- setup();
-
- Cursor c1 = s.open_cursor("table:t", null, null);
- Cursor c2 = s.open_cursor("table:t", null, null);
- for (String s : values) {
- c1.putKeyString(s);
- c1.putValueString(s);
- c1.insert();
- }
- c1.reset();
-
- // "key1" compared to "key1"
- c1.putKeyString(values[1]);
- Assert.assertEquals(c1.search_near(), SearchStatus.FOUND);
- c2.putKeyString(values[1]);
- Assert.assertEquals(c2.search_near(), SearchStatus.FOUND);
- Assert.assertEquals(c1.compare(c2), 0);
- Assert.assertEquals(c2.compare(c1), 0);
- Assert.assertEquals(c1.compare(c1), 0);
- Assert.assertEquals(c1.equals(c2), 1);
- Assert.assertEquals(c2.equals(c1), 1);
- Assert.assertEquals(c1.equals(c1), 1);
-
- // "key0" compared to "key1"
- c1.putKeyString(values[0]);
- Assert.assertEquals(c1.search_near(), SearchStatus.FOUND);
- Assert.assertEquals(c1.compare(c2), -1);
- Assert.assertEquals(c2.compare(c1), 1);
- Assert.assertEquals(c1.equals(c2), 0);
- Assert.assertEquals(c2.equals(c1), 0);
-
- c1.close();
- c2.close();
- teardown();
- }
-
- public void expectException(Cursor c1, Cursor c2)
- {
- boolean caught = false;
- try {
- c1.compare(c2);
- }
- catch (WiredTigerException wte) {
- caught = true;
- }
- Assert.assertTrue(caught);
-
- caught = false;
- try {
- c1.equals(c2);
- }
- catch (WiredTigerException wte) {
- caught = true;
- }
- Assert.assertTrue(caught);
- }
-
- @Test
- public void cursor_int_methods_errors()
- throws WiredTigerPackingException {
- setup();
-
- Cursor c1 = s.open_cursor("table:t", null, null);
- Cursor c2 = s.open_cursor("table:t", null, null);
- Cursor cx = s.open_cursor("table:t2", null, null);
- for (String s : values) {
- c1.putKeyString(s);
- c1.putValueString(s);
- c1.insert();
- cx.putKeyString(s);
- cx.putValueString(s);
- cx.insert();
- }
- c1.reset();
- cx.reset();
-
- // With both cursors not set, should be an exception.
- expectException(c1, c2);
- expectException(c1, c2);
-
- // With any one cursor not set, should be an exception.
- c1.putKeyString(values[1]);
- Assert.assertEquals(c1.search_near(), SearchStatus.FOUND);
- expectException(c1, c2);
- expectException(c1, c2);
-
- // With two cursors from different tables, should be an exception.
- cx.putKeyString(values[1]);
- Assert.assertEquals(cx.search_near(), SearchStatus.FOUND);
- expectException(c1, cx);
- expectException(c1, cx);
-
- c1.close();
- c2.close();
- cx.close();
- teardown();
- }
-
- private void setup() {
- conn = wiredtiger.open("WT_HOME", "create");
- s = conn.open_session(null);
- s.create("table:t", "key_format=S,value_format=S");
- s.create("table:t2", "key_format=S,value_format=S");
- }
-
- private void teardown() {
- s.drop("table:t", "");
- s.drop("table:t2", "");
- s.close("");
- conn.close("");
- }
-
-}
-
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ExceptionTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ExceptionTest.java
deleted file mode 100644
index a93fc703145..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/ExceptionTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerException;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.WiredTigerRollbackException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.io.PrintStream;
-
-public class ExceptionTest {
- String uri;
- Connection conn;
- Session s;
-
- @Test
- public void except01() {
- String keyFormat = "S";
- String valueFormat = "i";
- setup("table:except01", keyFormat, valueFormat);
- boolean caught = false;
- boolean expecting = false; // expecting the exception?
- Cursor c = null;
-
- try {
- c = s.open_cursor("table:except01", null, null);
- c.putKeyString("bar");
- expecting = true;
- /* expecting int, the following statement should throw */
- c.putValueString("bar");
- expecting = false;
- }
- catch (WiredTigerPackingException wtpe) {
- caught = true;
- }
- finally {
- if (c != null)
- c.close();
- }
- Assert.assertEquals(expecting, true);
- Assert.assertEquals(caught, true);
- teardown();
- }
-
- @Test
- public void except02() {
- String keyFormat = "S";
- String valueFormat = "i";
- setup("table:except02", keyFormat, valueFormat);
- boolean expecting = false; // expecting the exception?
- boolean caught = false;
- Cursor c = null;
-
- System.err.println("\n-- expect error output --");
- try {
- expecting = true;
- /* catch a generic error */
- c = s.open_cursor("nonsense:stuff", null, null);
- expecting = false;
- }
- catch (WiredTigerException wte) {
- Assert.assertEquals(wte.getClass(), WiredTigerException.class);
- caught = true;
- }
- System.err.println("-- end expected error output --");
- Assert.assertEquals(expecting, true);
- Assert.assertEquals(caught, true);
- teardown();
- }
-
- @Test
- public void except03() throws IOException {
- String keyFormat = "S";
- String valueFormat = "i";
- boolean caught = false;
- Session sess1 = null;
- Session sess2 = null;
- Cursor c1 = null;
- Cursor c2 = null;
-
- setup("table:except03", keyFormat, valueFormat);
- System.err.println("Starting");
-
- try {
- sess1 = conn.open_session("isolation=snapshot");
- sess2 = conn.open_session("isolation=snapshot");
-
- sess1.begin_transaction(null);
- sess2.begin_transaction(null);
-
- c1 = sess1.open_cursor("table:except03", null, null);
- c2 = sess2.open_cursor("table:except03", null, null);
-
- c1.putKeyString("key");
- c1.putValueInt(1);
- c1.insert();
-
- c2.putKeyString("key");
- c2.putValueInt(2);
- c2.insert();
- }
- catch (WiredTigerRollbackException rbe) {
- caught = true;
- }
- catch (Exception e) {
- System.err.println("ERROR: got unexpected exception: " + e);
- }
- finally {
- if (c1 != null)
- c1.close();
- if (c2 != null)
- c2.close();
- if (sess1 != null)
- sess1.close("");
- if (sess2 != null)
- sess2.close("");
- }
- Assert.assertEquals(caught, true);
- teardown();
- }
-
- private void setup(String uriparam, String keyFormat, String valueFormat) {
- uri = uriparam;
- conn = wiredtiger.open("WT_HOME", "create");
- s = conn.open_session(null);
- s.create(uri,
- "key_format=" + keyFormat + ",value_format=" + valueFormat);
- }
-
- private void teardown() {
- s.drop(uri, "");
- s.close("");
- conn.close("");
- }
-
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest.java
deleted file mode 100644
index cc98937d4f8..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.PackOutputStream;
-import com.wiredtiger.db.PackInputStream;
-import com.wiredtiger.db.WiredTigerPackingException;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-public class PackTest {
-
- // Some random numbers for testing.
- static long[] testers = {
- -12, -145, -14135, -1352308572, -1, 0, 1, 12, 145, 12314,
- 873593485, -30194371, -4578928, 75452136, -28619244, 93580892,
- 83350219, 27407091, -82413912, -727169, -3748613, 54046160,
- -49539872, -4517158, 20397230, -68522195, 61663315, -6009306,
- -57778143, -97631892, -62388819, 23581637, 2417807, -17761744,
- -4174142, 92685293, 84597598, -83143925, 95302021, 90888796,
- 88697909, -89601258, 93585507, 63705051, 51191732, 60900034,
- -93016118, -68693051, -49366599, -90203871, 58404039, -79195628,
- -98043222, 35325799, 47942822, 11582824, 93322027, 71799760,
- 65114434, 42851643, 69146495, -86855643, 40073283, 1956899,
- 28090147, 71274080, -95192279, -30641467, -1142067, -32599515,
- 92478069, -90277478, -39370258, -77673053, 82435569, 88167012,
- -39048877, 96895962, -8587864, -70095341, 49508886, 69912387,
- 24311011, -58758419, 63228782, -52050021, 24687766, 34342885,
- 97830395, 74658034, -9715954, -76120311, -63117710, -19312535,
- 42829521, 32389638, -51273506, 16329653, -39061706, -9931233,
- 42174615, 75412082, -26236331, 57741055, -17577762, 3605997,
- -73993355, -54545904, -86580638, 84432898, -83573465, -1278,
- 636, -9935, 9847, 8300, -5170, -2501, 6031, -6658, -9780, -5351,
- 6573, -5582, -1994, -7498, -5190, 7710, -8125, -6478, 3670, 4293,
- 1903, 2367, 3501, 841, -1718, -2303, -670, 9668, 8391, 3719, 1453,
- 7203, -9693, 1294, -3549, -8941, -5455, 30, 2773, 8354, 7272,
- -9794, -4806, -7091, -8404, 8297, -4093, -9890, -4948, -38, -66,
- -12, 9, 50, -26, 4, -25, 62, 2, 47, -40, -22, -87, 75, -43, -51,
- 65, 7, -17, -90, -27, 56, -60, 27, -2, 2, -3, 4, 7, 8, -8
- };
-
- @Test
- public void pack01()
- throws WiredTigerPackingException {
- String format = "b";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addByte((byte)8);
-
- Assert.assertEquals(format, packer.getFormat());
- byte[] packed = packer.getValue();
-
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertEquals(unpacker.getByte(), (byte)8);
- }
-
- @Test
- public void pack02()
- throws WiredTigerPackingException {
- String format = "biqrhS";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addByte((byte)8);
- packer.addInt(124);
- packer.addLong(1240978);
- packer.addRecord(5680234);
- packer.addShort((short)8576);
- packer.addString("Hello string");
-
- Assert.assertEquals(format, packer.getFormat());
- byte[] packed = packer.getValue();
-
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertEquals(unpacker.getByte(), (byte)8);
- Assert.assertEquals(unpacker.getInt(), 124);
- Assert.assertEquals(unpacker.getLong(), 1240978);
- Assert.assertEquals(unpacker.getRecord(), 5680234);
- Assert.assertEquals(unpacker.getShort(), 8576);
- Assert.assertEquals(unpacker.getString(), "Hello string");
- }
-
- @Test
- public void pack03()
- throws WiredTigerPackingException {
- String format = "SS";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addString("Hello 1");
- packer.addString("Hello 2");
-
- byte[] packed = packer.getValue();
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertEquals(unpacker.getString(), "Hello 1");
- Assert.assertEquals(unpacker.getString(), "Hello 2");
- }
-
- @Test
- public void pack04()
- throws WiredTigerPackingException {
- String format = "U";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addByteArray("Hello 1".getBytes());
-
- byte[] packed = packer.getValue();
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), "Hello 1".getBytes()));
- }
-
- @Test
- public void pack05()
- throws WiredTigerPackingException {
- String format = "uuu";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addByteArray("Hello 1".getBytes());
- packer.addByteArray("Hello 2".getBytes());
- packer.addByteArray("Hello 3".getBytes());
-
- byte[] packed = packer.getValue();
- //printByteArray(packed, packed.length);
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), "Hello 1".getBytes()));
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), "Hello 2".getBytes()));
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), "Hello 3".getBytes()));
- }
-
- @Test
- public void pack06()
- throws WiredTigerPackingException {
- String format = "uiS";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addByteArray("Hello 1".getBytes());
- packer.addInt(12);
- packer.addString("Hello 3");
-
- byte[] packed = packer.getValue();
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), "Hello 1".getBytes()));
- Assert.assertEquals(unpacker.getInt(), 12);
- Assert.assertEquals(unpacker.getString(), "Hello 3");
- }
-
- @Test
- public void pack07()
- throws WiredTigerPackingException {
- String format = "4s";
- PackOutputStream packer = new PackOutputStream(format);
- packer.addString("Hello 1");
-
- byte[] packed = packer.getValue();
- PackInputStream unpacker = new PackInputStream(format, packed);
- Assert.assertEquals(unpacker.getString(), "Hell");
- }
-
- @Test
- public void pack08()
- throws WiredTigerPackingException {
- String format = "u";
- PackOutputStream packer = new PackOutputStream(format);
- PackInputStream unpacker;
- byte[] b0 = {};
- byte[] b1 = { 0x00 };
- byte[] packed;
-
- packer.addByteArray(b0);
- packed = packer.getValue();
- unpacker = new PackInputStream(format, packed);
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), b0));
-
- packer = new PackOutputStream(format);
- packer.addByteArray(b1);
- packed = packer.getValue();
- unpacker = new PackInputStream(format, packed);
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), b1));
-
- format = "uu";
- for (int i = 0; i < 2; i++) {
- byte[] arg0 = (i == 0 ? b0 : b1);
- for (int j = 0; j < 2; j++) {
- byte[] arg1 = (j == 0 ? b0 : b1);
- packer = new PackOutputStream(format);
- packer.addByteArray(arg0);
- packer.addByteArray(arg1);
- packed = packer.getValue();
- unpacker = new PackInputStream(format, packed);
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), arg0));
- Assert.assertTrue(java.util.Arrays.equals(
- unpacker.getByteArray(), arg1));
- }
- }
- }
-
- @Test
- public void packUnpackNumber01()
- throws WiredTigerPackingException {
- // Verify that we can pack and unpack single signed longs.
- for (long i:testers) {
- PackOutputStream packer = new PackOutputStream("q");
- packer.addLong(i);
- PackInputStream unpacker =
- new PackInputStream("q", packer.getValue());
- long unpacked = unpacker.getLong();
- if (i != unpacked)
- System.out.println(
- i + " did not match " + unpacked);
- }
- }
-
- @Test
- public void packUnpackNumber02()
- throws WiredTigerPackingException {
- // Verify that we can pack and unpack pairs of signed longs reliably.
- // This is interesting because it ensures that we are tracking the
- // number of bytes used by number packing correctly.
- for (int i = 0; i + 1 < testers.length; i += 2) {
- long val1 = testers[i];
- long val2 = testers[i+1];
-
- PackOutputStream packer = new PackOutputStream("qq");
- packer.addLong(val1);
- packer.addLong(val2);
- PackInputStream unpacker =
- new PackInputStream("qq", packer.getValue());
- long unpacked = unpacker.getLong();
- if (val1 != unpacked) {
- System.out.println(i + " did not match " + unpacked);
- }
- unpacked = unpacker.getLong();
- if (val2 != unpacked) {
- System.out.println(i + " did not match " + unpacked);
- }
- }
- }
-
- // A debug helper method
- private void printByteArray(byte[] bytes, int len) {
- for (int i = 0; i < len; i++) {
- System.out.println(String.format(
- "\t%8s", Integer.toBinaryString(
- bytes[i] & 0xff)).replace(' ', '0'));
- }
- }
-
- public static void main(String[] args) {
- PackTest tester = new PackTest();
- try {
- tester.pack01();
- tester.pack02();
- tester.packUnpackNumber01();
- } catch (WiredTigerPackingException wtpe) {
- System.err.println("Packing exception: " + wtpe);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest02.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest02.java
deleted file mode 100644
index fa83ec03fdb..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest02.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import java.util.Arrays;
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerException;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-public class PackTest02 {
-
- public static final String TEST_NAME = "PackTest02";
-
- private Connection connection;
- private Session session;
-
- // Compare two byte arrays, assert if different
- void compareByteArrays(byte[] a1, byte[] a2) {
- //printByteArray(a1, a1.length);
- //printByteArray(a2, a2.length);
- if (a1.length != a2.length) {
- System.err.println("Length differ");
- }
- assertEquals(a1.length, a2.length);
- for (int i = 0; i < a1.length; i++) {
- if (a1[i] != a2[i])
- System.err.println("DIFFER at " + i);
- assertEquals(a1[i], a2[i]);
- }
- }
-
- // Add either a set of keys or a set of values to the
- // cursor at the current position.
- boolean addKeyValues(Cursor cursor, Object[] args, boolean iskey) {
- for (Object arg : args) {
- if (arg instanceof Integer) {
- if (iskey)
- cursor.putKeyInt((Integer)arg);
- else
- cursor.putValueInt((Integer)arg);
- }
- else if (arg instanceof String) {
- if (iskey)
- cursor.putKeyString((String)arg);
- else
- cursor.putValueString((String)arg);
- }
- else if (arg instanceof byte[]) {
- if (iskey)
- cursor.putKeyByteArray((byte[])arg);
- else
- cursor.putValueByteArray((byte[])arg);
- }
- else
- throw new IllegalArgumentException("unknown type");
- }
- return true;
- }
-
- // Check that either a set of keys or a set of values match
- // the given expected values. Assert when different.
- boolean checkKeyValues(Cursor cursor, Object[] args, boolean iskey) {
- for (Object arg : args) {
- if (arg instanceof Integer) {
- if (iskey)
- assertEquals(arg, cursor.getKeyInt());
- else
- assertEquals(arg, cursor.getValueInt());
- }
- else if (arg instanceof String) {
- if (iskey)
- assertEquals(arg, cursor.getKeyString());
- else
- assertEquals(arg, cursor.getValueString());
- }
- else if (arg instanceof byte[]) {
- if (iskey)
- compareByteArrays((byte[])arg, cursor.getKeyByteArray());
- else
- compareByteArrays((byte[])arg, cursor.getValueByteArray());
- }
- else
- throw new IllegalArgumentException("unknown type");
- }
- return true;
- }
-
- // Helper function to make an array out of variable args
- Object[] makeArray(Object... args)
- {
- return args;
- }
-
- // Use checkCompare for the common case that what
- // we store is what we expect.
- boolean check(String fmt, Object... args)
- {
- return checkCompare(fmt, args, args);
- }
-
- // Create a table with 'fmt' as the value, and also a
- // reverse index. Store the given arguments as values,
- // make sure we can retrieve them from the main table
- // and the index. We compare the result using compareArgs,
- // these may be different from what we store due to padding.
- boolean checkCompare(String fmt, Object[] storeArgs, Object[] compareArgs)
- throws WiredTigerException {
- String uri = "table:" + TEST_NAME + "-" + fmt;
- String idx_uri = "index:" + TEST_NAME + "-" + fmt + ":inverse";
- int nargs = storeArgs.length;
- String colnames = "";
- for (int i = 0; i < nargs; i++) {
- if (i > 0)
- colnames += ",";
- colnames += "v" + i;
- }
- session.create(uri, "columns=(k," + colnames + ")," +
- "key_format=i,value_format=" + fmt);
- session.create(idx_uri, "columns=(" + colnames + ")");
- Cursor forw = session.open_cursor(uri, null, null);
- Cursor forw_idx = session.open_cursor(idx_uri + "(k)", null, null);
-
- forw.putKeyInt(1234);
- if (!addKeyValues(forw, storeArgs, false))
- return false;
- forw.insert();
-
- forw.putKeyInt(1234);
- assertEquals(0, forw.search());
- if (!checkKeyValues(forw, compareArgs, false))
- return false;
-
- if (!addKeyValues(forw_idx, storeArgs, true))
- return false;
- assertEquals(0, forw_idx.search());
-
- Integer expected[] = { 1234 };
-
- if (!checkKeyValues(forw_idx, expected, false))
- return false;
-
- forw.close();
- forw_idx.close();
- session.drop(idx_uri, null);
- session.drop(uri, null);
- return true;
- }
-
- // A debug helper method
- private void printByteArray(byte[] bytes, int len) {
- for (int i = 0; i < len; i++) {
- System.out.println(String.format(
- "\t%8s", Integer.toBinaryString(
- bytes[i] & 0xff)).replace(' ', '0'));
- }
- }
-
- private void setup() {
- connection = wiredtiger.open("WT_HOME", "create");
- session = connection.open_session(null);
- }
-
- private void teardown() {
- session.close(null);
- connection.close(null);
- }
-
- @Test
- public void packTest()
- throws WiredTigerPackingException {
-
- // Do a test of packing, based on test suite's test_pack.py
-
- String a10 = "aaaaaaaaaa";
- String a42 = a10 + a10 + a10 + a10 + "aa";
- byte[] b10 =
- { 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42 };
- byte[] b20 =
- { 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
- 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42 };
- byte[] b1 = { 0x4 };
- byte[] b3 = { 0x4, 0x0, 0x0 };
-
- setup();
- check("iii", 0, 101, -99);
- check("3i", 0, 101, -99);
- check("iS", 42, "forty two");
- check("S", "abc");
- check("9S", "aaaaaaaaa");
- check("9sS", "forty two", "spam egg");
- check("42s", a42);
- check("42sS", a42, "something");
- check("S42s", "something", a42);
- // nul terminated string with padding
- check("10sS", "aaaaa\0\0\0\0\0", "something");
- check("S10s", "something", "aaaaa\0\0\0\0\0");
- check("u", b20);
- check("uu", b10, b10);
- // input 1 byte for a 3 byte format, extra null bytes will be stored
- checkCompare("3u", makeArray(b1), makeArray(b3));
- checkCompare("3uu", makeArray(b1, b10), makeArray(b3, b10));
- checkCompare("u3u", makeArray(b10, b1), makeArray(b10, b3));
-
- check("s", "4");
- check("1s", "4");
- check("2s", "42");
- teardown();
- }
-
- public static void main(String[] args) {
- PackTest02 tester = new PackTest02();
- try {
- tester.packTest();
- } catch (WiredTigerPackingException wtpe) {
- System.err.println("Packing exception: " + wtpe);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest03.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest03.java
deleted file mode 100644
index f46b84b2195..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/PackTest03.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import com.wiredtiger.db.Connection;
-import com.wiredtiger.db.Cursor;
-import com.wiredtiger.db.PackOutputStream;
-import com.wiredtiger.db.PackInputStream;
-import com.wiredtiger.db.Session;
-import com.wiredtiger.db.WiredTigerException;
-import com.wiredtiger.db.WiredTigerPackingException;
-import com.wiredtiger.db.wiredtiger;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/*
- * PackTest03 tests packing/unpacking in three ways:
- * 1) using PackInputStream/PackOutputStream
- * 2) putting values into a main table and rereading them.
- * 3) checking that values are stored in a reverse index on the main table.
- */
-public class PackTest03 {
-
- private Connection connection;
- private Session session;
-
- public interface PackingAdaptor {
- public void addval(PackOutputStream packer, long val);
- public long getval(PackInputStream unpacker);
- public void addval(Cursor cur, long val);
- public void addkey(Cursor cur, long key);
- public long getval(Cursor cur);
- }
- public static class Scenario {
- public Scenario(String format, long low, long high, int nbits,
- PackingAdaptor a) {
- this.format = format;
- this.low = low;
- this.high = high;
- this.nbits = nbits;
- if (format.equals("Q"))
- this.mask = -1L;
- else if (low == 0) // unsigned
- this.mask = (1L << nbits) - 1;
- else // signed - preserve the sign and lose one of the lower bits
- this.mask = (1L << (nbits - 1)) - 1;
- this.adaptor = a;
- }
- public String format;
- public long low;
- public long high;
- public int nbits;
- public long mask;
- public PackingAdaptor adaptor;
- }
- public static final Scenario scenarios[] = {
- new Scenario("b", -128, 127, 8, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addByte((byte)val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getByte(); }
- public void addval(Cursor cur, long val) {
- cur.putValueByte((byte)val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyByte((byte)key); }
- public long getval(Cursor cur) {
- return cur.getValueByte(); }
- }),
- new Scenario("B", 0, 255, 8, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addByte((byte)val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getByte(); }
- public void addval(Cursor cur, long val) {
- cur.putValueByte((byte)val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyByte((byte)key); }
- public long getval(Cursor cur) {
- return cur.getValueByte(); }
- }),
- new Scenario("h", -32768, 32767, 16, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addShort((short)val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getShort(); }
- public void addval(Cursor cur, long val) {
- cur.putValueShort((short)val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyShort((short)key); }
- public long getval(Cursor cur) {
- return cur.getValueShort(); }
- }),
- /*
- * Note: high should be 65535, there's not currently a way to insert
- * unsigned shorts between 2^15 and 2^16.
- */
- new Scenario("H", 0, 32767, 16, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addShort((short)val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getShort(); }
- public void addval(Cursor cur, long val) {
- cur.putValueShort((short)val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyShort((short)key); }
- public long getval(Cursor cur) {
- return cur.getValueShort(); }
- }),
- new Scenario("i", -2147483648, 2147483647, 32, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addInt((int)val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getInt(); }
- public void addval(Cursor cur, long val) {
- cur.putValueInt((int)val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyInt((int)key); }
- public long getval(Cursor cur) {
- return cur.getValueInt(); }
- }),
- /*
- * Note: high should be 4294967295L, there's not currently a way to
- * insert unsigned ints between 2^31 and 2^32.
- */
- new Scenario("I", 0, 2147483647L, 32, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addInt((int)val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getInt(); }
- public void addval(Cursor cur, long val) {
- cur.putValueInt((int)val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyInt((int)key); }
- public long getval(Cursor cur) {
- return cur.getValueInt(); }
- }),
- new Scenario("q", -9223372036854775808L,
- 9223372036854775807L, 64, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addLong(val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getLong(); }
- public void addval(Cursor cur, long val) {
- cur.putValueLong(val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyLong(key); }
- public long getval(Cursor cur) {
- return cur.getValueLong(); }
- }),
-
- /* 'unsigned long' numbers larger than 2^63 cannot be
- * expressed in Java (except indirectly as negative numbers).
- */
- new Scenario("Q", 0, -1L, 64, new PackingAdaptor() {
- public void addval(PackOutputStream packer, long val) {
- packer.addLong(val); }
- public long getval(PackInputStream unpacker) {
- return unpacker.getLong(); }
- public void addval(Cursor cur, long val) {
- cur.putValueLong(val); }
- public void addkey(Cursor cur, long key) {
- cur.putKeyLong(key); }
- public long getval(Cursor cur) {
- return cur.getValueLong(); }
- }),
- };
-
- void packSingle(Scenario scen, Cursor cur, Cursor curinv, long value)
- throws WiredTigerPackingException {
- if ((value < scen.low || value > scen.high) && scen.low < scen.high)
- throw new IllegalArgumentException("value out of range: " + value);
-
- // The Java API does not handle large unsigned values
- // via the cursor interface. We can fake it via the
- // Packing interface.
- if (scen.low == 0 && value > (scen.high / 2)) {
- // disable cursor checks
- cur = null;
- curinv = null;
- }
- PackOutputStream packer = new PackOutputStream(scen.format);
- scen.adaptor.addval(packer, value);
- byte[] bytes = packer.getValue();
- PackInputStream unpacker =
- new PackInputStream(scen.format, packer.getValue());
- long unpacked = scen.adaptor.getval(unpacker);
-
- // We jump through hoops to allow values to be packed/unpacked.
- if (scen.low < 0 && unpacked < 0) {
- unpacked = (unpacked & scen.mask) | ~scen.mask;
- }
- else {
- unpacked = unpacked & scen.mask;
- }
-
- if (value != unpacked) {
- System.err.println("ERROR: format " + scen.format +
- ": wanted=" + value +
- " did not match got=" + unpacked);
- assertEquals(value, unpacked);
- }
- if (cur != null) {
- cur.reset();
- cur.putKeyInt(9999);
- scen.adaptor.addval(cur, value);
- cur.insert();
- cur.reset();
- cur.putKeyInt(9999);
- assertEquals(0, cur.search());
- long unpacked2 = scen.adaptor.getval(cur);
- if (value != unpacked2) {
- System.out.println("ERROR: format " + scen.format +
- ": cursor wanted=" + value +
- " did not match got=" + unpacked2);
- assertEquals(value, unpacked2);
- }
- curinv.reset();
- scen.adaptor.addkey(curinv, value);
- assertEquals(0, curinv.search());
- assertEquals(9999, curinv.getValueInt());
- }
- }
-
- /**
- * An envelope method around tryPackSingle() that reports any exceptions
- */
- void tryPackSingle(Scenario scen, Cursor cur, Cursor curinv, long value)
- throws WiredTigerPackingException {
- try {
- packSingle(scen, cur, curinv, value);
- }
- catch (WiredTigerPackingException pe) {
- System.err.println("ERROR: scenario " + scen.format +
- ": value=" + value);
- throw pe;
- }
- catch (AssertionError ae) {
- System.err.println("ERROR: scenario " + scen.format +
- ": value=" + value);
- throw ae;
- }
- }
-
- void tryPackRange(Scenario scen, long lowRange, long highRange)
- throws WiredTigerPackingException {
- //System.out.println("Scenario " + scen.format +
- // ": [" + lowRange + "," + highRange + "]");
- String uri = "table:PackTest03";
- String uriinv = "index:PackTest03:inverse";
- session.create(uri, "columns=(k,v),key_format=i,value_format=" +
- scen.format);
- session.create(uriinv, "columns=(v)");
- Cursor cur = session.open_cursor(uri, null, null);
- Cursor curinv = session.open_cursor(uriinv + "(k)", null, null);
- if (lowRange < scen.low)
- lowRange = scen.low;
- if (highRange > scen.high && scen.high != -1L)
- highRange = scen.high;
- for (long val = lowRange; val <= highRange; val++) {
- try {
- tryPackSingle(scen, cur, curinv, val);
- }
- catch (Exception ex) {
- System.out.println("EXCEPTION: format " + scen.format +
- ": value: " + val + ": " + ex);
- throw ex;
- }
- // watch for long overflow
- if (val == Long.MAX_VALUE)
- break;
- }
- cur.close();
- curinv.close();
- session.drop(uriinv, null);
- session.drop(uri, null);
- }
-
- // A debug helper method
- private void printByteArray(byte[] bytes, int len) {
- for (int i = 0; i < len; i++) {
- System.out.println(String.format(
- "\t%8s", Integer.toBinaryString(
- bytes[i] & 0xff)).replace(' ', '0'));
- }
- }
-
- @Test
- public void packUnpackRanges()
- throws WiredTigerPackingException {
- // Do a comprehensive test of packing for various formats.
- // Based on test suite's test_intpack.py
- long imin = Integer.MIN_VALUE;
- long imax = Integer.MAX_VALUE;
- long e32 = 1L << 32;
- long lmin = Long.MIN_VALUE;
- long lmax = Long.MAX_VALUE;
-
- setup();
- for (int scenidx = 0; scenidx < scenarios.length; scenidx++) {
- Scenario scen = scenarios[scenidx];
- tryPackRange(scen, -100000, 100000);
- tryPackRange(scen, imin - 100, imin + 100);
- tryPackRange(scen, imax - 100, imax + 100);
- tryPackRange(scen, -e32 - 100, -e32 + 100);
- tryPackRange(scen, e32 - 100, e32 + 100);
- tryPackRange(scen, lmin, lmin + 100);
- tryPackRange(scen, lmax - 100, lmax);
- }
- teardown();
- }
-
- private void setup() {
- connection = wiredtiger.open("WT_HOME", "create");
- session = connection.open_session(null);
- }
-
- private void teardown() {
- session.close(null);
- connection.close(null);
- }
-
- public static void main(String[] args) {
- PackTest03 tester = new PackTest03();
- try {
- tester.packUnpackRanges();
- } catch (WiredTigerPackingException wtpe) {
- System.err.println("Packing exception: " + wtpe);
- }
- }
-}
diff --git a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/WiredTigerSuite.java b/src/third_party/wiredtiger/test/java/com/wiredtiger/test/WiredTigerSuite.java
deleted file mode 100644
index 07c1fd49d0d..00000000000
--- a/src/third_party/wiredtiger/test/java/com/wiredtiger/test/WiredTigerSuite.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * Public Domain 2014-2020 MongoDB, Inc.
- * Public Domain 2008-2014 WiredTiger, Inc.
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-package com.wiredtiger.test;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses( {
- AutoCloseTest.class,
- BackupCursorTest.class,
- ConfigTest.class,
- CursorTest.class,
- CursorTest02.class,
- CursorTest03.class,
- ExceptionTest.class,
- PackTest.class,
- PackTest02.class,
- PackTest03.class
-})
-
-public class WiredTigerSuite {
- // the class remains empty,
- // used only as a holder for the above annotations
-}
diff --git a/src/third_party/wiredtiger/test/suite/test_import08.py b/src/third_party/wiredtiger/test/suite/test_import08.py
new file mode 100644
index 00000000000..80859a4a5ef
--- /dev/null
+++ b/src/third_party/wiredtiger/test/suite/test_import08.py
@@ -0,0 +1,178 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2020 MongoDB, Inc.
+# Public Domain 2008-2014 WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# test_import08.py
+# Check that transaction ids from imported files are ignored regardless of write generation.
+
+import os, re, shutil
+from test_import01 import test_import_base
+from wtscenario import make_scenarios
+
+class test_import08(test_import_base):
+ conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
+ session_config = 'isolation=snapshot'
+
+ original_db_file = 'original_db_file'
+ uri = 'file:' + original_db_file
+
+ nrows = 100
+ ntables = 10
+ keys = [b'1', b'2', b'3', b'4', b'5', b'6']
+ values = [b'\x01\x02aaa\x03\x04', b'\x01\x02bbb\x03\x04', b'\x01\x02ccc\x03\x04',
+ b'\x01\x02ddd\x03\x04', b'\x01\x02eee\x03\x04', b'\x01\x02fff\x03\x04']
+ ts = [10*k for k in range(1, len(keys)+1)]
+ create_config = 'allocation_size=512,key_format=u,log=(enabled=true),value_format=u'
+ scenarios = make_scenarios([
+ ('file_metadata', dict(repair=False)),
+ ('repair', dict(repair=True)),
+ ])
+
+ def parse_write_gen(self, config):
+ # The search string will look like: 'write_gen=<num>'.
+ # Just reverse the string and take the digits from the back until we hit '='.
+ write_gen = re.search("write_gen=\d+", config)
+ self.assertTrue(write_gen is not None)
+ write_gen_str = str()
+ for c in reversed(write_gen.group(0)):
+ if not c.isdigit():
+ self.assertEqual(c, '=')
+ break
+ write_gen_str = c + write_gen_str
+ return int(write_gen_str)
+
+ def test_import_write_gen(self):
+ # Make a bunch of files and fill them with data. This has the side effect of allocating a
+ # lot of transaction ids which is important for our test.
+ self.populate(self.ntables, self.nrows)
+
+ # Find the URI of one of the generated tables.
+ session2 = self.conn.open_session()
+ cursor2 = session2.open_cursor('metadata:')
+ generated_uri = None
+ for k, _ in cursor2:
+ if k.startswith('table:'):
+ generated_uri = k
+ break
+ cursor2.close()
+
+ # Now begin a transaction and remove the first entry in the table.
+ #
+ # This is going to allocate a transaction ID and more importantly, will ensure that pinned
+ # ID is set for subsequent checkpoints in this test. If we don't do this, reconciliation
+ # won't actually write transaction IDs to the disk since they will be deemed obsolete.
+ session2.begin_transaction()
+ self.assertTrue(generated_uri is not None)
+ cursor2 = session2.open_cursor(generated_uri)
+ cursor2.set_key(0)
+ cursor2.remove()
+
+ # Now create the file that we'll be importing later.
+ self.session.create(self.uri, self.create_config)
+
+ # Insert records into our newly created file.
+ #
+ # Since we allocated a bunch of transaction IDs before, we'll be allocating pretty high
+ # IDs at this point.
+ for i in range(0, len(self.keys)):
+ self.update(self.uri, self.keys[i], self.values[i], self.ts[i])
+
+ # We want to checkpoint after each write to increase the write gen for this particular
+ # btree.
+ self.session.checkpoint()
+
+ # Export the metadata for the table.
+ c = self.session.open_cursor('metadata:', None, None)
+ original_db_file_config = c[self.uri]
+ c.close()
+
+ self.printVerbose(3, '\nFile configuration:\n' + original_db_file_config)
+
+ # Now that we've finished doing our checkpoints, we can let go of the transaction ID we
+ # allocated earlier.
+ session2.rollback_transaction()
+
+ # Close the connection.
+ self.close_conn()
+
+ # Create a new database and connect to it.
+ newdir = 'IMPORT_DB'
+ shutil.rmtree(newdir, ignore_errors=True)
+ os.mkdir(newdir)
+ self.conn = self.setUpConnectionOpen(newdir)
+ self.session = self.setUpSessionOpen(self.conn)
+
+ # Bring forward the oldest to be past or equal to the timestamps we'll be importing.
+ self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(self.ts[-1]))
+
+ # Copy over the datafiles for the object we want to import.
+ self.copy_file(self.original_db_file, '.', newdir)
+
+ # Contruct the config string.
+ if self.repair:
+ import_config = 'import=(enabled,repair=true)'
+ else:
+ import_config = 'import=(enabled,repair=false,file_metadata=(' + \
+ original_db_file_config + '))'
+
+ # Import the file.
+ self.session.create(self.uri, import_config)
+
+ # Verify object.
+ self.session.verify(self.uri)
+
+ # Check the write generation of the new table.
+ #
+ # The important thing to check is that it is greater than 1 (the current connection-wide
+ # base write gen).
+ c = self.session.open_cursor('metadata:')
+ original_db_file_config = c[self.uri]
+ c.close()
+ write_gen = self.parse_write_gen(original_db_file_config)
+ self.printVerbose(3, 'IMPORTED WRITE GEN: {}'.format(write_gen))
+ self.assertGreater(write_gen, 1)
+
+ # Check that the values are all visible.
+ #
+ # These values were written in the previous database with HIGH transaction IDs. Since we're
+ # on a fresh connection, our IDs are starting back from 1 so we MUST wipe the IDs otherwise
+ # they won't be visible to us and this test will fail.
+ #
+ # Since we were checkpointing after each write, the write gen of some of these pages will
+ # definitely be higher than 1.
+ #
+ # If we use the old scheme and compare the page's write gen with the connection-wide base
+ # write gen (which will be 1 since we made a new database), then we won't see some records
+ # and the test will fail.
+ #
+ # If we use the new scheme and compare with the btree specific base write gen that was
+ # supplied in the metadata, we will realise that it was from the previous run and wipe the
+ # IDs meaning that all records will be visible.
+ self.check(self.uri, self.keys, self.values)
+
+ # Perform a checkpoint.
+ self.session.checkpoint()
diff --git a/src/third_party/wiredtiger/test/suite/test_metadata_cursor04.py b/src/third_party/wiredtiger/test/suite/test_metadata_cursor04.py
new file mode 100644
index 00000000000..81234333335
--- /dev/null
+++ b/src/third_party/wiredtiger/test/suite/test_metadata_cursor04.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2020 MongoDB, Inc.
+# Public Domain 2008-2014 WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+import wiredtiger, wttest
+
+# test_metadata04.py
+# Check metadata create cursors with complex tables.
+class test_metadata04(wttest.WiredTigerTestCase):
+ # Turn logging on for the database but we will turn logging off for all tables.
+ conn_config = 'log=(enabled)'
+ uri = 'table:metadata04'
+
+ def check_meta(self, uri, check_log):
+ cur = self.session.open_cursor('metadata:create', None, None)
+ cur.set_key(uri)
+ cur.search()
+ meta = cur.get_value()
+ cur.close()
+ self.pr("======== " + uri)
+ self.pr(meta)
+ if not check_log:
+ return
+
+ log_false = meta.find('log=(enabled=false)')
+ if log_false == -1:
+ self.pr(uri + " FAIL: " + meta)
+ else:
+ self.pr(uri + " SUCCESS")
+ self.assertTrue(log_false != -1)
+
+ # Test a complex table with column groups and an index.
+ def test_metadata04_complex(self):
+ self.session.create(self.uri,
+ "log=(enabled=false),key_format=S,value_format=SS," +
+ "columns=(key,s0,s1),colgroups=(c1)")
+
+ self.session.create("index:metadata04:s0", "log=(enabled=false),columns=(s0)")
+ self.session.create("colgroup:metadata04:c1", "log=(enabled=false),columns=(s0,s1)")
+
+ # Check that we can see that logging on the index and colgroup tables is false.
+ self.check_meta("colgroup:metadata04:c1", True)
+ self.check_meta("index:metadata04:s0", True)
+ self.check_meta(self.uri, False)
+
+ # Test a simple table.
+ def test_metadata04_table(self):
+ self.session.create(self.uri, 'log=(enabled=false),key_format=S,value_format=S,')
+ self.check_meta(self.uri, True)
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/src/third_party/wiredtiger/test/suite/test_prepare08.py b/src/third_party/wiredtiger/test/suite/test_prepare08.py
index 9b2ac655ede..a7508ec3af4 100644
--- a/src/third_party/wiredtiger/test/suite/test_prepare08.py
+++ b/src/third_party/wiredtiger/test/suite/test_prepare08.py
@@ -39,7 +39,7 @@ def timestamp_str(t):
# to the data store.
class test_prepare08(wttest.WiredTigerTestCase):
# Force a small cache.
- conn_config = 'cache_size=5MB,eviction_dirty_trigger=80,eviction_updates_trigger=80'
+ conn_config = 'cache_size=10MB,eviction_dirty_trigger=80,eviction_updates_trigger=80'
def updates(self, ds, uri, nrows, value, ts):
cursor = self.session.open_cursor(uri)
diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp20.py b/src/third_party/wiredtiger/test/suite/test_timestamp20.py
index 69aec301a47..63a2503d915 100644
--- a/src/third_party/wiredtiger/test/suite/test_timestamp20.py
+++ b/src/third_party/wiredtiger/test/suite/test_timestamp20.py
@@ -37,7 +37,7 @@ class test_timestamp20(wttest.WiredTigerTestCase):
conn_config = 'cache_size=50MB'
session_config = 'isolation=snapshot'
- def test_timestamp20(self):
+ def test_timestamp20_standard(self):
uri = 'table:test_timestamp20'
self.session.create(uri, 'key_format=S,value_format=S')
self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(1))
@@ -86,3 +86,80 @@ class test_timestamp20(wttest.WiredTigerTestCase):
for i in range(1, 10000):
self.assertEqual(old_reader_cursor[str(i)], value3)
old_reader_session.rollback_transaction()
+
+ # In this test we're using modifies since they are more sensitive to corruptions.
+ #
+ # Corruptions to string types may go undetected since non-ASCII characters won't be included in
+ # the conversion to a Python string.
+ def test_timestamp20_modify(self):
+ uri = 'table:test_timestamp20'
+ self.session.create(uri, 'key_format=S,value_format=S')
+ self.conn.set_timestamp('oldest_timestamp=' + timestamp_str(1))
+ cursor = self.session.open_cursor(uri)
+
+ value1 = 'a' * 500
+ value2 = 'b' * 500
+ value3 = 'c' * 500
+
+ # Apply the base value.
+ for i in range(1, 10000):
+ self.session.begin_transaction()
+ cursor[str(i)] = value1
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(10))
+
+ # Now apply a series of modifies.
+ for i in range(1, 10000):
+ self.session.begin_transaction()
+ cursor.set_key(str(i))
+ self.assertEqual(cursor.modify([wiredtiger.Modify('B', 100, 1)]), 0)
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(20))
+
+ for i in range(1, 10000):
+ self.session.begin_transaction()
+ cursor.set_key(str(i))
+ self.assertEqual(cursor.modify([wiredtiger.Modify('C', 200, 1)]), 0)
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(30))
+
+ # Open an old reader at this point.
+ #
+ # I'm trying to read the middle modify because I specifically don't want to read one that
+ # has been squashed into a full update.
+ old_reader_session = self.conn.open_session()
+ old_reader_cursor = old_reader_session.open_cursor(uri)
+ old_reader_session.begin_transaction('read_timestamp=' + timestamp_str(30))
+
+ # Now apply the last modify.
+ # This will be the end of the chain of modifies.
+ for i in range(1, 10000):
+ self.session.begin_transaction()
+ cursor.set_key(str(i))
+ self.assertEqual(cursor.modify([wiredtiger.Modify('D', 300, 1)]), 0)
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(40))
+
+ # Now put two updates out of order. 5 will go to the history store and will trigger a
+ # correction to the existing contents.
+ for i in range(1, 10000):
+ self.session.begin_transaction()
+ cursor[str(i)] = value2
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(5))
+ self.session.begin_transaction()
+ cursor[str(i)] = value3
+ self.session.commit_transaction('commit_timestamp=' + timestamp_str(50))
+
+ # Open up a new transaction and read at 30.
+ # We shouldn't be able to see past 5 due to txnid visibility.
+ self.session.begin_transaction('read_timestamp=' + timestamp_str(30))
+ for i in range(1, 10000):
+ self.assertEqual(cursor[str(i)], value2)
+ self.session.rollback_transaction()
+
+ # Put together expected value.
+ expected = list(value1)
+ expected[100] = 'B'
+ expected[200] = 'C'
+ expected = str().join(expected)
+
+ # On the other hand, this older transaction SHOULD be able to read past the 5.
+ for i in range(1, 10000):
+ self.assertEqual(old_reader_cursor[str(i)], expected)
+ old_reader_session.rollback_transaction()