summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-01-28 09:25:16 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2016-01-28 09:30:32 +1100
commit67e412d4c578e203505446496c67fc1517931cad (patch)
tree5d1e780ea1e14b1d32ef34aa33716be9bc284f8c
parent3c2ad56b507d82d8d5599dc1ebb50d3ccc087bfb (diff)
parent7fea169e425b2a56d88351f362d746d5b5dd77f5 (diff)
downloadmongo-67e412d4c578e203505446496c67fc1517931cad.tar.gz
Merge branch 'develop' into mongodb-3.2
-rw-r--r--LICENSE2
-rw-r--r--NEWS231
-rw-r--r--README6
-rw-r--r--RELEASE_INFO2
-rw-r--r--SConstruct2
-rw-r--r--api/leveldb/leveldb_wt.h2
-rw-r--r--bench/wtperf/Makefile.am3
-rw-r--r--bench/wtperf/config.c181
-rw-r--r--bench/wtperf/config_opt.h2
-rw-r--r--bench/wtperf/doxy.c2
-rw-r--r--bench/wtperf/idle_table_cycle.c192
-rw-r--r--bench/wtperf/misc.c20
-rw-r--r--bench/wtperf/runners/btree-split-stress.wtperf10
-rw-r--r--bench/wtperf/runners/checkpoint_stress_schema_ops.wtperf19
-rwxr-xr-xbench/wtperf/runners/get_ckpt.py2
-rw-r--r--bench/wtperf/runners/mongodb-oplog.wtperf2
-rwxr-xr-xbench/wtperf/runners/wtperf_run.sh15
-rw-r--r--bench/wtperf/track.c2
-rw-r--r--bench/wtperf/wtperf.c332
-rw-r--r--bench/wtperf/wtperf.h132
-rw-r--r--bench/wtperf/wtperf_opt.i23
-rw-r--r--bench/wtperf/wtperf_throttle.c121
-rw-r--r--bench/wtperf/wtperf_truncate.c77
-rw-r--r--build_posix/Make.base1
-rw-r--r--build_posix/aclocal/version-set.m44
-rw-r--r--build_posix/aclocal/version.m42
-rw-r--r--build_posix/configure.ac.in2
-rw-r--r--build_win/filelist.win2
-rw-r--r--dist/api_data.py6
-rw-r--r--dist/filelist2
-rw-r--r--dist/flags.py4
-rw-r--r--dist/log.py97
-rw-r--r--dist/package/wiredtiger.spec2
-rwxr-xr-xdist/s_all8
-rwxr-xr-xdist/s_copyright26
-rwxr-xr-xdist/s_docs3
-rwxr-xr-xdist/s_funcs2
-rwxr-xr-xdist/s_longlines7
-rwxr-xr-xdist/s_string3
-rw-r--r--dist/s_string.ok27
-rwxr-xr-xdist/s_style9
-rwxr-xr-xdist/s_whitespace2
-rwxr-xr-xdist/s_win1
-rw-r--r--dist/stat.py16
-rw-r--r--dist/stat_data.py273
-rw-r--r--examples/c/ex_access.c2
-rw-r--r--examples/c/ex_all.c6
-rw-r--r--examples/c/ex_async.c2
-rw-r--r--examples/c/ex_backup.c2
-rw-r--r--examples/c/ex_call_center.c2
-rw-r--r--examples/c/ex_config.c2
-rw-r--r--examples/c/ex_config_parse.c2
-rw-r--r--examples/c/ex_cursor.c2
-rw-r--r--examples/c/ex_data_source.c4
-rw-r--r--examples/c/ex_encrypt.c2
-rw-r--r--examples/c/ex_extending.c2
-rw-r--r--examples/c/ex_extractor.c2
-rw-r--r--examples/c/ex_hello.c2
-rw-r--r--examples/c/ex_log.c2
-rw-r--r--examples/c/ex_pack.c2
-rw-r--r--examples/c/ex_process.c2
-rw-r--r--examples/c/ex_schema.c2
-rw-r--r--examples/c/ex_scope.c2
-rw-r--r--examples/c/ex_stat.c2
-rw-r--r--examples/c/ex_sync.c2
-rw-r--r--examples/c/ex_thread.c2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_access.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_all.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_async.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_call_center.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_cursor.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_log.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_schema.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_stat.java2
-rw-r--r--examples/java/com/wiredtiger/examples/ex_thread.java2
-rwxr-xr-xexamples/python/ex_access.py2
-rwxr-xr-xexamples/python/ex_stat.py2
-rw-r--r--ext/collators/reverse/reverse_collator.c2
-rw-r--r--ext/compressors/bzip2/bzip2_compress.c2
-rw-r--r--ext/compressors/lz4/lz4_compress.c2
-rw-r--r--ext/compressors/nop/nop_compress.c2
-rw-r--r--ext/compressors/snappy/snappy_compress.c2
-rw-r--r--ext/compressors/zlib/zlib_compress.c2
-rw-r--r--ext/datasources/helium/helium.c2
-rw-r--r--ext/encryptors/nop/nop_encrypt.c2
-rw-r--r--ext/encryptors/rotn/rotn_encrypt.c2
-rw-r--r--ext/extractors/csv/csv_extractor.c2
-rw-r--r--ext/test/kvs_bdb/kvs_bdb.c2
-rw-r--r--lang/java/Makefile.am1
-rw-r--r--lang/java/java_doc.i1
-rw-r--r--lang/java/src/com/wiredtiger/db/AsyncCallback.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/PackFormatInputStream.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/PackInputStream.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/PackOutputStream.java7
-rw-r--r--lang/java/src/com/wiredtiger/db/PackUtil.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerException.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java2
-rw-r--r--lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java2
-rw-r--r--lang/java/wiredtiger.i2
-rw-r--r--lang/python/setup.py2
-rw-r--r--lang/python/wiredtiger.i2
-rw-r--r--lang/python/wiredtiger/fpacking.py2
-rw-r--r--lang/python/wiredtiger/intpacking.py2
-rw-r--r--lang/python/wiredtiger/packing.py18
-rw-r--r--src/async/async_api.c2
-rw-r--r--src/async/async_op.c2
-rw-r--r--src/async/async_worker.c2
-rw-r--r--src/block/block_addr.c53
-rw-r--r--src/block/block_ckpt.c2
-rw-r--r--src/block/block_compact.c94
-rw-r--r--src/block/block_ext.c2
-rw-r--r--src/block/block_map.c2
-rw-r--r--src/block/block_mgr.c18
-rw-r--r--src/block/block_open.c71
-rw-r--r--src/block/block_read.c2
-rw-r--r--src/block/block_session.c2
-rw-r--r--src/block/block_slvg.c2
-rw-r--r--src/block/block_vrfy.c2
-rw-r--r--src/block/block_write.c2
-rw-r--r--src/bloom/bloom.c6
-rw-r--r--src/btree/bt_compact.c44
-rw-r--r--src/btree/bt_curnext.c169
-rw-r--r--src/btree/bt_curprev.c56
-rw-r--r--src/btree/bt_cursor.c52
-rw-r--r--src/btree/bt_debug.c10
-rw-r--r--src/btree/bt_delete.c2
-rw-r--r--src/btree/bt_discard.c2
-rw-r--r--src/btree/bt_handle.c38
-rw-r--r--src/btree/bt_huffman.c12
-rw-r--r--src/btree/bt_io.c2
-rw-r--r--src/btree/bt_misc.c18
-rw-r--r--src/btree/bt_ovfl.c2
-rw-r--r--src/btree/bt_page.c10
-rw-r--r--src/btree/bt_read.c6
-rw-r--r--src/btree/bt_rebalance.c486
-rw-r--r--src/btree/bt_ret.c2
-rw-r--r--src/btree/bt_slvg.c66
-rw-r--r--src/btree/bt_split.c312
-rw-r--r--src/btree/bt_stat.c6
-rw-r--r--src/btree/bt_sync.c2
-rw-r--r--src/btree/bt_upgrade.c2
-rw-r--r--src/btree/bt_vrfy.c31
-rw-r--r--src/btree/bt_vrfy_dsk.c16
-rw-r--r--src/btree/bt_walk.c170
-rw-r--r--src/btree/col_modify.c2
-rw-r--r--src/btree/col_srch.c122
-rw-r--r--src/btree/row_key.c2
-rw-r--r--src/btree/row_modify.c2
-rw-r--r--src/btree/row_srch.c229
-rw-r--r--src/cache/cache_las.c27
-rw-r--r--src/config/config.c8
-rw-r--r--src/config/config_api.c2
-rw-r--r--src/config/config_check.c2
-rw-r--r--src/config/config_collapse.c2
-rw-r--r--src/config/config_def.c39
-rw-r--r--src/config/config_ext.c2
-rw-r--r--src/config/config_upgrade.c2
-rw-r--r--src/conn/api_version.c2
-rw-r--r--src/conn/conn_api.c10
-rw-r--r--src/conn/conn_cache.c2
-rw-r--r--src/conn/conn_cache_pool.c2
-rw-r--r--src/conn/conn_ckpt.c2
-rw-r--r--src/conn/conn_dhandle.c60
-rw-r--r--src/conn/conn_handle.c2
-rw-r--r--src/conn/conn_log.c46
-rw-r--r--src/conn/conn_open.c2
-rw-r--r--src/conn/conn_stat.c6
-rw-r--r--src/conn/conn_sweep.c12
-rw-r--r--src/cursor/cur_backup.c25
-rw-r--r--src/cursor/cur_bulk.c196
-rw-r--r--src/cursor/cur_config.c2
-rw-r--r--src/cursor/cur_ds.c2
-rw-r--r--src/cursor/cur_dump.c2
-rw-r--r--src/cursor/cur_file.c6
-rw-r--r--src/cursor/cur_index.c2
-rw-r--r--src/cursor/cur_join.c19
-rw-r--r--src/cursor/cur_json.c15
-rw-r--r--src/cursor/cur_log.c2
-rw-r--r--src/cursor/cur_metadata.c10
-rw-r--r--src/cursor/cur_stat.c9
-rw-r--r--src/cursor/cur_std.c2
-rw-r--r--src/cursor/cur_table.c16
-rwxr-xr-xsrc/docs/build-javadoc.sh2
-rw-r--r--src/docs/command-line.dox41
-rw-r--r--src/docs/license.dox21
-rw-r--r--src/docs/programming.dox5
-rw-r--r--src/docs/rebalance.dox14
-rw-r--r--src/docs/schema.dox4
-rw-r--r--src/docs/spell.ok3
-rw-r--r--src/docs/style/footer.html4
-rwxr-xr-xsrc/docs/tools/doxfilter.py2
-rwxr-xr-xsrc/docs/tools/fixlinks.py2
-rw-r--r--src/docs/top/main.dox8
-rw-r--r--src/docs/tune-bulk-load.dox8
-rw-r--r--src/docs/upgrading.dox28
-rw-r--r--src/docs/wtperf.dox23
-rw-r--r--src/evict/evict_file.c4
-rw-r--r--src/evict/evict_lru.c110
-rw-r--r--src/evict/evict_page.c16
-rw-r--r--src/include/api.h2
-rw-r--r--src/include/async.h2
-rw-r--r--src/include/bitstring.i2
-rw-r--r--src/include/block.h9
-rw-r--r--src/include/bloom.h2
-rw-r--r--src/include/btmem.h21
-rw-r--r--src/include/btree.h14
-rw-r--r--src/include/btree.i116
-rw-r--r--src/include/btree_cmp.i2
-rw-r--r--src/include/buf.i14
-rw-r--r--src/include/cache.h2
-rw-r--r--src/include/cache.i2
-rw-r--r--src/include/cell.i2
-rw-r--r--src/include/column.i36
-rw-r--r--src/include/compact.h2
-rw-r--r--src/include/config.h41
-rw-r--r--src/include/connection.h3
-rw-r--r--src/include/cursor.h40
-rw-r--r--src/include/cursor.i8
-rw-r--r--src/include/dhandle.h6
-rw-r--r--src/include/dlh.h2
-rw-r--r--src/include/error.h2
-rw-r--r--src/include/extern.h63
-rw-r--r--src/include/flags.h60
-rw-r--r--src/include/gcc.h54
-rw-r--r--src/include/hardware.h2
-rw-r--r--src/include/intpack.i2
-rw-r--r--src/include/lint.h2
-rw-r--r--src/include/log.h11
-rw-r--r--src/include/log.i2
-rw-r--r--src/include/lsm.h2
-rw-r--r--src/include/meta.h6
-rw-r--r--src/include/misc.h5
-rw-r--r--src/include/misc.i2
-rw-r--r--src/include/msvc.h2
-rw-r--r--src/include/mutex.h2
-rw-r--r--src/include/mutex.i2
-rw-r--r--src/include/os.h2
-rw-r--r--src/include/os_windows.h2
-rw-r--r--src/include/packing.i23
-rw-r--r--src/include/posix.h2
-rw-r--r--src/include/schema.h28
-rw-r--r--src/include/serial.i2
-rw-r--r--src/include/session.h21
-rw-r--r--src/include/stat.h6
-rw-r--r--src/include/txn.h2
-rw-r--r--src/include/txn.i6
-rw-r--r--src/include/verify_build.h2
-rw-r--r--src/include/wiredtiger.in58
-rw-r--r--src/include/wiredtiger_ext.h2
-rw-r--r--src/include/wt_internal.h2
-rw-r--r--src/log/log.c24
-rw-r--r--src/log/log_auto.c96
-rw-r--r--src/log/log_slot.c4
-rw-r--r--src/lsm/lsm_cursor.c8
-rw-r--r--src/lsm/lsm_cursor_bulk.c4
-rw-r--r--src/lsm/lsm_manager.c2
-rw-r--r--src/lsm/lsm_merge.c11
-rw-r--r--src/lsm/lsm_meta.c2
-rw-r--r--src/lsm/lsm_stat.c37
-rw-r--r--src/lsm/lsm_tree.c36
-rw-r--r--src/lsm/lsm_work_unit.c13
-rw-r--r--src/lsm/lsm_worker.c2
-rw-r--r--src/meta/meta_apply.c52
-rw-r--r--src/meta/meta_ckpt.c2
-rw-r--r--src/meta/meta_ext.c2
-rw-r--r--src/meta/meta_table.c141
-rw-r--r--src/meta/meta_track.c21
-rw-r--r--src/meta/meta_turtle.c18
-rw-r--r--src/os_posix/os_abort.c2
-rw-r--r--src/os_posix/os_alloc.c2
-rw-r--r--src/os_posix/os_dir.c2
-rw-r--r--src/os_posix/os_dlopen.c2
-rw-r--r--src/os_posix/os_errno.c2
-rw-r--r--src/os_posix/os_exist.c2
-rw-r--r--src/os_posix/os_fallocate.c2
-rw-r--r--src/os_posix/os_filesize.c2
-rw-r--r--src/os_posix/os_flock.c2
-rw-r--r--src/os_posix/os_fsync.c28
-rw-r--r--src/os_posix/os_ftruncate.c2
-rw-r--r--src/os_posix/os_getenv.c2
-rw-r--r--src/os_posix/os_getline.c2
-rw-r--r--src/os_posix/os_getopt.c2
-rw-r--r--src/os_posix/os_map.c14
-rw-r--r--src/os_posix/os_mtx_cond.c2
-rw-r--r--src/os_posix/os_mtx_rw.c2
-rw-r--r--src/os_posix/os_once.c2
-rw-r--r--src/os_posix/os_open.c2
-rw-r--r--src/os_posix/os_pagesize.c19
-rw-r--r--src/os_posix/os_path.c2
-rw-r--r--src/os_posix/os_priv.c2
-rw-r--r--src/os_posix/os_remove.c2
-rw-r--r--src/os_posix/os_rename.c2
-rw-r--r--src/os_posix/os_rw.c2
-rw-r--r--src/os_posix/os_sleep.c2
-rw-r--r--src/os_posix/os_stdio.c2
-rw-r--r--src/os_posix/os_strtouq.c2
-rw-r--r--src/os_posix/os_thread.c2
-rw-r--r--src/os_posix/os_time.c2
-rw-r--r--src/os_posix/os_yield.c2
-rw-r--r--src/os_win/os_dir.c2
-rw-r--r--src/os_win/os_dlopen.c2
-rw-r--r--src/os_win/os_errno.c2
-rw-r--r--src/os_win/os_exist.c2
-rw-r--r--src/os_win/os_fallocate.c2
-rw-r--r--src/os_win/os_filesize.c2
-rw-r--r--src/os_win/os_flock.c2
-rw-r--r--src/os_win/os_fsync.c4
-rw-r--r--src/os_win/os_ftruncate.c2
-rw-r--r--src/os_win/os_getenv.c2
-rw-r--r--src/os_win/os_map.c2
-rw-r--r--src/os_win/os_mtx_cond.c2
-rw-r--r--src/os_win/os_once.c2
-rw-r--r--src/os_win/os_open.c2
-rw-r--r--src/os_win/os_pagesize.c23
-rw-r--r--src/os_win/os_path.c2
-rw-r--r--src/os_win/os_priv.c2
-rw-r--r--src/os_win/os_remove.c2
-rw-r--r--src/os_win/os_rename.c2
-rw-r--r--src/os_win/os_rw.c2
-rw-r--r--src/os_win/os_sleep.c2
-rw-r--r--src/os_win/os_snprintf.c2
-rw-r--r--src/os_win/os_thread.c2
-rw-r--r--src/os_win/os_time.c2
-rw-r--r--src/os_win/os_vsnprintf.c2
-rw-r--r--src/os_win/os_yield.c2
-rw-r--r--src/packing/pack_api.c2
-rw-r--r--src/packing/pack_impl.c4
-rw-r--r--src/packing/pack_stream.c2
-rw-r--r--src/reconcile/rec_track.c2
-rw-r--r--src/reconcile/rec_write.c229
-rw-r--r--src/schema/schema_create.c94
-rw-r--r--src/schema/schema_drop.c4
-rw-r--r--src/schema/schema_list.c6
-rw-r--r--src/schema/schema_open.c15
-rw-r--r--src/schema/schema_plan.c2
-rw-r--r--src/schema/schema_project.c2
-rw-r--r--src/schema/schema_rename.c4
-rw-r--r--src/schema/schema_stat.c2
-rw-r--r--src/schema/schema_truncate.c48
-rw-r--r--src/schema/schema_util.c2
-rw-r--r--src/schema/schema_worker.c6
-rw-r--r--src/session/session_api.c229
-rw-r--r--src/session/session_compact.c15
-rw-r--r--src/session/session_dhandle.c12
-rw-r--r--src/session/session_salvage.c2
-rw-r--r--src/support/cksum.c2
-rw-r--r--src/support/crypto.c2
-rw-r--r--src/support/err.c2
-rw-r--r--src/support/filename.c60
-rw-r--r--src/support/global.c31
-rw-r--r--src/support/hash_city.c8
-rw-r--r--src/support/hash_fnv.c2
-rw-r--r--src/support/hazard.c2
-rw-r--r--src/support/hex.c27
-rw-r--r--src/support/huffman.c28
-rw-r--r--src/support/pow.c2
-rw-r--r--src/support/rand.c25
-rw-r--r--src/support/scratch.c2
-rw-r--r--src/support/stat.c36
-rw-r--r--src/txn/txn.c84
-rw-r--r--src/txn/txn_ckpt.c35
-rw-r--r--src/txn/txn_ext.c2
-rw-r--r--src/txn/txn_log.c27
-rw-r--r--src/txn/txn_nsnap.c2
-rw-r--r--src/txn/txn_recover.c4
-rw-r--r--src/utilities/util.h3
-rw-r--r--src/utilities/util_backup.c2
-rw-r--r--src/utilities/util_compact.c2
-rw-r--r--src/utilities/util_cpyright.c4
-rw-r--r--src/utilities/util_create.c2
-rw-r--r--src/utilities/util_drop.c2
-rw-r--r--src/utilities/util_dump.c2
-rw-r--r--src/utilities/util_list.c75
-rw-r--r--src/utilities/util_load.c2
-rw-r--r--src/utilities/util_load.h2
-rw-r--r--src/utilities/util_load_json.c2
-rw-r--r--src/utilities/util_loadtext.c2
-rw-r--r--src/utilities/util_main.c8
-rw-r--r--src/utilities/util_misc.c2
-rw-r--r--src/utilities/util_printlog.c17
-rw-r--r--src/utilities/util_read.c2
-rw-r--r--src/utilities/util_rebalance.c63
-rw-r--r--src/utilities/util_rename.c2
-rw-r--r--src/utilities/util_salvage.c2
-rw-r--r--src/utilities/util_stat.c2
-rw-r--r--src/utilities/util_upgrade.c2
-rw-r--r--src/utilities/util_verbose.c2
-rw-r--r--src/utilities/util_verify.c2
-rw-r--r--src/utilities/util_write.c2
-rw-r--r--test/bloom/test_bloom.c2
-rw-r--r--test/checkpoint/checkpointer.c4
-rw-r--r--test/checkpoint/test_checkpoint.c2
-rw-r--r--test/checkpoint/test_checkpoint.h2
-rw-r--r--test/checkpoint/workers.c4
-rw-r--r--test/fops/file.c25
-rw-r--r--test/fops/fops.c22
-rw-r--r--test/fops/t.c2
-rw-r--r--test/fops/thread.h3
-rw-r--r--test/format/Makefile.am2
-rw-r--r--test/format/backup.c2
-rw-r--r--test/format/bdb.c2
-rw-r--r--test/format/bulk.c10
-rw-r--r--test/format/compact.c2
-rw-r--r--test/format/config.c14
-rw-r--r--test/format/config.h8
-rw-r--r--test/format/format.h24
-rw-r--r--test/format/lrt.c2
-rw-r--r--test/format/ops.c4
-rw-r--r--test/format/rebalance.c84
-rw-r--r--test/format/salvage.c2
-rw-r--r--test/format/t.c7
-rw-r--r--test/format/util.c4
-rw-r--r--test/format/wts.c32
-rw-r--r--test/huge/huge.c2
-rw-r--r--test/java/com/wiredtiger/test/AsyncTest.java2
-rw-r--r--test/java/com/wiredtiger/test/AutoCloseTest.java2
-rw-r--r--test/java/com/wiredtiger/test/BackupCursorTest.java2
-rw-r--r--test/java/com/wiredtiger/test/ConfigTest.java192
-rw-r--r--test/java/com/wiredtiger/test/CursorTest.java2
-rw-r--r--test/java/com/wiredtiger/test/CursorTest02.java2
-rw-r--r--test/java/com/wiredtiger/test/ExceptionTest.java2
-rw-r--r--test/java/com/wiredtiger/test/PackTest.java2
-rw-r--r--test/java/com/wiredtiger/test/PackTest02.java2
-rw-r--r--test/java/com/wiredtiger/test/PackTest03.java2
-rw-r--r--test/java/com/wiredtiger/test/WiredTigerSuite.java3
-rw-r--r--test/packing/intpack-test.c2
-rw-r--r--test/packing/intpack-test2.c2
-rw-r--r--test/packing/intpack-test3.c2
-rw-r--r--test/packing/packing-test.c5
-rw-r--r--test/recovery/recovery.c2
-rw-r--r--test/salvage/salvage.c4
-rw-r--r--test/suite/helper.py2
-rw-r--r--test/suite/run.py2
-rw-r--r--test/suite/suite_random.py2
-rw-r--r--test/suite/suite_subprocess.py2
-rw-r--r--test/suite/test_async01.py20
-rw-r--r--test/suite/test_async02.py30
-rw-r--r--test/suite/test_async03.py20
-rw-r--r--test/suite/test_autoclose.py2
-rw-r--r--test/suite/test_backup01.py4
-rw-r--r--test/suite/test_backup02.py2
-rw-r--r--test/suite/test_backup03.py11
-rw-r--r--test/suite/test_backup04.py10
-rw-r--r--test/suite/test_backup05.py3
-rw-r--r--test/suite/test_base01.py2
-rw-r--r--test/suite/test_base02.py2
-rw-r--r--test/suite/test_base03.py2
-rw-r--r--test/suite/test_base04.py2
-rw-r--r--test/suite/test_base05.py2
-rw-r--r--test/suite/test_baseconfig.py8
-rw-r--r--test/suite/test_bug001.py2
-rw-r--r--test/suite/test_bug003.py2
-rw-r--r--test/suite/test_bug004.py2
-rw-r--r--test/suite/test_bug005.py2
-rw-r--r--test/suite/test_bug006.py5
-rw-r--r--test/suite/test_bug007.py2
-rw-r--r--test/suite/test_bug008.py2
-rw-r--r--test/suite/test_bug009.py2
-rw-r--r--test/suite/test_bug010.py13
-rw-r--r--test/suite/test_bug011.py14
-rw-r--r--test/suite/test_bug012.py2
-rw-r--r--test/suite/test_bug013.py2
-rw-r--r--test/suite/test_bug014.py2
-rw-r--r--test/suite/test_bug015.py2
-rw-r--r--test/suite/test_bulk01.py138
-rw-r--r--test/suite/test_bulk02.py4
-rw-r--r--test/suite/test_checkpoint01.py2
-rw-r--r--test/suite/test_checkpoint02.py2
-rw-r--r--test/suite/test_colgap.py88
-rw-r--r--test/suite/test_compact01.py (renamed from test/suite/test_compact.py)13
-rw-r--r--test/suite/test_compact02.py152
-rw-r--r--test/suite/test_compress01.py12
-rw-r--r--test/suite/test_config01.py4
-rw-r--r--test/suite/test_config02.py8
-rw-r--r--test/suite/test_config03.py4
-rw-r--r--test/suite/test_config04.py33
-rw-r--r--test/suite/test_config05.py16
-rw-r--r--test/suite/test_config06.py93
-rw-r--r--test/suite/test_cursor01.py2
-rw-r--r--test/suite/test_cursor02.py2
-rw-r--r--test/suite/test_cursor03.py2
-rw-r--r--test/suite/test_cursor04.py2
-rw-r--r--test/suite/test_cursor05.py2
-rw-r--r--test/suite/test_cursor06.py2
-rw-r--r--test/suite/test_cursor07.py25
-rw-r--r--test/suite/test_cursor08.py29
-rw-r--r--test/suite/test_cursor09.py2
-rw-r--r--test/suite/test_cursor_compare.py2
-rw-r--r--test/suite/test_cursor_pin.py2
-rw-r--r--test/suite/test_cursor_random.py2
-rw-r--r--test/suite/test_cursor_random02.py84
-rw-r--r--test/suite/test_cursor_tracker.py2
-rw-r--r--test/suite/test_drop.py2
-rw-r--r--test/suite/test_drop_create.py2
-rw-r--r--test/suite/test_dump.py6
-rw-r--r--test/suite/test_dupc.py2
-rw-r--r--test/suite/test_durability01.py3
-rw-r--r--test/suite/test_empty.py2
-rw-r--r--test/suite/test_encrypt01.py4
-rw-r--r--test/suite/test_encrypt02.py4
-rw-r--r--test/suite/test_encrypt03.py4
-rw-r--r--test/suite/test_encrypt04.py4
-rw-r--r--test/suite/test_encrypt05.py4
-rw-r--r--test/suite/test_encrypt06.py4
-rw-r--r--test/suite/test_encrypt07.py4
-rw-r--r--test/suite/test_env01.py4
-rw-r--r--test/suite/test_excl.py2
-rw-r--r--test/suite/test_home.py5
-rw-r--r--test/suite/test_huffman01.py2
-rw-r--r--test/suite/test_huffman02.py2
-rw-r--r--test/suite/test_index01.py22
-rw-r--r--test/suite/test_inmem01.py11
-rw-r--r--test/suite/test_intpack.py2
-rw-r--r--test/suite/test_join01.py30
-rw-r--r--test/suite/test_join02.py2
-rw-r--r--test/suite/test_join03.py4
-rw-r--r--test/suite/test_join04.py169
-rw-r--r--test/suite/test_jsondump01.py2
-rw-r--r--test/suite/test_jsondump02.py4
-rw-r--r--test/suite/test_lsm01.py2
-rw-r--r--test/suite/test_lsm02.py2
-rw-r--r--test/suite/test_metadata_cursor01.py2
-rw-r--r--test/suite/test_nsnap01.py2
-rw-r--r--test/suite/test_nsnap02.py2
-rw-r--r--test/suite/test_nsnap03.py2
-rw-r--r--test/suite/test_nsnap04.py2
-rw-r--r--test/suite/test_overwrite.py2
-rw-r--r--test/suite/test_pack.py2
-rw-r--r--test/suite/test_perf001.py9
-rw-r--r--test/suite/test_rebalance.py81
-rw-r--r--test/suite/test_reconfig01.py2
-rw-r--r--test/suite/test_reconfig02.py2
-rw-r--r--test/suite/test_rename.py2
-rw-r--r--test/suite/test_salvage.py2
-rw-r--r--test/suite/test_schema01.py9
-rw-r--r--test/suite/test_schema02.py10
-rw-r--r--test/suite/test_schema03.py11
-rw-r--r--test/suite/test_schema04.py2
-rw-r--r--test/suite/test_schema05.py4
-rw-r--r--test/suite/test_schema06.py2
-rw-r--r--test/suite/test_shared_cache01.py4
-rw-r--r--test/suite/test_shared_cache02.py4
-rw-r--r--test/suite/test_split.py2
-rw-r--r--test/suite/test_stat01.py8
-rw-r--r--test/suite/test_stat02.py46
-rw-r--r--test/suite/test_stat03.py10
-rw-r--r--test/suite/test_stat04.py10
-rw-r--r--test/suite/test_stat05.py11
-rw-r--r--test/suite/test_stat_log01.py10
-rw-r--r--test/suite/test_sweep01.py27
-rw-r--r--test/suite/test_sweep02.py13
-rw-r--r--test/suite/test_sweep03.py25
-rw-r--r--test/suite/test_truncate01.py2
-rw-r--r--test/suite/test_truncate02.py2
-rw-r--r--test/suite/test_truncate03.py2
-rw-r--r--test/suite/test_txn01.py9
-rw-r--r--test/suite/test_txn02.py10
-rw-r--r--test/suite/test_txn03.py9
-rw-r--r--test/suite/test_txn04.py7
-rw-r--r--test/suite/test_txn05.py10
-rw-r--r--test/suite/test_txn06.py2
-rw-r--r--test/suite/test_txn07.py8
-rw-r--r--test/suite/test_txn08.py31
-rw-r--r--test/suite/test_txn09.py5
-rw-r--r--test/suite/test_txn10.py10
-rw-r--r--test/suite/test_txn11.py15
-rw-r--r--test/suite/test_txn12.py2
-rw-r--r--test/suite/test_txn13.py20
-rw-r--r--test/suite/test_txn14.py9
-rw-r--r--test/suite/test_txn15.py28
-rw-r--r--test/suite/test_unicode01.py2
-rw-r--r--test/suite/test_upgrade.py2
-rw-r--r--test/suite/test_util01.py2
-rw-r--r--test/suite/test_util02.py2
-rw-r--r--test/suite/test_util03.py2
-rw-r--r--test/suite/test_util04.py2
-rw-r--r--test/suite/test_util07.py2
-rw-r--r--test/suite/test_util08.py2
-rw-r--r--test/suite/test_util09.py2
-rw-r--r--test/suite/test_util11.py2
-rw-r--r--test/suite/test_util12.py2
-rw-r--r--test/suite/test_verify.py2
-rw-r--r--test/suite/test_version.py2
-rw-r--r--test/suite/wtscenario.py2
-rw-r--r--test/suite/wttest.py69
-rw-r--r--test/suite/wtthread.py49
-rw-r--r--test/thread/file.c2
-rw-r--r--test/thread/rw.c14
-rw-r--r--test/thread/stats.c2
-rw-r--r--test/thread/t.c2
-rw-r--r--test/thread/thread.h2
-rw-r--r--test/utility/test_util.i2
-rw-r--r--test/windows/windows_shim.c9
-rw-r--r--test/windows/windows_shim.h7
-rw-r--r--tools/wt_ckpt_decode.py103
-rw-r--r--tools/wtstats/test/test_wtstats.py2
-rw-r--r--tools/wtstats/wtstats.html.template32
-rwxr-xr-xtools/wtstats/wtstats.py2
599 files changed, 7143 insertions, 3038 deletions
diff --git a/LICENSE b/LICENSE
index b8b3b2c2043..a0f40657511 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2015 MongoDB, Inc.
+Copyright (c) 2014-2016 MongoDB, Inc.
Copyright (c) 2008-2014 WiredTiger, Inc.
All rights reserved.
diff --git a/NEWS b/NEWS
index 1b288c74b18..546d08b2418 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,228 @@
+WiredTiger release 2.7.0, 2015-12-08
+------------------------------------
+
+The WiredTiger 2.7.0 release contains new features, minor API changes and bug
+fixes.
+
+New features and API changes; refer to the API documentation for full details:
+
+* 959376c WT-147: Create indexes on non-empty tables.
+* 4368d39 WT-1315: Add an implementation of cursor joins via a new WT_SESSION::join API.
+* 944ccd1 WT-1350: Add a new configuration option to ::wiredtiger_open and
+ WT_CONNECTION::reconfigure called "eviction_dirty_trigger" that causes eviction to start evicting
+ dirty pages from cache once the given threshold has been reached.
+* ab5a8fb WT-1728: Add a WT_SESSION::reset method to release resources held by a session.
+* 263c5b7 WT-1930: Allow setting "file_manager=(close_idle_time=0)" to ::wiredtiger_open and
+ WT_CONNECTION::reconfigure to disable closing idle handles.
+* 6310c3f WT-1959: Change verify to distinguish between warnings and errors. Add a new strict mode
+ to verify that causes warnings to be reported as errors. Use strict mode to match earlier
+ behavior. See the upgrading documentation for more information.
+* e0d6229 WT-1980: Add a new "metadata:create" URI to WT_SESSION::open_cursor for metadata cursors
+ that return strings useful for passing to WT_SESSION::create.
+* 292712e WT-2065: Add a new configuration option to ::wiredtiger_open and
+ WT_CONNECTION::reconfigure called "shared_cache=(quota)" that limits the amount of shared cache a
+ participant can be assigned.
+* 4d0ebf4 WT-2104: Add a method to flush log files via a new WT_SESSION::log_flush API. Made
+ WT_SESSION::commit_transaction configuration options match WT_SESSION::log_flush. Change the
+ default WT_SESSION::transaction_sync timeout to 20 minutes rather than infinity.
+* 21b8330 WT-2151: Enhance logging configuration to allow reconfiguration and add a new
+ "log=(zero_fill)" configuration option that causes WiredTiger to zero-fill log files on creation.
+* 368b307 WT-2200: Add a new configuration option to ::wiredtiger_open called "write_through" that
+ causes WiredTiger to specify the FILE_FLAG_WRITE_THROUGH on Windows when writing files (default
+ false, including when "direct_io" is configured).
+* 08c0fcd WT-2217: After a successful call to WT_CURSOR::insert, the key and value will be
+ cleared from the cursor. See the upgrading documentation for more information.
+* d4fc69a SERVER-17078: Add a "statistics=(size)" mode to statistics cursors, which allows for
+ retrieving file size only.
+* b83b901 SERVER-18356: Changed the handling of the "config_base" option to ::wiredtiger_open. See
+ upgrading documentation for more information.
+
+
+The following statistics were removed:
+
+* f1ed3b9 WT-1481: connection dhandles swept.
+* f1ed3b9 WT-1481: connection candidate referenced.
+* 4ba4518 WT-1481: failed to find a slot large enough for record.
+* 28563af WT-1989: log buffer size increases.
+* f81c70d WT-1989: slots selected for switching that were unavailable.
+* df4f69c WT-2094: log records written directly.
+* df4f69c WT-2094: record size exceeded maximum.
+* d68e078 WT-2182: pages split during eviction.
+
+Lookaside table:
+
+* 6a5a461 WT-1967: Allow eviction of updates required by old readers.
+* 87592ec WT-2074: Fix a race between lookaside table reconciliation and checkpoints.
+* 0390b29 WT-2149: Fix the order of creation of the lookaside table.
+* 7518a69 WT-2190: Fix transaction visibility test that is applied to the lookaside table.
+* 2cf57a6 SERVER-21585: Don't use the lookaside file until the cache is stuck full.
+
+Issues fixed in MongoDB:
+
+* d57dc26 SERVER-18829: Have pages start in the middle of the LRU queue for eviction.
+* b847ccc SERVER-18838: During drops, don't remove files until the metadata is durable.
+* 8f7da9a SERVER-18875: Clean up deleted pages.
+* d04083d SERVER-18899: Add unit test to simulate fsyncLock.
+* 3ec45a7 SERVER-19340: Avoid type aliasing in the random number generator.
+* 907c0ca SERVER-19445: Have the oldest transaction update the oldest tracked ID.
+* fb8739f SERVER-19522: Try to evict internal pages with no useful child pages.
+* 4545a8b SERVER-19573: Change row-store inserts to avoid page locking.
+* b52d2d3 SERVER-19751: Retry pthread_create on EAGAIN or EINTR.
+* 46b4ad5 SERVER-19954: Don't scan tracked handles during checkpoints.
+* 65abd20 SERVER-19989: Add a write barrier before data handles are added to shared lists.
+* 3e46e79 SERVER-19990: Don't assert on eviction of live updates from dead trees.
+* 38dad39 SERVER-20008: Don't reset eviction walks when hitting a busy page.
+* 3b72361 SERVER-20159: Make all readers wait while the cache is full.
+* 8be547b SERVER-20193: Fix obsolete transaction check.
+* ad56c6a SERVER-20303: Tune in-memory splits when inserting large objects.
+* 7505a02 SERVER-20385: Make WT_CURSOR::next(random) more random.
+* 35d46c3 SERVER-21027: Reverse split if there are many deleted pages.
+* a6da10e SERVER-21553: Enable fast-path truncate after splits.
+* 890ee34 SERVER-21619: Don't do internal page splits after a tree is marked DEAD.
+* 0e93d60 SERVER-21691: Avoid insert stalls.
+
+Other note worthy changes since the previous release:
+
+* bc2aa57 WT-1744: Throttle worker threads based on eviction targets.
+* 55a989e WT-1845: Allow read only transactions to commit after failure.
+* df625dc WT-1869: Avoid doing in memory splits while checkpointing a tree.
+* ddac54f WT-1942: Add atomic implementations for PPC64 architecture.
+* 3866fa6 WT-1962: Make the hot_backup_lock a read/write lock.
+* 58f9e99 WT-1963: Fix backup cursor Java API.
+* 4e0fe59 WT-1964: Fix a bug in the Java API when closing handles from a different thread.
+* 60e2150 WT-1966: Change how the shared cache assigns priority to participants.
+* 76d2e73 WT-1975: Ensure previous log files are complete for forced sync.
+* e43b22a WT-1977: Improve performance of getting snapshots with many sessions.
+* 5eaf63e WT-1978: Better checking and tests for index cursor comparison.
+* 1602a4b WT-1981: Fix a signed 32-bit integer unpacking bug.
+* cd1704d WT-1982: Fix a bug where cached overflow items were freed too early.
+* 57a9f38 WT-1985: Integer packing and other fixes for Python and Java.
+* 9897eb2 WT-1986: Fix a race renaming temporary log files.
+* b10bff9 WT-1989: Improve scalability of log writes.
+* f8dc12b WT-1996: Fix a bug where we would free the fist update during a page rewrite on error.
+* 144a383 WT-1998: Fixes for indexes with some rarely used key/value formats.
+* 8af8b8a WT-2002: Fix a bug in verify where it would panic when encountering a corrupted file.
+* e1d8bc7 WT-2007: Statically allocate log slot buffers to a maximum size.
+* 911158c WT-2008: Fix a bug in recovery where a file create went missing.
+* 3e2e7e6 WT-2009: Apply tracked metadata operations post-commit.
+* 1255cb2 WT-2012: Fix a bug updating the oldest ID.
+* ef9d56f WT-2013: Add gcc asm definitions for ARM64.
+* c8633e6 WT-2014: Fix a bug in checkpoints where files could be flushed in the wrong order.
+* 9b09e69 WT-2015: Fix a bug in error handling during block open.
+* 4938b8d WT-2017: Once an eviction server thread is started keep it running.
+* 298f86c WT-2019: Fix a logic bug tracking the maximum transaction ID in clean trees.
+* 7d6075c WT-2020: Clarify checksum error failure messages.
+* 7b302d3 WT-2021: Fix a bug moving the oldest ID forward (introduced by WT-1967).
+* 9df72d7 WT-2022: Fix a bug not releasing a handle when opening a non-existent index cursor.
+* 81ffc2d WT-2023: Improve locking primitives: simplify read-write lock operations.
+* 6b84722 WT-2029: Improve scalability of statistics.
+* f97cfe9 WT-2031: Log slot revamp.
+* bee11c3 WT-2032: Improve next_random cursors to work with small trees.
+* cf53696 WT-2034: Improve shared cache balancing algorithm.
+* aee1c94 WT-2035: For index cursors, keep track of which column groups need to be positioned.
+* 36310d4 WT-2036: Make handle sweeps more robust.
+* c948fbb WT-2037: Only write a checkpoint to the log on close if it wasn't.
+* e25e615 WT-2038: Avoid long scans holding the handle list lock.
+* 75a4655 WT-2039: Add error check and unit test for log records over 4 GB.
+* 5ab26af WT-2042: Only try to evict tombstones that are visible to all readers.
+* ce223ac WT-2045: Don't let the eviction server do slow reconciliation, it can stall eviction.
+* 6665618 WT-2046: Add a statistic for search restarts.
+* 98b4a28 WT-2047: Fix a bug in the random generator code to handle an uninitialized state.
+* 258e2e1 WT-2050: Show size with memory allocation errors.
+* 2e1471c WT-2053: Fix a bug in disk verify messages.
+* e316e61 WT-2056: Reorder btree cursor close so stats are maintained correctly.
+* 70f9100 WT-2057: Remove the verbose configuration when writing the base configuration file.
+* 41b6fb8 WT-2058: Fix an alignment bug in the mutex and log-slot code.
+* d72012b WT-2059: Include non-aggregated stats in cursor results.
+* 3e0c7bf WT-2062: Try harder to make progress on in-memory splits.
+* 66757f7 WT-2064: Don't spin indefinitely waiting for the handle list lock in eviction.
+* 8f42f02 WT-2066: Update the oldest transaction ID from eviction.
+* e167592 WT-2068: Protect discarding handles with the handle list lock.
+* fd72a09 WT-2075: Fix a hang in logging with parallel workload.
+* 11c0fa0 WT-2078: Fix a bug in error handling with statistics cursors.
+* 9734d85 WT-2081: Make verify progress reporting less verbose.
+* 6008b41 WT-2085: Run some of the log_server threads operations more frequently.
+* 39a69ec WT-2086: Add a statistic to track when eviction finds a page that can be split.
+* 334e103 WT-2089: Relax restrictions on multiblock eviction and in-memory splits.
+* f13b788 WT-2090: Fix a bug in the Windows OS layer that swallowed error returns.
+* 83b8db7 WT-2092: Free log condition variables after all threads are joined.
+* d9391c0 WT-2093: Use the C99 bool type to clarify when functions return true/false.
+* f883d27 WT-2094: Eliminate direct write and record unbuffered log records.
+* 9008260 WT-2097: Reintroduce immediate waits when forced eviction is necessary.
+* ff1da28 WT-2100: Rename evict to evict_queue so it's easier to search for.
+* 41db2ee WT-2101: Don't update the logging ckpt_lsn on clean shutdown.
+* e1d6886 WT-2102: Fix a hang in log slot join when forcing log writes.
+* 0e96683 WT-2105: Fix a bug where we could reference an invalid memory address if a file is
+ corrupted on disk.
+* 6a565bc WT-2108: Rework in-memory page rewrite support (WT_PM_REC_REWRITE).
+* dcb0ddb WT-2114: Make application eviction fairer.
+* 10c2f15 WT-2115: Don't skip truncated pages that are part of a checkpoint.
+* cd6ce97 WT-2116: Add diagnostic checks for stuck cache and dump the state.
+* 51cf672 WT-2119: Don't evict clean multiblock pages with overflow items during checkpoints.
+* 346ad40 WT-2126: Clean up if there is an error during splits.
+* 6831485 WT-2127: Deepen the tree more regularly to avoid wide internal pages.
+* a0b5d2b WT-2128: When decoding huffman encoding during salvage it's possible to have fewer bits
+ than the symbol length during decoding, if the value has been corrupted.
+* 79f74e5 WT-2131: Switch to using a lock to control page splits to avoid starvation.
+* 02a3d9f WT-2132: Make debug dump function more robust to errors.
+* 8c223e4 WT-2134: Flush all buffered log records in log_flush.
+* d1b5e7f WT-2135: Fix log_only setting for backup cursor. Fix initialization.
+* aab8101 WT-2137: Check the sync_lsn is in the correct file before moving it forward.
+* 323af84 WT-2139: Fix a transaction visibility bug in read-uncommitted transactions.
+* 751c628 WT-2146: Improve performance when searching for short keys.
+* 62998ce WT-2148: Fix a compiler warning in encoding functions.
+* 6c16fdd WT-2153: Fix bug. Now we always need to start the log_server thread.
+* 6a5fca3 WT-2154: Make btree dump safer.
+* 0d74bc6 WT-2155: Remove last use of F_CAS_ATOMIC and the associated macro.
+* cc42bda WT-2156: Allow eviction workers to restart.
+* bf1d359 WT-2157: Fix a bug where a failed page split could lead to incomplete checkpoints.
+* ce9d265 WT-2159: Don't check the config twice in one path.
+* 544f27d WT-2162: Add null pointer check, needed after an index is dropped.
+* 0d85ebe WT-2164: Prevent another LSM chunk checkpoint while the first is still in progress.
+* a81aae8 WT-2165: Stop using FALLOC_FL_KEEP_SIZE flag when pre-allocating files.
+* 2865a76 WT-2167: Switch recovery to using an internal session.
+* 5d4c952 WT-2170: Protect the turtle file with a lock.
+* 497b744 WT-2174: Avoid the table list lock when creating a size only statistics cursor.
+* fdfa804 WT-2178: In-memory storage engine support.
+* b9bd01f WT-2179: Added decorator to mark txn13 as part of the --long test suite.
+* be544dd WT-2180: Remove cursor.{search,search-near,remove} key size validation.
+* be412b5 WT-2182: When internal pages grow large enough, split them into their parents.
+* c27e78e WT-2184: Fix log scan bug when final record has many trailing zeros.
+* 9584be3 WT-2185: Don't do reverse splits when closing a file.
+* f6b12d3 WT-2187: Add flag for flushing a slot.
+* a4545bf WT-2189: Update flag set and clear macros to be less error prone.
+* 30ab327 WT-2191: In-memory disk image no longer the same as saved updates.
+* 4ba5698 WT-2192: Fix the logic around checking whether internal page is evictable.
+* 2f0b3e2 WT-2193: Handle read-committed metadata checkpoints during snapshot transactions.
+* 9b1febc WT-2194: Java close callbacks should handle cursors that Java code did not open.
+* 438f455 WT-2195: Fix a hang after giving up on a reverse split.
+* ff27fe9 WT-2196: Fix error handling in size only statistics.
+* 0a1ee34 WT-2199: Fix transaction sync inconsistency.
+* 2ff1fd6 WT-2203: Release an allocated page on error.
+* 3b3cf2a WT-2204: Don't take a local copy of page->modify until we know the page is dirty.
+* 179d4d0 WT-2206: Change cache operations from flags to an enumeration.
+* 82514ca WT-2207: Track whenever a session has a handle exclusive.
+* 78bd4ac WT-2210: Raw compression fails if row-store recovery precedes column-store recovery.
+* c360d53 WT-2212: Add a "use_environment" config to ::wiredtiger_open.
+* a72ddb7 WT-2218: Add truncate stats.
+* ce8c091 WT-2219: Enhancements to in-memory testing.
+* e2f1130 WT-2220: Update time comparison macros.
+* 59857f9 WT-2222: Add statistics for named snapshots.
+* fb9cebe WT-2224: Track which deleted refs are discarded by a split.
+* cace179 WT-2228: Avoid unnecessary raw-compression calls.
+* 0a52a80 WT-2237: Have threads publish unique transaction IDs so that updates always become
+ visible immediately on commit.
+* 6c7338f WT-2241: Use a lock to protect transaction ID allocation.
+* 39dfd21 WT-2243: Don't keep transaction IDs pinned for reading from checkpoints.
+* 4c49948 WT-2244: Trigger in-memory splits sooner.
+* 9f2e4f3 WT-2248: WT_SESSION::close is updating WT_CONNECTION_IMPL.default_session.
+* 264ec21 WT-2249: Keep eviction stuck until cache usage is under 100%.
+* dca1411 WT-2250: Minor fix. Use SET instead of increment for stat.
+* e731ef8 WT-2251: Free addresses when we discard deleted page references.
+* 4fc3e39 WT-2253: Evict pages left behind by in-memory splits.
+* 2df5658 WT-2257: Fixes when given multiple thread workload configurations.
+* 4c49043 WT-2260: Avoid adding internal pages to the eviction queue
+
WiredTiger release 2.6.1, 2015-05-13
------------------------------------
@@ -255,7 +480,7 @@ API and behavior changes:
* Update configuration string parsing to always be case sensitive. See
upgrading documentation for more information.
-* Change the statistics cursor WT_CURSOR.reset method to re-load statistics
+* Change the statistics cursor WT_CURSOR::reset method to re-load statistics
values. See upgrading documentation for more information.
refs WT-1533
@@ -465,7 +690,7 @@ New features and API changes:
See API documentation for more information.
refs #1381
-* Add a new WT_SESSION.strerror method, a thread-safe alternative to
+* Add a new WT_SESSION::strerror method, a thread-safe alternative to
::wiredtiger_strerror.
refs #1516
@@ -1271,7 +1496,7 @@ This is primarily a bugfix and performance tuning release. The main changes are:
* The default behavior of the wt utility's load command has been changed to
overwrite existing data.
-* Add a WT_SESSION.create prefix_compression_min configuration option with a
+* Add a WT_SESSION::create prefix_compression_min configuration option with a
default value of 4. [#624] and [#624]
* Fix "make install" of Python API. [#598]
diff --git a/README b/README
index 5056431c95b..07dde47feaf 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-WiredTiger 2.7.0: (November 19, 2015)
+WiredTiger 2.7.1: (December 8, 2015)
-This is version 2.7.0 of WiredTiger.
+This is version 2.7.1 of WiredTiger.
WiredTiger release packages and documentation can be found at:
@@ -8,7 +8,7 @@ WiredTiger release packages and documentation can be found at:
The documentation for this specific release can be found at:
- http://source.wiredtiger.com/2.7.0/index.html
+ http://source.wiredtiger.com/2.7.1/index.html
The WiredTiger source code can be found at:
diff --git a/RELEASE_INFO b/RELEASE_INFO
index 1204e262af2..d2c7995910e 100644
--- a/RELEASE_INFO
+++ b/RELEASE_INFO
@@ -1,6 +1,6 @@
WIREDTIGER_VERSION_MAJOR=2
WIREDTIGER_VERSION_MINOR=7
-WIREDTIGER_VERSION_PATCH=0
+WIREDTIGER_VERSION_PATCH=1
WIREDTIGER_VERSION="$WIREDTIGER_VERSION_MAJOR.$WIREDTIGER_VERSION_MINOR.$WIREDTIGER_VERSION_PATCH"
WIREDTIGER_RELEASE_DATE=`date "+%B %e, %Y"`
diff --git a/SConstruct b/SConstruct
index 6a2b0497d15..3f395d17543 100644
--- a/SConstruct
+++ b/SConstruct
@@ -290,6 +290,7 @@ wtbin = env.Program("wt", [
"src/utilities/util_misc.c",
"src/utilities/util_printlog.c",
"src/utilities/util_read.c",
+ "src/utilities/util_rebalance.c",
"src/utilities/util_rename.c",
"src/utilities/util_salvage.c",
"src/utilities/util_stat.c",
@@ -458,6 +459,7 @@ t = env.Program("wtperf", [
"bench/wtperf/misc.c",
"bench/wtperf/track.c",
"bench/wtperf/wtperf.c",
+ "bench/wtperf/wtperf_throttle.c",
"bench/wtperf/wtperf_truncate.c",
],
LIBS=[wtlib, shim] + wtlibs)
diff --git a/api/leveldb/leveldb_wt.h b/api/leveldb/leveldb_wt.h
index 0b0ad42cf95..dc185183034 100644
--- a/api/leveldb/leveldb_wt.h
+++ b/api/leveldb/leveldb_wt.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/Makefile.am b/bench/wtperf/Makefile.am
index 15f151d84b2..cc1f84b5406 100644
--- a/bench/wtperf/Makefile.am
+++ b/bench/wtperf/Makefile.am
@@ -5,7 +5,8 @@ LDADD = $(top_builddir)/libwiredtiger.la -lm
noinst_PROGRAMS = wtperf
wtperf_LDFLAGS = -static
wtperf_SOURCES =\
- config.c misc.c track.c wtperf.c wtperf_truncate.c wtperf.h wtperf_opt.i
+ config.c idle_table_cycle.c misc.c track.c wtperf.c \
+ wtperf.h wtperf_opt.i wtperf_throttle.c wtperf_truncate.c
TESTS = smoke.sh
AM_TESTS_ENVIRONMENT = rm -rf WT_TEST ; mkdir WT_TEST ;
diff --git a/bench/wtperf/config.c b/bench/wtperf/config.c
index 6b0ce47ef3f..d9a22f4708d 100644
--- a/bench/wtperf/config.c
+++ b/bench/wtperf/config.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -46,7 +46,6 @@ static void config_opt_usage(void);
#define STRING_MATCH(str, bytes, len) \
(strncmp(str, bytes, len) == 0 && (str)[(len)] == '\0')
-
/*
* config_assign --
* Assign the src config to the dest, any storage allocated in dest is
@@ -55,29 +54,26 @@ static void config_opt_usage(void);
int
config_assign(CONFIG *dest, const CONFIG *src)
{
- size_t i, len;
+ CONFIG_QUEUE_ENTRY *conf_line, *tmp_line;
+ size_t i;
char *newstr, **pstr;
config_free(dest);
memcpy(dest, src, sizeof(CONFIG));
if (src->uris != NULL) {
- dest->uris = calloc(src->table_count, sizeof(char *));
- if (dest->uris == NULL)
- return (enomem(dest));
+ dest->uris = dcalloc(src->table_count, sizeof(char *));
for (i = 0; i < src->table_count; i++)
- dest->uris[i] = strdup(src->uris[i]);
+ dest->uris[i] = dstrdup(src->uris[i]);
}
dest->ckptthreads = NULL;
dest->popthreads = NULL;
dest->workers = NULL;
if (src->base_uri != NULL)
- dest->base_uri = strdup(src->base_uri);
+ dest->base_uri = dstrdup(src->base_uri);
if (src->workload != NULL) {
- dest->workload = calloc(WORKLOAD_MAX, sizeof(WORKLOAD));
- if (dest->workload == NULL)
- return (enomem(dest));
+ dest->workload = dcalloc(WORKLOAD_MAX, sizeof(WORKLOAD));
memcpy(dest->workload,
src->workload, WORKLOAD_MAX * sizeof(WORKLOAD));
}
@@ -88,15 +84,20 @@ config_assign(CONFIG *dest, const CONFIG *src)
pstr = (char **)
((u_char *)dest + config_opts[i].offset);
if (*pstr != NULL) {
- len = strlen(*pstr) + 1;
- if ((newstr = malloc(len)) == NULL)
- return (enomem(src));
- strncpy(newstr, *pstr, len);
+ newstr = dstrdup(*pstr);
*pstr = newstr;
}
}
TAILQ_INIT(&dest->stone_head);
+ TAILQ_INIT(&dest->config_head);
+
+ /* Clone the config string information into the new cfg object */
+ TAILQ_FOREACH(conf_line, &src->config_head, c) {
+ tmp_line = dcalloc(sizeof(CONFIG_QUEUE_ENTRY), 1);
+ tmp_line->string = dstrdup(conf_line->string);
+ TAILQ_INSERT_TAIL(&dest->config_head, tmp_line, c);
+ }
return (0);
}
@@ -107,9 +108,17 @@ config_assign(CONFIG *dest, const CONFIG *src)
void
config_free(CONFIG *cfg)
{
+ CONFIG_QUEUE_ENTRY *config_line;
size_t i;
char **pstr;
+ while (!TAILQ_EMPTY(&cfg->config_head)) {
+ config_line = TAILQ_FIRST(&cfg->config_head);
+ TAILQ_REMOVE(&cfg->config_head, config_line, c);
+ free(config_line->string);
+ free(config_line);
+ }
+
for (i = 0; i < sizeof(config_opts) / sizeof(config_opts[0]); i++)
if (config_opts[i].type == STRING_TYPE ||
config_opts[i].type == CONFIG_STRING_TYPE) {
@@ -181,9 +190,18 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
int ret;
group = scan = NULL;
+ if (cfg->workload != NULL) {
+ /*
+ * This call overrides an earlier call. Free and
+ * reset everything.
+ */
+ free(cfg->workload);
+ cfg->workload = NULL;
+ cfg->workload_cnt = 0;
+ cfg->workers_cnt = 0;
+ }
/* Allocate the workload array. */
- if ((cfg->workload = calloc(WORKLOAD_MAX, sizeof(WORKLOAD))) == NULL)
- return (enomem(cfg));
+ cfg->workload = dcalloc(WORKLOAD_MAX, sizeof(WORKLOAD));
cfg->workload_cnt = 0;
/*
@@ -201,7 +219,7 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
if ((ret = wiredtiger_config_parser_open(
NULL, groupk.str, groupk.len, &scan)) != 0)
goto err;
-
+
/* Move to the next workload slot. */
if (cfg->workload_cnt == WORKLOAD_MAX) {
fprintf(stderr,
@@ -219,8 +237,7 @@ config_threads(CONFIG *cfg, const char *config, size_t len)
continue;
}
if (STRING_MATCH("throttle", k.str, k.len)) {
- if ((workp->throttle = v.val) < 0)
- goto err;
+ workp->throttle = (uint64_t)v.val;
continue;
}
if (STRING_MATCH("insert", k.str, k.len) ||
@@ -308,7 +325,7 @@ err: if (group != NULL)
(void)group->close(group);
if (scan != NULL)
(void)scan->close(scan);
-
+
fprintf(stderr,
"invalid thread configuration or scan error: %.*s\n",
(int)len, config);
@@ -396,13 +413,10 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v)
strp = (char **)valueloc;
newlen = v->len + 1;
if (*strp == NULL) {
- if ((newstr = calloc(newlen, sizeof(char))) == NULL)
- return (enomem(cfg));
- strncpy(newstr, v->str, v->len);
+ newstr = dstrdup(v->str);
} else {
newlen += (strlen(*strp) + 1);
- if ((newstr = calloc(newlen, sizeof(char))) == NULL)
- return (enomem(cfg));
+ newstr = dcalloc(newlen, sizeof(char));
snprintf(newstr, newlen,
"%s,%*s", *strp, (int)v->len, v->str);
/* Free the old value now we've copied it. */
@@ -427,10 +441,11 @@ config_opt(CONFIG *cfg, WT_CONFIG_ITEM *k, WT_CONFIG_ITEM *v)
}
strp = (char **)valueloc;
free(*strp);
- if ((newstr = malloc(v->len + 1)) == NULL)
- return (enomem(cfg));
- strncpy(newstr, v->str, v->len);
- newstr[v->len] = '\0';
+ /*
+ * We duplicate the string to len rather than len+1 as we want
+ * to truncate the trailing quotation mark.
+ */
+ newstr = dstrndup(v->str, v->len);
*strp = newstr;
break;
}
@@ -465,11 +480,7 @@ config_opt_file(CONFIG *cfg, const char *filename)
goto err;
}
buf_size = (size_t)sb.st_size;
- file_buf = calloc(buf_size + 2, 1);
- if (file_buf == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ file_buf = dcalloc(buf_size + 2, 1);
read_size = read(fd, file_buf, buf_size);
if (read_size == -1
#ifndef _WIN32
@@ -560,16 +571,29 @@ err: if (fd != -1)
int
config_opt_line(CONFIG *cfg, const char *optstr)
{
+ CONFIG_QUEUE_ENTRY *config_line;
WT_CONFIG_ITEM k, v;
WT_CONFIG_PARSER *scan;
+ size_t len;
int ret, t_ret;
+ len = strlen(optstr);
if ((ret = wiredtiger_config_parser_open(
- NULL, optstr, strlen(optstr), &scan)) != 0) {
+ NULL, optstr, len, &scan)) != 0) {
lprintf(cfg, ret, 0, "Error in config_scan_begin");
return (ret);
}
+ /*
+ * Append the current line to our copy of the config. The config is
+ * stored in the order it is processed, so added options will be after
+ * any parsed from the original config. We allocate len + 1 to allow for
+ * a null byte to be added.
+ */
+ config_line = dcalloc(sizeof(CONFIG_QUEUE_ENTRY), 1);
+ config_line->string = dstrdup(optstr);
+ TAILQ_INSERT_TAIL(&cfg->config_head, config_line, c);
+
while (ret == 0) {
if ((ret = scan->next(scan, &k, &v)) != 0) {
/* Any parse error has already been reported. */
@@ -599,8 +623,7 @@ config_opt_str(CONFIG *cfg, const char *name, const char *value)
char *optstr;
/* name="value" */
- if ((optstr = malloc(strlen(name) + strlen(value) + 4)) == NULL)
- return (enomem(cfg));
+ optstr = dmalloc(strlen(name) + strlen(value) + 4);
sprintf(optstr, "%s=\"%s\"", name, value);
ret = config_opt_line(cfg, optstr);
free(optstr);
@@ -644,6 +667,86 @@ config_sanity(CONFIG *cfg)
}
/*
+ * config_consolidate --
+ * Consolidate repeated configuration settings so that it only appears
+ * once in the configuration output file.
+ */
+void
+config_consolidate(CONFIG *cfg)
+{
+ CONFIG_QUEUE_ENTRY *conf_line, *test_line, *tmp;
+ char *string_key;
+
+ /*
+ * This loop iterates over the config queue and for entry checks if an
+ * entry later in the queue has the same key. If a match is found then
+ * the current queue entry is removed and we continue.
+ */
+ conf_line = TAILQ_FIRST(&cfg->config_head);
+ while (conf_line != NULL) {
+ string_key = strchr(conf_line->string, '=');
+ tmp = test_line = TAILQ_NEXT(conf_line, c);
+ while (test_line != NULL) {
+ /*
+ * The + 1 here forces the '=' sign to be matched
+ * ensuring we don't match keys that have a common
+ * prefix such as "table_count" and "table_count_idle"
+ * as being the same key.
+ */
+ if (strncmp(conf_line->string, test_line->string,
+ (size_t)(string_key - conf_line->string + 1))
+ == 0) {
+ TAILQ_REMOVE(&cfg->config_head, conf_line, c);
+ free(conf_line->string);
+ free(conf_line);
+ break;
+ }
+ test_line = TAILQ_NEXT(test_line, c);
+ }
+ conf_line = tmp;
+ }
+}
+
+/*
+ * config_to_file --
+ * Write the final config used in this execution to a file.
+ */
+void
+config_to_file(CONFIG *cfg)
+{
+ CONFIG_QUEUE_ENTRY *config_line;
+ FILE *fp;
+ size_t req_len;
+ char *path;
+
+ fp = NULL;
+
+ /* Backup the config */
+ req_len = strlen(cfg->home) + strlen("/CONFIG.wtperf") + 1;
+ path = dcalloc(req_len, 1);
+ snprintf(path, req_len, "%s/CONFIG.wtperf", cfg->home);
+ if ((fp = fopen(path, "w")) == NULL) {
+ lprintf(cfg, errno, 0, "%s", path);
+ goto err;
+ }
+
+ /* Print the config dump */
+ fprintf(fp,"# Warning. This config includes "
+ "unwritten, implicit configuration defaults.\n"
+ "# Changes to those values may cause differences in behavior.\n");
+ config_consolidate(cfg);
+ config_line = TAILQ_FIRST(&cfg->config_head);
+ while (config_line != NULL) {
+ fprintf(fp, "%s\n", config_line->string);
+ config_line = TAILQ_NEXT(config_line, c);
+ }
+
+err: free(path);
+ if (fp != NULL)
+ (void)fclose(fp);
+}
+
+/*
* config_print --
* Print out the configuration in verbose mode.
*/
@@ -677,7 +780,7 @@ config_print(CONFIG *cfg)
for (i = 0, workp = cfg->workload;
i < cfg->workload_cnt; ++i, ++workp)
printf("\t\t%" PRId64 " threads (inserts=%" PRId64
- ", reads=%" PRId64 ", updates=%" PRId64
+ ", reads=%" PRId64 ", updates=%" PRId64
", truncates=% " PRId64 ")\n",
workp->threads,
workp->insert, workp->read,
diff --git a/bench/wtperf/config_opt.h b/bench/wtperf/config_opt.h
index 0fb1d988c3a..b7eff8e143f 100644
--- a/bench/wtperf/config_opt.h
+++ b/bench/wtperf/config_opt.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/doxy.c b/bench/wtperf/doxy.c
index 2921caea76c..26d73168ef2 100644
--- a/bench/wtperf/doxy.c
+++ b/bench/wtperf/doxy.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/idle_table_cycle.c b/bench/wtperf/idle_table_cycle.c
new file mode 100644
index 00000000000..b699b5b9dd1
--- /dev/null
+++ b/bench/wtperf/idle_table_cycle.c
@@ -0,0 +1,192 @@
+/*-
+ * Public Domain 2014-2016 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.
+ */
+
+#include "wtperf.h"
+
+static int
+check_timing(CONFIG *cfg,
+ const char *name, struct timespec start, struct timespec *stop)
+{
+ uint64_t last_interval;
+ int ret;
+
+ if ((ret = __wt_epoch(NULL, stop)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Get time failed in cycle_idle_tables.");
+ cfg->error = ret;
+ return (ret);
+ }
+
+ last_interval = (uint64_t)(WT_TIMEDIFF_SEC(*stop, start));
+
+ if (last_interval > cfg->idle_table_cycle) {
+ lprintf(cfg, ret, 0,
+ "Cycling idle table failed because %s took %" PRIu64
+ " seconds which is longer than configured acceptable"
+ " maximum of %" PRIu32 ".",
+ name, last_interval, cfg->idle_table_cycle);
+ cfg->error = ETIMEDOUT;
+ return (ETIMEDOUT);
+ }
+ return (0);
+}
+/*
+ * Regularly create, open a cursor and drop a table.
+ * Measure how long each step takes, and flag an error if it exceeds the
+ * configured maximum.
+ */
+static void *
+cycle_idle_tables(void *arg)
+{
+ struct timespec start, stop;
+ CONFIG *cfg;
+ WT_SESSION *session;
+ WT_CURSOR *cursor;
+ int cycle_count, ret;
+ char uri[512];
+
+ cfg = (CONFIG *)arg;
+ cycle_count = 0;
+
+ if ((ret = cfg->conn->open_session(
+ cfg->conn, NULL, cfg->sess_config, &session)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Error opening a session on %s", cfg->home);
+ return (NULL);
+ }
+
+ for (cycle_count = 0; cfg->idle_cycle_run; ++cycle_count) {
+ snprintf(uri, 512, "%s_cycle%07d", cfg->uris[0], cycle_count);
+ /* Don't busy cycle in this loop. */
+ __wt_sleep(1, 0);
+
+ /* Setup a start timer. */
+ if ((ret = __wt_epoch(NULL, &start)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Get time failed in cycle_idle_tables.");
+ cfg->error = ret;
+ return (NULL);
+ }
+
+ /* Create a table. */
+ if ((ret = session->create(
+ session, uri, cfg->table_config)) != 0) {
+ if (ret == EBUSY)
+ continue;
+ lprintf(cfg, ret, 0,
+ "Table create failed in cycle_idle_tables.");
+ cfg->error = ret;
+ return (NULL);
+ }
+ if (check_timing(cfg, "create", start, &stop) != 0)
+ return (NULL);
+ start = stop;
+
+ /* Open and close cursor. */
+ if ((ret = session->open_cursor(
+ session, uri, NULL, NULL, &cursor)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Cursor open failed in cycle_idle_tables.");
+ cfg->error = ret;
+ return (NULL);
+ }
+ if ((ret = cursor->close(cursor)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Cursor close failed in cycle_idle_tables.");
+ cfg->error = ret;
+ return (NULL);
+ }
+ if (check_timing(cfg, "cursor", start, &stop) != 0)
+ return (NULL);
+ start = stop;
+
+ /*
+ * Drop the table. Keep retrying on EBUSY failure - it is an
+ * expected return when checkpoints are happening.
+ */
+ while ((ret = session->drop(session, uri, "force")) == EBUSY)
+ __wt_sleep(1, 0);
+
+ if (ret != 0 && ret != EBUSY) {
+ lprintf(cfg, ret, 0,
+ "Table drop failed in cycle_idle_tables.");
+ cfg->error = ret;
+ return (NULL);
+ }
+ if (check_timing(cfg, "drop", start, &stop) != 0)
+ return (NULL);
+ }
+
+ return (NULL);
+}
+
+/*
+ * Start a thread the creates and drops tables regularly.
+ * TODO: Currently accepts a pthread_t as a parameter, since it is not
+ * possible to portably statically initialize it in the global configuration
+ * structure. Should reshuffle the configuration structure so explicit static
+ * initialization isn't necessary.
+ */
+int
+start_idle_table_cycle(CONFIG *cfg, pthread_t *idle_table_cycle_thread)
+{
+ pthread_t thread_id;
+ int ret;
+
+ if (cfg->idle_table_cycle == 0)
+ return (0);
+
+ cfg->idle_cycle_run = true;
+ if ((ret = pthread_create(
+ &thread_id, NULL, cycle_idle_tables, cfg)) != 0) {
+ lprintf(
+ cfg, ret, 0, "Error creating idle table cycle thread.");
+ cfg->idle_cycle_run = false;
+ return (ret);
+ }
+ *idle_table_cycle_thread = thread_id;
+
+ return (0);
+}
+
+int
+stop_idle_table_cycle(CONFIG *cfg, pthread_t idle_table_cycle_thread)
+{
+ int ret;
+
+ if (cfg->idle_table_cycle == 0 || !cfg->idle_cycle_run)
+ return (0);
+
+ cfg->idle_cycle_run = false;
+ if ((ret = pthread_join(idle_table_cycle_thread, NULL)) != 0) {
+ lprintf(
+ cfg, ret, 0, "Error joining idle table cycle thread.");
+ return (ret);
+ }
+ return (0);
+}
diff --git a/bench/wtperf/misc.c b/bench/wtperf/misc.c
index 1e47c76214c..bdfd53d5295 100644
--- a/bench/wtperf/misc.c
+++ b/bench/wtperf/misc.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -28,19 +28,6 @@
#include "wtperf.h"
-int
-enomem(const CONFIG *cfg)
-{
- const char *msg;
-
- msg = "Unable to allocate memory";
- if (cfg->logf == NULL)
- fprintf(stderr, "%s\n", msg);
- else
- lprintf(cfg, ENOMEM, 0, "%s", msg);
- return (ENOMEM);
-}
-
/* Setup the logging output mechanism. */
int
setup_log_file(CONFIG *cfg)
@@ -53,9 +40,8 @@ setup_log_file(CONFIG *cfg)
if (cfg->verbose < 1)
return (0);
- if ((fname = calloc(strlen(cfg->monitor_dir) +
- strlen(cfg->table_name) + strlen(".stat") + 2, 1)) == NULL)
- return (enomem(cfg));
+ fname = dcalloc(strlen(cfg->monitor_dir) +
+ strlen(cfg->table_name) + strlen(".stat") + 2, 1);
sprintf(fname, "%s/%s.stat", cfg->monitor_dir, cfg->table_name);
cfg->logf = fopen(fname, "w");
diff --git a/bench/wtperf/runners/btree-split-stress.wtperf b/bench/wtperf/runners/btree-split-stress.wtperf
new file mode 100644
index 00000000000..deb8c70d12f
--- /dev/null
+++ b/bench/wtperf/runners/btree-split-stress.wtperf
@@ -0,0 +1,10 @@
+conn_config="cache_size=2GB,statistics=[fast,clear],statistics_log=(wait=10),eviction=(threads_max=4,threads_min=4)"
+table_config="type=file,leaf_page_max=8k,internal_page_max=8k,memory_page_max=2MB,split_deepen_min_child=250"
+icount=200000
+report_interval=5
+run_time=300
+reopen_connection=false
+populate_threads=2
+value_sz=256
+read_range=100
+threads=((count=4,inserts=1,throttle=100000),(count=8,reads=1))
diff --git a/bench/wtperf/runners/checkpoint_stress_schema_ops.wtperf b/bench/wtperf/runners/checkpoint_stress_schema_ops.wtperf
new file mode 100644
index 00000000000..b69ead7f8b1
--- /dev/null
+++ b/bench/wtperf/runners/checkpoint_stress_schema_ops.wtperf
@@ -0,0 +1,19 @@
+# A stress configuration, to create long running checkpoints and see how
+# they interfere with schema level operations (table create, drop).
+# Setup a cache size large enough that checkpoints can take a long time.
+conn_config="cache_size=8GB,log=(enabled=false),checkpoint=(wait=30)"
+table_config="leaf_page_max=4k,internal_page_max=16k,type=file"
+icount=10000000
+table_count_idle=100
+# Turn on create/drop of idle tables, and error if a single operation takes
+# more than 5 seconds.
+idle_table_cycle=5
+populate_threads=5
+checkpoint_threads=0
+report_interval=5
+# 100 million
+random_range=100000000
+run_time=1000
+# Setup a workload that dirties a lot of the cache
+threads=((count=2,reads=1),(count=2,inserts=1),(count=2,updates=1))
+value_sz=500
diff --git a/bench/wtperf/runners/get_ckpt.py b/bench/wtperf/runners/get_ckpt.py
index 95354ece190..03bbda7dab1 100755
--- a/bench/wtperf/runners/get_ckpt.py
+++ b/bench/wtperf/runners/get_ckpt.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/runners/mongodb-oplog.wtperf b/bench/wtperf/runners/mongodb-oplog.wtperf
index 34235f04518..105e8c4f5bb 100644
--- a/bench/wtperf/runners/mongodb-oplog.wtperf
+++ b/bench/wtperf/runners/mongodb-oplog.wtperf
@@ -8,4 +8,4 @@ run_time=500
populate_threads=1
# Setup three threads to insert into the oplog
# Setup one thread to be doing truncates from the oplog
-threads=((count=3,inserts=1,throttle=2000),(count=1,truncate=1,truncate_pct=10,truncate_count=50000))
+threads=((count=3,inserts=1,throttle=4000),(count=1,truncate=1,truncate_pct=10,truncate_count=50000))
diff --git a/bench/wtperf/runners/wtperf_run.sh b/bench/wtperf/runners/wtperf_run.sh
index ac31c2a2e78..7a1ad44f39c 100755
--- a/bench/wtperf/runners/wtperf_run.sh
+++ b/bench/wtperf/runners/wtperf_run.sh
@@ -12,16 +12,27 @@
# This script should be invoked with the pathname of the wtperf test
# config to run and the number of runs.
#
-if test "$#" -ne "2"; then
+if test "$#" -lt "2"; then
echo "Must specify wtperf test to run and number of runs"
exit 1
fi
wttest=$1
runmax=$2
+# Jenkins removes the quotes from the passed in arg so we may
+# have 3 or 4 args.
+wtarg=""
+wtarg2=""
+if test "$#" -gt "2"; then
+ wtarg=$3
+ if test "$#" -eq "4"; then
+ wtarg2=$4
+ fi
+fi
home=./WT_TEST
outfile=./wtperf.out
rm -f $outfile
+echo "Parsed $# args: test: $wttest runmax: $runmax args: $wtarg $wtarg2" >> $outfile
# Each of these has an entry for each op in ops below.
avg=(0 0 0 0)
@@ -77,7 +88,7 @@ run=1
while test "$run" -le "$runmax"; do
rm -rf $home
mkdir $home
- LD_PRELOAD=/usr/lib64/libjemalloc.so.1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ./wtperf -O $wttest
+ LD_PRELOAD=/usr/lib64/libjemalloc.so.1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ./wtperf -O $wttest $wtarg $wtarg2
if test "$?" -ne "0"; then
exit 1
fi
diff --git a/bench/wtperf/track.c b/bench/wtperf/track.c
index 75f5a012a94..b3f4847d9d0 100644
--- a/bench/wtperf/track.c
+++ b/bench/wtperf/track.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/bench/wtperf/wtperf.c b/bench/wtperf/wtperf.c
index 9ac96862fa1..b2e68198e9a 100644
--- a/bench/wtperf/wtperf.c
+++ b/bench/wtperf/wtperf.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -57,9 +57,11 @@ static const CONFIG default_cfg = {
0, /* thread error */
0, /* notify threads to stop */
0, /* in warmup phase */
+ false, /* Signal for idle cycle thread */
0, /* total seconds running */
0, /* has truncate */
{NULL, NULL}, /* the truncate queue */
+ {NULL, NULL}, /* the config queue */
#define OPT_DEFINE_DEFAULT
#include "wtperf_opt.i"
@@ -71,7 +73,6 @@ static const char * const debug_tconfig = "";
static void *checkpoint_worker(void *);
static int create_tables(CONFIG *);
-static int create_uris(CONFIG *);
static int drop_all_tables(CONFIG *);
static int execute_populate(CONFIG *);
static int execute_workload(CONFIG *);
@@ -86,7 +87,7 @@ static int start_threads(CONFIG *,
static int stop_threads(CONFIG *, u_int, CONFIG_THREAD *);
static void *thread_run_wtperf(void *);
static void *worker(void *);
-static void worker_throttle(int64_t, int64_t *, struct timespec *);
+
static uint64_t wtperf_rand(CONFIG_THREAD *);
static uint64_t wtperf_value_range(CONFIG *);
@@ -371,18 +372,65 @@ err: cfg->error = cfg->stop = 1;
return (NULL);
}
+/*
+ * do_range_reads --
+ * If configured to execute a sequence of next operations after each
+ * search do them. Ensuring the keys we see are always in order.
+ */
+static int
+do_range_reads(CONFIG *cfg, WT_CURSOR *cursor)
+{
+ size_t range;
+ uint64_t next_val, prev_val;
+ char *range_key_buf;
+ char buf[512];
+ int ret;
+
+ ret = 0;
+
+ if (cfg->read_range == 0)
+ return (0);
+
+ memset(&buf[0], 0, 512 * sizeof(char));
+ range_key_buf = &buf[0];
+
+ /* Save where the first key is for comparisons. */
+ cursor->get_key(cursor, &range_key_buf);
+ extract_key(range_key_buf, &next_val);
+
+ for (range = 0; range < cfg->read_range; ++range) {
+ prev_val = next_val;
+ ret = cursor->next(cursor);
+ /* We are done if we reach the end. */
+ if (ret != 0)
+ break;
+
+ /* Retrieve and decode the key */
+ cursor->get_key(cursor, &range_key_buf);
+ extract_key(range_key_buf, &next_val);
+ if (next_val < prev_val) {
+ lprintf(cfg, EINVAL, 0,
+ "Out of order keys %" PRIu64
+ " came before %" PRIu64,
+ prev_val, next_val);
+ return (EINVAL);
+ }
+ }
+ return (0);
+}
+
static void *
worker(void *arg)
{
- struct timespec start, stop, interval;
+ struct timespec start, stop;
CONFIG *cfg;
CONFIG_THREAD *thread;
TRACK *trk;
WT_CONNECTION *conn;
WT_CURSOR **cursors, *cursor, *tmp_cursor;
WT_SESSION *session;
- int64_t ops, ops_per_txn, throttle_ops;
size_t i;
+ int64_t ops, ops_per_txn;
uint64_t next_val, usecs;
uint8_t *op, *op_end;
int measure_latency, ret, truncated;
@@ -397,19 +445,13 @@ worker(void *arg)
ops_per_txn = thread->workload->ops_per_txn;
session = NULL;
trk = NULL;
- throttle_ops = 0;
if ((ret = conn->open_session(
conn, NULL, cfg->sess_config, &session)) != 0) {
lprintf(cfg, ret, 0, "worker: WT_CONNECTION.open_session");
goto err;
}
- cursors = calloc(cfg->table_count, sizeof(WT_CURSOR *));
- if (cursors == NULL) {
- lprintf(cfg, ENOMEM, 0,
- "worker: couldn't allocate cursor array");
- goto err;
- }
+ cursors = dcalloc(cfg->table_count, sizeof(WT_CURSOR *));
for (i = 0; i < cfg->table_count_idle; i++) {
snprintf(buf, 512, "%s_idle%05d", cfg->uris[0], (int)i);
if ((ret = session->open_cursor(
@@ -435,10 +477,8 @@ worker(void *arg)
}
/* Setup the timer for throttling. */
if (thread->workload->throttle != 0 &&
- (ret = __wt_epoch(NULL, &interval)) != 0) {
- lprintf(cfg, ret, 0, "Get time call failed");
+ (ret = setup_throttle(thread)) != 0)
goto err;
- }
/* Setup for truncate */
if (thread->workload->truncate != 0)
@@ -533,7 +573,14 @@ worker(void *arg)
"get_value in read.");
goto err;
}
+ /*
+ * If we want to read a range, then call next
+ * for several operations, confirming that the
+ * next key is in the correct order.
+ */
+ ret = do_range_reads(cfg, cursor);
}
+
if (ret == 0 || ret == WT_NOTFOUND)
break;
goto op_err;
@@ -681,13 +728,11 @@ op_err: if (ret == WT_ROLLBACK && ops_per_txn != 0) {
op = thread->workload->ops;
/*
- * Check throttling periodically to avoid taking too
- * many time samples.
+ * Decrement throttle ops and check if we should sleep
+ * and then get more work to perform.
*/
- if (thread->workload->throttle != 0 &&
- throttle_ops++ % THROTTLE_OPS == 0)
- worker_throttle(thread->workload->throttle,
- &throttle_ops, &interval);
+ if (--thread->throttle_cfg.ops_count == 0)
+ worker_throttle(thread);
}
if ((ret = session->close(session, NULL)) != 0) {
@@ -862,12 +907,7 @@ populate_thread(void *arg)
cursor_config =
(cfg->populate_threads == 1 && !cfg->index) ? "bulk" : NULL;
/* Create the cursors. */
- cursors = calloc(cfg->table_count, sizeof(WT_CURSOR *));
- if (cursors == NULL) {
- lprintf(cfg, ENOMEM, 0,
- "worker: couldn't allocate cursor array");
- goto err;
- }
+ cursors = dcalloc(cfg->table_count, sizeof(WT_CURSOR *));
for (i = 0; i < cfg->table_count; i++) {
if ((ret = session->open_cursor(
session, cfg->uris[i], NULL,
@@ -1097,9 +1137,10 @@ monitor(void *arg)
uint32_t read_avg, read_min, read_max;
uint32_t insert_avg, insert_min, insert_max;
uint32_t update_avg, update_min, update_max;
- uint32_t latency_max;
+ uint32_t latency_max, level;
u_int i;
- int ret;
+ int msg_err, ret;
+ const char *str;
char buf[64], *path;
cfg = (CONFIG *)arg;
@@ -1112,10 +1153,7 @@ monitor(void *arg)
/* Open the logging file. */
len = strlen(cfg->monitor_dir) + 100;
- if ((path = malloc(len)) == NULL) {
- (void)enomem(cfg);
- goto err;
- }
+ path = dmalloc(len);
snprintf(path, len, "%s/monitor", cfg->monitor_dir);
if ((fp = fopen(path, "w")) == NULL) {
lprintf(cfg, errno, 0, "%s", path);
@@ -1197,25 +1235,41 @@ monitor(void *arg)
if (latency_max != 0 &&
(read_max > latency_max || insert_max > latency_max ||
- update_max > latency_max))
- /*
- * Make this a non-fatal error and print WARNING in
- * the output so Jenkins can flag it as unstable.
- */
- lprintf(cfg, 0, 0,
- "WARNING: max latency exceeded: threshold %" PRIu32
+ update_max > latency_max)) {
+ if (cfg->max_latency_fatal) {
+ level = 1;
+ msg_err = WT_PANIC;
+ str = "ERROR";
+ } else {
+ level = 0;
+ msg_err = 0;
+ str = "WARNING";
+ }
+ lprintf(cfg, msg_err, level,
+ "%s: max latency exceeded: threshold %" PRIu32
" read max %" PRIu32 " insert max %" PRIu32
- " update max %" PRIu32, latency_max,
+ " update max %" PRIu32, str, latency_max,
read_max, insert_max, update_max);
+ }
if (min_thr != 0 &&
((cur_reads != 0 && cur_reads < min_thr) ||
(cur_inserts != 0 && cur_inserts < min_thr) ||
- (cur_updates != 0 && cur_updates < min_thr)))
- lprintf(cfg, WT_PANIC, 0,
- "minimum throughput not met: threshold %" PRIu64
+ (cur_updates != 0 && cur_updates < min_thr))) {
+ if (cfg->min_throughput_fatal) {
+ level = 1;
+ msg_err = WT_PANIC;
+ str = "ERROR";
+ } else {
+ level = 0;
+ msg_err = 0;
+ str = "WARNING";
+ }
+ lprintf(cfg, msg_err, level,
+ "%s: minimum throughput not met: threshold %" PRIu64
" reads %" PRIu64 " inserts %" PRIu64
- " updates %" PRIu64, min_thr, cur_reads,
+ " updates %" PRIu64, str, min_thr, cur_reads,
cur_inserts, cur_updates);
+ }
last_reads = reads;
last_inserts = inserts;
last_updates = updates;
@@ -1306,6 +1360,7 @@ execute_populate(CONFIG *cfg)
struct timespec start, stop;
CONFIG_THREAD *popth;
WT_ASYNC_OP *asyncop;
+ pthread_t idle_table_cycle_thread;
size_t i;
uint64_t last_ops, msecs, print_ops_sec;
uint32_t interval, tables;
@@ -1318,11 +1373,13 @@ execute_populate(CONFIG *cfg)
" populate thread(s) for %" PRIu32 " items",
cfg->populate_threads, cfg->icount);
+ /* Start cycling idle tables if configured. */
+ if ((ret = start_idle_table_cycle(cfg, &idle_table_cycle_thread)) != 0)
+ return (ret);
+
cfg->insert_key = 0;
- if ((cfg->popthreads =
- calloc(cfg->populate_threads, sizeof(CONFIG_THREAD))) == NULL)
- return (enomem(cfg));
+ cfg->popthreads = dcalloc(cfg->populate_threads, sizeof(CONFIG_THREAD));
if (cfg->use_asyncops > 0) {
lprintf(cfg, 0, 1, "Starting %" PRIu32 " async thread(s)",
cfg->async_threads);
@@ -1447,6 +1504,11 @@ execute_populate(CONFIG *cfg)
(uint64_t)(WT_TIMEDIFF_SEC(stop, start)));
assert(tables == 0);
}
+
+ /* Stop cycling idle tables. */
+ if ((ret = stop_idle_table_cycle(cfg, idle_table_cycle_thread)) != 0)
+ return (ret);
+
return (0);
}
@@ -1496,6 +1558,7 @@ execute_workload(CONFIG *cfg)
{
CONFIG_THREAD *threads;
WORKLOAD *workp;
+ pthread_t idle_table_cycle_thread;
uint64_t last_ckpts, last_inserts, last_reads, last_truncates;
uint64_t last_updates;
uint32_t interval, run_ops, run_time;
@@ -1511,15 +1574,15 @@ execute_workload(CONFIG *cfg)
last_updates = 0;
ret = 0;
+ /* Start cycling idle tables. */
+ if ((ret = start_idle_table_cycle(cfg, &idle_table_cycle_thread)) != 0)
+ return (ret);
+
if (cfg->warmup != 0)
cfg->in_warmup = 1;
/* Allocate memory for the worker threads. */
- if ((cfg->workers =
- calloc((size_t)cfg->workers_cnt, sizeof(CONFIG_THREAD))) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ cfg->workers = dcalloc((size_t)cfg->workers_cnt, sizeof(CONFIG_THREAD));
if (cfg->use_asyncops > 0) {
lprintf(cfg, 0, 1, "Starting %" PRIu32 " async thread(s)",
@@ -1534,8 +1597,10 @@ execute_workload(CONFIG *cfg)
lprintf(cfg, 0, 1,
"Starting workload #%d: %" PRId64 " threads, inserts=%"
PRId64 ", reads=%" PRId64 ", updates=%" PRId64
- ", truncate=%" PRId64, i + 1, workp->threads, workp->insert,
- workp->read, workp->update, workp->truncate);
+ ", truncate=%" PRId64 ", throttle=%" PRId64,
+ i + 1, workp->threads, workp->insert,
+ workp->read, workp->update, workp->truncate,
+ workp->throttle);
/* Figure out the workload's schedule. */
if ((ret = run_mix_schedule(cfg, workp)) != 0)
@@ -1608,6 +1673,10 @@ execute_workload(CONFIG *cfg)
/* Notify the worker threads they are done. */
err: cfg->stop = 1;
+ /* Stop cycling idle tables. */
+ if ((ret = stop_idle_table_cycle(cfg, idle_table_cycle_thread)) != 0)
+ return (ret);
+
if ((t_ret = stop_threads(
cfg, (u_int)cfg->workers_cnt, cfg->workers)) != 0 && ret == 0)
ret = t_ret;
@@ -1689,27 +1758,17 @@ out: return (ret);
/*
* Populate the uri array if more than one table is being used.
*/
-static int
+static void
create_uris(CONFIG *cfg)
{
size_t base_uri_len;
uint32_t i;
- int ret;
char *uri;
- ret = 0;
base_uri_len = strlen(cfg->base_uri);
- cfg->uris = calloc(cfg->table_count, sizeof(char *));
- if (cfg->uris == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ cfg->uris = dcalloc(cfg->table_count, sizeof(char *));
for (i = 0; i < cfg->table_count; i++) {
- uri = cfg->uris[i] = calloc(base_uri_len + 5, 1);
- if (uri == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ uri = cfg->uris[i] = dcalloc(base_uri_len + 5, 1);
/*
* If there is only one table, just use base name.
*/
@@ -1718,13 +1777,6 @@ create_uris(CONFIG *cfg)
else
sprintf(uri, "%s%05d", cfg->base_uri, i);
}
-err: if (ret != 0 && cfg->uris != NULL) {
- for (i = 0; i < cfg->table_count; i++)
- free(cfg->uris[i]);
- free(cfg->uris);
- cfg->uris = NULL;
- }
- return (ret);
}
static int
@@ -1806,40 +1858,22 @@ start_all_runs(CONFIG *cfg)
return (start_run(cfg));
/* Allocate an array to hold our config struct copies. */
- configs = calloc(cfg->database_count, sizeof(CONFIG *));
- if (configs == NULL)
- return (ENOMEM);
+ configs = dcalloc(cfg->database_count, sizeof(CONFIG *));
/* Allocate an array to hold our thread IDs. */
- threads = calloc(cfg->database_count, sizeof(pthread_t));
- if (threads == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ threads = dcalloc(cfg->database_count, sizeof(pthread_t));
home_len = strlen(cfg->home);
cmd_len = (home_len * 2) + 30; /* Add some slop. */
- cmd_buf = calloc(cmd_len, 1);
- if (cmd_buf == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ cmd_buf = dcalloc(cmd_len, 1);
for (i = 0; i < cfg->database_count; i++) {
- next_cfg = calloc(1, sizeof(CONFIG));
- if (next_cfg == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ next_cfg = dcalloc(1, sizeof(CONFIG));
configs[i] = next_cfg;
if ((ret = config_assign(next_cfg, cfg)) != 0)
goto err;
/* Setup a unique home directory for each database. */
- new_home = malloc(home_len + 5);
- if (new_home == NULL) {
- ret = ENOMEM;
- goto err;
- }
+ new_home = dmalloc(home_len + 5);
snprintf(new_home, home_len + 5, "%s/D%02d", cfg->home, (int)i);
next_cfg->home = new_home;
@@ -1906,7 +1940,7 @@ start_run(CONFIG *cfg)
monitor_created = ret = 0;
/* [-Wconditional-uninitialized] */
memset(&monitor_thread, 0, sizeof(monitor_thread));
-
+
if ((ret = setup_log_file(cfg)) != 0)
goto err;
@@ -1929,8 +1963,7 @@ start_run(CONFIG *cfg)
ret, 0, "Error loading Helium: %s", helium_buf);
}
- if ((ret = create_uris(cfg)) != 0)
- goto err;
+ create_uris(cfg);
if ((ret = create_tables(cfg)) != 0)
goto err;
@@ -1967,12 +2000,8 @@ start_run(CONFIG *cfg)
lprintf(cfg, 0, 1,
"Starting %" PRIu32 " checkpoint thread(s)",
cfg->checkpoint_threads);
- if ((cfg->ckptthreads =
- calloc(cfg->checkpoint_threads,
- sizeof(CONFIG_THREAD))) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ cfg->ckptthreads = dcalloc(
+ cfg->checkpoint_threads, sizeof(CONFIG_THREAD));
if (start_threads(cfg, NULL, cfg->ckptthreads,
cfg->checkpoint_threads, checkpoint_worker) != 0)
goto err;
@@ -2084,14 +2113,16 @@ main(int argc, char *argv[])
if (config_assign(cfg, &default_cfg))
goto err;
+ TAILQ_INIT(&cfg->config_head);
+
/* Do a basic validation of options, and home is needed before open. */
while ((ch = __wt_getopt("wtperf", argc, argv, opts)) != EOF)
switch (ch) {
case 'C':
if (user_cconfig == NULL)
- user_cconfig = strdup(__wt_optarg);
+ user_cconfig = dstrdup(__wt_optarg);
else {
- user_cconfig = realloc(user_cconfig,
+ user_cconfig = drealloc(user_cconfig,
strlen(user_cconfig) +
strlen(__wt_optarg) + 2);
strcat(user_cconfig, ",");
@@ -2106,9 +2137,9 @@ main(int argc, char *argv[])
break;
case 'T':
if (user_tconfig == NULL)
- user_tconfig = strdup(__wt_optarg);
+ user_tconfig = dstrdup(__wt_optarg);
else {
- user_tconfig = realloc(user_tconfig,
+ user_tconfig = drealloc(user_tconfig,
strlen(user_tconfig) +
strlen(__wt_optarg) + 2);
strcat(user_tconfig, ",");
@@ -2179,10 +2210,7 @@ main(int argc, char *argv[])
* to 4096 if needed.
*/
req_len = strlen(",async=(enabled=true,threads=)") + 4;
- if ((cfg->async_config = calloc(req_len, 1)) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ cfg->async_config = dcalloc(req_len, 1);
snprintf(cfg->async_config, req_len,
",async=(enabled=true,threads=%d)",
cfg->async_threads);
@@ -2205,10 +2233,7 @@ main(int argc, char *argv[])
/* Build the URI from the table name. */
req_len = strlen("table:") +
strlen(HELIUM_NAME) + strlen(cfg->table_name) + 2;
- if ((cfg->base_uri = calloc(req_len, 1)) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ cfg->base_uri = dcalloc(req_len, 1);
snprintf(cfg->base_uri, req_len, "table:%s%s%s",
cfg->helium_mount == NULL ? "" : HELIUM_NAME,
cfg->helium_mount == NULL ? "" : "/",
@@ -2227,10 +2252,7 @@ main(int argc, char *argv[])
req_len += strlen(cfg->async_config);
if (cfg->compress_ext != NULL)
req_len += strlen(cfg->compress_ext);
- if ((cc_buf = calloc(req_len, 1)) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ cc_buf = dcalloc(req_len, 1);
/*
* This is getting hard to parse.
*/
@@ -2255,10 +2277,7 @@ main(int argc, char *argv[])
req_len += strlen(cfg->compress_table);
if (cfg->index)
req_len += strlen(INDEX_COL_NAMES);
- if ((tc_buf = calloc(req_len, 1)) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ tc_buf = dcalloc(req_len, 1);
/*
* This is getting hard to parse.
*/
@@ -2277,10 +2296,7 @@ main(int argc, char *argv[])
if (cfg->log_partial && cfg->table_count > 1) {
req_len = strlen(cfg->table_config) +
strlen(LOG_PARTIAL_CONFIG) + 1;
- if ((cfg->partial_config = calloc(req_len, 1)) == NULL) {
- ret = enomem(cfg);
- goto err;
- }
+ cfg->partial_config = dcalloc(req_len, 1);
snprintf((char *)cfg->partial_config, req_len, "%s%s",
(char *)cfg->table_config, LOG_PARTIAL_CONFIG);
}
@@ -2289,6 +2305,9 @@ main(int argc, char *argv[])
if ((ret = config_sanity(cfg)) != 0)
goto err;
+ /* Write a copy of the config. */
+ config_to_file(cfg);
+
/* Display the configuration. */
if (cfg->verbose > 1)
config_print(cfg);
@@ -2314,7 +2333,7 @@ start_threads(CONFIG *cfg,
WORKLOAD *workp, CONFIG_THREAD *base, u_int num, void *(*func)(void *))
{
CONFIG_THREAD *thread;
- u_int i, j;
+ u_int i;
int ret;
/* Initialize the threads. */
@@ -2323,15 +2342,13 @@ start_threads(CONFIG *cfg,
thread->workload = workp;
/*
- * We don't want the threads executing in lock-step, move each
- * new RNG state further along in the sequence.
+ * We don't want the threads executing in lock-step, seed each
+ * one differently.
*/
- if (i == 0)
- __wt_random_init(&thread->rnd);
- else
- thread->rnd = (thread - 1)->rnd;
- for (j = 0; j < 1000; ++j)
- (void)__wt_random(&thread->rnd);
+ if ((ret = __wt_random_init_seed(NULL, &thread->rnd)) != 0) {
+ lprintf(cfg, ret, 0, "Error initializing RNG");
+ return (ret);
+ }
/*
* Every thread gets a key/data buffer because we don't bother
@@ -2339,10 +2356,8 @@ start_threads(CONFIG *cfg,
* don't, it's not enough memory to bother. These buffers hold
* strings: trailing NUL is included in the size.
*/
- if ((thread->key_buf = calloc(cfg->key_sz, 1)) == NULL)
- return (enomem(cfg));
- if ((thread->value_buf = calloc(cfg->value_sz, 1)) == NULL)
- return (enomem(cfg));
+ thread->key_buf = dcalloc(cfg->key_sz, 1);
+ thread->value_buf = dcalloc(cfg->value_sz, 1);
/*
* Initialize and then toss in a bit of random values if needed.
*/
@@ -2402,35 +2417,6 @@ stop_threads(CONFIG *cfg, u_int num, CONFIG_THREAD *threads)
return (0);
}
-/*
- * TODO: Spread the stalls out, so we don't flood at the start of each
- * second and then pause. Doing this every 10th of a second is probably enough
- */
-static void
-worker_throttle(int64_t throttle, int64_t *ops, struct timespec *interval)
-{
- struct timespec now;
- uint64_t usecs_to_complete;
- if (*ops < throttle)
- return;
-
- /* Ignore errors, we don't really care. */
- if (__wt_epoch(NULL, &now) != 0)
- return;
-
- /*
- * If we've completed enough operations, reset the counters.
- * If we did enough operations in less than a second, sleep for
- * the rest of the second.
- */
- usecs_to_complete = WT_TIMEDIFF_US(now, *interval);
- if (usecs_to_complete < USEC_PER_SEC)
- (void)usleep((useconds_t)(USEC_PER_SEC - usecs_to_complete));
-
- *ops = 0;
- *interval = now;
-}
-
static int
drop_all_tables(CONFIG *cfg)
{
diff --git a/bench/wtperf/wtperf.h b/bench/wtperf/wtperf.h
index e4b9fc00798..7dbe1822a26 100644
--- a/bench/wtperf/wtperf.h
+++ b/bench/wtperf/wtperf.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -66,6 +66,7 @@
typedef struct __config CONFIG;
typedef struct __config_thread CONFIG_THREAD;
+typedef struct __truncate_queue_entry TRUNCATE_QUEUE_ENTRY;
#define EXT_PFX ",extensions=("
#define EXT_SFX ")"
@@ -90,7 +91,7 @@ typedef struct {
int64_t insert; /* Insert ratio */
int64_t read; /* Read ratio */
int64_t update; /* Update ratio */
- int64_t throttle; /* Maximum operations/second */
+ uint64_t throttle; /* Maximum operations/second */
/* Number of operations per transaction. Zero for autocommit */
int64_t ops_per_txn;
int64_t truncate; /* Truncate ratio */
@@ -106,8 +107,7 @@ typedef struct {
} WORKLOAD;
/* Steering items for the truncate workload */
-typedef struct __truncate_struct TRUNCATE_CONFIG;
-struct __truncate_struct {
+typedef struct {
uint64_t stone_gap;
uint64_t needed_stones;
uint64_t final_stone_gap;
@@ -116,7 +116,8 @@ struct __truncate_struct {
uint64_t last_total_inserts;
uint64_t num_stones;
uint64_t last_key;
-};
+ uint64_t catchup_multiplier;
+} TRUNCATE_CONFIG;
/* Queue entry for use with the Truncate Logic */
struct __truncate_queue_entry {
@@ -124,7 +125,20 @@ struct __truncate_queue_entry {
uint64_t diff; /* Number of items to be truncated*/
TAILQ_ENTRY(__truncate_queue_entry) q;
};
-typedef struct __truncate_queue_entry TRUNCATE_QUEUE_ENTRY;
+
+struct __config_queue_entry {
+ char *string;
+ TAILQ_ENTRY(__config_queue_entry) c;
+};
+typedef struct __config_queue_entry CONFIG_QUEUE_ENTRY;
+
+/* Steering for the throttle configuration */
+typedef struct {
+ struct timespec last_increment; /* Time that we last added more ops */
+ uint64_t ops_count; /* The number of ops this increment */
+ uint64_t ops_per_increment; /* Ops to add per increment */
+ uint64_t usecs_increment; /* Time interval of each increment */
+} THROTTLE_CONFIG;
#define LOG_PARTIAL_CONFIG ",log=(enabled=false)"
/*
@@ -173,6 +187,8 @@ struct __config { /* Configuration structure */
volatile int stop; /* notify threads to stop */
volatile int in_warmup; /* Running warmup phase */
+ volatile bool idle_cycle_run; /* Signal for idle cycle thread */
+
volatile uint32_t totalsec; /* total seconds running */
u_int has_truncate; /* if there is a truncate workload */
@@ -180,6 +196,9 @@ struct __config { /* Configuration structure */
/* Queue head for use with the Truncate Logic */
TAILQ_HEAD(__truncate_qh, __truncate_queue_entry) stone_head;
+ /* Queue head to save a copy of the config to be output */
+ TAILQ_HEAD(__config_qh, __config_queue_entry) config_head;
+
/* Fields changeable on command line are listed in wtperf_opt.i */
#define OPT_DECLARE_STRUCT
#include "wtperf_opt.i"
@@ -188,6 +207,7 @@ struct __config { /* Configuration structure */
#define ELEMENTS(a) (sizeof(a) / sizeof(a[0]))
+#define READ_RANGE_OPS 10
#define THROTTLE_OPS 100
#define THOUSAND (1000ULL)
@@ -253,14 +273,16 @@ struct __config_thread { /* Per-thread structure */
WORKLOAD *workload; /* Workload */
+ THROTTLE_CONFIG throttle_cfg; /* Throttle configuration */
+
+ TRUNCATE_CONFIG trunc_cfg; /* Truncate configuration */
+
TRACK ckpt; /* Checkpoint operations */
TRACK insert; /* Insert operations */
TRACK read; /* Read operations */
TRACK update; /* Update operations */
TRACK truncate; /* Truncate operations */
TRACK truncate_sleep; /* Truncate sleep operations */
- TRUNCATE_CONFIG trunc_cfg; /* Truncate configuration */
-
};
void cleanup_truncate_config(CONFIG *);
@@ -270,17 +292,21 @@ void config_free(CONFIG *);
int config_opt_file(CONFIG *, const char *);
int config_opt_line(CONFIG *, const char *);
int config_opt_str(CONFIG *, const char *, const char *);
+void config_to_file(CONFIG *);
+void config_consolidate(CONFIG *);
void config_print(CONFIG *);
int config_sanity(CONFIG *);
void latency_insert(CONFIG *, uint32_t *, uint32_t *, uint32_t *);
void latency_read(CONFIG *, uint32_t *, uint32_t *, uint32_t *);
void latency_update(CONFIG *, uint32_t *, uint32_t *, uint32_t *);
void latency_print(CONFIG *);
-int enomem(const CONFIG *);
int run_truncate(
CONFIG *, CONFIG_THREAD *, WT_CURSOR *, WT_SESSION *, int *);
int setup_log_file(CONFIG *);
+int setup_throttle(CONFIG_THREAD*);
int setup_truncate(CONFIG *, CONFIG_THREAD *, WT_SESSION *);
+int start_idle_table_cycle(CONFIG *, pthread_t *);
+int stop_idle_table_cycle(CONFIG *, pthread_t);
uint64_t sum_ckpt_ops(CONFIG *);
uint64_t sum_insert_ops(CONFIG *);
uint64_t sum_pop_ops(CONFIG *);
@@ -288,6 +314,7 @@ uint64_t sum_read_ops(CONFIG *);
uint64_t sum_truncate_ops(CONFIG *);
uint64_t sum_update_ops(CONFIG *);
void usage(void);
+int worker_throttle(CONFIG_THREAD*);
void lprintf(const CONFIG *, int err, uint32_t, const char *, ...)
#if defined(__GNUC__)
@@ -304,4 +331,91 @@ generate_key(CONFIG *cfg, char *key_buf, uint64_t keyno)
sprintf(key_buf, "%0*" PRIu64, cfg->key_sz - 1, keyno);
}
+static inline void
+extract_key(char *key_buf, uint64_t *keynop)
+{
+ sscanf(key_buf, "%" SCNu64, keynop);
+}
+
+/*
+ * die --
+ * Print message and exit on failure.
+ */
+static inline void
+die(int e, const char *str)
+{
+ fprintf(stderr, "Call to %s failed: %s", str, wiredtiger_strerror(e));
+ exit(EXIT_FAILURE);
+}
+
+/*
+ * dmalloc --
+ * Call malloc, dying on failure.
+ */
+static inline void *
+dmalloc(size_t len)
+{
+ void *p;
+
+ if ((p = malloc(len)) == NULL)
+ die(errno, "malloc");
+ return (p);
+}
+
+/*
+ * dcalloc --
+ * Call calloc, dying on failure.
+ */
+static inline void *
+dcalloc(size_t num, size_t len)
+{
+ void *p;
+
+ if ((p = calloc(len, num)) == NULL)
+ die(errno, "calloc");
+ return (p);
+}
+
+/*
+ * drealloc --
+ * Call realloc, dying on failure.
+ */
+static inline void *
+drealloc(void *p, size_t len)
+{
+ void *repl;
+
+ if ((repl = realloc(p, len)) == NULL)
+ die(errno, "realloc");
+ return (repl);
+}
+
+/*
+ * dstrdup --
+ * Call strdup, dying on failure.
+ */
+static inline char *
+dstrdup(const char *str)
+{
+ char *p;
+
+ if ((p = strdup(str)) == NULL)
+ die(errno, "strdup");
+ return (p);
+}
+
+/*
+ * dstrndup --
+ * Call strndup, dying on failure.
+ */
+static inline char *
+dstrndup(const char *str, const size_t len)
+{
+ char *p;
+
+ if ((p = strndup(str, len)) == NULL)
+ die(errno, "strndup");
+ return (p);
+}
+
#endif
diff --git a/bench/wtperf/wtperf_opt.i b/bench/wtperf/wtperf_opt.i
index be3ba462e0c..6dc2a6d5569 100644
--- a/bench/wtperf/wtperf_opt.i
+++ b/bench/wtperf/wtperf_opt.i
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -110,6 +110,10 @@ DEF_OPT_AS_UINT32(drop_tables, 0,
DEF_OPT_AS_UINT32(icount, 5000,
"number of records to initially populate. If multiple tables are "
"configured the count is spread evenly across all tables.")
+DEF_OPT_AS_UINT32(idle_table_cycle, 0,
+ "Enable regular create and drop of idle tables, value is the maximum "
+ "number of seconds a create or drop is allowed before flagging an error. "
+ "Default 0 which means disabled.")
DEF_OPT_AS_BOOL(index, 0,
"Whether to create an index on the value field.")
DEF_OPT_AS_BOOL(insert_rmw, 0,
@@ -117,11 +121,17 @@ DEF_OPT_AS_BOOL(insert_rmw, 0,
DEF_OPT_AS_UINT32(key_sz, 20, "key size")
DEF_OPT_AS_BOOL(log_partial, 0, "perform partial logging on first table only.")
DEF_OPT_AS_UINT32(min_throughput, 0,
- "abort if any throughput measured is less than this amount. Requires "
- "sample_interval to be configured")
+ "notify if any throughput measured is less than this amount. "
+ "Aborts or prints warning based on min_throughput_fatal setting. "
+ "Requires sample_interval to be configured")
+DEF_OPT_AS_BOOL(min_throughput_fatal, 0,
+ "print warning (false) or abort (true) of min_throughput failure.")
DEF_OPT_AS_UINT32(max_latency, 0,
- "abort if any latency measured exceeds this number of milliseconds."
+ "notify if any latency measured exceeds this number of milliseconds."
+ "Aborts or prints warning based on min_throughput_fatal setting. "
"Requires sample_interval to be configured")
+DEF_OPT_AS_BOOL(max_latency_fatal, 0,
+ "print warning (false) or abort (true) of max_latency failure.")
DEF_OPT_AS_UINT32(pareto, 0, "use pareto distribution for random numbers. Zero "
"to disable, otherwise a percentage indicating how aggressive the "
"distribution should be.")
@@ -134,6 +144,7 @@ DEF_OPT_AS_UINT32(random_range, 0,
"if non zero choose a value from within this range as the key for "
"insert operations")
DEF_OPT_AS_BOOL(random_value, 0, "generate random content for the value")
+DEF_OPT_AS_UINT32(read_range, 0, "scan a range of keys after each search")
DEF_OPT_AS_BOOL(reopen_connection, 1,
"close and reopen the connection between populate and workload phases")
DEF_OPT_AS_UINT32(report_interval, 2,
@@ -164,8 +175,8 @@ DEF_OPT_AS_STRING(threads, "", "workload configuration: each 'count' "
"'update' entries are the ratios of insert, read and update operations "
"done by each worker thread; If a throttle value is provided each thread "
"will do a maximum of that number of operations per second; multiple "
- "workload configurations may be "
- "specified; for example, a more complex threads configuration might be "
+ "workload configurations may be specified per threads configuration; "
+ "for example, a more complex threads configuration might be "
"'threads=((count=2,reads=1)(count=8,reads=1,inserts=2,updates=1))' "
"which would create 2 threads doing nothing but reads and 8 threads "
"each doing 50% inserts and 25% reads and updates. Allowed configuration "
diff --git a/bench/wtperf/wtperf_throttle.c b/bench/wtperf/wtperf_throttle.c
new file mode 100644
index 00000000000..bba1f629715
--- /dev/null
+++ b/bench/wtperf/wtperf_throttle.c
@@ -0,0 +1,121 @@
+/*-
+ * Public Domain 2014-2015 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.
+ */
+
+#include "wtperf.h"
+
+/*
+ * Put the initial config together for running a throttled workload.
+ */
+int
+setup_throttle(CONFIG_THREAD *thread)
+{
+ THROTTLE_CONFIG *throttle_cfg;
+
+ throttle_cfg = &thread->throttle_cfg;
+
+ /*
+ * Setup how the number of operations to run each interval in order to
+ * meet our desired max throughput.
+ * - If we have a very small number of them we can do one op
+ * on a larger increment. Given there is overhead in throttle logic
+ * we want to avoid running the throttle check regularly.
+ * - For most workloads, we aim to do 100 ops per interval and adjust
+ * the sleep period accordingly.
+ * - For high throughput workloads, we aim to do many ops in 100us
+ * increments.
+ */
+
+ if (thread->workload->throttle < THROTTLE_OPS) {
+ /* If the interval is very small, we do one operation */
+ throttle_cfg->usecs_increment =
+ USEC_PER_SEC / thread->workload->throttle;
+ throttle_cfg->ops_per_increment = 1;
+ } else if (thread->workload->throttle < USEC_PER_SEC / THROTTLE_OPS) {
+ throttle_cfg->usecs_increment =
+ USEC_PER_SEC / thread->workload->throttle * THROTTLE_OPS;
+ throttle_cfg->ops_per_increment = THROTTLE_OPS;
+ } else {
+ /* If the interval is large, we do more ops per interval */
+ throttle_cfg->usecs_increment = USEC_PER_SEC / THROTTLE_OPS;
+ throttle_cfg->ops_per_increment =
+ thread->workload->throttle / THROTTLE_OPS;
+ }
+
+ /* Give the queue some initial operations to work with */
+ throttle_cfg->ops_count = throttle_cfg->ops_per_increment;
+
+ /* Set the first timestamp of when we incremented */
+ WT_RET(__wt_epoch(NULL, &throttle_cfg->last_increment));
+ return (0);
+}
+
+/*
+ * Run the throttle function. We will sleep if needed and then reload the
+ * counter to perform more operations.
+ */
+int
+worker_throttle(CONFIG_THREAD *thread)
+{
+ THROTTLE_CONFIG *throttle_cfg;
+ struct timespec now;
+ uint64_t usecs_delta;
+
+ throttle_cfg = &thread->throttle_cfg;
+
+ WT_RET(__wt_epoch(NULL, &now));
+
+ /*
+ * If we did enough operations in the current interval, sleep for
+ * the rest of the interval. Then add more operations to the queue.
+ */
+ usecs_delta = WT_TIMEDIFF_US(now, throttle_cfg->last_increment);
+ if (usecs_delta < throttle_cfg->usecs_increment) {
+ (void)usleep(
+ (useconds_t)(throttle_cfg->usecs_increment - usecs_delta));
+ throttle_cfg->ops_count =
+ throttle_cfg->ops_per_increment;
+ /*
+ * After sleeping, set the interval to the current time.
+ */
+ WT_RET(__wt_epoch(NULL, &throttle_cfg->last_increment));
+ } else {
+ throttle_cfg->ops_count =
+ (uint64_t) (float)(usecs_delta /
+ throttle_cfg->usecs_increment) *
+ (float)throttle_cfg->ops_per_increment;
+ throttle_cfg->last_increment = now;
+ }
+
+ /*
+ * Take the minimum so we don't overfill the queue.
+ */
+ throttle_cfg->ops_count =
+ WT_MIN(throttle_cfg->ops_count, thread->workload->throttle);
+
+ return (0);
+}
diff --git a/bench/wtperf/wtperf_truncate.c b/bench/wtperf/wtperf_truncate.c
index 581d1987947..11b09c60d5d 100644
--- a/bench/wtperf/wtperf_truncate.c
+++ b/bench/wtperf/wtperf_truncate.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -41,7 +41,7 @@ setup_truncate(CONFIG *cfg, CONFIG_THREAD *thread, WT_SESSION *session) {
TRUNCATE_QUEUE_ENTRY *truncate_item;
WORKLOAD *workload;
WT_CURSOR *cursor;
- char *key, *truncate_key;
+ char *key;
int ret;
uint64_t end_point, final_stone_gap, i, start_point;
@@ -54,6 +54,12 @@ setup_truncate(CONFIG *cfg, CONFIG_THREAD *thread, WT_SESSION *session) {
session, cfg->uris[0], NULL, NULL, &cursor)) != 0)
goto err;
+ /*
+ * If we find the workload getting behind we multiply the number of
+ * records to be truncated.
+ */
+ trunc_cfg->catchup_multiplier = 1;
+
/* How many entries between each stone. */
trunc_cfg->stone_gap =
(workload->truncate_count * workload->truncate_pct) / 100;
@@ -96,23 +102,14 @@ setup_truncate(CONFIG *cfg, CONFIG_THREAD *thread, WT_SESSION *session) {
if (trunc_cfg->stone_gap != 0) {
trunc_cfg->expected_total = (end_point - start_point);
for (i = 1; i <= trunc_cfg->needed_stones; i++) {
- truncate_key = calloc(cfg->key_sz, 1);
- if (truncate_key == NULL) {
- ret = enomem(cfg);
- goto err;
- }
- truncate_item = calloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
- if (truncate_item == NULL) {
- free(truncate_key);
- ret = enomem(cfg);
- goto err;
- }
+ truncate_item =
+ dcalloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
+ truncate_item->key = dcalloc(cfg->key_sz, 1);
generate_key(
- cfg, truncate_key, trunc_cfg->stone_gap * i);
- truncate_item->key = truncate_key;
+ cfg, truncate_item->key, trunc_cfg->stone_gap * i);
truncate_item->diff =
(trunc_cfg->stone_gap * i) - trunc_cfg->last_key;
- TAILQ_INSERT_TAIL( &cfg->stone_head, truncate_item, q);
+ TAILQ_INSERT_TAIL(&cfg->stone_head, truncate_item, q);
trunc_cfg->last_key = trunc_cfg->stone_gap * i;
trunc_cfg->num_stones++;
}
@@ -131,8 +128,8 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread,
TRUNCATE_CONFIG *trunc_cfg;
TRUNCATE_QUEUE_ENTRY *truncate_item;
- char *truncate_key;
int ret, t_ret;
+ uint64_t used_stone_gap;
ret = 0;
trunc_cfg = &thread->trunc_cfg;
@@ -145,27 +142,36 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread,
trunc_cfg->last_total_inserts = trunc_cfg->total_inserts;
/* We are done if there isn't enough data to trigger a new milestone. */
- if (trunc_cfg->expected_total <= trunc_cfg->needed_stones)
+ if (trunc_cfg->expected_total <= thread->workload->truncate_count)
return (0);
+ /*
+ * If we are falling behind and using more than one stone per lap we
+ * should widen the stone gap for this lap to try and catch up quicker.
+ */
+ if (trunc_cfg->expected_total >
+ thread->workload->truncate_count + trunc_cfg->stone_gap) {
+ /*
+ * Increase the multiplier until we create stones that are
+ * almost large enough to truncate the whole expected table size
+ * in one operation.
+ */
+ trunc_cfg->catchup_multiplier =
+ WT_MIN(trunc_cfg->catchup_multiplier + 1,
+ trunc_cfg->needed_stones - 1);
+ } else {
+ /* Back off if we start seeing an improvement */
+ trunc_cfg->catchup_multiplier =
+ WT_MAX(trunc_cfg->catchup_multiplier - 1, 1);
+ }
+ used_stone_gap = trunc_cfg->stone_gap * trunc_cfg->catchup_multiplier;
+
while (trunc_cfg->num_stones < trunc_cfg->needed_stones) {
- trunc_cfg->last_key += trunc_cfg->stone_gap;
- truncate_key = calloc(cfg->key_sz, 1);
- if (truncate_key == NULL) {
- lprintf(cfg, ENOMEM, 0,
- "truncate: couldn't allocate key array");
- return (ENOMEM);
- }
- truncate_item = calloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
- if (truncate_item == NULL) {
- free(truncate_key);
- lprintf(cfg, ENOMEM, 0,
- "truncate: couldn't allocate item");
- return (ENOMEM);
- }
- generate_key(cfg, truncate_key, trunc_cfg->last_key);
- truncate_item->key = truncate_key;
- truncate_item->diff = trunc_cfg->stone_gap;
+ trunc_cfg->last_key += used_stone_gap;
+ truncate_item = dcalloc(sizeof(TRUNCATE_QUEUE_ENTRY), 1);
+ truncate_item->key = dcalloc(cfg->key_sz, 1);
+ generate_key(cfg, truncate_item->key, trunc_cfg->last_key);
+ truncate_item->diff = used_stone_gap;
TAILQ_INSERT_TAIL(&cfg->stone_head, truncate_item, q);
trunc_cfg->num_stones++;
}
@@ -189,7 +195,6 @@ run_truncate(CONFIG *cfg, CONFIG_THREAD *thread,
goto err;
}
-
*truncatedp = 1;
trunc_cfg->expected_total -= truncate_item->diff;
diff --git a/build_posix/Make.base b/build_posix/Make.base
index 3037d70528a..4efbe3f76c3 100644
--- a/build_posix/Make.base
+++ b/build_posix/Make.base
@@ -31,6 +31,7 @@ wt_SOURCES =\
src/utilities/util_misc.c \
src/utilities/util_printlog.c \
src/utilities/util_read.c \
+ src/utilities/util_rebalance.c \
src/utilities/util_rename.c \
src/utilities/util_salvage.c \
src/utilities/util_stat.c \
diff --git a/build_posix/aclocal/version-set.m4 b/build_posix/aclocal/version-set.m4
index c8b89b7842b..6c7c6eed9cf 100644
--- a/build_posix/aclocal/version-set.m4
+++ b/build_posix/aclocal/version-set.m4
@@ -2,8 +2,8 @@ dnl build by dist/s_version
VERSION_MAJOR=2
VERSION_MINOR=7
-VERSION_PATCH=0
-VERSION_STRING='"WiredTiger 2.7.0: (November 19, 2015)"'
+VERSION_PATCH=1
+VERSION_STRING='"WiredTiger 2.7.1: (December 8, 2015)"'
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
diff --git a/build_posix/aclocal/version.m4 b/build_posix/aclocal/version.m4
index 2ebe4516695..3b690982f9d 100644
--- a/build_posix/aclocal/version.m4
+++ b/build_posix/aclocal/version.m4
@@ -1,2 +1,2 @@
dnl WiredTiger product version for AC_INIT. Maintained by dist/s_version
-2.7.0
+2.7.1
diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in
index de2f8963629..5949fb0509c 100644
--- a/build_posix/configure.ac.in
+++ b/build_posix/configure.ac.in
@@ -103,7 +103,7 @@ esac
# Linux requires buffers aligned to 4KB boundaries for O_DIRECT to work.
BUFFER_ALIGNMENT=0
-if test "$ac_cv_func_posix_memalign" = "yes" ; then
+if test "$ax_cv_func_posix_memalign_works" = "yes" ; then
case "$host_os" in
linux*) BUFFER_ALIGNMENT=4096 ;;
esac
diff --git a/build_win/filelist.win b/build_win/filelist.win
index af6ddf98da9..0a313026793 100644
--- a/build_win/filelist.win
+++ b/build_win/filelist.win
@@ -31,6 +31,7 @@ src/btree/bt_misc.c
src/btree/bt_ovfl.c
src/btree/bt_page.c
src/btree/bt_read.c
+src/btree/bt_rebalance.c
src/btree/bt_ret.c
src/btree/bt_slvg.c
src/btree/bt_split.c
@@ -121,6 +122,7 @@ src/os_win/os_map.c
src/os_win/os_mtx_cond.c
src/os_win/os_once.c
src/os_win/os_open.c
+src/os_win/os_pagesize.c
src/os_win/os_path.c
src/os_win/os_priv.c
src/os_win/os_remove.c
diff --git a/dist/api_data.py b/dist/api_data.py
index ff6d3f3ccb5..e4055112d5e 100644
--- a/dist/api_data.py
+++ b/dist/api_data.py
@@ -564,6 +564,7 @@ connection_runtime_config = [
'mutex',
'overflow',
'read',
+ 'rebalance',
'reconcile',
'recovery',
'salvage',
@@ -770,6 +771,10 @@ methods = {
Config('remove_files', 'true', r'''
should the underlying files be removed?''',
type='boolean'),
+ Config('lock_wait', 'true', r'''
+ wait for locks, if \c lock_wait=false, fail if any required locks are
+ not available immediately''',
+ type='boolean'),
]),
'WT_SESSION.join' : Method([
@@ -892,6 +897,7 @@ methods = {
type='list'),
]),
+'WT_SESSION.rebalance' : Method([]),
'WT_SESSION.rename' : Method([]),
'WT_SESSION.reset' : Method([]),
'WT_SESSION.salvage' : Method([
diff --git a/dist/filelist b/dist/filelist
index 52af87c2a68..edd59435841 100644
--- a/dist/filelist
+++ b/dist/filelist
@@ -31,6 +31,7 @@ src/btree/bt_misc.c
src/btree/bt_ovfl.c
src/btree/bt_page.c
src/btree/bt_read.c
+src/btree/bt_rebalance.c
src/btree/bt_ret.c
src/btree/bt_slvg.c
src/btree/bt_split.c
@@ -119,6 +120,7 @@ src/os_posix/os_mtx_cond.c
src/os_posix/os_mtx_rw.c
src/os_posix/os_once.c
src/os_posix/os_open.c
+src/os_posix/os_pagesize.c
src/os_posix/os_path.c
src/os_posix/os_priv.c
src/os_posix/os_remove.c
diff --git a/dist/flags.py b/dist/flags.py
index 7d237dd39a4..b97235b965a 100644
--- a/dist/flags.py
+++ b/dist/flags.py
@@ -31,11 +31,13 @@ flags = {
'page_read' : [
'READ_CACHE',
'READ_COMPACT',
+ 'READ_NOTFOUND_OK',
'READ_NO_EMPTY',
'READ_NO_EVICT',
'READ_NO_GEN',
'READ_NO_WAIT',
'READ_PREV',
+ 'READ_RESTART_OK',
'READ_SKIP_INTL',
'READ_SKIP_LEAF',
'READ_TRUNCATE',
@@ -70,6 +72,7 @@ flags = {
'VERB_MUTEX',
'VERB_OVERFLOW',
'VERB_READ',
+ 'VERB_REBALANCE',
'VERB_RECONCILE',
'VERB_RECOVERY',
'VERB_SALVAGE',
@@ -108,6 +111,7 @@ flags = {
'SESSION_CAN_WAIT',
'SESSION_CLEAR_EVICT_WALK',
'SESSION_INTERNAL',
+ 'SESSION_LOCK_NO_WAIT',
'SESSION_LOCKED_CHECKPOINT',
'SESSION_LOCKED_HANDLE_LIST',
'SESSION_LOCKED_SCHEMA',
diff --git a/dist/log.py b/dist/log.py
index feeb053db3e..6d35bf2e718 100644
--- a/dist/log.py
+++ b/dist/log.py
@@ -8,14 +8,15 @@ import log_data
tmp_file = '__tmp'
# Map log record types to:
-# (C type, pack type, printf format, printf arg(s), printf setup)
+# (C type, pack type, printf format, printf arg(s), list of setup functions)
field_types = {
- 'string' : ('const char *', 'S', '%s', 'arg', ''),
+ 'string' : ('const char *', 'S', '%s', 'arg', [ '' ]),
'item' : ('WT_ITEM *', 'u', '%s', 'escaped',
- 'WT_ERR(__logrec_jsonify_str(session, &escaped, &arg));'),
- 'recno' : ('uint64_t', 'r', '%" PRIu64 "', 'arg', ''),
- 'uint32' : ('uint32_t', 'I', '%" PRIu32 "', 'arg', ''),
- 'uint64' : ('uint64_t', 'Q', '%" PRIu64 "', 'arg', ''),
+ [ 'WT_ERR(__logrec_make_json_str(session, &escaped, &arg));',
+ 'WT_ERR(__logrec_make_hex_str(session, &escaped, &arg));']),
+ 'recno' : ('uint64_t', 'r', '%" PRIu64 "', 'arg', [ '' ]),
+ 'uint32' : ('uint32_t', 'I', '%" PRIu32 "', 'arg', [ '' ]),
+ 'uint64' : ('uint64_t', 'Q', '%" PRIu64 "', 'arg', [ '' ]),
}
def cintype(f):
@@ -38,15 +39,13 @@ def clocaltype(f):
return type
def escape_decl(fields):
- for f in fields:
- if 'escaped' in field_types[f[0]][4]:
- return '\n\tchar *escaped;'
- return ''
+ return '\n\tchar *escaped;' if has_escape(fields) else ''
def has_escape(fields):
for f in fields:
- if 'escaped' in field_types[f[0]][4]:
- return True
+ for setup in field_types[f[0]][4]:
+ if 'escaped' in setup:
+ return True
return False
def pack_fmt(fields):
@@ -65,10 +64,38 @@ def printf_arg(f):
arg = field_types[f[0]][3].replace('arg', f[1])
return ' ' + arg
-def printf_setup(f):
- stmt = field_types[f[0]][4].replace('arg', f[1])
- return '' if stmt == '' else stmt + '\n\t'
-
+def printf_setup(f, i, nl_indent):
+ stmt = field_types[f[0]][4][i].replace('arg', f[1])
+ return '' if stmt == '' else stmt + nl_indent
+
+def n_setup(f):
+ return len(field_types[f[0]][4])
+
+# Create a printf line, with an optional setup function.
+# ishex indicates that the the field name in the output is modified
+# (to add "-hex"), and that the setup and printf are conditional
+# in the generated code.
+def printf_line(f, optype, i, ishex):
+ ifbegin = ''
+ ifend = ''
+ nl_indent = '\n\t'
+ name = f[1]
+ postcomma = '' if i + 1 == len(optype.fields) else ',\\n'
+ precomma = ''
+ if ishex > 0:
+ name += '-hex'
+ ifend = nl_indent + '}'
+ nl_indent += '\t'
+ ifbegin = 'if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {' + nl_indent
+ if postcomma == '':
+ precomma = ',\\n'
+ body = '%s%s(__wt_fprintf(out,' % (
+ printf_setup(f, ishex, nl_indent),
+ 'WT_ERR' if has_escape(optype.fields) else 'WT_RET') + \
+ '%s "%s \\"%s\\": \\"%s\\"%s",%s));' % (
+ nl_indent, precomma, name, printf_fmt(f), postcomma,
+ printf_arg(f))
+ return ifbegin + body + ifend
#####################################################################
# Update log.h with #defines for types
@@ -176,7 +203,7 @@ __logrec_json_unpack_str(char *dest, size_t destlen, const char *src,
}
static int
-__logrec_jsonify_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
+__logrec_make_json_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
{
\tsize_t needed;
@@ -185,6 +212,17 @@ __logrec_jsonify_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
\t(void)__logrec_json_unpack_str(*destp, needed, item->data, item->size);
\treturn (0);
}
+
+static int
+__logrec_make_hex_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
+{
+\tsize_t needed;
+
+\tneeded = item->size * 2 + 1;
+\tWT_RET(__wt_realloc(session, NULL, needed, destp));
+\t__wt_fill_hex(item->data, item->size, (uint8_t *)*destp, needed, NULL);
+\treturn (0);
+}
''')
# Emit code to read, write and print log operations (within a log record)
@@ -255,11 +293,12 @@ __wt_logop_%(name)s_unpack(
tfile.write('''
int
__wt_logop_%(name)s_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
%(arg_ret)s\t%(arg_decls)s
-\t%(arg_init)sWT_RET(__wt_logop_%(name)s_unpack(
+\t%(arg_unused)s%(arg_init)sWT_RET(__wt_logop_%(name)s_unpack(
\t session, pp, end%(arg_addrs)s));
\tWT_RET(__wt_fprintf(out, " \\"optype\\": \\"%(name)s\\",\\n"));
@@ -272,27 +311,22 @@ __wt_logop_%(name)s_print(
'arg_decls' : ('\n\t'.join('%s%s%s;' %
(clocaltype(f), '' if clocaltype(f)[-1] == '*' else ' ', f[1])
for f in optype.fields)) + escape_decl(optype.fields),
+ 'arg_unused' : ('' if has_escape(optype.fields)
+ else 'WT_UNUSED(flags);\n\t'),
'arg_init' : ('escaped = NULL;\n\t' if has_escape(optype.fields) else ''),
'arg_fini' : ('\nerr:\t__wt_free(session, escaped);\n\treturn (ret);'
if has_escape(optype.fields) else '\treturn (0);'),
'arg_addrs' : ''.join(', &%s' % f[1] for f in optype.fields),
- 'print_args' : '\n\t'.join(
- '%s%s(__wt_fprintf(out,\n\t " \\"%s\\": \\"%s\\",\\n",%s));' %
- (printf_setup(f),
- 'WT_ERR' if has_escape(optype.fields) else 'WT_RET',
- f[1], printf_fmt(f), printf_arg(f))
- for f in optype.fields[:-1]) + str(
- '\n\t%s%s(__wt_fprintf(out,\n\t " \\"%s\\": \\"%s\\"",%s));' %
- (printf_setup(last_field),
- 'WT_ERR' if has_escape(optype.fields) else 'WT_RET',
- last_field[1], printf_fmt(last_field), printf_arg(last_field))),
+ 'print_args' : '\n\t'.join(printf_line(f, optype, i, s)
+ for i,f in enumerate(optype.fields) for s in range(0, n_setup(f)))
})
# Emit the printlog entry point
tfile.write('''
int
__wt_txn_op_printlog(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
\tuint32_t optype, opsize;
@@ -308,7 +342,8 @@ for optype in log_data.optypes:
tfile.write('''
\tcase %(macro)s:
-\t\tWT_RET(%(print_func)s(session, pp, end, out));
+\t\tWT_RET(%(print_func)s(session, pp, end, out,
+\t\t flags));
\t\tbreak;
''' % {
'macro' : optype.macro_name(),
diff --git a/dist/package/wiredtiger.spec b/dist/package/wiredtiger.spec
index 6c7d6b9bc41..5bbb26885c0 100644
--- a/dist/package/wiredtiger.spec
+++ b/dist/package/wiredtiger.spec
@@ -1,5 +1,5 @@
Name: wiredtiger
-Version: 2.7.0
+Version: 2.7.1
Release: 1%{?dist}
Summary: WiredTiger data storage engine
diff --git a/dist/s_all b/dist/s_all
index 8e3f265e79b..46a68864906 100755
--- a/dist/s_all
+++ b/dist/s_all
@@ -88,7 +88,13 @@ COMMANDS="
2>&1 ./s_win > ${t_pfx}s_win
2>&1 ./s_docs > ${t_pfx}s_docs"
-echo "$COMMANDS" | xargs -P 20 -I{} /bin/sh -c {}
+# Parallelize if possible.
+xp=""
+echo date | xargs -P 20 >/dev/null 2>&1
+if test $? -eq 0; then
+ xp="-P 20"
+fi
+echo "$COMMANDS" | xargs $xp -I{} /bin/sh -c {}
for f in `find . -name ${t_pfx}\*`; do
if ! `test -s $f`; then
diff --git a/dist/s_copyright b/dist/s_copyright
index 020be6ae33d..cfada71a839 100755
--- a/dist/s_copyright
+++ b/dist/s_copyright
@@ -1,11 +1,15 @@
#! /bin/sh
+# Only run when building a release
+test -z "$WT_RELEASE_BUILD" && exit 0
+
# Check the copyrights.
c1=__wt.copyright.1
c2=__wt.copyright.2
c3=__wt.copyright.3
c4=__wt.copyright.4
+c5=__wt.copyright.5
check()
{
@@ -34,6 +38,9 @@ check()
if `sed -e 1,3p -e 4q -e d $1 | diff - dist/$c4 > /dev/null` ; then
return;
fi
+ if `sed -e 2,7p -e 8q -e d $1 | diff - dist/$c5 > /dev/null` ; then
+ return;
+ fi
echo "$1: copyright information is incorrect"
exit 1
@@ -81,6 +88,23 @@ cat > $c4 <<ENDOFTEXT
# This is free and unencumbered software released into the public domain.
ENDOFTEXT
+cat > $c5 <<ENDOFTEXT
+ * Copyright (c) 2014-$year MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ENDOFTEXT
+
+# Parallelize if possible.
+xp=""
+echo date | xargs -P 20 >/dev/null 2>&1
+if test $? -eq 0; then
+ xp="-P 20"
+fi
+
# Search for files, skipping some well-known 3rd party directories.
(cd .. && find [a-z]* -name '*.[chi]' \
-o -name '*.cxx' \
@@ -97,7 +121,7 @@ ENDOFTEXT
-e '/\/node_modules\//d' \
-e '/dist\/__/d' \
-e 's/^\.\///' |
- xargs -P 20 -n 1 -I{} sh dist/s_copyright {})
+ xargs $xp -n 1 -I{} sh dist/s_copyright {})
# A few special cases: LICENSE, documentation, wt utility, some of which have
# more than one copyright notice in the file. For files that have only a single
diff --git a/dist/s_docs b/dist/s_docs
index 96cacd3fb34..c66bcb0bd06 100755
--- a/dist/s_docs
+++ b/dist/s_docs
@@ -22,7 +22,8 @@ changelog()
(echo "WiredTiger Change Log"
echo "====================="
echo
- cat ../NEWS) > ../src/docs/changelog.md
+ sed -e 's, \([0-9a-f]\{7\}\) , [\1](https://github.com/wiredtiger/wiredtiger/commit/\1) ,g' \
+ -e 's,\(\(WT\|SERVER\)-[0-9]*\),[\1](https://jira.mongodb.org/browse/\1),g' ../NEWS) > ../src/docs/changelog.md
}
wtperf_config()
diff --git a/dist/s_funcs b/dist/s_funcs
index 3769ccc4aa7..5fee03b5615 100755
--- a/dist/s_funcs
+++ b/dist/s_funcs
@@ -6,7 +6,7 @@ trap 'rm -f $t; exit 0' 0 1 2 3 13 15
# List of files to search.
l=`sed -e 's,#.*,,' -e '/^$/d' -e 's,^,../,' filelist`
-l="$l `echo ../src/*/*.i ../src/utilities/*.c`"
+l="$l `echo ../src/*/*.i ../src/utilities/*.c ../bench/wtperf/*.c`"
(
# Copy out the functions we don't use, but it's OK.
diff --git a/dist/s_longlines b/dist/s_longlines
index 15ca5603385..decedb58f44 100755
--- a/dist/s_longlines
+++ b/dist/s_longlines
@@ -8,10 +8,11 @@ l=`(cd .. &&
find bench/wtperf examples ext src test -name '*.[chisy]' &&
find dist -name '*.py' &&
find src -name '*.in') |
- sed -e '/include\/extern\.h/d'\
- -e '/support\/stat\.c/d'`
+ sed -e '/dist\/stat_data\.py/d' \
+ -e '/support\/stat\.c/d' \
+ -e '/include\/extern\.h/d'`
for f in $l ; do
expand -t8 < ../$f | awk -- \
- "{if(length(\$0) > 80) printf(\"%s:%d\\n\", \"$f\", NR)}"
+ "{if(length(\$0) > 80) printf(\"%s:%d\\n\", \"$f\", NR)}"
done
diff --git a/dist/s_string b/dist/s_string
index 08d066f5929..3a4f9e190d3 100755
--- a/dist/s_string
+++ b/dist/s_string
@@ -30,7 +30,8 @@ replace() {
# check:
# Check the spelling of an individual file.
check() {
- aspell --lang=en $1 list < ../$2 |
+ # Strip out git hashes, which are seven character hex strings.
+ sed 's/ [0-9a-f]\{7\} / /g' ../$2 | aspell --lang=en $1 list |
sort -u |
comm -23 /dev/stdin s_string.ok > $t
test -s $t && {
diff --git a/dist/s_string.ok b/dist/s_string.ok
index 3669fa4d608..b2d5a453441 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -102,6 +102,7 @@ Encryptor
Encryptors
Enqueue
Eron
+FALLOC
FALLTHROUGH
FH
FLD
@@ -143,6 +144,7 @@ INIT
INITIALIZER
INMEM
INTL
+ISA
ITEMs
Inline
Intra
@@ -179,6 +181,7 @@ LevelDB
Levyx
Llqr
Llqrt
+LoadLoad
LockFile
Lookaside
Lookup
@@ -186,6 +189,7 @@ MALLOC
MEM
MEMALIGN
MERCHANTABILITY
+MONGODB
MSVC
MULTIBLOCK
MUTEX
@@ -224,6 +228,7 @@ Obama
Outfmt
PARAM
POSIX
+PPC
PREDEFINE
PRIu
PRNG
@@ -250,6 +255,7 @@ RNG
RPC
RUNDIR
Radu
+Rebalance
RedHat
Redistributions
Resize
@@ -281,10 +287,13 @@ Spinlock
Spinlocks
Split's
Stoica
+StoreLoad
+StoreStore
TAILQ
TCMalloc
TODO
TORTIOUS
+TSO
TXN
TXNC
Timespec
@@ -299,6 +308,7 @@ ULINE
URI
URIs
UTF
+UltraSparc
Unbuffered
UnixLib
Unmap
@@ -358,6 +368,7 @@ arg
argc
args
argv
+asm
async
asyncopp
asyncops
@@ -368,6 +379,7 @@ automake
bInheritHandle
basecfg
basho
+bcr
bdb
beginthreadex
bigram
@@ -409,6 +421,7 @@ bzip
calloc
cas
catfmt
+ccr
cd
centric
cfg
@@ -486,6 +499,7 @@ datasets
datasource
datastore
dbc
+dcalloc
decile
deciles
decl
@@ -525,6 +539,7 @@ dmalloc
dmsg
doxgen
doxygen
+drealloc
ds
dsb
dsk
@@ -532,6 +547,7 @@ dsrc
dst
dstlen
dstrdup
+dstrndup
dsync
dumpcmp
dumpfile
@@ -595,6 +611,7 @@ free'd
fscanf
fstat
fsync
+fsyncLock
fsyncs
ftruncate
func
@@ -708,6 +725,7 @@ lookaside
lookup
lookups
lossy
+lr
lrt
lru
lseek
@@ -716,6 +734,7 @@ lsn
lsnappy
lt
lu
+lwsync
lz
lzo
madvise
@@ -723,6 +742,8 @@ majorp
malloc
marshall
marshalled
+mbll
+mbss
mem
memalign
membar
@@ -799,6 +820,7 @@ os
ovfl
ownp
packv
+pagesize
parens
pareto
parserp
@@ -809,6 +831,7 @@ perf
pfx
poptable
popthreads
+portably
pos
posint
posix
@@ -849,6 +872,8 @@ readlock
readonly
readunlock
realloc
+rebalance
+rebalanced
rebalancing
recno
recnos
@@ -877,6 +902,7 @@ runtime
rwlock
sH
sHQ
+scalability
sched
scr
sd
@@ -1018,6 +1044,7 @@ variable's
vectorized
versa
vfprintf
+vm
vpack
vprintf
vrfy
diff --git a/dist/s_style b/dist/s_style
index 0e013852914..44a5bdda741 100755
--- a/dist/s_style
+++ b/dist/s_style
@@ -4,6 +4,13 @@
t=__wt.$$
trap 'rm -f $t; exit 0' 0 1 2 3 13 15
+# Parallelize if possible.
+xp=""
+echo date | xargs -P 20 >/dev/null 2>&1
+if test $? -eq 0; then
+ xp="-P 20"
+fi
+
# s_style is re-entrant, when run with no parameters it calls itself
# again for each file that needs checking.
if [ $# -ne 1 ]; then
@@ -12,7 +19,7 @@ if [ $# -ne 1 ]; then
find bench examples ext src test \
-name '*.[chisy]' -o -name '*.in' -o -name '*.dox' |
sed -e '/Makefile.in/d' -e '/build_win\/wiredtiger_config.h/d' |
- xargs -P 20 -n 1 -I{} sh ./dist/s_style {}
+ xargs $xp -n 1 -I{} sh ./dist/s_style {}
else
# General style correction and cleanup for a single file
f=$1
diff --git a/dist/s_whitespace b/dist/s_whitespace
index 38eb5d6c2df..d13de4b5989 100755
--- a/dist/s_whitespace
+++ b/dist/s_whitespace
@@ -32,7 +32,7 @@ for f in `find dist -name '*.py' -name 's_*'`; do
done
# C-language sources.
-for f in `find examples ext src test \
+for f in `find bench examples ext src test \
-name '*.[chi]' -o \
-name '*.dox' -o \
-name '*.in' -o \
diff --git a/dist/s_win b/dist/s_win
index cdfc71a8a1e..1eb4702d517 100755
--- a/dist/s_win
+++ b/dist/s_win
@@ -62,6 +62,7 @@ win_filelist()
-e 's;os_posix/os_mtx_cond.c;os_win/os_mtx_cond.c;' \
-e 's;os_posix/os_once.c;os_win/os_once.c;' \
-e 's;os_posix/os_open.c;os_win/os_open.c;' \
+ -e 's;os_posix/os_pagesize.c;os_win/os_pagesize.c;' \
-e 's;os_posix/os_path.c;os_win/os_path.c;' \
-e 's;os_posix/os_priv.c;os_win/os_priv.c;' \
-e 's;os_posix/os_remove.c;os_win/os_remove.c;' \
diff --git a/dist/stat.py b/dist/stat.py
index d62fda3fcb9..6dcfccfeab5 100644
--- a/dist/stat.py
+++ b/dist/stat.py
@@ -171,9 +171,7 @@ __wt_stat_''' + name + '''_aggregate_single(
{
''')
for l in sorted(list):
- if 'no_aggregate' in l.flags:
- o = '\tto->' + l.name + ' = from->' + l.name + ';\n'
- elif 'max_aggregate' in l.flags:
+ if 'max_aggregate' in l.flags:
o = '\tif (from->' + l.name + ' > to->' + l.name + ')\n' +\
'\t\tto->' + l.name + ' = from->' + l.name + ';\n'
else:
@@ -197,12 +195,12 @@ __wt_stat_''' + name + '''_aggregate(
f.write('\tint64_t v;\n\n')
break;
for l in sorted(list):
- if 'no_aggregate' in l.flags:
- o = '\tto->' + l.name + ' = from[0]->' + l.name + ';\n'
- elif 'max_aggregate' in l.flags:
- o = '\tif ((v = WT_STAT_READ(from, ' + l.name + ')) >\n' +\
- '\t to->' + l.name + ')\n' +\
- '\t\tto->' + l.name + ' = v;\n'
+ if 'max_aggregate' in l.flags:
+ o = '\tif ((v = WT_STAT_READ(from, ' + l.name + ')) > ' +\
+ 'to->' + l.name + ')\n'
+ if len(o) > 72: # Account for the leading tab.
+ o = o.replace(' > ', ' >\n\t ')
+ o +='\t\tto->' + l.name + ' = v;\n'
else:
o = '\tto->' + l.name + ' += WT_STAT_READ(from, ' + l.name + ');\n'
if len(o) > 72: # Account for the leading tab.
diff --git a/dist/stat_data.py b/dist/stat_data.py
index 3a23071a3f2..41a93961079 100644
--- a/dist/stat_data.py
+++ b/dist/stat_data.py
@@ -8,20 +8,13 @@
# NOTE: All statistics descriptions must have a prefix string followed by ':'.
#
# Data-source statistics are normally aggregated across the set of underlying
-# objects. Additional optionaly configuration flags are available:
-# no_aggregate Ignore the value when aggregating statistics
+# objects. Additional optional configuration flags are available:
# max_aggregate Take the maximum value when aggregating statistics
-#
-# Optional configuration flags:
# no_clear Value not cleared when statistics cleared
# no_scale Don't scale value per second in the logging tool script
#
-# The no_clear flag is a little complicated: it means we don't clear the values
-# when resetting statistics after each run (necessary when the WiredTiger engine
-# is updating values that persist over multiple runs, for example the count of
-# cursors), but it also causes the underlying display routines to not treat the
-# change between displays as relative to the number of seconds, that is, it's an
-# absolute value. The no_clear flag should be set in either case.
+# The no_clear and no_scale flags are normally always set together (values that
+# are maintained over time are normally not scaled per second).
from operator import attrgetter
import sys
@@ -129,13 +122,11 @@ connection_stats = [
# Async API statistics
##########################################
AsyncStat('async_alloc_race', 'number of allocation state races'),
- AsyncStat('async_alloc_view',
- 'number of operation slots viewed for allocation'),
+ AsyncStat('async_alloc_view', 'number of operation slots viewed for allocation'),
AsyncStat('async_cur_queue', 'current work queue length'),
AsyncStat('async_flush', 'number of flush calls'),
AsyncStat('async_full', 'number of times operation allocation failed'),
- AsyncStat('async_max_queue',
- 'maximum work queue length', 'no_clear,no_scale'),
+ AsyncStat('async_max_queue', 'maximum work queue length', 'no_clear,no_scale'),
AsyncStat('async_nowork', 'number of times worker found no work'),
AsyncStat('async_op_alloc', 'total allocations'),
AsyncStat('async_op_compact', 'total compact calls'),
@@ -158,89 +149,59 @@ connection_stats = [
##########################################
# Cache and eviction statistics
##########################################
- CacheStat('cache_bytes_dirty',
- 'tracked dirty bytes in the cache', 'no_clear,no_scale'),
- CacheStat('cache_bytes_internal',
- 'tracked bytes belonging to internal pages in the cache',
- 'no_clear,no_scale'),
- CacheStat('cache_bytes_inuse',
- 'bytes currently in the cache', 'no_clear,no_scale'),
- CacheStat('cache_bytes_leaf',
- 'tracked bytes belonging to leaf pages in the cache',
- 'no_clear,no_scale'),
- CacheStat('cache_bytes_max',
- 'maximum bytes configured', 'no_clear,no_scale'),
- CacheStat('cache_bytes_overflow',
- 'tracked bytes belonging to overflow pages in the cache',
- 'no_clear,no_scale'),
+ CacheStat('cache_bytes_dirty', 'tracked dirty bytes in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_internal', 'tracked bytes belonging to internal pages in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_inuse', 'bytes currently in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_leaf', 'tracked bytes belonging to leaf pages in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_max', 'maximum bytes configured', 'no_clear,no_scale'),
+ CacheStat('cache_bytes_overflow', 'tracked bytes belonging to overflow pages in the cache', 'no_clear,no_scale'),
CacheStat('cache_bytes_read', 'bytes read into cache'),
CacheStat('cache_bytes_write', 'bytes written from cache'),
CacheStat('cache_eviction_app', 'pages evicted by application threads'),
CacheStat('cache_eviction_checkpoint', 'checkpoint blocked page eviction'),
CacheStat('cache_eviction_clean', 'unmodified pages evicted'),
- CacheStat('cache_eviction_deepen',
- 'page split during eviction deepened the tree'),
+ CacheStat('cache_eviction_deepen', 'page split during eviction deepened the tree'),
CacheStat('cache_eviction_dirty', 'modified pages evicted'),
- CacheStat('cache_eviction_fail',
- 'pages selected for eviction unable to be evicted'),
- CacheStat('cache_eviction_force',
- 'pages evicted because they exceeded the in-memory maximum'),
- CacheStat('cache_eviction_force_delete',
- 'pages evicted because they had chains of deleted items'),
- CacheStat('cache_eviction_force_fail',
- 'failed eviction of pages that exceeded the in-memory maximum'),
+ CacheStat('cache_eviction_fail', 'pages selected for eviction unable to be evicted'),
+ CacheStat('cache_eviction_force', 'pages evicted because they exceeded the in-memory maximum'),
+ CacheStat('cache_eviction_force_delete', 'pages evicted because they had chains of deleted items'),
+ CacheStat('cache_eviction_force_fail', 'failed eviction of pages that exceeded the in-memory maximum'),
CacheStat('cache_eviction_hazard', 'hazard pointer blocked page eviction'),
CacheStat('cache_eviction_internal', 'internal pages evicted'),
- CacheStat('cache_eviction_maximum_page_size',
- 'maximum page size at eviction', 'no_clear,no_scale'),
- 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'),
- CacheStat('cache_eviction_server_not_evicting',
- 'eviction server populating queue, but not evicting pages'),
- CacheStat('cache_eviction_slow',
- 'eviction server unable to reach eviction goal'),
- CacheStat('cache_eviction_split_internal',
- 'internal pages split during eviction'),
+ CacheStat('cache_eviction_maximum_page_size', 'maximum page size at eviction', 'no_clear,no_scale'),
+ 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'),
+ CacheStat('cache_eviction_server_not_evicting', 'eviction server populating queue, but not evicting pages'),
+ CacheStat('cache_eviction_slow', 'eviction server unable to reach eviction goal'),
+ CacheStat('cache_eviction_split_internal', 'internal pages split during eviction'),
CacheStat('cache_eviction_split_leaf', 'leaf pages split during eviction'),
CacheStat('cache_eviction_walk', 'pages walked for eviction'),
- CacheStat('cache_eviction_worker_evicting',
- 'eviction worker thread evicting pages'),
+ CacheStat('cache_eviction_worker_evicting', 'eviction worker thread evicting pages'),
CacheStat('cache_inmem_split', 'in-memory page splits'),
- CacheStat('cache_inmem_splittable',
- 'in-memory page passed criteria to be split'),
+ CacheStat('cache_inmem_splittable', 'in-memory page passed criteria to be split'),
CacheStat('cache_lookaside_insert', 'lookaside table insert calls'),
CacheStat('cache_lookaside_remove', 'lookaside table remove calls'),
CacheStat('cache_overhead', 'percentage overhead', 'no_clear,no_scale'),
- CacheStat('cache_pages_dirty',
- 'tracked dirty pages in the cache', 'no_clear,no_scale'),
- CacheStat('cache_pages_inuse',
- 'pages currently held in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_pages_dirty', 'tracked dirty pages in the cache', 'no_clear,no_scale'),
+ CacheStat('cache_pages_inuse', 'pages currently held in the cache', 'no_clear,no_scale'),
CacheStat('cache_read', 'pages read into cache'),
- CacheStat('cache_read_lookaside',
- 'pages read into cache requiring lookaside entries'),
+ CacheStat('cache_read_lookaside', 'pages read into cache requiring lookaside entries'),
CacheStat('cache_write', 'pages written from cache'),
- CacheStat('cache_write_lookaside',
- 'page written requiring lookaside records'),
- CacheStat('cache_write_restore',
- 'pages written requiring in-memory restoration'),
+ CacheStat('cache_write_lookaside', 'page written requiring lookaside records'),
+ CacheStat('cache_write_restore', 'pages written requiring in-memory restoration'),
##########################################
# Dhandle statistics
##########################################
- DhandleStat('dh_conn_handle_count',
- 'connection data handles currently active', 'no_clear,no_scale'),
+ DhandleStat('dh_conn_handle_count', 'connection data handles currently active', 'no_clear,no_scale'),
+ DhandleStat('dh_session_handles', 'session dhandles swept'),
+ DhandleStat('dh_session_sweeps', 'session sweep attempts'),
DhandleStat('dh_sweep_close', 'connection sweep dhandles closed'),
- DhandleStat('dh_sweep_remove',
- 'connection sweep dhandles removed from hash list'),
DhandleStat('dh_sweep_ref', 'connection sweep candidate became referenced'),
+ DhandleStat('dh_sweep_remove', 'connection sweep dhandles removed from hash list'),
DhandleStat('dh_sweep_tod', 'connection sweep time-of-death sets'),
DhandleStat('dh_sweeps', 'connection sweeps'),
- DhandleStat('dh_session_handles', 'session dhandles swept'),
- DhandleStat('dh_session_sweeps', 'session sweep attempts'),
##########################################
# Logging statistics
@@ -257,10 +218,8 @@ connection_stats = [
LogStat('log_flush', 'log flush operations'),
LogStat('log_max_filesize', 'maximum log file size', 'no_clear,no_scale'),
LogStat('log_prealloc_files', 'pre-allocated log files prepared'),
- LogStat('log_prealloc_max',
- 'number of pre-allocated log files to create', 'no_clear,no_scale'),
- LogStat('log_prealloc_missed',
- 'pre-allocated log files not ready and missed'),
+ LogStat('log_prealloc_max', 'number of pre-allocated log files to create', 'no_clear,no_scale'),
+ LogStat('log_prealloc_missed', 'pre-allocated log files not ready and missed'),
LogStat('log_prealloc_used', 'pre-allocated log files used'),
LogStat('log_release_write_lsn', 'log release advances write LSN'),
LogStat('log_scan_records', 'records processed by log scan'),
@@ -283,46 +242,32 @@ connection_stats = [
##########################################
# Reconciliation statistics
##########################################
- RecStat('rec_pages', 'page reconciliation calls'),
RecStat('rec_page_delete', 'pages deleted'),
RecStat('rec_page_delete_fast', 'fast-path pages deleted'),
+ RecStat('rec_pages', 'page reconciliation calls'),
RecStat('rec_pages_eviction', 'page reconciliation calls for eviction'),
- RecStat('rec_split_stashed_bytes',
- 'split bytes currently awaiting free', 'no_clear,no_scale'),
- RecStat('rec_split_stashed_objects',
- 'split objects currently awaiting free', 'no_clear,no_scale'),
+ RecStat('rec_split_stashed_bytes', 'split bytes currently awaiting free', 'no_clear,no_scale'),
+ RecStat('rec_split_stashed_objects', 'split objects currently awaiting free', 'no_clear,no_scale'),
##########################################
# Transaction statistics
##########################################
TxnStat('txn_begin', 'transaction begins'),
TxnStat('txn_checkpoint', 'transaction checkpoints'),
- TxnStat('txn_checkpoint_generation',
- 'transaction checkpoint generation', 'no_clear,no_scale'),
- TxnStat('txn_checkpoint_running',
- 'transaction checkpoint currently running', 'no_clear,no_scale'),
- TxnStat('txn_checkpoint_time_max',
- 'transaction checkpoint max time (msecs)', 'no_clear,no_scale'),
- TxnStat('txn_checkpoint_time_min',
- 'transaction checkpoint min time (msecs)', 'no_clear,no_scale'),
- TxnStat('txn_checkpoint_time_recent',
- 'transaction checkpoint most recent time (msecs)', 'no_clear,no_scale'),
- TxnStat('txn_checkpoint_time_total',
- 'transaction checkpoint total time (msecs)', 'no_clear,no_scale'),
+ TxnStat('txn_checkpoint_generation', 'transaction checkpoint generation', 'no_clear,no_scale'),
+ TxnStat('txn_checkpoint_running', 'transaction checkpoint currently running', 'no_clear,no_scale'),
+ TxnStat('txn_checkpoint_time_max', 'transaction checkpoint max time (msecs)', 'no_clear,no_scale'),
+ TxnStat('txn_checkpoint_time_min', 'transaction checkpoint min time (msecs)', 'no_clear,no_scale'),
+ TxnStat('txn_checkpoint_time_recent', 'transaction checkpoint most recent time (msecs)', 'no_clear,no_scale'),
+ TxnStat('txn_checkpoint_time_total', 'transaction checkpoint total time (msecs)', 'no_clear,no_scale'),
TxnStat('txn_commit', 'transactions committed'),
- TxnStat('txn_fail_cache',
- 'transaction failures due to cache overflow'),
- TxnStat('txn_pinned_checkpoint_range',
- 'transaction range of IDs currently pinned by a checkpoint',
- 'no_clear,no_scale'),
- TxnStat('txn_pinned_range',
- 'transaction range of IDs currently pinned', 'no_clear,no_scale'),
- TxnStat('txn_pinned_snapshot_range',
- 'transaction range of IDs currently pinned by named snapshots',
- 'no_clear,no_scale'),
+ TxnStat('txn_fail_cache', 'transaction failures due to cache overflow'),
+ TxnStat('txn_pinned_checkpoint_range', 'transaction range of IDs currently pinned by a checkpoint', 'no_clear,no_scale'),
+ TxnStat('txn_pinned_range', 'transaction range of IDs currently pinned', 'no_clear,no_scale'),
+ TxnStat('txn_pinned_snapshot_range', 'transaction range of IDs currently pinned by named snapshots', 'no_clear,no_scale'),
+ TxnStat('txn_rollback', 'transactions rolled back'),
TxnStat('txn_snapshots_created', 'number of named snapshots created'),
TxnStat('txn_snapshots_dropped', 'number of named snapshots dropped'),
- TxnStat('txn_rollback', 'transactions rolled back'),
TxnStat('txn_sync', 'transaction sync calls'),
##########################################
@@ -331,23 +276,18 @@ connection_stats = [
LSMStat('lsm_checkpoint_throttle', 'sleep for LSM checkpoint throttle'),
LSMStat('lsm_merge_throttle', 'sleep for LSM merge throttle'),
LSMStat('lsm_rows_merged', 'rows merged in an LSM tree'),
- LSMStat('lsm_work_queue_app',
- 'application work units currently queued', 'no_clear,no_scale'),
- LSMStat('lsm_work_queue_manager',
- 'merge work units currently queued', 'no_clear,no_scale'),
+ LSMStat('lsm_work_queue_app', 'application work units currently queued', 'no_clear,no_scale'),
+ LSMStat('lsm_work_queue_manager', 'merge work units currently queued', 'no_clear,no_scale'),
LSMStat('lsm_work_queue_max', 'tree queue hit maximum'),
- LSMStat('lsm_work_queue_switch',
- 'switch work units currently queued', 'no_clear,no_scale'),
+ LSMStat('lsm_work_queue_switch', 'switch work units currently queued', 'no_clear,no_scale'),
LSMStat('lsm_work_units_created', 'tree maintenance operations scheduled'),
- LSMStat('lsm_work_units_discarded',
- 'tree maintenance operations discarded'),
+ LSMStat('lsm_work_units_discarded', 'tree maintenance operations discarded'),
LSMStat('lsm_work_units_done', 'tree maintenance operations executed'),
##########################################
# Session operations
##########################################
- SessionStat('session_cursor_open',
- 'open cursor count', 'no_clear,no_scale'),
+ SessionStat('session_cursor_open', 'open cursor count', 'no_clear,no_scale'),
SessionStat('session_open', 'open session count', 'no_clear,no_scale'),
##########################################
@@ -385,8 +325,7 @@ dsrc_stats = [
# Session operations
##########################################
SessionStat('session_compact', 'object compaction'),
- SessionStat('session_cursor_open',
- 'open cursor count', 'no_clear,no_scale'),
+ SessionStat('session_cursor_open', 'open cursor count', 'no_clear,no_scale'),
##########################################
# Cursor operations
@@ -394,8 +333,7 @@ dsrc_stats = [
CursorStat('cursor_create', 'create calls'),
CursorStat('cursor_insert', 'insert calls'),
CursorStat('cursor_insert_bulk', 'bulk-loaded cursor-insert calls'),
- CursorStat('cursor_insert_bytes',
- 'cursor-insert key and value bytes inserted'),
+ CursorStat('cursor_insert_bytes', 'cursor-insert key and value bytes inserted'),
CursorStat('cursor_next', 'next calls'),
CursorStat('cursor_prev', 'prev calls'),
CursorStat('cursor_remove', 'remove calls'),
@@ -411,33 +349,21 @@ dsrc_stats = [
##########################################
# Btree statistics
##########################################
- BtreeStat('btree_checkpoint_generation',
- 'btree checkpoint generation', 'no_clear,no_scale'),
- BtreeStat('btree_column_deleted',
- 'column-store variable-size deleted values', 'no_scale'),
- BtreeStat('btree_column_fix',
- 'column-store fixed-size leaf pages', 'no_scale'),
- BtreeStat('btree_column_internal',
- 'column-store internal pages', 'no_scale'),
- BtreeStat('btree_column_rle',
- 'column-store variable-size RLE encoded values', 'no_scale'),
- BtreeStat('btree_column_variable',
- 'column-store variable-size leaf pages', 'no_scale'),
+ BtreeStat('btree_checkpoint_generation', 'btree checkpoint generation', 'no_clear,no_scale'),
+ BtreeStat('btree_column_deleted', 'column-store variable-size deleted values', 'no_scale'),
+ BtreeStat('btree_column_fix', 'column-store fixed-size leaf pages', 'no_scale'),
+ BtreeStat('btree_column_internal', 'column-store internal pages', 'no_scale'),
+ BtreeStat('btree_column_rle', 'column-store variable-size RLE encoded values', 'no_scale'),
+ BtreeStat('btree_column_variable', 'column-store variable-size leaf pages', 'no_scale'),
BtreeStat('btree_compact_rewrite', 'pages rewritten by compaction'),
BtreeStat('btree_entries', 'number of key/value pairs', 'no_scale'),
- BtreeStat('btree_fixed_len', 'fixed-record size', 'no_aggregate,no_scale'),
- BtreeStat('btree_maximum_depth',
- 'maximum tree depth', 'max_aggregate,no_scale'),
- BtreeStat('btree_maxintlkey',
- 'maximum internal page key size', 'max_aggregate,no_scale'),
- BtreeStat('btree_maxintlpage',
- 'maximum internal page size', 'max_aggregate,no_scale'),
- BtreeStat('btree_maxleafkey',
- 'maximum leaf page key size', 'max_aggregate,no_scale'),
- BtreeStat('btree_maxleafpage',
- 'maximum leaf page size', 'max_aggregate,no_scale'),
- BtreeStat('btree_maxleafvalue',
- 'maximum leaf page value size', 'max_aggregate,no_scale'),
+ BtreeStat('btree_fixed_len', 'fixed-record size', 'max_aggregate,no_scale'),
+ BtreeStat('btree_maximum_depth', 'maximum tree depth', 'max_aggregate,no_scale'),
+ BtreeStat('btree_maxintlkey', 'maximum internal page key size', 'max_aggregate,no_scale'),
+ BtreeStat('btree_maxintlpage', 'maximum internal page size', 'max_aggregate,no_scale'),
+ BtreeStat('btree_maxleafkey', 'maximum leaf page key size', 'max_aggregate,no_scale'),
+ BtreeStat('btree_maxleafpage', 'maximum leaf page size', 'max_aggregate,no_scale'),
+ BtreeStat('btree_maxleafvalue', 'maximum leaf page value size', 'max_aggregate,no_scale'),
BtreeStat('btree_overflow', 'overflow pages', 'no_scale'),
BtreeStat('btree_row_internal', 'row-store internal pages', 'no_scale'),
BtreeStat('btree_row_leaf', 'row-store leaf pages', 'no_scale'),
@@ -454,26 +380,21 @@ dsrc_stats = [
LSMStat('bloom_size', 'total size of bloom filters', 'no_scale'),
LSMStat('lsm_checkpoint_throttle', 'sleep for LSM checkpoint throttle'),
LSMStat('lsm_chunk_count', 'chunks in the LSM tree', 'no_scale'),
- LSMStat('lsm_generation_max',
- 'highest merge generation in the LSM tree', 'max_aggregate,no_scale'),
- LSMStat('lsm_lookup_no_bloom',
- 'queries that could have benefited ' +
- 'from a Bloom filter that did not exist'),
+ LSMStat('lsm_generation_max', 'highest merge generation in the LSM tree', 'max_aggregate,no_scale'),
+ LSMStat('lsm_lookup_no_bloom', 'queries that could have benefited from a Bloom filter that did not exist'),
LSMStat('lsm_merge_throttle', 'sleep for LSM merge throttle'),
##########################################
# Block manager statistics
##########################################
- BlockStat('allocation_size',
- 'file allocation unit size', 'no_aggregate,no_scale'),
+ BlockStat('allocation_size', 'file allocation unit size', 'max_aggregate,no_scale'),
BlockStat('block_alloc', 'blocks allocated'),
BlockStat('block_checkpoint_size', 'checkpoint size', 'no_scale'),
BlockStat('block_extension', 'allocations requiring file extension'),
BlockStat('block_free', 'blocks freed'),
- BlockStat('block_magic', 'file magic number', 'no_aggregate,no_scale'),
- BlockStat('block_major',
- 'file major version number', 'no_aggregate,no_scale'),
- BlockStat('block_minor', 'minor version number', 'no_aggregate,no_scale'),
+ BlockStat('block_magic', 'file magic number', 'max_aggregate,no_scale'),
+ BlockStat('block_major', 'file major version number', 'max_aggregate,no_scale'),
+ BlockStat('block_minor', 'minor version number', 'max_aggregate,no_scale'),
BlockStat('block_reuse_bytes', 'file bytes available for reuse'),
BlockStat('block_size', 'file size in bytes', 'no_scale'),
@@ -484,44 +405,33 @@ dsrc_stats = [
CacheStat('cache_bytes_write', 'bytes written from cache'),
CacheStat('cache_eviction_checkpoint', 'checkpoint blocked page eviction'),
CacheStat('cache_eviction_clean', 'unmodified pages evicted'),
- CacheStat('cache_eviction_deepen',
- 'page split during eviction deepened the tree'),
+ CacheStat('cache_eviction_deepen', 'page split during eviction deepened the tree'),
CacheStat('cache_eviction_dirty', 'modified pages evicted'),
- CacheStat('cache_eviction_fail',
- 'data source pages selected for eviction unable to be evicted'),
+ CacheStat('cache_eviction_fail', 'data source pages selected for eviction unable to be evicted'),
CacheStat('cache_eviction_hazard', 'hazard pointer blocked page eviction'),
CacheStat('cache_eviction_internal', 'internal pages evicted'),
- CacheStat('cache_eviction_split_internal',
- 'internal pages split during eviction'),
+ CacheStat('cache_eviction_split_internal', 'internal pages split during eviction'),
CacheStat('cache_eviction_split_leaf', 'leaf pages split during eviction'),
CacheStat('cache_inmem_split', 'in-memory page splits'),
- CacheStat('cache_inmem_splittable',
- 'in-memory page passed criteria to be split'),
- CacheStat('cache_overflow_value',
- 'overflow values cached in memory', 'no_scale'),
+ CacheStat('cache_inmem_splittable', 'in-memory page passed criteria to be split'),
+ CacheStat('cache_overflow_value', 'overflow values cached in memory', 'no_scale'),
CacheStat('cache_read', 'pages read into cache'),
- CacheStat('cache_read_lookaside',
- 'pages read into cache requiring lookaside entries'),
+ CacheStat('cache_read_lookaside', 'pages read into cache requiring lookaside entries'),
CacheStat('cache_read_overflow', 'overflow pages read into cache'),
CacheStat('cache_write', 'pages written from cache'),
- CacheStat('cache_write_lookaside',
- 'page written requiring lookaside records'),
- CacheStat('cache_write_restore',
- 'pages written requiring in-memory restoration'),
+ CacheStat('cache_write_lookaside', 'page written requiring lookaside records'),
+ CacheStat('cache_write_restore', 'pages written requiring in-memory restoration'),
##########################################
# Compression statistics
##########################################
- CompressStat('compress_raw_fail',
- 'raw compression call failed, no additional data available'),
- CompressStat('compress_raw_fail_temporary',
- 'raw compression call failed, additional data available'),
+ CompressStat('compress_raw_fail', 'raw compression call failed, no additional data available'),
+ CompressStat('compress_raw_fail_temporary', 'raw compression call failed, additional data available'),
CompressStat('compress_raw_ok', 'raw compression call succeeded'),
CompressStat('compress_read', 'compressed pages read'),
CompressStat('compress_write', 'compressed pages written'),
CompressStat('compress_write_fail', 'page written failed to compress'),
- CompressStat('compress_write_too_small',
- 'page written was too small to compress'),
+ CompressStat('compress_write_too_small', 'page written was too small to compress'),
##########################################
# Reconciliation statistics
@@ -529,8 +439,7 @@ dsrc_stats = [
RecStat('rec_dictionary', 'dictionary matches'),
RecStat('rec_multiblock_internal', 'internal page multi-block writes'),
RecStat('rec_multiblock_leaf', 'leaf page multi-block writes'),
- RecStat('rec_multiblock_max',
- 'maximum blocks required for a page', 'max_aggregate,no_scale'),
+ RecStat('rec_multiblock_max', 'maximum blocks required for a page', 'max_aggregate,no_scale'),
RecStat('rec_overflow_key_internal', 'internal-page overflow keys'),
RecStat('rec_overflow_key_leaf', 'leaf-page overflow keys'),
RecStat('rec_overflow_value', 'overflow values written'),
@@ -539,10 +448,8 @@ dsrc_stats = [
RecStat('rec_page_match', 'page checksum matches'),
RecStat('rec_pages', 'page reconciliation calls'),
RecStat('rec_pages_eviction', 'page reconciliation calls for eviction'),
- RecStat('rec_prefix_compression',
- 'leaf page key bytes discarded using prefix compression'),
- RecStat('rec_suffix_compression',
- 'internal page key bytes discarded using suffix compression'),
+ RecStat('rec_prefix_compression', 'leaf page key bytes discarded using prefix compression'),
+ RecStat('rec_suffix_compression', 'internal page key bytes discarded using suffix compression'),
##########################################
# Transaction statistics
diff --git a/examples/c/ex_access.c b/examples/c/ex_access.c
index 58861267408..cc42982617b 100644
--- a/examples/c/ex_access.c
+++ b/examples/c/ex_access.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c
index 213e058d4cc..f7ee857a7c7 100644
--- a/examples/c/ex_all.c
+++ b/examples/c/ex_all.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -673,6 +673,10 @@ session_ops(WT_SESSION *session)
ret = session->compact(session, "table:mytable", NULL);
/*! [Compact a table] */
+ /*! [Rebalance a table] */
+ ret = session->rebalance(session, "table:mytable", NULL);
+ /*! [Rebalance a table] */
+
/*! [Rename a table] */
ret = session->rename(session, "table:old", "table:new", NULL);
/*! [Rename a table] */
diff --git a/examples/c/ex_async.c b/examples/c/ex_async.c
index f40e0ea4c5a..584c3e54b87 100644
--- a/examples/c/ex_async.c
+++ b/examples/c/ex_async.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_backup.c b/examples/c/ex_backup.c
index 743cd7b9cf1..12eeaa4b7c3 100644
--- a/examples/c/ex_backup.c
+++ b/examples/c/ex_backup.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_call_center.c b/examples/c/ex_call_center.c
index 37f5e3a4547..d401507d165 100644
--- a/examples/c/ex_call_center.c
+++ b/examples/c/ex_call_center.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_config.c b/examples/c/ex_config.c
index 0086621fccf..2ac8198176c 100644
--- a/examples/c/ex_config.c
+++ b/examples/c/ex_config.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_config_parse.c b/examples/c/ex_config_parse.c
index 77e5bb48607..124eff21130 100644
--- a/examples/c/ex_config_parse.c
+++ b/examples/c/ex_config_parse.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_cursor.c b/examples/c/ex_cursor.c
index 35597ca7b8e..67c945ebc0b 100644
--- a/examples/c/ex_cursor.c
+++ b/examples/c/ex_cursor.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_data_source.c b/examples/c/ex_data_source.c
index 3cd44257d39..dd2b835e6ae 100644
--- a/examples/c/ex_data_source.c
+++ b/examples/c/ex_data_source.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -439,7 +439,7 @@ my_open_cursor(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
{
/*! [WT_EXTENSION metadata search] */
/*
- * Insert a new WiredTiger metadata record.
+ * Search for a WiredTiger metadata record.
*/
const char *key = "datasource_uri";
char *value;
diff --git a/examples/c/ex_encrypt.c b/examples/c/ex_encrypt.c
index 108faeb20b1..425ee6b7287 100644
--- a/examples/c/ex_encrypt.c
+++ b/examples/c/ex_encrypt.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_extending.c b/examples/c/ex_extending.c
index 9237c06e153..4d265ae1d2b 100644
--- a/examples/c/ex_extending.c
+++ b/examples/c/ex_extending.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_extractor.c b/examples/c/ex_extractor.c
index 68906bcc743..fff9c79f8e0 100644
--- a/examples/c/ex_extractor.c
+++ b/examples/c/ex_extractor.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_hello.c b/examples/c/ex_hello.c
index f1a684c7518..345e434741f 100644
--- a/examples/c/ex_hello.c
+++ b/examples/c/ex_hello.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_log.c b/examples/c/ex_log.c
index d5a8f32487d..cc6a3c46b93 100644
--- a/examples/c/ex_log.c
+++ b/examples/c/ex_log.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_pack.c b/examples/c/ex_pack.c
index e2b0b1ad066..43b57880674 100644
--- a/examples/c/ex_pack.c
+++ b/examples/c/ex_pack.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_process.c b/examples/c/ex_process.c
index a601395bb9c..19f395dddaf 100644
--- a/examples/c/ex_process.c
+++ b/examples/c/ex_process.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_schema.c b/examples/c/ex_schema.c
index dabb568129e..fdf02d12302 100644
--- a/examples/c/ex_schema.c
+++ b/examples/c/ex_schema.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_scope.c b/examples/c/ex_scope.c
index 4e9b32d0a18..93878ec7e3d 100644
--- a/examples/c/ex_scope.c
+++ b/examples/c/ex_scope.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_stat.c b/examples/c/ex_stat.c
index 4d27e2dd535..65402230eb8 100644
--- a/examples/c/ex_stat.c
+++ b/examples/c/ex_stat.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_sync.c b/examples/c/ex_sync.c
index 2e08d141b41..8c3a6463a82 100644
--- a/examples/c/ex_sync.c
+++ b/examples/c/ex_sync.c
@@ -1,5 +1,5 @@
/*
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/c/ex_thread.c b/examples/c/ex_thread.c
index 7980b6ed308..a72211b6243 100644
--- a/examples/c/ex_thread.c
+++ b/examples/c/ex_thread.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_access.java b/examples/java/com/wiredtiger/examples/ex_access.java
index 3c10efd5662..104f86d5545 100644
--- a/examples/java/com/wiredtiger/examples/ex_access.java
+++ b/examples/java/com/wiredtiger/examples/ex_access.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_all.java b/examples/java/com/wiredtiger/examples/ex_all.java
index 7cef12a1873..153f12d3e27 100644
--- a/examples/java/com/wiredtiger/examples/ex_all.java
+++ b/examples/java/com/wiredtiger/examples/ex_all.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_async.java b/examples/java/com/wiredtiger/examples/ex_async.java
index a822b5b8ea9..2e890095b2d 100644
--- a/examples/java/com/wiredtiger/examples/ex_async.java
+++ b/examples/java/com/wiredtiger/examples/ex_async.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_call_center.java b/examples/java/com/wiredtiger/examples/ex_call_center.java
index c0fc018952e..a3f0f56ded8 100644
--- a/examples/java/com/wiredtiger/examples/ex_call_center.java
+++ b/examples/java/com/wiredtiger/examples/ex_call_center.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_cursor.java b/examples/java/com/wiredtiger/examples/ex_cursor.java
index 38af04d5849..a0a6e48aa46 100644
--- a/examples/java/com/wiredtiger/examples/ex_cursor.java
+++ b/examples/java/com/wiredtiger/examples/ex_cursor.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_log.java b/examples/java/com/wiredtiger/examples/ex_log.java
index 4a721d2a275..03eab6b38b1 100644
--- a/examples/java/com/wiredtiger/examples/ex_log.java
+++ b/examples/java/com/wiredtiger/examples/ex_log.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_schema.java b/examples/java/com/wiredtiger/examples/ex_schema.java
index ba15db62a14..be1077ee2df 100644
--- a/examples/java/com/wiredtiger/examples/ex_schema.java
+++ b/examples/java/com/wiredtiger/examples/ex_schema.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_stat.java b/examples/java/com/wiredtiger/examples/ex_stat.java
index 2e932e1027f..b0b83a2d3b2 100644
--- a/examples/java/com/wiredtiger/examples/ex_stat.java
+++ b/examples/java/com/wiredtiger/examples/ex_stat.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/java/com/wiredtiger/examples/ex_thread.java b/examples/java/com/wiredtiger/examples/ex_thread.java
index 59ab9c40b34..402daebbd61 100644
--- a/examples/java/com/wiredtiger/examples/ex_thread.java
+++ b/examples/java/com/wiredtiger/examples/ex_thread.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/examples/python/ex_access.py b/examples/python/ex_access.py
index 2940ac63625..aa99c1f6547 100755
--- a/examples/python/ex_access.py
+++ b/examples/python/ex_access.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/examples/python/ex_stat.py b/examples/python/ex_stat.py
index af2c4f7a1a7..10f1d6d597c 100755
--- a/examples/python/ex_stat.py
+++ b/examples/python/ex_stat.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/ext/collators/reverse/reverse_collator.c b/ext/collators/reverse/reverse_collator.c
index 336519fe661..7e205f98193 100644
--- a/ext/collators/reverse/reverse_collator.c
+++ b/ext/collators/reverse/reverse_collator.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/bzip2/bzip2_compress.c b/ext/compressors/bzip2/bzip2_compress.c
index ab96ebc5df2..845107c609f 100644
--- a/ext/compressors/bzip2/bzip2_compress.c
+++ b/ext/compressors/bzip2/bzip2_compress.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/lz4/lz4_compress.c b/ext/compressors/lz4/lz4_compress.c
index 125aaa11db3..d070dc3fb79 100644
--- a/ext/compressors/lz4/lz4_compress.c
+++ b/ext/compressors/lz4/lz4_compress.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/nop/nop_compress.c b/ext/compressors/nop/nop_compress.c
index ce6964be85d..e54013ae8b0 100644
--- a/ext/compressors/nop/nop_compress.c
+++ b/ext/compressors/nop/nop_compress.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/snappy/snappy_compress.c b/ext/compressors/snappy/snappy_compress.c
index 286637f91c3..b5a347fce81 100644
--- a/ext/compressors/snappy/snappy_compress.c
+++ b/ext/compressors/snappy/snappy_compress.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/compressors/zlib/zlib_compress.c b/ext/compressors/zlib/zlib_compress.c
index e5a313627a5..4ff0d8576eb 100644
--- a/ext/compressors/zlib/zlib_compress.c
+++ b/ext/compressors/zlib/zlib_compress.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/datasources/helium/helium.c b/ext/datasources/helium/helium.c
index 208f54f75d8..0350f9a2752 100644
--- a/ext/datasources/helium/helium.c
+++ b/ext/datasources/helium/helium.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/encryptors/nop/nop_encrypt.c b/ext/encryptors/nop/nop_encrypt.c
index e3f693ad37d..eac7d8f4632 100644
--- a/ext/encryptors/nop/nop_encrypt.c
+++ b/ext/encryptors/nop/nop_encrypt.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/encryptors/rotn/rotn_encrypt.c b/ext/encryptors/rotn/rotn_encrypt.c
index 5b29e66c503..9a92ae7b642 100644
--- a/ext/encryptors/rotn/rotn_encrypt.c
+++ b/ext/encryptors/rotn/rotn_encrypt.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/extractors/csv/csv_extractor.c b/ext/extractors/csv/csv_extractor.c
index a13f7a79b1f..698a9d6fa96 100644
--- a/ext/extractors/csv/csv_extractor.c
+++ b/ext/extractors/csv/csv_extractor.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/ext/test/kvs_bdb/kvs_bdb.c b/ext/test/kvs_bdb/kvs_bdb.c
index 76dccb89bf2..05c522ff41f 100644
--- a/ext/test/kvs_bdb/kvs_bdb.c
+++ b/ext/test/kvs_bdb/kvs_bdb.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/Makefile.am b/lang/java/Makefile.am
index b9871cf2599..192e44a05d2 100644
--- a/lang/java/Makefile.am
+++ b/lang/java/Makefile.am
@@ -45,6 +45,7 @@ JAVA_JUNIT = \
$(JAVATEST)/AutoCloseTest.java \
$(JAVATEST)/AsyncTest.java \
$(JAVATEST)/BackupCursorTest.java \
+ $(JAVATEST)/ConfigTest.java \
$(JAVATEST)/CursorTest.java \
$(JAVATEST)/CursorTest02.java \
$(JAVATEST)/ExceptionTest.java \
diff --git a/lang/java/java_doc.i b/lang/java/java_doc.i
index 17317ab875b..450cb1d5ab2 100644
--- a/lang/java/java_doc.i
+++ b/lang/java/java_doc.i
@@ -36,6 +36,7 @@ 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, rebalance)
COPYDOC(__wt_session, WT_SESSION, rename)
COPYDOC(__wt_session, WT_SESSION, reset)
COPYDOC(__wt_session, WT_SESSION, salvage)
diff --git a/lang/java/src/com/wiredtiger/db/AsyncCallback.java b/lang/java/src/com/wiredtiger/db/AsyncCallback.java
index c3640c1a47d..ff428fae4fd 100644
--- a/lang/java/src/com/wiredtiger/db/AsyncCallback.java
+++ b/lang/java/src/com/wiredtiger/db/AsyncCallback.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java b/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
index 0d0ce42d375..02639bfe77a 100644
--- a/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
+++ b/lang/java/src/com/wiredtiger/db/PackFormatInputStream.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/PackInputStream.java b/lang/java/src/com/wiredtiger/db/PackInputStream.java
index 77eb19d1de1..f265d041d94 100644
--- a/lang/java/src/com/wiredtiger/db/PackInputStream.java
+++ b/lang/java/src/com/wiredtiger/db/PackInputStream.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/PackOutputStream.java b/lang/java/src/com/wiredtiger/db/PackOutputStream.java
index cc8b93e3457..805e34f6ca8 100644
--- a/lang/java/src/com/wiredtiger/db/PackOutputStream.java
+++ b/lang/java/src/com/wiredtiger/db/PackOutputStream.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -206,14 +206,11 @@ public class PackOutputStream {
} else {
stringLen = value.length();
}
- if (havesize) {
+ if (havesize || fieldFormat == 's') {
size = format.getLengthFromFormat(true);
if (stringLen > size) {
stringLen = size;
}
- } else if (fieldFormat == 's') {
- havesize = true;
- size = 1;
}
if (fieldFormat == 'S' && !havesize) {
diff --git a/lang/java/src/com/wiredtiger/db/PackUtil.java b/lang/java/src/com/wiredtiger/db/PackUtil.java
index bfc13d9a586..d47119eaf30 100644
--- a/lang/java/src/com/wiredtiger/db/PackUtil.java
+++ b/lang/java/src/com/wiredtiger/db/PackUtil.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerException.java b/lang/java/src/com/wiredtiger/db/WiredTigerException.java
index 69ce031b6ef..13481efd9e4 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerException.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java b/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
index 2af1c5ccc9f..7dd1cfc24be 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerPackingException.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java b/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
index 8535af5d316..8c0e08a77fb 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerPanicException.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java b/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
index 2f620d95da3..47d079c139d 100644
--- a/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
+++ b/lang/java/src/com/wiredtiger/db/WiredTigerRollbackException.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/java/wiredtiger.i b/lang/java/wiredtiger.i
index 1326b9ebb90..ce013a1939c 100644
--- a/lang/java/wiredtiger.i
+++ b/lang/java/wiredtiger.i
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/python/setup.py b/lang/python/setup.py
index 9eb57d55b5c..cf5b0c5cab1 100644
--- a/lang/python/setup.py
+++ b/lang/python/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i
index 3f297ca25a0..7bc84066d64 100644
--- a/lang/python/wiredtiger.i
+++ b/lang/python/wiredtiger.i
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/lang/python/wiredtiger/fpacking.py b/lang/python/wiredtiger/fpacking.py
index 62d7af739b8..cc009a29764 100644
--- a/lang/python/wiredtiger/fpacking.py
+++ b/lang/python/wiredtiger/fpacking.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/lang/python/wiredtiger/intpacking.py b/lang/python/wiredtiger/intpacking.py
index fe2e93f3dca..023c25ab5b3 100644
--- a/lang/python/wiredtiger/intpacking.py
+++ b/lang/python/wiredtiger/intpacking.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/lang/python/wiredtiger/packing.py b/lang/python/wiredtiger/packing.py
index b0e055490b0..5d21b539888 100644
--- a/lang/python/wiredtiger/packing.py
+++ b/lang/python/wiredtiger/packing.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -70,6 +70,8 @@ def __unpack_iter_fmt(fmt):
size = (size * 10) + int(char)
havesize = 1
else:
+ if not havesize:
+ size = 1
yield offset, havesize, size, char
size = 0
havesize = 0
@@ -83,14 +85,12 @@ def unpack(fmt, s):
result = []
for offset, havesize, size, f in __unpack_iter_fmt(fmt):
if f == 'x':
- if not havesize:
- size = 1
s = s[size:]
# Note: no value, don't increment i
elif f in 'SsUu':
if not havesize:
if f == 's':
- size = 1
+ pass
elif f == 'S':
size = s.find('\0')
elif f == 'u' and offset == len(fmt) - 1:
@@ -106,14 +106,10 @@ def unpack(fmt, s):
s = s[size:]
elif f in 't':
# bit type, size is number of bits
- if not havesize:
- size = 1
result.append(ord(s[0:1]))
s = s[1:]
elif f in 'Bb':
# byte type
- if not havesize:
- size = 1
for i in xrange(size):
v = ord(s[0:1])
if f != 'B':
@@ -122,8 +118,6 @@ def unpack(fmt, s):
s = s[1:]
else:
# integral type
- if not havesize:
- size = 1
for j in xrange(size):
v, s = unpack_int(s)
result.append(v)
@@ -164,11 +158,9 @@ def pack(fmt, *values):
l = val.find('\0')
else:
l = len(val)
- if havesize:
+ if havesize or f == 's':
if l > size:
l = size
- elif f == 's':
- havesize = size = 1
elif (f == 'u' and offset != len(fmt) - 1) or f == 'U':
result += pack_int(l)
if type(val) is unicode and f in 'Ss':
diff --git a/src/async/async_api.c b/src/async/async_api.c
index dc26f2d11c3..fea8714176b 100644
--- a/src/async/async_api.c
+++ b/src/async/async_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/async/async_op.c b/src/async/async_op.c
index 7661a4383d6..130c704757b 100644
--- a/src/async/async_op.c
+++ b/src/async/async_op.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/async/async_worker.c b/src/async/async_worker.c
index 6a5ec5feeb0..e692bc619a9 100644
--- a/src/async/async_worker.c
+++ b/src/async/async_worker.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_addr.c b/src/block/block_addr.c
index 6d50e5f0f4e..b1f2fd9454a 100644
--- a/src/block/block_addr.c
+++ b/src/block/block_addr.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -14,7 +14,7 @@
* caller's buffer reference so it can be called repeatedly to load a buffer.
*/
static int
-__block_buffer_to_addr(WT_BLOCK *block,
+__block_buffer_to_addr(uint32_t allocsize,
const uint8_t **pp, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump)
{
uint64_t o, s, c;
@@ -39,8 +39,8 @@ __block_buffer_to_addr(WT_BLOCK *block,
*offsetp = 0;
*sizep = *cksump = 0;
} else {
- *offsetp = (wt_off_t)(o + 1) * block->allocsize;
- *sizep = (uint32_t)s * block->allocsize;
+ *offsetp = (wt_off_t)(o + 1) * allocsize;
+ *sizep = (uint32_t)s * allocsize;
*cksump = (uint32_t)c;
}
return (0);
@@ -80,7 +80,8 @@ int
__wt_block_buffer_to_addr(WT_BLOCK *block,
const uint8_t *p, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump)
{
- return (__block_buffer_to_addr(block, &p, offsetp, sizep, cksump));
+ return (__block_buffer_to_addr(
+ block->allocsize, &p, offsetp, sizep, cksump));
}
/*
@@ -139,12 +140,12 @@ __wt_block_addr_string(WT_SESSION_IMPL *session,
}
/*
- * __wt_block_buffer_to_ckpt --
+ * __block_buffer_to_ckpt --
* Convert a checkpoint cookie into its components.
*/
-int
-__wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session,
- WT_BLOCK *block, const uint8_t *p, WT_BLOCK_CKPT *ci)
+static int
+__block_buffer_to_ckpt(WT_SESSION_IMPL *session,
+ uint32_t allocsize, const uint8_t *p, WT_BLOCK_CKPT *ci)
{
uint64_t a;
const uint8_t **pp;
@@ -154,13 +155,13 @@ __wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session,
WT_RET_MSG(session, WT_ERROR, "unsupported checkpoint version");
pp = &p;
- WT_RET(__block_buffer_to_addr(block, pp,
+ WT_RET(__block_buffer_to_addr(allocsize, pp,
&ci->root_offset, &ci->root_size, &ci->root_cksum));
- WT_RET(__block_buffer_to_addr(block, pp,
+ WT_RET(__block_buffer_to_addr(allocsize, pp,
&ci->alloc.offset, &ci->alloc.size, &ci->alloc.cksum));
- WT_RET(__block_buffer_to_addr(block, pp,
+ WT_RET(__block_buffer_to_addr(allocsize, pp,
&ci->avail.offset, &ci->avail.size, &ci->avail.cksum));
- WT_RET(__block_buffer_to_addr(block, pp,
+ WT_RET(__block_buffer_to_addr(allocsize, pp,
&ci->discard.offset, &ci->discard.size, &ci->discard.cksum));
WT_RET(__wt_vunpack_uint(pp, 0, &a));
ci->file_size = (wt_off_t)a;
@@ -171,6 +172,32 @@ __wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session,
}
/*
+ * __wt_block_buffer_to_ckpt --
+ * Convert a checkpoint cookie into its components, block manager version.
+ */
+int
+__wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session,
+ WT_BLOCK *block, const uint8_t *p, WT_BLOCK_CKPT *ci)
+{
+ return (__block_buffer_to_ckpt(session, block->allocsize, p, ci));
+}
+
+/*
+ * __wt_block_ckpt_decode --
+ * Convert a checkpoint cookie into its components, external utility
+ * version.
+ */
+int
+__wt_block_ckpt_decode(WT_SESSION *wt_session,
+ size_t allocsize, const uint8_t *p, WT_BLOCK_CKPT *ci)
+{
+ WT_SESSION_IMPL *session;
+
+ session = (WT_SESSION_IMPL *)wt_session;
+ return (__block_buffer_to_ckpt(session, (uint32_t)allocsize, p, ci));
+}
+
+/*
* __wt_block_ckpt_to_buffer --
* Convert the components into its checkpoint cookie.
*/
diff --git a/src/block/block_ckpt.c b/src/block/block_ckpt.c
index adbcf0e3fdc..03059c8f23a 100644
--- a/src/block/block_ckpt.c
+++ b/src/block/block_ckpt.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_compact.c b/src/block/block_compact.c
index d45d0a96da7..8c9be4f029c 100644
--- a/src/block/block_compact.c
+++ b/src/block/block_compact.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -8,7 +8,7 @@
#include "wt_internal.h"
-static int __block_dump_avail(WT_SESSION_IMPL *, WT_BLOCK *);
+static int __block_dump_avail(WT_SESSION_IMPL *, WT_BLOCK *, bool);
/*
* __wt_block_compact_start --
@@ -22,8 +22,6 @@ __wt_block_compact_start(WT_SESSION_IMPL *session, WT_BLOCK *block)
/* Switch to first-fit allocation. */
__wt_block_configure_first_fit(block, true);
- block->compact_pct_tenths = 0;
-
return (0);
}
@@ -34,14 +32,21 @@ __wt_block_compact_start(WT_SESSION_IMPL *session, WT_BLOCK *block)
int
__wt_block_compact_end(WT_SESSION_IMPL *session, WT_BLOCK *block)
{
+ WT_DECL_RET;
+
WT_UNUSED(session);
/* Restore the original allocation plan. */
__wt_block_configure_first_fit(block, false);
- block->compact_pct_tenths = 0;
+ /* Dump the results of the compaction pass. */
+ if (WT_VERBOSE_ISSET(session, WT_VERB_COMPACT)) {
+ __wt_spin_lock(session, &block->live_lock);
+ ret = __block_dump_avail(session, block, false);
+ __wt_spin_unlock(session, &block->live_lock);
+ }
- return (0);
+ return (ret);
}
/*
@@ -70,12 +75,23 @@ __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp)
if (fh->size <= WT_MEGABYTE)
return (0);
+ /*
+ * Reset the compaction state information. This is done here, not in the
+ * compaction "start" routine, because this function is called first to
+ * determine if compaction is useful.
+ */
+ block->compact_pct_tenths = 0;
+ block->compact_pages_reviewed = 0;
+ block->compact_pages_skipped = 0;
+ block->compact_pages_written = 0;
+
__wt_spin_lock(session, &block->live_lock);
+ /* Dump the current state of the file. */
if (WT_VERBOSE_ISSET(session, WT_VERB_COMPACT))
- WT_ERR(__block_dump_avail(session, block));
+ WT_ERR(__block_dump_avail(session, block, true));
- /* Sum the available bytes in the first 80% and 90% of the file. */
+ /* Sum the available bytes in the initial 80% and 90% of the file. */
avail_eighty = avail_ninety = 0;
ninety = fh->size - fh->size / 10;
eighty = fh->size - ((fh->size / 10) * 2);
@@ -88,23 +104,6 @@ __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp)
avail_eighty += ext->size;
}
- WT_ERR(__wt_verbose(session, WT_VERB_COMPACT,
- "%s: %" PRIuMAX "MB (%" PRIuMAX ") available space in the first "
- "80%% of the file",
- block->name,
- (uintmax_t)avail_eighty / WT_MEGABYTE, (uintmax_t)avail_eighty));
- WT_ERR(__wt_verbose(session, WT_VERB_COMPACT,
- "%s: %" PRIuMAX "MB (%" PRIuMAX ") available space in the first "
- "90%% of the file",
- block->name,
- (uintmax_t)avail_ninety / WT_MEGABYTE, (uintmax_t)avail_ninety));
- WT_ERR(__wt_verbose(session, WT_VERB_COMPACT,
- "%s: require 10%% or %" PRIuMAX "MB (%" PRIuMAX ") in the first "
- "90%% of the file to perform compaction, compaction %s",
- block->name,
- (uintmax_t)(fh->size / 10) / WT_MEGABYTE, (uintmax_t)fh->size / 10,
- *skipp ? "skipped" : "proceeding"));
-
/*
* Skip files where we can't recover at least 1MB.
*
@@ -127,6 +126,23 @@ __wt_block_compact_skip(WT_SESSION_IMPL *session, WT_BLOCK *block, bool *skipp)
block->compact_pct_tenths = 1;
}
+ WT_ERR(__wt_verbose(session, WT_VERB_COMPACT,
+ "%s: %" PRIuMAX "MB (%" PRIuMAX ") available space in the first "
+ "80%% of the file",
+ block->name,
+ (uintmax_t)avail_eighty / WT_MEGABYTE, (uintmax_t)avail_eighty));
+ WT_ERR(__wt_verbose(session, WT_VERB_COMPACT,
+ "%s: %" PRIuMAX "MB (%" PRIuMAX ") available space in the first "
+ "90%% of the file",
+ block->name,
+ (uintmax_t)avail_ninety / WT_MEGABYTE, (uintmax_t)avail_ninety));
+ WT_ERR(__wt_verbose(session, WT_VERB_COMPACT,
+ "%s: require 10%% or %" PRIuMAX "MB (%" PRIuMAX ") in the first "
+ "90%% of the file to perform compaction, compaction %s",
+ block->name,
+ (uintmax_t)(fh->size / 10) / WT_MEGABYTE, (uintmax_t)fh->size / 10,
+ *skipp ? "skipped" : "proceeding"));
+
err: __wt_spin_unlock(session, &block->live_lock);
return (ret);
@@ -177,6 +193,14 @@ __wt_block_compact_page_skip(WT_SESSION_IMPL *session,
}
__wt_spin_unlock(session, &block->live_lock);
+ if (WT_VERBOSE_ISSET(session, WT_VERB_COMPACT)) {
+ ++block->compact_pages_reviewed;
+ if (*skipp)
+ ++block->compact_pages_skipped;
+ else
+ ++block->compact_pages_written;
+ }
+
return (ret);
}
@@ -185,7 +209,7 @@ __wt_block_compact_page_skip(WT_SESSION_IMPL *session,
* Dump out the avail list so we can see what compaction will look like.
*/
static int
-__block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block)
+__block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block, bool start)
{
WT_EXTLIST *el;
WT_EXT *ext;
@@ -196,6 +220,20 @@ __block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block)
size = block->fh->size;
WT_RET(__wt_verbose(session, WT_VERB_COMPACT,
+ "============ %s",
+ start ? "testing for compaction" : "ending compaction pass"));
+
+ if (!start) {
+ WT_RET(__wt_verbose(session, WT_VERB_COMPACT,
+ "pages reviewed: %" PRIuMAX,
+ block->compact_pages_reviewed));
+ WT_RET(__wt_verbose(session, WT_VERB_COMPACT,
+ "pages skipped: %" PRIuMAX, block->compact_pages_skipped));
+ WT_RET(__wt_verbose(session, WT_VERB_COMPACT,
+ "pages written: %" PRIuMAX, block->compact_pages_written));
+ }
+
+ WT_RET(__wt_verbose(session, WT_VERB_COMPACT,
"file size %" PRIuMAX "MB (%" PRIuMAX ") with %" PRIuMAX
"%% space available %" PRIuMAX "MB (%" PRIuMAX ")",
(uintmax_t)size / WT_MEGABYTE, (uintmax_t)size,
@@ -219,6 +257,10 @@ __block_dump_avail(WT_SESSION_IMPL *session, WT_BLOCK *block)
}
#ifdef __VERBOSE_OUTPUT_PERCENTILE
+ /*
+ * The verbose output always displays 10% buckets, running this code
+ * as well also displays 1% buckets.
+ */
for (i = 0; i < WT_ELEMENTS(percentile); ++i) {
v = percentile[i] * 512;
WT_RET(__wt_verbose(session, WT_VERB_COMPACT,
diff --git a/src/block/block_ext.c b/src/block/block_ext.c
index a56df220390..ab5d5604087 100644
--- a/src/block/block_ext.c
+++ b/src/block/block_ext.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_map.c b/src/block/block_map.c
index 6dc270760d6..3d04a492269 100644
--- a/src/block/block_map.c
+++ b/src/block/block_map.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_mgr.c b/src/block/block_mgr.c
index 7260cab75d9..6e2dc775362 100644
--- a/src/block/block_mgr.c
+++ b/src/block/block_mgr.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -221,6 +221,18 @@ __bm_free(WT_BM *bm,
}
/*
+ * __bm_is_mapped --
+ * Return if the file is mapped into memory.
+ */
+static bool
+__bm_is_mapped(WT_BM *bm, WT_SESSION_IMPL *session)
+{
+ WT_UNUSED(session);
+
+ return (bm->map == NULL ? false : true);
+}
+
+/*
* __bm_stat --
* Block-manager statistics.
*/
@@ -357,6 +369,7 @@ __bm_method_set(WT_BM *bm, bool readonly)
(int (*)(WT_BM *, WT_SESSION_IMPL *))__bm_readonly;
bm->free = (int (*)(WT_BM *,
WT_SESSION_IMPL *, const uint8_t *, size_t))__bm_readonly;
+ bm->is_mapped = __bm_is_mapped;
bm->preload = __wt_bm_preload;
bm->read = __wt_bm_read;
bm->salvage_end = (int (*)
@@ -367,6 +380,7 @@ __bm_method_set(WT_BM *bm, bool readonly)
(WT_BM *, WT_SESSION_IMPL *))__bm_readonly;
bm->salvage_valid = (int (*)(WT_BM *,
WT_SESSION_IMPL *, uint8_t *, size_t, bool))__bm_readonly;
+ bm->size = __wt_block_manager_size;
bm->stat = __bm_stat;
bm->sync =
(int (*)(WT_BM *, WT_SESSION_IMPL *, bool))__bm_readonly;
@@ -391,12 +405,14 @@ __bm_method_set(WT_BM *bm, bool readonly)
bm->compact_skip = __bm_compact_skip;
bm->compact_start = __bm_compact_start;
bm->free = __bm_free;
+ bm->is_mapped = __bm_is_mapped;
bm->preload = __wt_bm_preload;
bm->read = __wt_bm_read;
bm->salvage_end = __bm_salvage_end;
bm->salvage_next = __bm_salvage_next;
bm->salvage_start = __bm_salvage_start;
bm->salvage_valid = __bm_salvage_valid;
+ bm->size = __wt_block_manager_size;
bm->stat = __bm_stat;
bm->sync = __bm_sync;
bm->verify_addr = __bm_verify_addr;
diff --git a/src/block/block_open.c b/src/block/block_open.c
index 7cf12d36066..dd0f3f0716a 100644
--- a/src/block/block_open.c
+++ b/src/block/block_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -11,36 +11,13 @@
static int __desc_read(WT_SESSION_IMPL *, WT_BLOCK *);
/*
- * __wt_block_manager_truncate --
- * Truncate a file.
+ * __wt_block_manager_drop --
+ * Drop a file.
*/
int
-__wt_block_manager_truncate(
- WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize)
+__wt_block_manager_drop(WT_SESSION_IMPL *session, const char *filename)
{
- WT_DECL_RET;
- WT_FH *fh;
-
- /* Open the underlying file handle. */
- WT_RET(__wt_open(
- session, filename, false, false, WT_FILE_TYPE_DATA, &fh));
-
- /* Truncate the file. */
- WT_ERR(__wt_block_truncate(session, fh, (wt_off_t)0));
-
- /* Write out the file's meta-data. */
- WT_ERR(__wt_desc_init(session, fh, allocsize));
-
- /*
- * Ensure the truncated file has made it to disk, then the upper-level
- * is never surprised.
- */
- WT_ERR(__wt_fsync(session, fh));
-
- /* Close the file handle. */
-err: WT_TRET(__wt_close(session, &fh));
-
- return (ret);
+ return (__wt_remove_if_exists(session, filename));
}
/*
@@ -405,27 +382,37 @@ __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_STATS *stats)
* Reading from the live system's structure normally requires locking,
* but it's an 8B statistics read, there's no need.
*/
- stats->allocation_size = block->allocsize;
- stats->block_checkpoint_size = (int64_t)block->live.ckpt_size;
- stats->block_magic = WT_BLOCK_MAGIC;
- stats->block_major = WT_BLOCK_MAJOR_VERSION;
- stats->block_minor = WT_BLOCK_MINOR_VERSION;
- stats->block_reuse_bytes = (int64_t)block->live.avail.bytes;
- stats->block_size = block->fh->size;
+ WT_STAT_WRITE(stats, allocation_size, block->allocsize);
+ WT_STAT_WRITE(
+ stats, block_checkpoint_size, (int64_t)block->live.ckpt_size);
+ WT_STAT_WRITE(stats, block_magic, WT_BLOCK_MAGIC);
+ WT_STAT_WRITE(stats, block_major, WT_BLOCK_MAJOR_VERSION);
+ WT_STAT_WRITE(stats, block_minor, WT_BLOCK_MINOR_VERSION);
+ WT_STAT_WRITE(
+ stats, block_reuse_bytes, (int64_t)block->live.avail.bytes);
+ WT_STAT_WRITE(stats, block_size, block->fh->size);
}
/*
* __wt_block_manager_size --
- * Set the size statistic for a file.
+ * Return the size of a live block handle.
*/
int
-__wt_block_manager_size(
- WT_SESSION_IMPL *session, const char *filename, WT_DSRC_STATS *stats)
+__wt_block_manager_size(WT_BM *bm, WT_SESSION_IMPL *session, wt_off_t *sizep)
{
- wt_off_t filesize;
-
- WT_RET(__wt_filesize_name(session, filename, false, &filesize));
- stats->block_size = filesize;
+ WT_UNUSED(session);
+ *sizep = bm->block->fh == NULL ? 0 : bm->block->fh->size;
return (0);
}
+
+/*
+ * __wt_block_manager_named_size --
+ * Return the size of a named file.
+ */
+int
+__wt_block_manager_named_size(
+ WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep)
+{
+ return (__wt_filesize_name(session, name, false, sizep));
+}
diff --git a/src/block/block_read.c b/src/block/block_read.c
index ca7797f17af..0e5911ecf2a 100644
--- a/src/block/block_read.c
+++ b/src/block/block_read.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_session.c b/src/block/block_session.c
index 6683fdd20ce..268adb530cf 100644
--- a/src/block/block_session.c
+++ b/src/block/block_session.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_slvg.c b/src/block/block_slvg.c
index 9f3093c741d..ef22c727db4 100644
--- a/src/block/block_slvg.c
+++ b/src/block/block_slvg.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_vrfy.c b/src/block/block_vrfy.c
index 9904dcccd14..35c7a2c218c 100644
--- a/src/block/block_vrfy.c
+++ b/src/block/block_vrfy.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/block/block_write.c b/src/block/block_write.c
index 26efac54080..23f4d7650b9 100644
--- a/src/block/block_write.c
+++ b/src/block/block_write.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/bloom/bloom.c b/src/bloom/bloom.c
index e3a21f25dc1..505630f12cf 100644
--- a/src/bloom/bloom.c
+++ b/src/bloom/bloom.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -130,8 +130,8 @@ __bloom_open_cursor(WT_BLOOM *bloom, WT_CURSOR *owner)
c = NULL;
WT_RET(__wt_open_cursor(session, bloom->uri, owner, cfg, &c));
- /* XXX Layering violation: bump the cache priority for Bloom filters. */
- ((WT_CURSOR_BTREE *)c)->btree->evict_priority = WT_EVICT_INT_SKEW;
+ /* Bump the cache priority for Bloom filters. */
+ __wt_evict_priority_set(session, WT_EVICT_INT_SKEW);
bloom->c = c;
return (0);
diff --git a/src/btree/bt_compact.c b/src/btree/bt_compact.c
index 8044d4f852d..12df19a7e04 100644
--- a/src/btree/bt_compact.c
+++ b/src/btree/bt_compact.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -17,9 +17,11 @@ __compact_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp)
{
WT_BM *bm;
WT_DECL_RET;
+ WT_MULTI *multi;
WT_PAGE *page;
WT_PAGE_MODIFY *mod;
size_t addr_size;
+ uint32_t i;
const uint8_t *addr;
*skipp = true; /* Default skip. */
@@ -41,29 +43,46 @@ __compact_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp)
/*
* If the page is clean, test the original addresses.
- * If the page is a 1-to-1 replacement, test the replacement addresses.
+ * If the page is a replacement, test the replacement addresses.
* Ignore empty pages, they get merged into the parent.
*/
if (mod == NULL || mod->rec_result == 0) {
__wt_ref_info(ref, &addr, &addr_size, NULL);
if (addr == NULL)
return (0);
- WT_RET(
+ return (
bm->compact_page_skip(bm, session, addr, addr_size, skipp));
- } else if (mod->rec_result == WT_PM_REC_REPLACE) {
- /*
- * The page's modification information can change underfoot if
- * the page is being reconciled, serialize with reconciliation.
- */
+ }
+
+ /*
+ * The page's modification information can change underfoot if the page
+ * is being reconciled, serialize with reconciliation.
+ */
+ if (mod->rec_result == WT_PM_REC_REPLACE ||
+ mod->rec_result == WT_PM_REC_MULTIBLOCK)
WT_RET(__wt_fair_lock(session, &page->page_lock));
+ if (mod->rec_result == WT_PM_REC_REPLACE)
ret = bm->compact_page_skip(bm, session,
mod->mod_replace.addr, mod->mod_replace.size, skipp);
+ if (mod->rec_result == WT_PM_REC_MULTIBLOCK)
+ for (multi = mod->mod_multi,
+ i = 0; i < mod->mod_multi_entries; ++multi, ++i) {
+ if (multi->disk_image != NULL)
+ continue;
+ if ((ret = bm->compact_page_skip(bm, session,
+ multi->addr.addr, multi->addr.size, skipp)) != 0)
+ break;
+ if (!*skipp)
+ break;
+ }
+
+ if (mod->rec_result == WT_PM_REC_REPLACE ||
+ mod->rec_result == WT_PM_REC_MULTIBLOCK)
WT_TRET(__wt_fair_unlock(session, &page->page_lock));
- WT_RET(ret);
- }
- return (0);
+
+ return (ret);
}
/*
@@ -139,7 +158,8 @@ __wt_compact(WT_SESSION_IMPL *session, const char *cfg[])
if (skip)
continue;
- session->compaction = true;
+ session->compact_state = WT_COMPACT_SUCCESS;
+
/* Rewrite the page: mark the page and tree dirty. */
WT_ERR(__wt_page_modify_init(session, ref->page));
__wt_page_modify_set(session, ref->page);
diff --git a/src/btree/bt_curnext.c b/src/btree/bt_curnext.c
index 55843d1cae5..63b2e2abebc 100644
--- a/src/btree/bt_curnext.c
+++ b/src/btree/bt_curnext.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -31,13 +31,12 @@ __cursor_fix_append_next(WT_CURSOR_BTREE *cbt, bool newpage)
return (WT_NOTFOUND);
/*
- * This code looks different from the cursor-previous code. The append
- * list appears on the last page of the tree, but it may be preceded by
- * other rows, which means the cursor's recno will be set to a value and
- * we simply want to increment it. If the cursor's recno is NOT set,
- * we're starting our iteration in a tree that has only appended items.
- * In that case, recno will be 0 and happily enough the increment will
- * set it to 1, which is correct.
+ * This code looks different from the cursor-previous code. The append
+ * list may be preceded by other rows, which means the cursor's recno
+ * will be set to a value and we simply want to increment it. If the
+ * cursor's recno is NOT set, we're starting an iteration in a tree with
+ * only appended items. In that case, recno will be 0 and happily enough
+ * the increment will set it to 1, which is correct.
*/
__cursor_set_recno(cbt, cbt->recno + 1);
@@ -368,6 +367,140 @@ new_insert: if ((ins = cbt->ins) != NULL) {
/* NOTREACHED */
}
+#ifdef HAVE_DIAGNOSTIC
+/*
+ * __cursor_key_order_check_col --
+ * Check key ordering for column-store cursor movements.
+ */
+static int
+__cursor_key_order_check_col(
+ WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next)
+{
+ int cmp;
+
+ cmp = 0; /* -Werror=maybe-uninitialized */
+
+ if (cbt->lastrecno != WT_RECNO_OOB) {
+ if (cbt->lastrecno < cbt->recno)
+ cmp = -1;
+ if (cbt->lastrecno > cbt->recno)
+ cmp = 1;
+ }
+
+ if (cbt->lastrecno == WT_RECNO_OOB ||
+ (next && cmp < 0) || (!next && cmp > 0)) {
+ cbt->lastrecno = cbt->recno;
+ return (0);
+ }
+
+ WT_PANIC_RET(session, EINVAL,
+ "WT_CURSOR.%s out-of-order returns: returned key %" PRIu64 " then "
+ "key %" PRIu64,
+ next ? "next" : "prev", cbt->lastrecno, cbt->recno);
+}
+
+/*
+ * __cursor_key_order_check_row --
+ * Check key ordering for row-store cursor movements.
+ */
+static int
+__cursor_key_order_check_row(
+ WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next)
+{
+ WT_BTREE *btree;
+ WT_ITEM *key;
+ WT_DECL_RET;
+ WT_DECL_ITEM(a);
+ WT_DECL_ITEM(b);
+ int cmp;
+
+ btree = S2BT(session);
+ key = &cbt->iface.key;
+ cmp = 0; /* -Werror=maybe-uninitialized */
+
+ if (cbt->lastkey->size != 0)
+ WT_RET(__wt_compare(
+ session, btree->collator, cbt->lastkey, key, &cmp));
+
+ if (cbt->lastkey->size == 0 || (next && cmp < 0) || (!next && cmp > 0))
+ return (__wt_buf_set(session,
+ cbt->lastkey, cbt->iface.key.data, cbt->iface.key.size));
+
+ WT_ERR(__wt_scr_alloc(session, 512, &a));
+ WT_ERR(__wt_scr_alloc(session, 512, &b));
+
+ WT_PANIC_ERR(session, EINVAL,
+ "WT_CURSOR.%s out-of-order returns: returned key %s then key %s",
+ next ? "next" : "prev",
+ __wt_buf_set_printable(
+ session, cbt->lastkey->data, cbt->lastkey->size, a),
+ __wt_buf_set_printable(session, key->data, key->size, b));
+
+err: __wt_scr_free(session, &a);
+ __wt_scr_free(session, &b);
+
+ return (ret);
+}
+
+/*
+ * __wt_cursor_key_order_check --
+ * Check key ordering for cursor movements.
+ */
+int
+__wt_cursor_key_order_check(
+ WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next)
+{
+ switch (cbt->ref->page->type) {
+ case WT_PAGE_COL_FIX:
+ case WT_PAGE_COL_VAR:
+ return (__cursor_key_order_check_col(session, cbt, next));
+ case WT_PAGE_ROW_LEAF:
+ return (__cursor_key_order_check_row(session, cbt, next));
+ WT_ILLEGAL_VALUE(session);
+ }
+ /* NOTREACHED */
+}
+
+/*
+ * __wt_cursor_key_order_init --
+ * Initialize key ordering checks for cursor movements after a successful
+ * search.
+ */
+int
+__wt_cursor_key_order_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
+{
+ /*
+ * Cursor searches set the position for cursor movements, set the
+ * last-key value for diagnostic checking.
+ */
+ switch (cbt->ref->page->type) {
+ case WT_PAGE_COL_FIX:
+ case WT_PAGE_COL_VAR:
+ cbt->lastrecno = cbt->recno;
+ return (0);
+ case WT_PAGE_ROW_LEAF:
+ return (__wt_buf_set(session,
+ cbt->lastkey, cbt->iface.key.data, cbt->iface.key.size));
+ WT_ILLEGAL_VALUE(session);
+ }
+ /* NOTREACHED */
+}
+
+/*
+ * __wt_cursor_key_order_reset --
+ * Turn off key ordering checks for cursor movements.
+ */
+void
+__wt_cursor_key_order_reset(WT_CURSOR_BTREE *cbt)
+{
+ /*
+ * Clear the last-key returned, it doesn't apply.
+ */
+ cbt->lastkey->size = 0;
+ cbt->lastrecno = WT_RECNO_OOB;
+}
+#endif
+
/*
* __wt_btcur_iterate_setup --
* Initialize a cursor for iteration, usually based on a search.
@@ -393,10 +526,14 @@ __wt_btcur_iterate_setup(WT_CURSOR_BTREE *cbt)
* If we don't have a search page, then we're done, we're starting at
* the beginning or end of the tree, not as a result of a search.
*/
- if (cbt->ref == NULL)
+ if (cbt->ref == NULL) {
+#ifdef HAVE_DIAGNOSTIC
+ __wt_cursor_key_order_reset(cbt);
+#endif
return;
- page = cbt->ref->page;
+ }
+ page = cbt->ref->page;
if (page->type == WT_PAGE_ROW_LEAF) {
/*
* For row-store pages, we need a single item that tells us the
@@ -468,7 +605,6 @@ __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating)
*/
for (newpage = false;; newpage = true) {
page = cbt->ref == NULL ? NULL : cbt->ref->page;
- WT_ASSERT(session, page == NULL || !WT_PAGE_IS_INTERNAL(page));
if (F_ISSET(cbt, WT_CBT_ITERATE_APPEND)) {
switch (page->type) {
@@ -502,9 +638,9 @@ __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating)
break;
/*
- * The last page in a column-store has appended entries.
- * We handle it separately from the usual cursor code:
- * it's only that one page and it's in a simple format.
+ * Column-store pages may have appended entries. Handle
+ * it separately from the usual cursor code, it's in a
+ * simple format.
*/
if (page->type != WT_PAGE_ROW_LEAF &&
(cbt->ins_head = WT_COL_APPEND(page)) != NULL) {
@@ -531,6 +667,11 @@ __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating)
WT_ERR_TEST(cbt->ref == NULL, WT_NOTFOUND);
}
+#ifdef HAVE_DIAGNOSTIC
+ if (ret == 0)
+ WT_ERR(__wt_cursor_key_order_check(session, cbt, true));
+#endif
+
err: if (ret != 0)
WT_TRET(__cursor_reset(cbt));
return (ret);
diff --git a/src/btree/bt_curprev.c b/src/btree/bt_curprev.c
index 1d23b976edd..a083ec4016e 100644
--- a/src/btree/bt_curprev.c
+++ b/src/btree/bt_curprev.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -139,10 +139,20 @@ __cursor_fix_append_prev(WT_CURSOR_BTREE *cbt, bool newpage)
if ((cbt->ins = WT_SKIP_LAST(cbt->ins_head)) == NULL)
return (WT_NOTFOUND);
} else {
+ /* Move to the previous record in the append list, if any. */
+ if (cbt->ins != NULL &&
+ cbt->recno <= WT_INSERT_RECNO(cbt->ins))
+ WT_RET(__cursor_skip_prev(cbt));
+
/*
* Handle the special case of leading implicit records, that is,
- * there aren't any records in the tree not on the append list,
- * and the first record on the append list isn't record 1.
+ * there aren't any records in the page not on the append list,
+ * and the append list's first record isn't the first record on
+ * the page. (Although implemented as a test of the page values,
+ * this is really a test for a tree where the first inserted
+ * record wasn't record 1, any other page with only an append
+ * list will have a first page record number matching the first
+ * record in the append list.)
*
* The "right" place to handle this is probably in our caller.
* The high-level cursor-previous routine would:
@@ -156,27 +166,26 @@ __cursor_fix_append_prev(WT_CURSOR_BTREE *cbt, bool newpage)
* into our caller. Anyway, if this code breaks for any reason,
* that's the way I'd go.
*
- * If we're not pointing to a WT_INSERT entry, or we can't find
- * a WT_INSERT record that precedes our record name-space, check
- * if there are any records on the page. If there aren't, then
- * we're in the magic zone, keep going until we get to a record
- * number of 1.
+ * If we're not pointing to a WT_INSERT entry (we didn't find a
+ * WT_INSERT record preceding our record name-space), check if
+ * we've reached the beginning of this page, a possibility if a
+ * page had a large number of items appended, and then split.
+ * If not, check if there are any records on the page. If there
+ * aren't, then we're in the magic zone, keep going until we get
+ * to a record number matching the first record on the page.
*/
- if (cbt->ins != NULL &&
- cbt->recno <= WT_INSERT_RECNO(cbt->ins))
- WT_RET(__cursor_skip_prev(cbt));
if (cbt->ins == NULL &&
- (cbt->recno == 1 || __col_fix_last_recno(page) != 0))
+ (cbt->recno == page->pg_fix_recno ||
+ __col_fix_last_recno(page) != 0))
return (WT_NOTFOUND);
}
/*
- * This code looks different from the cursor-next code. The append
- * list appears on the last page of the tree and contains the last
- * records in the tree. If we're iterating through the tree, starting
- * at the last record in the tree, by definition we're starting a new
- * iteration and we set the record number to the last record found in
- * the tree. Otherwise, decrement the record.
+ * This code looks different from the cursor-next code. The append list
+ * may be preceded by other rows. If we're iterating through the tree,
+ * starting at the last record in the tree, by definition we're starting
+ * a new iteration and we set the record number to the last record found
+ * on the page. Otherwise, decrement the record.
*/
if (newpage)
__cursor_set_recno(cbt, WT_INSERT_RECNO(cbt->ins));
@@ -556,12 +565,11 @@ __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating)
*/
for (newpage = false;; newpage = true) {
page = cbt->ref == NULL ? NULL : cbt->ref->page;
- WT_ASSERT(session, page == NULL || !WT_PAGE_IS_INTERNAL(page));
/*
- * The last page in a column-store has appended entries.
- * We handle it separately from the usual cursor code:
- * it's only that one page and it's in a simple format.
+ * Column-store pages may have appended entries. Handle it
+ * separately from the usual cursor code, it's in a simple
+ * format.
*/
if (newpage && page != NULL && page->type != WT_PAGE_ROW_LEAF &&
(cbt->ins_head = WT_COL_APPEND(page)) != NULL)
@@ -618,6 +626,10 @@ __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating)
WT_ERR(__wt_tree_walk(session, &cbt->ref, flags));
WT_ERR_TEST(cbt->ref == NULL, WT_NOTFOUND);
}
+#ifdef HAVE_DIAGNOSTIC
+ if (ret == 0)
+ WT_ERR(__wt_cursor_key_order_check(session, cbt, false));
+#endif
err: if (ret != 0)
WT_TRET(__cursor_reset(cbt));
diff --git a/src/btree/bt_cursor.c b/src/btree/bt_cursor.c
index f2bf2978320..c11b7d35de6 100644
--- a/src/btree/bt_cursor.c
+++ b/src/btree/bt_cursor.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -62,8 +62,18 @@ __cursor_size_chk(WT_SESSION_IMPL *session, WT_ITEM *kv)
static inline int
__cursor_fix_implicit(WT_BTREE *btree, WT_CURSOR_BTREE *cbt)
{
- return (btree->type == BTREE_COL_FIX &&
- !F_ISSET(cbt, WT_CBT_MAX_RECORD));
+ /*
+ * When there's no exact match, column-store search returns the key
+ * nearest the searched-for key (continuing past keys smaller than the
+ * searched-for key to return the next-largest key). Therefore, if the
+ * returned comparison is -1, the searched-for key was larger than any
+ * row on the page's standard information or column-store insert list.
+ *
+ * If the returned comparison is NOT -1, there was a row equal to or
+ * larger than the searched-for key, and we implicitly create missing
+ * rows.
+ */
+ return (btree->type == BTREE_COL_FIX && cbt->compare != -1);
}
/*
@@ -344,6 +354,11 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt)
} else
ret = WT_NOTFOUND;
+#ifdef HAVE_DIAGNOSTIC
+ if (ret == 0)
+ WT_ERR(__wt_cursor_key_order_init(session, cbt));
+#endif
+
err: if (ret != 0)
WT_TRET(__cursor_reset(cbt));
return (ret);
@@ -454,6 +469,11 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp)
exact = -1;
}
+#ifdef HAVE_DIAGNOSTIC
+ if (ret == 0)
+ WT_ERR(__wt_cursor_key_order_init(session, cbt));
+#endif
+
err: if (ret != 0)
WT_TRET(__cursor_reset(cbt));
if (exactp != NULL && (ret == 0 || ret == WT_NOTFOUND))
@@ -502,19 +522,14 @@ retry: WT_RET(__cursor_func_init(cbt, true));
case BTREE_COL_VAR:
/*
* If WT_CURSTD_APPEND is set, insert a new record (ignoring
- * the application's record number). First we search for the
- * maximum possible record number so the search ends on the
- * last page. The real record number is assigned by the
- * serialized append operation.
+ * the application's record number). The real record number
+ * is assigned by the serialized append operation.
*/
if (F_ISSET(cursor, WT_CURSTD_APPEND))
- cbt->iface.recno = UINT64_MAX;
+ cbt->iface.recno = WT_RECNO_OOB;
WT_ERR(__cursor_col_search(session, cbt, NULL));
- if (F_ISSET(cursor, WT_CURSTD_APPEND))
- cbt->iface.recno = WT_RECNO_OOB;
-
/*
* If not overwriting, fail if the key exists. Creating a
* record past the end of the tree in a fixed-length
@@ -830,6 +845,7 @@ __wt_btcur_next_random(WT_CURSOR_BTREE *cbt)
WT_DECL_RET;
WT_SESSION_IMPL *session;
WT_UPDATE *upd;
+ wt_off_t size;
uint64_t skip;
session = (WT_SESSION_IMPL *)cbt->iface.session;
@@ -866,10 +882,12 @@ __wt_btcur_next_random(WT_CURSOR_BTREE *cbt)
* !!!
* Ideally, the number would be prime to avoid restart issues.
*/
- if (cbt->next_random_sample_size != 0)
+ if (cbt->next_random_sample_size != 0) {
+ WT_ERR(btree->bm->size(btree->bm, session, &size));
cbt->next_random_leaf_skip = (uint64_t)
- ((btree->bm->block->fh->size / btree->allocsize) /
+ ((size / btree->allocsize) /
cbt->next_random_sample_size) + 1;
+ }
/*
* Choose a leaf page from the tree.
@@ -1225,6 +1243,11 @@ __wt_btcur_open(WT_CURSOR_BTREE *cbt)
{
cbt->row_key = &cbt->_row_key;
cbt->tmp = &cbt->_tmp;
+
+#ifdef HAVE_DIAGNOSTIC
+ cbt->lastkey = &cbt->_lastkey;
+ cbt->lastrecno = WT_RECNO_OOB;
+#endif
}
/*
@@ -1250,6 +1273,9 @@ __wt_btcur_close(WT_CURSOR_BTREE *cbt, bool lowlevel)
__wt_buf_free(session, &cbt->_row_key);
__wt_buf_free(session, &cbt->_tmp);
+#ifdef HAVE_DIAGNOSTIC
+ __wt_buf_free(session, &cbt->_lastkey);
+#endif
return (ret);
}
diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c
index d52a94a6da2..7c7f8cab855 100644
--- a/src/btree/bt_debug.c
+++ b/src/btree/bt_debug.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -74,9 +74,7 @@ __wt_debug_set_verbose(WT_SESSION_IMPL *session, const char *v)
static inline void
__debug_hex_byte(WT_DBG *ds, uint8_t v)
{
- static const char hex[] = "0123456789abcdef";
-
- __dmsg(ds, "#%c%c", hex[(v & 0xf0) >> 4], hex[v & 0x0f]);
+ __dmsg(ds, "#%c%c", __wt_hex[(v & 0xf0) >> 4], __wt_hex[v & 0x0f]);
}
/*
@@ -678,8 +676,12 @@ __debug_page_metadata(WT_DBG *ds, WT_PAGE *page)
__dmsg(ds, ", evict-lru");
if (F_ISSET_ATOMIC(page, WT_PAGE_OVERFLOW_KEYS))
__dmsg(ds, ", overflow-keys");
+ if (F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_BLOCK))
+ __dmsg(ds, ", split-block");
if (F_ISSET_ATOMIC(page, WT_PAGE_SPLIT_INSERT))
__dmsg(ds, ", split-insert");
+ if (F_ISSET_ATOMIC(page, WT_PAGE_UPDATE_IGNORE))
+ __dmsg(ds, ", update-ignore");
if (mod != NULL)
switch (mod->rec_result) {
diff --git a/src/btree/bt_delete.c b/src/btree/bt_delete.c
index 9dd72108e4b..ba16dd204e8 100644
--- a/src/btree/bt_delete.c
+++ b/src/btree/bt_delete.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_discard.c b/src/btree/bt_discard.c
index 54b07513089..795111d53f9 100644
--- a/src/btree/bt_discard.c
+++ b/src/btree/bt_discard.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c
index a6330326954..7f0f37d95d6 100644
--- a/src/btree/bt_handle.c
+++ b/src/btree/bt_handle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -105,14 +105,23 @@ __wt_btree_open(WT_SESSION_IMPL *session, const char *op_cfg[])
WT_ERR(__wt_btree_tree_open(
session, root_addr, root_addr_size));
- /* Warm the cache, if possible. */
- WT_WITH_PAGE_INDEX(session,
- ret = __btree_preload(session));
- WT_ERR(ret);
-
- /* Get the last record number in a column-store file. */
- if (btree->type != BTREE_ROW)
- WT_ERR(__btree_get_last_recno(session));
+ /*
+ * Rebalance uses the cache, but only wants the root
+ * page, nothing else.
+ */
+ if (!F_ISSET(btree, WT_BTREE_REBALANCE)) {
+ /* Warm the cache, if possible. */
+ WT_WITH_PAGE_INDEX(session,
+ ret = __btree_preload(session));
+ WT_ERR(ret);
+
+ /*
+ * Get the last record number in a column-store
+ * file.
+ */
+ if (btree->type != BTREE_ROW)
+ WT_ERR(__btree_get_last_recno(session));
+ }
}
}
@@ -514,7 +523,7 @@ __btree_tree_open_empty(WT_SESSION_IMPL *session, bool creation)
/* Bulk loads require a leaf page for reconciliation: create it now. */
if (F_ISSET(btree, WT_BTREE_BULK)) {
- WT_ERR(__wt_btree_new_leaf_page(session, &leaf));
+ WT_ERR(__wt_btree_new_leaf_page(session, 1, &leaf));
ref->page = leaf;
ref->state = WT_REF_MEM;
WT_ERR(__wt_page_modify_init(session, leaf));
@@ -538,7 +547,8 @@ err: if (leaf != NULL)
* Create an empty leaf page.
*/
int
-__wt_btree_new_leaf_page(WT_SESSION_IMPL *session, WT_PAGE **pagep)
+__wt_btree_new_leaf_page(
+ WT_SESSION_IMPL *session, uint64_t recno, WT_PAGE **pagep)
{
WT_BTREE *btree;
@@ -547,15 +557,15 @@ __wt_btree_new_leaf_page(WT_SESSION_IMPL *session, WT_PAGE **pagep)
switch (btree->type) {
case BTREE_COL_FIX:
WT_RET(__wt_page_alloc(
- session, WT_PAGE_COL_FIX, 1, 0, false, pagep));
+ session, WT_PAGE_COL_FIX, recno, 0, false, pagep));
break;
case BTREE_COL_VAR:
WT_RET(__wt_page_alloc(
- session, WT_PAGE_COL_VAR, 1, 0, false, pagep));
+ session, WT_PAGE_COL_VAR, recno, 0, false, pagep));
break;
case BTREE_ROW:
WT_RET(__wt_page_alloc(
- session, WT_PAGE_ROW_LEAF, 0, 0, false, pagep));
+ session, WT_PAGE_ROW_LEAF, WT_RECNO_OOB, 0, false, pagep));
break;
WT_ILLEGAL_VALUE(session);
}
diff --git a/src/btree/bt_huffman.c b/src/btree/bt_huffman.c
index d9ff9616072..2c0238545fb 100644
--- a/src/btree/bt_huffman.c
+++ b/src/btree/bt_huffman.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -332,11 +332,17 @@ __wt_huffman_read(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *ip,
for (tp = table, lineno = 1; (ret =
fscanf(fp, "%" SCNi64 " %" SCNi64, &symbol, &frequency)) != EOF;
++tp, ++lineno) {
- if (lineno > entries)
+ /*
+ * Entries is 0-based, that is, there are (entries +1) possible
+ * values that can be configured. The line number is 1-based, so
+ * adjust the test for too many entries, and report (entries +1)
+ * in the error as the maximum possible number of entries.
+ */
+ if (lineno > entries + 1)
WT_ERR_MSG(session, EINVAL,
"Huffman table file %.*s is corrupted, "
"more than %" PRIu32 " entries",
- (int)ip->len, ip->str, entries);
+ (int)ip->len, ip->str, entries + 1);
if (ret != 2)
WT_ERR_MSG(session, EINVAL,
"line %u of Huffman table file %.*s is corrupted: "
diff --git a/src/btree/bt_io.c b/src/btree/bt_io.c
index 6481f514323..aaf906ca785 100644
--- a/src/btree/bt_io.c
+++ b/src/btree/bt_io.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_misc.c b/src/btree/bt_misc.c
index a60499ef8b7..7f188502a0a 100644
--- a/src/btree/bt_misc.c
+++ b/src/btree/bt_misc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -129,3 +129,19 @@ __wt_addr_string(WT_SESSION_IMPL *session,
}
return (buf->data);
}
+
+/*
+ * __wt_buf_set_printable --
+ * Set the contents of the buffer to a printable representation of a
+ * byte string.
+ */
+const char *
+__wt_buf_set_printable(
+ WT_SESSION_IMPL *session, const void *p, size_t size, WT_ITEM *buf)
+{
+ if (__wt_raw_to_esc_hex(session, p, size, buf)) {
+ buf->data = "[Error]";
+ buf->size = strlen("[Error]");
+ }
+ return (buf->data);
+}
diff --git a/src/btree/bt_ovfl.c b/src/btree/bt_ovfl.c
index 651cbc8d4ad..fbe361e000a 100644
--- a/src/btree/bt_ovfl.c
+++ b/src/btree/bt_ovfl.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c
index 8808f0b1a85..9fa0145bbdd 100644
--- a/src/btree/bt_page.c
+++ b/src/btree/bt_page.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -272,7 +272,7 @@ __inmem_col_int(WT_SESSION_IMPL *session, WT_PAGE *page)
const WT_PAGE_HEADER *dsk;
WT_PAGE_INDEX *pindex;
WT_REF **refp, *ref;
- uint32_t i;
+ uint32_t hint, i;
btree = S2BT(session);
dsk = page->dsk;
@@ -284,9 +284,11 @@ __inmem_col_int(WT_SESSION_IMPL *session, WT_PAGE *page)
*/
pindex = WT_INTL_INDEX_GET_SAFE(page);
refp = pindex->index;
+ hint = 0;
WT_CELL_FOREACH(btree, dsk, cell, unpack, i) {
ref = *refp++;
ref->home = page;
+ ref->pindex_hint = hint++;
__wt_cell_unpack(cell, unpack);
ref->addr = cell;
@@ -404,7 +406,7 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep)
const WT_PAGE_HEADER *dsk;
WT_PAGE_INDEX *pindex;
WT_REF *ref, **refp;
- uint32_t i;
+ uint32_t hint, i;
bool overflow_keys;
btree = S2BT(session);
@@ -421,9 +423,11 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep)
pindex = WT_INTL_INDEX_GET_SAFE(page);
refp = pindex->index;
overflow_keys = false;
+ hint = 0;
WT_CELL_FOREACH(btree, dsk, cell, unpack, i) {
ref = *refp;
ref->home = page;
+ ref->pindex_hint = hint++;
__wt_cell_unpack(cell, unpack);
switch (unpack->type) {
diff --git a/src/btree/bt_read.c b/src/btree/bt_read.c
index c50f97bbe14..ac9faef4ff2 100644
--- a/src/btree/bt_read.c
+++ b/src/btree/bt_read.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -379,7 +379,9 @@ __page_read(WT_SESSION_IMPL *session, WT_REF *ref)
if (addr == NULL) {
WT_ASSERT(session, previous_state == WT_REF_DELETED);
- WT_ERR(__wt_btree_new_leaf_page(session, &page));
+ WT_ERR(__wt_btree_new_leaf_page(session,
+ btree->type == BTREE_ROW ? WT_RECNO_OOB : ref->key.recno,
+ &page));
ref->page = page;
goto done;
}
diff --git a/src/btree/bt_rebalance.c b/src/btree/bt_rebalance.c
new file mode 100644
index 00000000000..86360e83ddf
--- /dev/null
+++ b/src/btree/bt_rebalance.c
@@ -0,0 +1,486 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+#include "wt_internal.h"
+
+/*
+ * Shared rebalance information.
+ */
+typedef struct {
+ WT_REF **leaf; /* List of leaf pages */
+ size_t leaf_next; /* Next entry */
+ size_t leaf_allocated; /* Allocated bytes */
+
+ WT_ADDR *fl; /* List of objects to free */
+ size_t fl_next; /* Next entry */
+ size_t fl_allocated; /* Allocated bytes */
+
+ WT_PAGE *root; /* Created root page */
+
+ uint8_t type; /* Internal page type */
+
+#define WT_REBALANCE_PROGRESS_INTERVAL 100
+ uint64_t progress; /* Progress counter */
+
+ WT_ITEM *tmp1; /* Temporary buffers */
+ WT_ITEM *tmp2;
+} WT_REBALANCE_STUFF;
+
+/*
+ * __rebalance_discard --
+ * Free the allocated information.
+ */
+static void
+__rebalance_discard(WT_SESSION_IMPL *session, WT_REBALANCE_STUFF *rs)
+{
+ while (rs->leaf_next > 0) {
+ --rs->leaf_next;
+ __wt_free_ref(
+ session, rs->leaf[rs->leaf_next], rs->type, false);
+ }
+ __wt_free(session, rs->leaf);
+
+ while (rs->fl_next > 0) {
+ --rs->fl_next;
+ __wt_free(session, rs->fl[rs->fl_next].addr);
+ }
+ __wt_free(session, rs->fl);
+}
+
+/*
+ * __rebalance_leaf_append --
+ * Add a new entry to the list of leaf pages.
+ */
+static int
+__rebalance_leaf_append(WT_SESSION_IMPL *session,
+ const uint8_t *key, size_t key_len, uint64_t recno,
+ const uint8_t *addr, size_t addr_len, u_int addr_type,
+ WT_REBALANCE_STUFF *rs)
+{
+ WT_ADDR *copy_addr;
+ WT_REF *copy;
+
+ WT_RET(__wt_verbose(session, WT_VERB_REBALANCE,
+ "rebalance leaf-list append %s, %s",
+ __wt_buf_set_printable(session, key, key_len, rs->tmp2),
+ __wt_addr_string(session, addr, addr_len, rs->tmp1)));
+
+ /* Allocate and initialize a new leaf page reference. */
+ WT_RET(__wt_realloc_def(
+ session, &rs->leaf_allocated, rs->leaf_next + 1, &rs->leaf));
+ WT_RET(__wt_calloc_one(session, &copy));
+ rs->leaf[rs->leaf_next++] = copy;
+
+ copy->page = NULL;
+ copy->home = NULL;
+ copy->pindex_hint = 0;
+ copy->state = WT_REF_DISK;
+
+ WT_RET(__wt_calloc_one(session, &copy_addr));
+ copy->addr = copy_addr;
+ WT_RET(__wt_strndup(session, addr, addr_len, &copy_addr->addr));
+ copy_addr->size = (uint8_t)addr_len;
+ copy_addr->type = (uint8_t)addr_type;
+
+ if (recno == WT_RECNO_OOB)
+ WT_RET(__wt_row_ikey(session, 0, key, key_len, copy));
+ else
+ copy->key.recno = recno;
+
+ copy->page_del = NULL;
+ return (0);
+}
+
+/*
+ * __rebalance_fl_append --
+ * Add a new entry to the free list.
+ */
+static int
+__rebalance_fl_append(WT_SESSION_IMPL *session,
+ const uint8_t *addr, size_t addr_len, WT_REBALANCE_STUFF *rs)
+{
+ WT_ADDR *copy;
+
+ WT_RET(__wt_realloc_def(
+ session, &rs->fl_allocated, rs->fl_next + 1, &rs->fl));
+ copy = &rs->fl[rs->fl_next++];
+
+ WT_RET(__wt_strndup(session, addr, addr_len, &copy->addr));
+ copy->size = (uint8_t)addr_len;
+ copy->type = 0;
+
+ return (0);
+}
+
+/*
+ * __rebalance_internal --
+ * Build an in-memory page that references all of the leaf pages we've
+ * found.
+ */
+static int
+__rebalance_internal(WT_SESSION_IMPL *session, WT_REBALANCE_STUFF *rs)
+{
+ WT_BTREE *btree;
+ WT_DECL_RET;
+ WT_PAGE *page;
+ WT_PAGE_INDEX *pindex;
+ WT_REF **refp;
+ uint32_t i, leaf_next;
+
+ btree = S2BT(session);
+
+ /*
+ * There's a limit to the number of pages we can rebalance: the number
+ * of elements on a page is a 4B quantity and it's technically possible
+ * there could be more pages than that in a tree.
+ */
+ if (rs->leaf_next > UINT32_MAX)
+ WT_RET_MSG(session, ENOTSUP,
+ "too many leaf pages to rebalance, %" WT_SIZET_FMT " pages "
+ "exceeds the maximum of %" PRIu32,
+ rs->leaf_next, UINT32_MAX);
+ leaf_next = (uint32_t)rs->leaf_next;
+
+ /* Allocate a row-store root (internal) page and fill it in. */
+ WT_RET(__wt_page_alloc(session, rs->type,
+ rs->type == WT_PAGE_COL_INT ? 1 : 0, leaf_next, false, &page));
+ page->pg_intl_parent_ref = &btree->root;
+ WT_ERR(__wt_page_modify_init(session, page));
+ __wt_page_modify_set(session, page);
+
+ pindex = WT_INTL_INDEX_GET_SAFE(page);
+ for (refp = pindex->index, i = 0; i < leaf_next; ++i) {
+ rs->leaf[i]->home = page;
+ *refp++ = rs->leaf[i];
+ rs->leaf[i] = NULL;
+ }
+
+ rs->root = page;
+ return (0);
+
+err: __wt_page_out(session, &page);
+ return (ret);
+}
+
+/*
+ * __rebalance_free_original --
+ * Free the tracked internal pages and overflow keys.
+ */
+static int
+__rebalance_free_original(WT_SESSION_IMPL *session, WT_REBALANCE_STUFF *rs)
+{
+ WT_ADDR *addr;
+ uint64_t i;
+
+ for (i = 0; i < rs->fl_next; ++i) {
+ addr = &rs->fl[i];
+
+ WT_RET(__wt_verbose(session, WT_VERB_REBALANCE,
+ "rebalance discarding %s",
+ __wt_addr_string(
+ session, addr->addr, addr->size, rs->tmp1)));
+
+ WT_RET(__wt_btree_block_free(session, addr->addr, addr->size));
+ }
+ return (0);
+}
+
+/*
+ * __rebalance_col_walk --
+ * Walk a column-store page and its descendants.
+ */
+static int
+__rebalance_col_walk(
+ WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk, WT_REBALANCE_STUFF *rs)
+{
+ WT_BTREE *btree;
+ WT_CELL *cell;
+ WT_CELL_UNPACK unpack;
+ WT_DECL_ITEM(buf);
+ WT_DECL_RET;
+ uint32_t i;
+
+ btree = S2BT(session);
+
+ WT_ERR(__wt_scr_alloc(session, 0, &buf));
+
+ /* Report progress periodically. */
+ if (++rs->progress % WT_REBALANCE_PROGRESS_INTERVAL == 0)
+ WT_ERR(__wt_progress(session, NULL, rs->progress));
+
+ /*
+ * Walk the page, instantiating keys: the page contains sorted key and
+ * location cookie pairs. Keys are on-page/overflow items and location
+ * cookies are WT_CELL_ADDR_XXX items.
+ */
+ WT_CELL_FOREACH(btree, dsk, cell, &unpack, i) {
+ __wt_cell_unpack(cell, &unpack);
+ switch (unpack.type) {
+ case WT_CELL_ADDR_INT:
+ /* An internal page: read it and recursively walk it. */
+ WT_ERR(__wt_bt_read(
+ session, buf, unpack.data, unpack.size));
+ WT_ERR(__rebalance_col_walk(session, buf->data, rs));
+ WT_ERR(__wt_verbose(session, WT_VERB_REBALANCE,
+ "free-list append internal page: %s",
+ __wt_addr_string(
+ session, unpack.data, unpack.size, rs->tmp1)));
+ WT_ERR(__rebalance_fl_append(
+ session, unpack.data, unpack.size, rs));
+ break;
+ case WT_CELL_ADDR_LEAF:
+ case WT_CELL_ADDR_LEAF_NO:
+ WT_ERR(__rebalance_leaf_append(session,
+ NULL, 0, unpack.v, unpack.data, unpack.size,
+ unpack.type == WT_CELL_ADDR_LEAF ?
+ WT_ADDR_LEAF : WT_ADDR_LEAF_NO, rs));
+ break;
+ WT_ILLEGAL_VALUE_ERR(session);
+ }
+ }
+
+err: __wt_scr_free(session, &buf);
+ return (ret);
+}
+
+/*
+ * __rebalance_row_leaf_key --
+ * Acquire a copy of the key for a leaf page.
+ */
+static int
+__rebalance_row_leaf_key(WT_SESSION_IMPL *session,
+ const uint8_t *addr, size_t addr_len, WT_ITEM *key, WT_REBALANCE_STUFF *rs)
+{
+ WT_PAGE *page;
+ WT_DECL_RET;
+
+ /*
+ * We need the first key from a leaf page. Leaf pages are relatively
+ * complex (Huffman encoding, prefix compression, and so on), do the
+ * work to instantiate the page and copy the first key to the buffer.
+ */
+ WT_RET(__wt_bt_read(session, rs->tmp1, addr, addr_len));
+ WT_RET(__wt_page_inmem(session, NULL, rs->tmp1->data, 0, 0, &page));
+ ret = __wt_row_leaf_key_copy(session, page, &page->pg_row_d[0], key);
+ __wt_page_out(session, &page);
+ return (ret);
+}
+
+/*
+ * __rebalance_row_walk --
+ * Walk a row-store page and its descendants.
+ */
+static int
+__rebalance_row_walk(
+ WT_SESSION_IMPL *session, const WT_PAGE_HEADER *dsk, WT_REBALANCE_STUFF *rs)
+{
+ WT_BTREE *btree;
+ WT_CELL *cell;
+ WT_CELL_UNPACK key, unpack;
+ WT_DECL_ITEM(buf);
+ WT_DECL_ITEM(leafkey);
+ WT_DECL_RET;
+ size_t len;
+ uint32_t i;
+ bool first_cell;
+ const void *p;
+
+ btree = S2BT(session);
+ WT_CLEAR(key); /* [-Werror=maybe-uninitialized] */
+
+ WT_ERR(__wt_scr_alloc(session, 0, &buf));
+ WT_ERR(__wt_scr_alloc(session, 0, &leafkey));
+
+ /* Report progress periodically. */
+ if (++rs->progress % WT_REBALANCE_PROGRESS_INTERVAL == 0)
+ WT_ERR(__wt_progress(session, NULL, rs->progress));
+
+ /*
+ * Walk the page, instantiating keys: the page contains sorted key and
+ * location cookie pairs. Keys are on-page/overflow items and location
+ * cookies are WT_CELL_ADDR_XXX items.
+ */
+ first_cell = true;
+ WT_CELL_FOREACH(btree, dsk, cell, &unpack, i) {
+ __wt_cell_unpack(cell, &unpack);
+ switch (unpack.type) {
+ case WT_CELL_KEY:
+ key = unpack;
+ break;
+ case WT_CELL_KEY_OVFL:
+ /*
+ * Any overflow key that references an internal page is
+ * of no further use, schedule its blocks to be freed.
+ *
+ * We could potentially use the same overflow key being
+ * freed here for the internal page we're creating, but
+ * that's more work to get reconciliation to understand
+ * and overflow keys are (well, should be), uncommon.
+ */
+ WT_ERR(__wt_verbose(session, WT_VERB_REBALANCE,
+ "free-list append overflow key: %s",
+ __wt_addr_string(
+ session, unpack.data, unpack.size, rs->tmp1)));
+
+ WT_ERR(__rebalance_fl_append(
+ session, unpack.data, unpack.size, rs));
+
+ key = unpack;
+ break;
+ case WT_CELL_ADDR_DEL:
+ /*
+ * A deleted leaf page: we're rebalancing this tree,
+ * which means no transaction can be active in it,
+ * which means no deleted leaf page is interesting,
+ * ignore it.
+ */
+ first_cell = false;
+ break;
+ case WT_CELL_ADDR_INT:
+ /* An internal page, schedule its blocks to be freed. */
+ WT_ERR(__wt_verbose(session, WT_VERB_REBALANCE,
+ "free-list append internal page: %s",
+ __wt_addr_string(
+ session, unpack.data, unpack.size, rs->tmp1)));
+ WT_ERR(__rebalance_fl_append(
+ session, unpack.data, unpack.size, rs));
+
+ /* Read and recursively walk the page. */
+ WT_ERR(__wt_bt_read(
+ session, buf, unpack.data, unpack.size));
+ WT_ERR(__rebalance_row_walk(session, buf->data, rs));
+ break;
+ case WT_CELL_ADDR_LEAF:
+ case WT_CELL_ADDR_LEAF_NO:
+ /*
+ * A leaf page.
+ * We can't trust the 0th key on an internal page (we
+ * often don't store them in reconciliation because it
+ * saves space), get it from the underlying leaf page.
+ * Else, if the internal page key is an overflow key,
+ * instantiate it and use it.
+ * Else, we can use the internal page's key as is, it's
+ * sufficient for the page.
+ */
+ if (first_cell) {
+ WT_ERR(__rebalance_row_leaf_key(session,
+ unpack.data, unpack.size, leafkey, rs));
+ p = leafkey->data;
+ len = leafkey->size;
+ } else if (key.type == WT_CELL_KEY_OVFL) {
+ WT_ERR(__wt_dsk_cell_data_ref(
+ session, WT_PAGE_ROW_INT, &key, leafkey));
+ p = leafkey->data;
+ len = leafkey->size;
+ } else {
+ p = key.data;
+ len = key.size;
+ }
+ WT_ERR(__rebalance_leaf_append(session,
+ p, len, WT_RECNO_OOB, unpack.data, unpack.size,
+ unpack.type == WT_CELL_ADDR_LEAF ?
+ WT_ADDR_LEAF : WT_ADDR_LEAF_NO, rs));
+
+ first_cell = false;
+ break;
+ WT_ILLEGAL_VALUE_ERR(session);
+ }
+ }
+
+err: __wt_scr_free(session, &buf);
+ __wt_scr_free(session, &leafkey);
+ return (ret);
+}
+
+/*
+ * __wt_bt_rebalance --
+ * Rebalance the last checkpoint in the file.
+ */
+int
+__wt_bt_rebalance(WT_SESSION_IMPL *session, const char *cfg[])
+{
+ WT_BTREE *btree;
+ WT_DECL_RET;
+ WT_REBALANCE_STUFF *rs, _rstuff;
+ bool evict_reset;
+
+ WT_UNUSED(cfg);
+
+ btree = S2BT(session);
+
+ /*
+ * If the tree has never been written to disk, we're done, rebalance
+ * walks disk images, not in-memory pages. For the same reason, the
+ * tree has to be clean.
+ */
+ if (btree->root.page->dsk == NULL)
+ return (0);
+ if (btree->modified)
+ WT_RET_MSG(session, EINVAL,
+ "tree is modified, only clean trees may be rebalanced");
+
+ WT_CLEAR(_rstuff);
+ rs = &_rstuff;
+
+ WT_ERR(__wt_scr_alloc(session, 0, &rs->tmp1));
+ WT_ERR(__wt_scr_alloc(session, 0, &rs->tmp2));
+
+ /* Set the internal page tree type. */
+ rs->type = btree->root.page->type;
+
+ /*
+ * Get exclusive access to the file. (Not required, the only page in the
+ * cache is the root page, and that cannot be evicted; however, this way
+ * eviction ignores the tree entirely.)
+ */
+ WT_ERR(__wt_evict_file_exclusive_on(session, &evict_reset));
+
+ /* Recursively walk the tree. */
+ switch (rs->type) {
+ case WT_PAGE_ROW_INT:
+ WT_ERR(
+ __rebalance_row_walk(session, btree->root.page->dsk, rs));
+ break;
+ case WT_PAGE_COL_INT:
+ WT_ERR(
+ __rebalance_col_walk(session, btree->root.page->dsk, rs));
+ break;
+ WT_ILLEGAL_VALUE_ERR(session);
+ }
+
+ /* Build a new root page. */
+ WT_ERR(__rebalance_internal(session, rs));
+
+ /*
+ * Schedule the free of the original blocks (they shouldn't actually be
+ * freed until the next checkpoint completes).
+ */
+ WT_ERR(__rebalance_free_original(session, rs));
+
+ /*
+ * Swap the old root page for our newly built root page, writing the new
+ * root page as part of a checkpoint will finish the rebalance.
+ */
+ __wt_page_out(session, &btree->root.page);
+ btree->root.page = rs->root;
+ rs->root = NULL;
+
+err: /* Discard any leftover root page we created. */
+ if (rs->root != NULL) {
+ __wt_page_modify_clear(session, rs->root);
+ __wt_page_out(session, &rs->root);
+ }
+
+ /* Discard any leftover leaf and internal page information. */
+ __rebalance_discard(session, rs);
+
+ __wt_scr_free(session, &rs->tmp1);
+ __wt_scr_free(session, &rs->tmp2);
+
+ return (ret);
+}
diff --git a/src/btree/bt_ret.c b/src/btree/bt_ret.c
index c7a4b8e22f4..ebc0499f6a2 100644
--- a/src/btree/bt_ret.c
+++ b/src/btree/bt_ret.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c
index 756ffd98f3a..8d78bda79fb 100644
--- a/src/btree/bt_slvg.c
+++ b/src/btree/bt_slvg.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -595,22 +595,18 @@ __slvg_trk_leaf(WT_SESSION_IMPL *session,
WT_ERR(__wt_row_leaf_key_copy(session, page,
&page->pg_row_d[page->pg_row_entries - 1], &trk->row_stop));
- if (WT_VERBOSE_ISSET(session, WT_VERB_SALVAGE)) {
- WT_ERR(__wt_buf_set_printable(session, ss->tmp1,
- trk->row_start.data, trk->row_start.size));
- WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
- "%s start key %.*s",
- __wt_addr_string(session,
- trk->trk_addr, trk->trk_addr_size, ss->tmp2),
- (int)ss->tmp1->size, (char *)ss->tmp1->data));
- WT_ERR(__wt_buf_set_printable(session, ss->tmp1,
- trk->row_stop.data, trk->row_stop.size));
- WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
- "%s stop key %.*s",
- __wt_addr_string(session,
- trk->trk_addr, trk->trk_addr_size, ss->tmp2),
- (int)ss->tmp1->size, (char *)ss->tmp1->data));
- }
+ WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
+ "%s start key %s",
+ __wt_addr_string(session,
+ trk->trk_addr, trk->trk_addr_size, ss->tmp1),
+ __wt_buf_set_printable(session,
+ trk->row_start.data, trk->row_start.size, ss->tmp2)));
+ WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
+ "%s stop key %s",
+ __wt_addr_string(session,
+ trk->trk_addr, trk->trk_addr_size, ss->tmp1),
+ __wt_buf_set_printable(session,
+ trk->row_stop.data, trk->row_stop.size, ss->tmp2)));
/* Row-store pages can contain overflow items. */
WT_ERR(__slvg_trk_leaf_ovfl(session, dsk, trk));
@@ -1807,7 +1803,7 @@ err: if (page != NULL)
*/
static int
__slvg_row_build_internal(
- WT_SESSION_IMPL *session, uint32_t leaf_cnt, WT_STUFF *ss)
+ WT_SESSION_IMPL *session, uint32_t leaf_cnt, WT_STUFF *ss)
{
WT_ADDR *addr;
WT_DECL_RET;
@@ -1821,7 +1817,7 @@ __slvg_row_build_internal(
/* Allocate a row-store root (internal) page and fill it in. */
WT_RET(__wt_page_alloc(
- session, WT_PAGE_ROW_INT, 0, leaf_cnt, true, &page));
+ session, WT_PAGE_ROW_INT, WT_RECNO_OOB, leaf_cnt, true, &page));
WT_ERR(__slvg_modify_init(session, page));
pindex = WT_INTL_INDEX_GET_SAFE(page);
@@ -1937,16 +1933,12 @@ __slvg_row_build_leaf(
btree->collator, key, &trk->row_start, &cmp));
if (cmp >= 0)
break;
- if (WT_VERBOSE_ISSET(session, WT_VERB_SALVAGE)) {
- WT_ERR(__wt_buf_set_printable(session,
- ss->tmp1, key->data, key->size));
- WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
- "%s merge discarding leading key %.*s",
- __wt_addr_string(session,
- trk->trk_addr, trk->trk_addr_size,
- ss->tmp2), (int)ss->tmp1->size,
- (char *)ss->tmp1->data));
- }
+ WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
+ "%s merge discarding leading key %.*s",
+ __wt_addr_string(session,
+ trk->trk_addr, trk->trk_addr_size, ss->tmp1),
+ __wt_buf_set_printable(
+ session, key->data, key->size, ss->tmp2)));
++skip_start;
}
if (F_ISSET(trk, WT_TRACK_CHECK_STOP))
@@ -1961,16 +1953,12 @@ __slvg_row_build_leaf(
btree->collator, key, &trk->row_stop, &cmp));
if (cmp < 0)
break;
- if (WT_VERBOSE_ISSET(session, WT_VERB_SALVAGE)) {
- WT_ERR(__wt_buf_set_printable(session,
- ss->tmp1, key->data, key->size));
- WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
- "%s merge discarding trailing key %.*s",
- __wt_addr_string(session,
- trk->trk_addr, trk->trk_addr_size,
- ss->tmp2), (int)ss->tmp1->size,
- (char *)ss->tmp1->data));
- }
+ WT_ERR(__wt_verbose(session, WT_VERB_SALVAGE,
+ "%s merge discarding trailing key %.*s",
+ __wt_addr_string(session,
+ trk->trk_addr, trk->trk_addr_size, ss->tmp1),
+ __wt_buf_set_printable(
+ session, key->data, key->size, ss->tmp2)));
++skip_stop;
}
diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c
index 12f4197e9e7..102265c0a8f 100644
--- a/src/btree/bt_split.c
+++ b/src/btree/bt_split.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -15,6 +15,22 @@
} while (0)
/*
+ * A note on error handling: main split functions first allocate/initialize new
+ * structures; failures during that period are handled by discarding the memory
+ * and returning an error code, the caller knows the split didn't happen and
+ * proceeds accordingly. Second, split functions update the tree, and a failure
+ * in that period is catastrophic, any partial update to the tree requires a
+ * panic, we can't recover. Third, once the split is complete and the tree has
+ * been fully updated, we have to ignore most errors, the split is complete and
+ * correct, callers have to proceed accordingly.
+ */
+typedef enum {
+ WT_ERR_IGNORE, /* Ignore minor errors */
+ WT_ERR_PANIC, /* Panic on all errors */
+ WT_ERR_RETURN /* Clean up and return error */
+} WT_SPLIT_ERROR_PHASE;
+
+/*
* __split_oldest_gen --
* Calculate the oldest active split generation.
*/
@@ -512,8 +528,9 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
WT_PAGE_INDEX *alloc_index, *child_pindex, *pindex;
WT_REF **alloc_refp;
WT_REF **child_refp, *ref, **root_refp;
+ WT_SPLIT_ERROR_PHASE complete;
size_t child_incr, root_decr, root_incr, size;
- uint64_t split_gen;
+ uint64_t recno, split_gen;
uint32_t children, chunk, i, j, remain;
uint32_t slots;
void *p;
@@ -539,7 +556,7 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
btree = S2BT(session);
alloc_index = NULL;
root_decr = root_incr = 0;
- complete = ERR_RETURN;
+ complete = WT_ERR_RETURN;
/* The root page will be marked dirty, make sure that will succeed. */
WT_RET(__wt_page_modify_init(session, root));
@@ -589,8 +606,11 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
for (root_refp = pindex->index,
alloc_refp = alloc_index->index, i = 0; i < children; ++i) {
slots = i == children - 1 ? remain : chunk;
+
+ recno = root->type == WT_PAGE_COL_INT ?
+ (*root_refp)->key.recno : WT_RECNO_OOB;
WT_ERR(__wt_page_alloc(
- session, root->type, 0, slots, false, &child));
+ session, root->type, recno, slots, false, &child));
/*
* Initialize the page's child reference; we need a copy of the
@@ -605,12 +625,10 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
WT_ERR(__wt_row_ikey(session, 0, p, size, ref));
root_incr += sizeof(WT_IKEY) + size;
} else
- ref->key.recno = (*root_refp)->key.recno;
+ ref->key.recno = recno;
ref->state = WT_REF_MEM;
/* Initialize the child page. */
- if (root->type == WT_PAGE_COL_INT)
- child->pg_intl_recno = (*root_refp)->key.recno;
child->pg_intl_parent_ref = ref;
/* Mark it dirty. */
@@ -623,7 +641,7 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
* threads may be underneath us right now changing the structure
* state.) However, if the WT_REF structures reference on-page
* information, we have to fix that, because the disk image for
- * the page that has an page index entry for the WT_REF is about
+ * the page that has a page index entry for the WT_REF is about
* to change.
*/
child_pindex = WT_INTL_INDEX_GET_SAFE(child);
@@ -641,7 +659,7 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
root_refp - pindex->index == (ptrdiff_t)pindex->entries);
/* Start making real changes to the tree, errors are fatal. */
- complete = ERR_PANIC;
+ complete = WT_ERR_PANIC;
/* Prepare the WT_REFs for the move. */
__split_ref_step1(session, alloc_index, false);
@@ -661,7 +679,7 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
WT_ERR(__split_ref_step2(session, alloc_index, false));
/* The split is complete and correct, ignore benign errors. */
- complete = ERR_IGNORE;
+ complete = WT_ERR_IGNORE;
/* We've installed the allocated page-index, ensure error handling. */
alloc_index = NULL;
@@ -687,15 +705,15 @@ __split_root(WT_SESSION_IMPL *session, WT_PAGE *root)
__wt_page_modify_set(session, root);
err: switch (complete) {
- case ERR_RETURN:
+ case WT_ERR_RETURN:
__wt_free_ref_index(session, root, alloc_index, true);
break;
- case ERR_PANIC:
+ case WT_ERR_PANIC:
__wt_err(session, ret,
"fatal error during root page split to deepen the tree");
ret = WT_PANIC;
break;
- case ERR_IGNORE:
+ case WT_ERR_IGNORE:
if (ret != 0 && ret != WT_PANIC) {
__wt_err(session, ret,
"ignoring not-fatal error during root page split "
@@ -721,19 +739,21 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new,
WT_PAGE *parent;
WT_PAGE_INDEX *alloc_index, *pindex;
WT_REF **alloc_refp, *next_ref;
+ WT_SPLIT_ERROR_PHASE complete;
size_t parent_decr, size;
uint64_t split_gen;
- uint32_t i, j;
+ uint32_t hint, i, j;
uint32_t deleted_entries, parent_entries, result_entries;
uint32_t *deleted_refs;
- bool complete, empty_parent;
+ bool empty_parent;
parent = ref->home;
alloc_index = pindex = NULL;
parent_decr = 0;
parent_entries = 0;
- complete = empty_parent = false;
+ empty_parent = false;
+ complete = WT_ERR_RETURN;
/* The parent page will be marked dirty, make sure that will succeed. */
WT_RET(__wt_page_modify_init(session, parent));
@@ -751,7 +771,7 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new,
* array anyway. Switch them to the special split state, so that any
* reading thread will restart.
*/
- WT_RET(__wt_scr_alloc(session, 10 * sizeof(uint32_t), &scr));
+ WT_ERR(__wt_scr_alloc(session, 10 * sizeof(uint32_t), &scr));
for (deleted_entries = 0, i = 0; i < parent_entries; ++i) {
next_ref = pindex->index[i];
WT_ASSERT(session, next_ref->state != WT_REF_SPLIT);
@@ -791,28 +811,40 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new,
* Allocate and initialize a new page index array for the parent, then
* copy references from the original index array, plus references from
* the newly created split array, into place.
+ *
+ * Update the WT_REF's page-index hint as we go. This can race with a
+ * thread setting the hint based on an older page-index, and the change
+ * isn't backed out in the case of an error, so there ways for the hint
+ * to be wrong; OK because it's just a hint.
*/
size = sizeof(WT_PAGE_INDEX) + result_entries * sizeof(WT_REF *);
WT_ERR(__wt_calloc(session, 1, size, &alloc_index));
parent_incr += size;
alloc_index->index = (WT_REF **)(alloc_index + 1);
alloc_index->entries = result_entries;
- for (alloc_refp = alloc_index->index, i = 0; i < parent_entries; ++i) {
+ for (alloc_refp = alloc_index->index,
+ hint = i = 0; i < parent_entries; ++i) {
next_ref = pindex->index[i];
if (next_ref == ref)
for (j = 0; j < new_entries; ++j) {
ref_new[j]->home = parent;
+ ref_new[j]->pindex_hint = hint++;
*alloc_refp++ = ref_new[j];
}
- else if (next_ref->state != WT_REF_SPLIT)
+ else if (next_ref->state != WT_REF_SPLIT) {
/* Skip refs we have marked for deletion. */
+ next_ref->pindex_hint = hint++;
*alloc_refp++ = next_ref;
+ }
}
/* Check that we filled in all the entries. */
WT_ASSERT(session,
alloc_refp - alloc_index->index == (ptrdiff_t)result_entries);
+ /* Start making real changes to the tree, errors are fatal. */
+ complete = WT_ERR_PANIC;
+
/*
* Confirm the parent page's index hasn't moved then update it, which
* makes the split visible to threads descending the tree.
@@ -853,16 +885,8 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref, WT_REF **ref_new,
*/
WT_FULL_BARRIER();
- /*
- * A note on error handling: failures before we swapped the new page
- * index into the parent can be resolved by freeing allocated memory
- * because the original page is unchanged, we can continue to use it
- * and we have not yet modified the parent. Failures after we swap
- * the new page index into the parent are also relatively benign, the
- * split is OK and complete. For those reasons, we ignore errors past
- * this point unless there's a panic.
- */
- complete = true;
+ /* The split is complete and correct, ignore benign errors. */
+ complete = WT_ERR_IGNORE;
WT_ERR(__wt_verbose(session, WT_VERB_SPLIT,
"%p: %s %s" "split into parent %p, %" PRIu32 " -> %" PRIu32
@@ -946,7 +970,8 @@ err: __wt_scr_free(session, &scr);
* nothing really bad can have happened, and our caller has to proceed
* with the split.
*/
- if (!complete) {
+ switch (complete) {
+ case WT_ERR_RETURN:
for (i = 0; i < parent_entries; ++i) {
next_ref = pindex->index[i];
if (next_ref->state == WT_REF_SPLIT)
@@ -954,20 +979,28 @@ err: __wt_scr_free(session, &scr);
}
__wt_free_ref_index(session, NULL, alloc_index, false);
-
/*
* The split couldn't proceed because the parent would be empty,
* return EBUSY so our caller knows to unlock the WT_REF that's
* being deleted, but don't be noisy, there's nothing wrong.
*/
if (empty_parent)
- return (EBUSY);
+ ret = EBUSY;
+ break;
+ case WT_ERR_PANIC:
+ __wt_err(session, ret, "fatal error during parent page split");
+ ret = WT_PANIC;
+ break;
+ case WT_ERR_IGNORE:
+ if (ret != 0 && ret != WT_PANIC) {
+ __wt_err(session, ret,
+ "ignoring not-fatal error during parent page "
+ "split");
+ ret = 0;
+ }
+ break;
}
-
- if (ret != 0 && ret != WT_PANIC)
- __wt_err(session, ret,
- "ignoring not-fatal error during parent page split");
- return (ret == WT_PANIC || !complete ? ret : 0);
+ return (ret);
}
/*
@@ -983,8 +1016,9 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
WT_PAGE_INDEX *alloc_index, *child_pindex, *pindex, *replace_index;
WT_REF **alloc_refp;
WT_REF **child_refp, *page_ref, **page_refp, *ref;
+ WT_SPLIT_ERROR_PHASE complete;
size_t child_incr, page_decr, page_incr, parent_incr, size;
- uint64_t split_gen;
+ uint64_t recno, split_gen;
uint32_t children, chunk, i, j, remain;
uint32_t slots;
void *p;
@@ -1012,7 +1046,7 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
alloc_index = replace_index = NULL;
page_ref = page->pg_intl_parent_ref;
page_decr = page_incr = parent_incr = 0;
- complete = ERR_RETURN;
+ complete = WT_ERR_RETURN;
/*
* Our caller is holding the page locked to single-thread splits, which
@@ -1081,8 +1115,11 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
WT_ASSERT(session, page_refp == pindex->index + chunk);
for (alloc_refp = alloc_index->index + 1, i = 1; i < children; ++i) {
slots = i == children - 1 ? remain : chunk;
+
+ recno = page->type == WT_PAGE_COL_INT ?
+ (*page_refp)->key.recno : WT_RECNO_OOB;
WT_ERR(__wt_page_alloc(
- session, page->type, 0, slots, false, &child));
+ session, page->type, recno, slots, false, &child));
/*
* Initialize the page's child reference; we need a copy of the
@@ -1097,12 +1134,10 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
WT_ERR(__wt_row_ikey(session, 0, p, size, ref));
parent_incr += sizeof(WT_IKEY) + size;
} else
- ref->key.recno = (*page_refp)->key.recno;
+ ref->key.recno = recno;
ref->state = WT_REF_MEM;
/* Initialize the child page. */
- if (page->type == WT_PAGE_COL_INT)
- child->pg_intl_recno = (*page_refp)->key.recno;
child->pg_intl_parent_ref = ref;
/* Mark it dirty. */
@@ -1133,7 +1168,7 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
page_refp - pindex->index == (ptrdiff_t)pindex->entries);
/* Start making real changes to the tree, errors are fatal. */
- complete = ERR_PANIC;
+ complete = WT_ERR_PANIC;
/* Prepare the WT_REFs for the move. */
__split_ref_step1(session, alloc_index, true);
@@ -1157,7 +1192,7 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
WT_ERR(__split_ref_step2(session, alloc_index, true));
/* The split is complete and correct, ignore benign errors. */
- complete = ERR_IGNORE;
+ complete = WT_ERR_IGNORE;
/*
* Push out the changes: not required for correctness, but no reason
@@ -1193,16 +1228,16 @@ __split_internal(WT_SESSION_IMPL *session, WT_PAGE *parent, WT_PAGE *page)
__wt_page_modify_set(session, page);
err: switch (complete) {
- case ERR_RETURN:
+ case WT_ERR_RETURN:
__wt_free_ref_index(session, page, alloc_index, true);
__wt_free_ref_index(session, page, replace_index, false);
break;
- case ERR_PANIC:
+ case WT_ERR_PANIC:
__wt_err(session, ret,
"fatal error during internal page split");
ret = WT_PANIC;
break;
- case ERR_IGNORE:
+ case WT_ERR_IGNORE:
if (ret != 0 && ret != WT_PANIC) {
__wt_err(session, ret,
"ignoring not-fatal error during internal page "
@@ -1654,10 +1689,11 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
WT_DECL_RET;
WT_DECL_ITEM(key);
WT_INSERT *ins, **insp, *moved_ins, *prev_ins;
- WT_INSERT_HEAD *ins_head;
+ WT_INSERT_HEAD *ins_head, *tmp_ins_head;
WT_PAGE *page, *right;
WT_REF *child, *split_ref[2] = { NULL, NULL };
size_t page_decr, parent_incr, right_incr;
+ uint8_t type;
int i;
WT_STAT_FAST_CONN_INCR(session, cache_inmem_split);
@@ -1666,6 +1702,7 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
page = ref->page;
right = NULL;
page_decr = parent_incr = right_incr = 0;
+ type = page->type;
/*
* Assert splitting makes sense; specifically assert the page is dirty,
@@ -1679,9 +1716,12 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
F_SET_ATOMIC(page, WT_PAGE_SPLIT_INSERT);
/* Find the last item on the page. */
- ins_head = page->pg_row_entries == 0 ?
- WT_ROW_INSERT_SMALLEST(page) :
- WT_ROW_INSERT_SLOT(page, page->pg_row_entries - 1);
+ if (type == WT_PAGE_ROW_LEAF)
+ ins_head = page->pg_row_entries == 0 ?
+ WT_ROW_INSERT_SMALLEST(page) :
+ WT_ROW_INSERT_SLOT(page, page->pg_row_entries - 1);
+ else
+ ins_head = WT_COL_APPEND(page);
moved_ins = WT_SKIP_LAST(ins_head);
/*
@@ -1692,14 +1732,12 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
* The new WT_REF is not quite identical: we have to instantiate a key,
* and the new reference is visible to readers once the split completes.
*
- * The key-instantiation code checks for races, leave the key fields
- * zeroed we don't trigger them.
- *
* Don't copy any deleted page state: we may be splitting a page that
* was instantiated after a truncate and that history should not be
* carried onto these new child pages.
*/
WT_ERR(__wt_calloc_one(session, &split_ref[0]));
+ parent_incr += sizeof(WT_REF);
child = split_ref[0];
child->page = ref->page;
child->home = ref->home;
@@ -1713,49 +1751,82 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
*/
ref->addr = NULL;
- /*
- * Copy the first key from the original page into first ref in the new
- * parent. Pages created in memory always have a "smallest" insert
- * list, so look there first. If we don't find one, get the first key
- * from the disk image.
- *
- * We can't just use the key from the original ref: it may have been
- * suffix-compressed, and after the split the truncated key may not be
- * valid.
- */
- WT_ERR(__wt_scr_alloc(session, 0, &key));
- if ((ins = WT_SKIP_FIRST(WT_ROW_INSERT_SMALLEST(page))) != NULL) {
- key->data = WT_INSERT_KEY(ins);
- key->size = WT_INSERT_KEY_SIZE(ins);
+ if (type == WT_PAGE_ROW_LEAF) {
+ /*
+ * Copy the first key from the original page into first ref in
+ * the new parent. Pages created in memory always have a
+ * "smallest" insert list, so look there first. If we don't
+ * find one, get the first key from the disk image.
+ *
+ * We can't just use the key from the original ref: it may have
+ * been suffix-compressed, and after the split the truncated key
+ * may not be valid.
+ */
+ WT_ERR(__wt_scr_alloc(session, 0, &key));
+ if ((ins =
+ WT_SKIP_FIRST(WT_ROW_INSERT_SMALLEST(page))) != NULL) {
+ key->data = WT_INSERT_KEY(ins);
+ key->size = WT_INSERT_KEY_SIZE(ins);
+ } else
+ WT_ERR(__wt_row_leaf_key(
+ session, page, &page->pg_row_d[0], key, true));
+ WT_ERR(__wt_row_ikey(session, 0, key->data, key->size, child));
+ parent_incr += sizeof(WT_IKEY) + key->size;
+ __wt_scr_free(session, &key);
} else
- WT_ERR(__wt_row_leaf_key(
- session, page, &page->pg_row_d[0], key, true));
- WT_ERR(__wt_row_ikey(session, 0, key->data, key->size, child));
- parent_incr += sizeof(WT_REF) + sizeof(WT_IKEY) + key->size;
- __wt_scr_free(session, &key);
+ child->key.recno = ref->key.recno;
/*
* The second page in the split is a new WT_REF/page pair.
*/
- WT_ERR(__wt_page_alloc(session, WT_PAGE_ROW_LEAF, 0, 0, false, &right));
- WT_ERR(__wt_calloc_one(session, &right->pg_row_ins));
- WT_ERR(__wt_calloc_one(session, &right->pg_row_ins[0]));
+ if (type == WT_PAGE_ROW_LEAF)
+ WT_ERR(__wt_page_alloc(session,
+ type, WT_RECNO_OOB, 0, false, &right));
+ else
+ WT_ERR(__wt_page_alloc(session,
+ type, WT_INSERT_RECNO(moved_ins), 0, false, &right));
+
+ /*
+ * The new page is dirty by definition, column-store splits update the
+ * page-modify structure, so create it now.
+ */
+ WT_ERR(__wt_page_modify_init(session, right));
+ __wt_page_modify_set(session, right);
+
+ if (type == WT_PAGE_ROW_LEAF) {
+ WT_ERR(__wt_calloc_one(session, &right->pg_row_ins));
+ WT_ERR(__wt_calloc_one(session, &right->pg_row_ins[0]));
+ } else {
+ WT_ERR(__wt_calloc_one(session, &right->modify->mod_append));
+ WT_ERR(__wt_calloc_one(session, &right->modify->mod_append[0]));
+ }
right_incr += sizeof(WT_INSERT_HEAD);
right_incr += sizeof(WT_INSERT_HEAD *);
WT_ERR(__wt_calloc_one(session, &split_ref[1]));
+ parent_incr += sizeof(WT_REF);
child = split_ref[1];
child->page = right;
child->state = WT_REF_MEM;
- WT_ERR(__wt_row_ikey(session, 0,
- WT_INSERT_KEY(moved_ins), WT_INSERT_KEY_SIZE(moved_ins),
- child));
- parent_incr +=
- sizeof(WT_REF) + sizeof(WT_IKEY) + WT_INSERT_KEY_SIZE(moved_ins);
- /* The new page is dirty by definition. */
- WT_ERR(__wt_page_modify_init(session, right));
- __wt_page_modify_set(session, right);
+ if (type == WT_PAGE_ROW_LEAF) {
+ WT_ERR(__wt_row_ikey(session, 0,
+ WT_INSERT_KEY(moved_ins), WT_INSERT_KEY_SIZE(moved_ins),
+ child));
+ parent_incr += sizeof(WT_IKEY) + WT_INSERT_KEY_SIZE(moved_ins);
+ } else
+ child->key.recno = WT_INSERT_RECNO(moved_ins);
+
+ /*
+ * Allocation operations completed, we're going to split.
+ *
+ * Record the split column-store page record, used in reconciliation.
+ */
+ if (type != WT_PAGE_ROW_LEAF) {
+ WT_ASSERT(session,
+ page->modify->mod_split_recno == WT_RECNO_OOB);
+ page->modify->mod_split_recno = child->key.recno;
+ }
/*
* We modified the page above, which will have set the first dirty
@@ -1779,15 +1850,16 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
page_decr, right_incr, __wt_update_list_memsize(moved_ins->upd));
/*
- * Allocation operations completed, move the last insert list item from
- * the original page to the new page.
+ * Move the last insert list item from the original page to the new
+ * page.
*
* First, update the item to the new child page. (Just append the entry
* for simplicity, the previous skip list pointers originally allocated
* can be ignored.)
*/
- right->pg_row_ins[0]->head[0] =
- right->pg_row_ins[0]->tail[0] = moved_ins;
+ tmp_ins_head = type == WT_PAGE_ROW_LEAF ?
+ right->pg_row_ins[0] : right->modify->mod_append[0];
+ tmp_ins_head->head[0] = tmp_ins_head->tail[0] = moved_ins;
/*
* Remove the entry from the orig page (i.e truncate the skip list).
@@ -1872,34 +1944,40 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
__wt_cache_page_inmem_incr(session, right, right_incr);
/*
- * Split into the parent. After this, the original page is no
+ * Split into the parent. On successful return, the original page is no
* longer locked, so we cannot safely look at it.
*/
page = NULL;
if ((ret = __split_parent(
- session, ref, split_ref, 2, parent_incr, false, true)) != 0) {
- /*
- * Move the insert list element back to the original page list.
- * For simplicity, the previous skip list pointers originally
- * allocated can be ignored, just append the entry to the end of
- * the level 0 list. As before, we depend on the list having
- * multiple elements and ignore the edge cases small lists have.
- */
- right->pg_row_ins[0]->head[0] =
- right->pg_row_ins[0]->tail[0] = NULL;
- ins_head->tail[0]->next[0] = moved_ins;
- ins_head->tail[0] = moved_ins;
+ session, ref, split_ref, 2, parent_incr, false, true)) == 0)
+ return (0);
- /*
- * We marked the new page dirty; we're going to discard it, but
- * first mark it clean and fix up the cache statistics.
- */
- __wt_page_modify_clear(session, right);
+ /*
+ * Failure.
+ *
+ * Reset the split column-store page record.
+ */
+ page->modify->mod_split_recno = WT_RECNO_OOB;
- WT_ERR(ret);
- }
+ /*
+ * Clear the allocated page's reference to the moved insert list element
+ * so it's not freed when we discard the page.
+ *
+ * Move the element back to the original page list. For simplicity, the
+ * previous skip list pointers originally allocated can be ignored, just
+ * append the entry to the end of the level 0 list. As before, we depend
+ * on the list having multiple elements and ignore the edge cases small
+ * lists have.
+ */
+ if (type == WT_PAGE_ROW_LEAF)
+ right->pg_row_ins[0]->head[0] =
+ right->pg_row_ins[0]->tail[0] = NULL;
+ else
+ right->modify->mod_append[0]->head[0] =
+ right->modify->mod_append[0]->tail[0] = NULL;
- return (0);
+ ins_head->tail[0]->next[0] = moved_ins;
+ ins_head->tail[0] = moved_ins;
err: if (split_ref[0] != NULL) {
/*
@@ -1907,15 +1985,23 @@ err: if (split_ref[0] != NULL) {
*/
ref->addr = split_ref[0]->addr;
- __wt_free(session, split_ref[0]->key.ikey);
+ if (type == WT_PAGE_ROW_LEAF)
+ __wt_free(session, split_ref[0]->key.ikey);
__wt_free(session, split_ref[0]);
}
if (split_ref[1] != NULL) {
- __wt_free(session, split_ref[1]->key.ikey);
+ if (type == WT_PAGE_ROW_LEAF)
+ __wt_free(session, split_ref[1]->key.ikey);
__wt_free(session, split_ref[1]);
}
- if (right != NULL)
+ if (right != NULL) {
+ /*
+ * We marked the new page dirty; we're going to discard it,
+ * but first mark it clean and fix up the cache statistics.
+ */
+ __wt_page_modify_clear(session, right);
__wt_page_out(session, &right);
+ }
__wt_scr_free(session, &key);
return (ret);
}
diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c
index 5dd75835b0b..3d5abf34147 100644
--- a/src/btree/bt_stat.c
+++ b/src/btree/bt_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -35,10 +35,10 @@ __wt_btree_stat_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst)
WT_STAT_SET(session, stats, btree_fixed_len, btree->bitcnt);
WT_STAT_SET(session, stats, btree_maximum_depth, btree->maximum_depth);
- WT_STAT_SET(session, stats, btree_maxintlpage, btree->maxintlpage);
WT_STAT_SET(session, stats, btree_maxintlkey, btree->maxintlkey);
- WT_STAT_SET(session, stats, btree_maxleafpage, btree->maxleafpage);
+ WT_STAT_SET(session, stats, btree_maxintlpage, btree->maxintlpage);
WT_STAT_SET(session, stats, btree_maxleafkey, btree->maxleafkey);
+ WT_STAT_SET(session, stats, btree_maxleafpage, btree->maxleafpage);
WT_STAT_SET(session, stats, btree_maxleafvalue, btree->maxleafvalue);
/* Everything else is really, really expensive. */
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c
index 86607d8f187..5cbd8d1e996 100644
--- a/src/btree/bt_sync.c
+++ b/src/btree/bt_sync.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_upgrade.c b/src/btree/bt_upgrade.c
index 6b403595ecc..a9ff16ad496 100644
--- a/src/btree/bt_upgrade.c
+++ b/src/btree/bt_upgrade.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/bt_vrfy.c b/src/btree/bt_vrfy.c
index d745210bdce..ae2c20be1b6 100644
--- a/src/btree/bt_vrfy.c
+++ b/src/btree/bt_vrfy.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -30,8 +30,7 @@ typedef struct {
u_int depth, depth_internal[100], depth_leaf[100];
- WT_ITEM *tmp1; /* Temporary buffer */
- WT_ITEM *tmp2; /* Temporary buffer */
+ WT_ITEM *tmp1, *tmp2, *tmp3, *tmp4; /* Temporary buffers */
} WT_VSTUFF;
static void __verify_checkpoint_reset(WT_VSTUFF *);
@@ -170,6 +169,8 @@ __wt_verify(WT_SESSION_IMPL *session, const char *cfg[])
WT_ERR(__wt_scr_alloc(session, 0, &vs->max_addr));
WT_ERR(__wt_scr_alloc(session, 0, &vs->tmp1));
WT_ERR(__wt_scr_alloc(session, 0, &vs->tmp2));
+ WT_ERR(__wt_scr_alloc(session, 0, &vs->tmp3));
+ WT_ERR(__wt_scr_alloc(session, 0, &vs->tmp4));
/* Check configuration strings. */
WT_ERR(__verify_config(session, cfg, vs));
@@ -251,6 +252,8 @@ err: /* Inform the underlying block manager we're done. */
__wt_scr_free(session, &vs->max_addr);
__wt_scr_free(session, &vs->tmp1);
__wt_scr_free(session, &vs->tmp2);
+ __wt_scr_free(session, &vs->tmp3);
+ __wt_scr_free(session, &vs->tmp4);
return (ret);
}
@@ -570,10 +573,14 @@ __verify_row_int_key_order(WT_SESSION_IMPL *session,
WT_RET_MSG(session, WT_ERROR,
"the internal key in entry %" PRIu32 " on the page at %s "
"sorts before the last key appearing on page %s, earlier "
- "in the tree",
+ "in the tree: %s, %s",
entry,
__wt_page_addr_string(session, ref, vs->tmp1),
- (char *)vs->max_addr->data);
+ (char *)vs->max_addr->data,
+ __wt_buf_set_printable(session,
+ item.data, item.size, vs->tmp2),
+ __wt_buf_set_printable(session,
+ vs->max_key->data, vs->max_key->size, vs->tmp3));
/* Update the largest key we've seen to the key just checked. */
WT_RET(__wt_buf_set(session, vs->max_key, item.data, item.size));
@@ -628,11 +635,15 @@ __verify_row_leaf_key_order(
btree->collator, vs->tmp1, (WT_ITEM *)vs->max_key, &cmp));
if (cmp < 0)
WT_RET_MSG(session, WT_ERROR,
- "the first key on the page at %s sorts equal to or "
- "less than a key appearing on the page at %s, "
- "earlier in the tree",
- __wt_page_addr_string(session, ref, vs->tmp1),
- (char *)vs->max_addr->data);
+ "the first key on the page at %s sorts equal to "
+ "or less than the last key appearing on the page "
+ "at %s, earlier in the tree: %s, %s",
+ __wt_page_addr_string(session, ref, vs->tmp2),
+ (char *)vs->max_addr->data,
+ __wt_buf_set_printable(session,
+ vs->tmp1->data, vs->tmp1->size, vs->tmp3),
+ __wt_buf_set_printable(session,
+ vs->max_key->data, vs->max_key->size, vs->tmp4));
}
/* Update the largest key we've seen to the last key on this page. */
diff --git a/src/btree/bt_vrfy_dsk.c b/src/btree/bt_vrfy_dsk.c
index a703fbd540d..5480a25b5ec 100644
--- a/src/btree/bt_vrfy_dsk.c
+++ b/src/btree/bt_vrfy_dsk.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -197,6 +197,8 @@ __verify_dsk_row(
WT_DECL_ITEM(current);
WT_DECL_ITEM(last_ovfl);
WT_DECL_ITEM(last_pfx);
+ WT_DECL_ITEM(tmp1);
+ WT_DECL_ITEM(tmp2);
WT_DECL_RET;
WT_ITEM *last;
enum { FIRST, WAS_KEY, WAS_VALUE } last_cell_type;
@@ -213,6 +215,8 @@ __verify_dsk_row(
WT_ERR(__wt_scr_alloc(session, 0, &current));
WT_ERR(__wt_scr_alloc(session, 0, &last_pfx));
WT_ERR(__wt_scr_alloc(session, 0, &last_ovfl));
+ WT_ERR(__wt_scr_alloc(session, 0, &tmp1));
+ WT_ERR(__wt_scr_alloc(session, 0, &tmp2));
last = last_ovfl;
end = (uint8_t *)dsk + dsk->mem_size;
@@ -402,8 +406,12 @@ key_compare: /*
if (cmp >= 0)
WT_ERR_VRFY(session,
"the %" PRIu32 " and %" PRIu32 " keys on "
- "page at %s are incorrectly sorted",
- cell_num - 2, cell_num, tag);
+ "page at %s are incorrectly sorted: %s, %s",
+ cell_num - 2, cell_num, tag,
+ __wt_buf_set_printable(session,
+ last->data, last->size, tmp1),
+ __wt_buf_set_printable(session,
+ current->data, current->size, tmp2));
}
/*
@@ -464,6 +472,8 @@ err: if (ret == 0)
__wt_scr_free(session, &current);
__wt_scr_free(session, &last_pfx);
__wt_scr_free(session, &last_ovfl);
+ __wt_scr_free(session, &tmp1);
+ __wt_scr_free(session, &tmp2);
return (ret);
}
diff --git a/src/btree/bt_walk.c b/src/btree/bt_walk.c
index abb18529041..49a59b89552 100644
--- a/src/btree/bt_walk.c
+++ b/src/btree/bt_walk.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -9,11 +9,11 @@
#include "wt_internal.h"
/*
- * __page_refp --
+ * __ref_index_slot --
* Return the page's index and slot for a reference.
*/
static inline void
-__page_refp(WT_SESSION_IMPL *session,
+__ref_index_slot(WT_SESSION_IMPL *session,
WT_REF *ref, WT_PAGE_INDEX **pindexp, uint32_t *slotp)
{
WT_PAGE_INDEX *pindex;
@@ -32,37 +32,36 @@ retry: WT_INTL_INDEX_GET(session, ref->home, pindex);
* loop is from the hint to the end of the list, and the second loop
* is from the start of the list to the end of the list. (The second
* loop overlaps the first, but that only happen in cases where we've
- * deepened the tree and aren't going to find our slot at all, that's
- * not worth optimizing.)
+ * split the tree and aren't going to find our slot at all, that's not
+ * worth optimizing.)
*
* It's not an error for the reference hint to be wrong, it just means
* the first retrieval (which sets the hint for subsequent retrievals),
* is slower.
*/
i = ref->pindex_hint;
- if (i < pindex->entries && pindex->index[i]->page == ref->page) {
+ if (i < pindex->entries && pindex->index[i] == ref) {
*pindexp = pindex;
*slotp = i;
return;
}
while (++i < pindex->entries)
- if (pindex->index[i]->page == ref->page) {
+ if (pindex->index[i] == ref) {
*pindexp = pindex;
*slotp = ref->pindex_hint = i;
return;
}
for (i = 0; i < pindex->entries; ++i)
- if (pindex->index[i]->page == ref->page) {
+ if (pindex->index[i] == ref) {
*pindexp = pindex;
*slotp = ref->pindex_hint = i;
return;
}
/*
- * If we don't find our reference, the page split into a new level and
- * our home pointer references the wrong page. After internal pages
- * deepen, their reference structure home value are updated; yield and
- * wait for that to happen.
+ * If we don't find our reference, the page split and our home pointer
+ * references the wrong page. When internal pages split, their WT_REF
+ * structure home values are updated; yield and wait for that to happen.
*/
__wt_yield();
goto retry;
@@ -116,13 +115,45 @@ __page_ascend(WT_SESSION_IMPL *session,
parent_ref = ref->home->pg_intl_parent_ref;
if (__wt_ref_is_root(parent_ref))
break;
- __page_refp(session, parent_ref, pindexp, slotp);
+ __ref_index_slot(session, parent_ref, pindexp, slotp);
/*
- * When internal pages split, the WT_REF structures being moved
- * are updated first. If the WT_REF we started with references
- * the same page as we found on our search of the parent, there
- * is a consistent view.
+ * There's a split race when a cursor moving forwards through
+ * the tree ascends the tree. If we're splitting an internal
+ * page into its parent, we move the WT_REF structures and
+ * then update the parent's page index before updating the split
+ * page's page index, and it's not an atomic update. A thread
+ * can read the split page's original page index and then read
+ * the parent page's replacement index.
+ *
+ * This can create a race for next-cursor movements.
+ *
+ * For example, imagine an internal page with 3 child pages,
+ * with the namespaces a-f, g-h and i-j; the first child page
+ * splits. The parent starts out with the following page-index:
+ *
+ * | ... | a | g | i | ... |
+ *
+ * which changes to this:
+ *
+ * | ... | a | c | e | g | i | ... |
+ *
+ * The split page starts out with the following page-index:
+ *
+ * | a | b | c | d | e | f |
+ *
+ * Imagine a cursor finishing the 'f' part of the namespace that
+ * starts its ascent to the parent's 'a' slot. Then the page
+ * splits and the parent page's page index is replaced. If the
+ * cursor then searches the parent's replacement page index for
+ * the 'a' slot, it finds it and then increments to the slot
+ * after the 'a' slot, the 'c' slot, and then it incorrectly
+ * repeats its traversal of part of the namespace.
+ *
+ * This function takes a WT_REF argument which is the page from
+ * which we start our ascent. If the parent's slot we find in
+ * our search doesn't point to the same page as that initial
+ * WT_REF, there's a race and we start over again.
*/
if (ref->home == parent_ref->page)
break;
@@ -132,6 +163,91 @@ __page_ascend(WT_SESSION_IMPL *session,
}
/*
+ * __page_descend --
+ * Descend the tree one level.
+ */
+static void
+__page_descend(WT_SESSION_IMPL *session,
+ WT_PAGE *page, WT_PAGE_INDEX **pindexp, uint32_t *slotp, bool prev)
+{
+ WT_PAGE_INDEX *pindex;
+
+ /*
+ * Ref is a child page into which we're descending, and on which we
+ * have a hazard pointer.
+ */
+ for (;; __wt_yield()) {
+ WT_INTL_INDEX_GET(session, page, pindex);
+ *slotp = prev ? pindex->entries - 1 : 0;
+
+ /*
+ * There's a split race when a cursor moving backwards through
+ * the tree descends the tree. If we're splitting an internal
+ * page into its parent, we move the WT_REF structures and
+ * update the parent's page index before updating the split
+ * page's page index, and it's not an atomic update. A thread
+ * can read the parent page's replacement page index and then
+ * read the split page's original index.
+ *
+ * This can create a race for previous-cursor movements.
+ *
+ * For example, imagine an internal page with 3 child pages,
+ * with the namespaces a-f, g-h and i-j; the first child page
+ * splits. The parent starts out with the following page-index:
+ *
+ * | ... | a | g | i | ... |
+ *
+ * The split page starts out with the following page-index:
+ *
+ * | a | b | c | d | e | f |
+ *
+ * The first step is to move the c-f ranges into a new subtree,
+ * so, for example we might have two new internal pages 'c' and
+ * 'e', where the new 'c' page references the c-d namespace and
+ * the new 'e' page references the e-f namespace. The top of the
+ * subtree references the parent page, but until the parent's
+ * page index is updated, any threads in the subtree won't be
+ * able to ascend out of the subtree. However, once the parent
+ * page's page index is updated to this:
+ *
+ * | ... | a | c | e | g | i | ... |
+ *
+ * threads in the subtree can ascend into the parent. Imagine a
+ * cursor in the c-d part of the namespace that ascends to the
+ * parent's 'c' slot. It would then decrement to the slot before
+ * the 'c' slot, the 'a' slot.
+ *
+ * The previous-cursor movement selects the last slot in the 'a'
+ * page; if the split page's page-index hasn't been updated yet,
+ * it will select the 'f' slot, which is incorrect. Once the
+ * split page's page index is updated to this:
+ *
+ * | a | b |
+ *
+ * the previous-cursor movement will select the 'b' slot, which
+ * is correct.
+ *
+ * This function takes an argument which is the internal page
+ * from which we're descending. If the last slot on the page no
+ * longer points to the current page as its "home", the page is
+ * being split and part of its namespace moved. We have the
+ * correct page and we don't have to move, all we have to do is
+ * wait until the split page's page index is updated.
+ *
+ * No test is necessary for a next-cursor movement because we
+ * do right-hand splits on internal pages and the initial part
+ * of the page's namespace won't change as part of a split.
+ * Instead of testing the direction boolean, do the test the
+ * previous cursor movement requires in all cases, even though
+ * it will always succeed for a next-cursor movement.
+ */
+ if (pindex->index[*slotp]->home == page)
+ break;
+ }
+ *pindexp = pindex;
+}
+
+/*
* __tree_walk_internal --
* Move to the next/previous page in the tree.
*/
@@ -225,7 +341,7 @@ __tree_walk_internal(WT_SESSION_IMPL *session,
}
/* Figure out the current slot in the WT_REF array. */
- __page_refp(session, ref, &pindex, &slot);
+ __ref_index_slot(session, ref, &pindex, &slot);
for (;;) {
/*
@@ -270,12 +386,8 @@ __tree_walk_internal(WT_SESSION_IMPL *session,
* the parent can't have been evicted.
*/
if (!LF_ISSET(WT_READ_SKIP_INTL)) {
- if ((ret = __wt_page_swap(
- session, couple, ref, flags)) != 0) {
- WT_TRET(__wt_page_release(
- session, couple, flags));
- WT_ERR(ret);
- }
+ WT_ERR(__wt_page_swap(
+ session, couple, ref, flags));
*refp = ref;
goto done;
}
@@ -389,7 +501,8 @@ __tree_walk_internal(WT_SESSION_IMPL *session,
}
}
- ret = __wt_page_swap(session, couple, ref, flags);
+ ret = __wt_page_swap(session, couple, ref,
+ WT_READ_NOTFOUND_OK | WT_READ_RESTART_OK | flags);
/*
* Not-found is an expected return when only walking
@@ -434,7 +547,7 @@ __tree_walk_internal(WT_SESSION_IMPL *session,
couple == couple_orig ||
WT_PAGE_IS_INTERNAL(couple->page));
ref = couple;
- __page_refp(session, ref, &pindex, &slot);
+ __ref_index_slot(session, ref, &pindex, &slot);
if (couple == couple_orig)
break;
}
@@ -446,9 +559,10 @@ __tree_walk_internal(WT_SESSION_IMPL *session,
*/
if (WT_PAGE_IS_INTERNAL(ref->page)) {
descend: couple = ref;
- WT_INTL_INDEX_GET(session, ref->page, pindex);
- slot = prev ? pindex->entries - 1 : 0;
empty_internal = true;
+
+ __page_descend(
+ session, ref->page, &pindex, &slot, prev);
} else {
/*
* Optionally skip leaf pages, the second half.
diff --git a/src/btree/col_modify.c b/src/btree/col_modify.c
index bb2de3f444b..645d98d9c9b 100644
--- a/src/btree/col_modify.c
+++ b/src/btree/col_modify.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/col_srch.c b/src/btree/col_srch.c
index e9fa570f97b..cb5a227495f 100644
--- a/src/btree/col_srch.c
+++ b/src/btree/col_srch.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -9,12 +9,60 @@
#include "wt_internal.h"
/*
+ * __check_leaf_key_range --
+ * Check the search key is in the leaf page's key range.
+ */
+static inline int
+__check_leaf_key_range(WT_SESSION_IMPL *session,
+ uint64_t recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt)
+{
+ WT_PAGE_INDEX *pindex;
+ uint32_t indx;
+
+ /*
+ * There are reasons we can't do the fast checks, and we continue with
+ * the leaf page search in those cases, only skipping the complete leaf
+ * page search if we know it's not going to work.
+ */
+ cbt->compare = 0;
+
+ /*
+ * Check if the search key is smaller than the parent's starting key for
+ * this page.
+ */
+ if (recno < leaf->key.recno) {
+ cbt->compare = 1; /* page keys > search key */
+ return (0);
+ }
+
+ /*
+ * Check if the search key is greater than or equal to the starting key
+ * for the parent's next page.
+ *
+ * !!!
+ * Check that "indx + 1" is a valid page-index entry first, because it
+ * also checks that "indx" is a valid page-index entry, and we have to
+ * do that latter check before looking at the indx slot of the array
+ * for a match to leaf (in other words, our page hint might be wrong).
+ */
+ WT_INTL_INDEX_GET(session, leaf->home, pindex);
+ indx = leaf->pindex_hint;
+ if (indx + 1 < pindex->entries && pindex->index[indx] == leaf)
+ if (recno >= pindex->index[indx + 1]->key.recno) {
+ cbt->compare = -1; /* page keys < search key */
+ return (0);
+ }
+
+ return (0);
+}
+
+/*
* __wt_col_search --
* Search a column-store tree for a specific record-based key.
*/
int
__wt_col_search(WT_SESSION_IMPL *session,
- uint64_t recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt)
+ uint64_t search_recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt)
{
WT_BTREE *btree;
WT_COL *cip;
@@ -24,6 +72,7 @@ __wt_col_search(WT_SESSION_IMPL *session,
WT_PAGE *page;
WT_PAGE_INDEX *pindex, *parent_pindex;
WT_REF *current, *descent;
+ uint64_t recno;
uint32_t base, indx, limit;
int depth;
@@ -31,8 +80,38 @@ __wt_col_search(WT_SESSION_IMPL *session,
__cursor_pos_clear(cbt);
- /* We may only be searching a single leaf page, not the full tree. */
+ /*
+ * When appending a new record, the search record number will be an
+ * out-of-band value, search for the largest key in the table instead.
+ */
+ if ((recno = search_recno) == WT_RECNO_OOB)
+ recno = UINT64_MAX;
+
+ /*
+ * We may be searching only a single leaf page, not the full tree. In
+ * the normal case where the page links to a parent, check the page's
+ * parent keys before doing the full search, it's faster when the
+ * cursor is being re-positioned. (One case where the page doesn't
+ * have a parent is if it is being re-instantiated in memory as part
+ * of a split).
+ */
if (leaf != NULL) {
+ WT_ASSERT(session, search_recno != WT_RECNO_OOB);
+
+ if (leaf->home != NULL) {
+ WT_RET(__check_leaf_key_range(
+ session, recno, leaf, cbt));
+ if (cbt->compare != 0) {
+ /*
+ * !!!
+ * WT_CURSOR.search_near uses the slot value to
+ * decide if there was an on-page match.
+ */
+ cbt->slot = 0;
+ return (0);
+ }
+ }
+
current = leaf;
goto leaf_only;
}
@@ -103,7 +182,8 @@ descend: /*
* page; otherwise return on error, the swap call ensures we're
* holding nothing on failure.
*/
- if ((ret = __wt_page_swap(session, current, descent, 0)) == 0) {
+ if ((ret = __wt_page_swap(
+ session, current, descent, WT_READ_RESTART_OK)) == 0) {
current = descent;
continue;
}
@@ -120,7 +200,17 @@ leaf_only:
page = current->page;
cbt->ref = current;
cbt->recno = recno;
- cbt->compare = 0;
+
+ /*
+ * Don't bother searching if the caller is appending a new record where
+ * we'll allocate the record number; we're not going to find a match by
+ * definition, and we figure out the record number and position when we
+ * do the work.
+ */
+ if (search_recno == WT_RECNO_OOB) {
+ cbt->compare = -1;
+ return (0);
+ }
/*
* Set the on-page slot to an impossible value larger than any possible
@@ -142,6 +232,7 @@ leaf_only:
* that's impossibly large for the page. We do have additional setup to
* do in that case, the record may be appended to the page.
*/
+ cbt->compare = 0;
if (page->type == WT_PAGE_COL_FIX) {
if (recno < page->pg_fix_recno) {
cbt->compare = 1;
@@ -190,18 +281,10 @@ past_end:
* This is a rarely used path: we normally find exact matches, because
* column-store files are dense, but in this case the caller searched
* past the end of the table.
- *
- * Don't bother searching if the caller is appending a new record where
- * we'll allocate the record number; we're not going to find a match by
- * definition, and we figure out the position when we do the work.
*/
cbt->ins_head = WT_COL_APPEND(page);
- if (recno == UINT64_MAX)
- cbt->ins = NULL;
- else
- cbt->ins = __col_insert_search(
- cbt->ins_head, cbt->ins_stack, cbt->next_stack, recno);
- if (cbt->ins == NULL)
+ if ((cbt->ins = __col_insert_search(
+ cbt->ins_head, cbt->ins_stack, cbt->next_stack, recno)) == NULL)
cbt->compare = -1;
else {
cbt->recno = WT_INSERT_RECNO(cbt->ins);
@@ -212,14 +295,5 @@ past_end:
else
cbt->compare = -1;
}
-
- /*
- * Note if the record is past the maximum record in the tree, the cursor
- * search functions need to know for fixed-length column-stores because
- * appended records implicitly create any skipped records, and cursor
- * search functions have to handle that case.
- */
- if (cbt->compare == -1)
- F_SET(cbt, WT_CBT_MAX_RECORD);
return (0);
}
diff --git a/src/btree/row_key.c b/src/btree/row_key.c
index 6d24708e59c..8b9e858ec18 100644
--- a/src/btree/row_key.c
+++ b/src/btree/row_key.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/row_modify.c b/src/btree/row_modify.c
index 0fc02948dd3..176016bb340 100644
--- a/src/btree/row_modify.c
+++ b/src/btree/row_modify.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/btree/row_srch.c b/src/btree/row_srch.c
index 079f9d3bad1..c06274cdb17 100644
--- a/src/btree/row_srch.c
+++ b/src/btree/row_srch.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -132,6 +132,76 @@ __wt_search_insert(
}
/*
+ * __check_leaf_key_range --
+ * Check the search key is in the leaf page's key range.
+ */
+static inline int
+__check_leaf_key_range(WT_SESSION_IMPL *session,
+ WT_ITEM *srch_key, WT_REF *leaf, WT_CURSOR_BTREE *cbt)
+{
+ WT_BTREE *btree;
+ WT_COLLATOR *collator;
+ WT_ITEM *item;
+ WT_PAGE_INDEX *pindex;
+ uint32_t indx;
+ int cmp;
+
+ btree = S2BT(session);
+ collator = btree->collator;
+ item = cbt->tmp;
+
+ /*
+ * There are reasons we can't do the fast checks, and we continue with
+ * the leaf page search in those cases, only skipping the complete leaf
+ * page search if we know it's not going to work.
+ */
+ cbt->compare = 0;
+
+ /*
+ * First, confirm we have the right parent page-index slot, and quit if
+ * we don't. We don't search for the correct slot, that would make this
+ * cheap test expensive.
+ */
+ WT_INTL_INDEX_GET(session, leaf->home, pindex);
+ indx = leaf->pindex_hint;
+ if (indx >= pindex->entries || pindex->index[indx] != leaf)
+ return (0);
+
+ /*
+ * Check if the search key is smaller than the parent's starting key for
+ * this page.
+ *
+ * We can't compare against slot 0 on a row-store internal page because
+ * reconciliation doesn't build it, it may not be a valid key.
+ */
+ if (indx != 0) {
+ __wt_ref_key(leaf->home, leaf, &item->data, &item->size);
+ WT_RET(__wt_compare(session, collator, srch_key, item, &cmp));
+ if (cmp < 0) {
+ cbt->compare = 1; /* page keys > search key */
+ return (0);
+ }
+ }
+
+ /*
+ * Check if the search key is greater than or equal to the starting key
+ * for the parent's next page.
+ */
+ ++indx;
+ if (indx < pindex->entries) {
+ __wt_ref_key(
+ leaf->home, pindex->index[indx], &item->data, &item->size);
+ WT_RET(__wt_compare(session, collator, srch_key, item, &cmp));
+ if (cmp >= 0) {
+ cbt->compare = -1; /* page keys < search key */
+ return (0);
+ }
+ }
+
+ return (0);
+}
+
+/*
* __wt_row_search --
* Search a row-store tree for a specific key.
*/
@@ -179,8 +249,29 @@ __wt_row_search(WT_SESSION_IMPL *session,
append_check = insert && cbt->append_tree;
descend_right = true;
- /* We may only be searching a single leaf page, not the full tree. */
+ /*
+ * We may be searching only a single leaf page, not the full tree. In
+ * the normal case where the page links to a parent, check the page's
+ * parent keys before doing the full search, it's faster when the
+ * cursor is being re-positioned. (One case where the page doesn't
+ * have a parent is if it is being re-instantiated in memory as part
+ * of a split).
+ */
if (leaf != NULL) {
+ if (leaf->home != NULL) {
+ WT_RET(__check_leaf_key_range(
+ session, srch_key, leaf, cbt));
+ if (cbt->compare != 0) {
+ /*
+ * !!!
+ * WT_CURSOR.search_near uses the slot value to
+ * decide if there was an on-page match.
+ */
+ cbt->slot = 0;
+ return (0);
+ }
+ }
+
current = leaf;
goto leaf_only;
}
@@ -196,15 +287,6 @@ restart_page: page = current->page;
WT_INTL_INDEX_GET(session, page, pindex);
- /*
- * Fast-path internal pages with one child, a common case for
- * the root page in new trees.
- */
- if (pindex->entries == 1) {
- descent = pindex->index[0];
- goto descend;
- }
-
/* Fast-path appends. */
if (append_check) {
descent = pindex->index[pindex->entries - 1];
@@ -345,7 +427,8 @@ descend: /*
* page; otherwise return on error, the swap call ensures we're
* holding nothing on failure.
*/
- if ((ret = __wt_page_swap(session, current, descent, 0)) == 0) {
+ if ((ret = __wt_page_swap(
+ session, current, descent, WT_READ_RESTART_OK)) == 0) {
current = descent;
continue;
}
@@ -542,12 +625,18 @@ err: /*
int
__wt_row_random_leaf(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
{
- WT_INSERT *p, *t;
+ WT_INSERT *ins, **start, **stop;
+ WT_INSERT_HEAD *ins_head;
WT_PAGE *page;
- uint32_t cnt;
+ uint32_t choice, entries, i;
+ int level;
page = cbt->ref->page;
+ start = stop = NULL; /* [-Wconditional-uninitialized] */
+ entries = 0; /* [-Wconditional-uninitialized] */
+
+ /* If the page has disk-based entries, select from them. */
if (page->pg_row_entries != 0) {
cbt->compare = 0;
cbt->slot = __wt_random(&session->rnd) % page->pg_row_entries;
@@ -562,24 +651,115 @@ __wt_row_random_leaf(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
/*
* If the tree is new (and not empty), it might have a large insert
- * list. Count how many records are in the list.
+ * list.
*/
F_SET(cbt, WT_CBT_SEARCH_SMALLEST);
if ((cbt->ins_head = WT_ROW_INSERT_SMALLEST(page)) == NULL)
return (WT_NOTFOUND);
- for (cnt = 1, p = WT_SKIP_FIRST(cbt->ins_head);; ++cnt)
- if ((p = WT_SKIP_NEXT(p)) == NULL)
- break;
/*
- * Select a random number from 0 to (N - 1), return that record.
+ * Walk down the list until we find a level with at least 50 entries,
+ * that's where we'll start rolling random numbers. The value 50 is
+ * used to ignore levels with only a few entries, that is, levels which
+ * are potentially badly skewed.
*/
- cnt = __wt_random(&session->rnd) % cnt;
- for (p = t = WT_SKIP_FIRST(cbt->ins_head);; t = p)
- if (cnt-- == 0 || (p = WT_SKIP_NEXT(p)) == NULL)
+ for (ins_head = cbt->ins_head,
+ level = WT_SKIP_MAXDEPTH - 1; level >= 0; --level) {
+ start = &ins_head->head[level];
+ for (entries = 0, stop = start;
+ *stop != NULL; stop = &(*stop)->next[level])
+ ++entries;
+
+ if (entries > 50)
break;
+ }
+
+ /*
+ * If it's a tiny list and we went all the way to level 0, correct the
+ * level; entries is correctly set.
+ */
+ if (level < 0)
+ level = 0;
+
+ /*
+ * Step down the skip list levels, selecting a random chunk of the name
+ * space at each level.
+ */
+ while (level > 0) {
+ /*
+ * There are (entries) or (entries + 1) chunks of the name space
+ * considered at each level. They are: between start and the 1st
+ * element, between the 1st and 2nd elements, and so on to the
+ * last chunk which is the name space after the stop element on
+ * the current level. This last chunk of name space may or may
+ * not be there: as we descend the levels of the skip list, this
+ * chunk may appear, depending if the next level down has
+ * entries logically after the stop point in the current level.
+ * We can't ignore those entries: because of the algorithm used
+ * to determine the depth of a skiplist, there may be a large
+ * number of entries "revealed" by descending a level.
+ *
+ * If the next level down has more items after the current stop
+ * point, there are (entries + 1) chunks to consider, else there
+ * are (entries) chunks.
+ */
+ if (*(stop - 1) == NULL)
+ choice = __wt_random(&session->rnd) % entries;
+ else
+ choice = __wt_random(&session->rnd) % (entries + 1);
+
+ if (choice == entries) {
+ /*
+ * We selected the name space after the stop element on
+ * this level. Set the start point to the current stop
+ * point, descend a level and move the stop element to
+ * the end of the list, that is, the end of the newly
+ * discovered name space, counting entries as we go.
+ */
+ start = stop;
+ --start;
+ --level;
+ for (entries = 0, stop = start;
+ *stop != NULL; stop = &(*stop)->next[level])
+ ++entries;
+ } else {
+ /*
+ * We selected another name space on the level. Move the
+ * start pointer the selected number of entries forward
+ * to the start of the selected chunk (if the selected
+ * number is 0, start won't move). Set the stop pointer
+ * to the next element in the list and drop both start
+ * and stop down a level.
+ */
+ for (i = 0; i < choice; ++i)
+ start = &(*start)->next[level];
+ stop = &(*start)->next[level];
+
+ --start;
+ --stop;
+ --level;
+
+ /* Count the entries in the selected name space. */
+ for (entries = 0,
+ ins = *start; ins != *stop; ins = ins->next[level])
+ ++entries;
+ }
+ }
+
+ /*
+ * When we reach the bottom level, entries will already be set. Select
+ * a random entry from the name space and return it.
+ *
+ * It should be impossible for the entries count to be 0 at this point,
+ * but check for it out of paranoia and to quiet static testing tools.
+ */
+ if (entries > 0)
+ entries = __wt_random(&session->rnd) % entries;
+ for (ins = *start; entries > 0; --entries)
+ ins = ins->next[0];
+
+ cbt->ins = ins;
cbt->compare = 0;
- cbt->ins = t;
return (0);
}
@@ -617,7 +797,8 @@ restart_root:
* Swap the parent page for the child page; return on error,
* the swap function ensures we're holding nothing on failure.
*/
- if ((ret = __wt_page_swap(session, current, descent, 0)) == 0) {
+ if ((ret = __wt_page_swap(
+ session, current, descent, WT_READ_RESTART_OK)) == 0) {
current = descent;
continue;
}
diff --git a/src/cache/cache_las.c b/src/cache/cache_las.c
index d3a0265c13a..1ef8dd32bb4 100644
--- a/src/cache/cache_las.c
+++ b/src/cache/cache_las.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -18,6 +18,7 @@ __wt_las_stats_update(WT_SESSION_IMPL *session)
WT_CONNECTION_IMPL *conn;
WT_CONNECTION_STATS **cstats;
WT_DSRC_STATS **dstats;
+ int64_t v;
conn = S2C(session);
@@ -37,10 +38,10 @@ __wt_las_stats_update(WT_SESSION_IMPL *session)
dstats = ((WT_CURSOR_BTREE *)
conn->las_session->las_cursor)->btree->dhandle->stats;
- WT_STAT_SET(session, cstats,
- cache_lookaside_insert, WT_STAT_READ(dstats, cursor_insert));
- WT_STAT_SET(session, cstats,
- cache_lookaside_remove, WT_STAT_READ(dstats, cursor_remove));
+ v = WT_STAT_READ(dstats, cursor_insert);
+ WT_STAT_SET(session, cstats, cache_lookaside_insert, v);
+ v = WT_STAT_READ(dstats, cursor_remove);
+ WT_STAT_SET(session, cstats, cache_lookaside_remove, v);
}
/*
@@ -139,18 +140,27 @@ __wt_las_is_written(WT_SESSION_IMPL *session)
}
/*
- * __wt_las_cursor_create --
+ * __wt_las_cursor_open --
* Open a new lookaside table cursor.
*/
int
-__wt_las_cursor_create(WT_SESSION_IMPL *session, WT_CURSOR **cursorp)
+__wt_las_cursor_open(WT_SESSION_IMPL *session, WT_CURSOR **cursorp)
{
WT_BTREE *btree;
+ WT_DECL_RET;
const char *open_cursor_cfg[] = {
WT_CONFIG_BASE(session, WT_SESSION_open_cursor), NULL };
- WT_RET(__wt_open_cursor(
+ WT_WITHOUT_DHANDLE(session, ret = __wt_open_cursor(
session, WT_LAS_URI, NULL, open_cursor_cfg, cursorp));
+ WT_RET(ret);
+
+ /*
+ * Retrieve the btree from the cursor, rather than the session because
+ * we don't always switch the LAS handle in to the session before
+ * entering this function.
+ */
+ btree = ((WT_CURSOR_BTREE *)(*cursorp))->btree;
/*
* Set special flags for the lookaside table: the lookaside flag (used,
@@ -161,7 +171,6 @@ __wt_las_cursor_create(WT_SESSION_IMPL *session, WT_CURSOR **cursorp)
* opens (the first update is safe because it's single-threaded from
* wiredtiger_open).
*/
- btree = S2BT(session);
if (!F_ISSET(btree, WT_BTREE_LOOKASIDE))
F_SET(btree, WT_BTREE_LOOKASIDE);
if (!F_ISSET(btree, WT_BTREE_NO_CHECKPOINT))
diff --git a/src/config/config.c b/src/config/config.c
index 505b843aa86..f480ab83dbd 100644
--- a/src/config/config.c
+++ b/src/config/config.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -365,6 +365,9 @@ __config_next(WT_CONFIG *conf, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value)
conf, "Unexpected character", EINVAL));
case A_DOWN:
+ if (conf->top == -1)
+ return (__config_err(
+ conf, "Unbalanced brackets", EINVAL));
--conf->depth;
CAP(0);
break;
@@ -471,8 +474,7 @@ __config_next(WT_CONFIG *conf, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value)
if (conf->depth == 0)
return (WT_NOTFOUND);
- return (__config_err(conf,
- "Closing brackets missing from config string", EINVAL));
+ return (__config_err(conf, "Unbalanced brackets", EINVAL));
}
/*
diff --git a/src/config/config_api.c b/src/config/config_api.c
index 2aba80ebcdd..b5228c4329c 100644
--- a/src/config/config_api.c
+++ b/src/config/config_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_check.c b/src/config/config_check.c
index 6b9d6c563ad..c29013483f6 100644
--- a/src/config/config_check.c
+++ b/src/config/config_check.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_collapse.c b/src/config/config_collapse.c
index c997ac3a324..27bd6255a0a 100644
--- a/src/config/config_collapse.c
+++ b/src/config/config_collapse.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_def.c b/src/config/config_def.c
index 9d12e953498..879de670695 100644
--- a/src/config/config_def.c
+++ b/src/config/config_def.c
@@ -151,9 +151,9 @@ static const WT_CONFIG_CHECK confchk_WT_CONNECTION_reconfigure[] = {
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\",\"read\","
- "\"reconcile\",\"recovery\",\"salvage\",\"shared_cache\","
- "\"split\",\"temporary\",\"transaction\",\"verify\",\"version\","
- "\"write\"]",
+ "\"rebalance\",\"reconcile\",\"recovery\",\"salvage\","
+ "\"shared_cache\",\"split\",\"temporary\",\"transaction\","
+ "\"verify\",\"version\",\"write\"]",
NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
};
@@ -291,6 +291,7 @@ static const WT_CONFIG_CHECK confchk_WT_SESSION_create[] = {
static const WT_CONFIG_CHECK confchk_WT_SESSION_drop[] = {
{ "force", "boolean", NULL, NULL, NULL, 0 },
+ { "lock_wait", "boolean", NULL, NULL, NULL, 0 },
{ "remove_files", "boolean", NULL, NULL, NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
};
@@ -563,9 +564,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = {
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\",\"read\","
- "\"reconcile\",\"recovery\",\"salvage\",\"shared_cache\","
- "\"split\",\"temporary\",\"transaction\",\"verify\",\"version\","
- "\"write\"]",
+ "\"rebalance\",\"reconcile\",\"recovery\",\"salvage\","
+ "\"shared_cache\",\"split\",\"temporary\",\"transaction\","
+ "\"verify\",\"version\",\"write\"]",
NULL, 0 },
{ "write_through", "list",
NULL, "choices=[\"data\",\"log\"]",
@@ -643,9 +644,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = {
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\",\"read\","
- "\"reconcile\",\"recovery\",\"salvage\",\"shared_cache\","
- "\"split\",\"temporary\",\"transaction\",\"verify\",\"version\","
- "\"write\"]",
+ "\"rebalance\",\"reconcile\",\"recovery\",\"salvage\","
+ "\"shared_cache\",\"split\",\"temporary\",\"transaction\","
+ "\"verify\",\"version\",\"write\"]",
NULL, 0 },
{ "version", "string", NULL, NULL, NULL, 0 },
{ "write_through", "list",
@@ -718,9 +719,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = {
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\",\"read\","
- "\"reconcile\",\"recovery\",\"salvage\",\"shared_cache\","
- "\"split\",\"temporary\",\"transaction\",\"verify\",\"version\","
- "\"write\"]",
+ "\"rebalance\",\"reconcile\",\"recovery\",\"salvage\","
+ "\"shared_cache\",\"split\",\"temporary\",\"transaction\","
+ "\"verify\",\"version\",\"write\"]",
NULL, 0 },
{ "version", "string", NULL, NULL, NULL, 0 },
{ "write_through", "list",
@@ -793,9 +794,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = {
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"lsm_manager\",\"metadata\",\"mutex\",\"overflow\",\"read\","
- "\"reconcile\",\"recovery\",\"salvage\",\"shared_cache\","
- "\"split\",\"temporary\",\"transaction\",\"verify\",\"version\","
- "\"write\"]",
+ "\"rebalance\",\"reconcile\",\"recovery\",\"salvage\","
+ "\"shared_cache\",\"split\",\"temporary\",\"transaction\","
+ "\"verify\",\"version\",\"write\"]",
NULL, 0 },
{ "write_through", "list",
NULL, "choices=[\"data\",\"log\"]",
@@ -904,8 +905,8 @@ static const WT_CONFIG_ENTRY config_entries[] = {
confchk_WT_SESSION_create, 40
},
{ "WT_SESSION.drop",
- "force=0,remove_files=",
- confchk_WT_SESSION_drop, 2
+ "force=0,lock_wait=,remove_files=",
+ confchk_WT_SESSION_drop, 3
},
{ "WT_SESSION.join",
"bloom_bit_count=16,bloom_hash_count=8,compare=\"eq\",count=,"
@@ -926,6 +927,10 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"skip_sort_check=0,statistics=,target=",
confchk_WT_SESSION_open_cursor, 12
},
+ { "WT_SESSION.rebalance",
+ "",
+ NULL, 0
+ },
{ "WT_SESSION.reconfigure",
"isolation=read-committed",
confchk_WT_SESSION_reconfigure, 1
diff --git a/src/config/config_ext.c b/src/config/config_ext.c
index 5102f354b02..56c0018f8c3 100644
--- a/src/config/config_ext.c
+++ b/src/config/config_ext.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/config/config_upgrade.c b/src/config/config_upgrade.c
index 0bca1392b51..e9ba38c6693 100644
--- a/src/config/config_upgrade.c
+++ b/src/config/config_upgrade.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/api_version.c b/src/conn/api_version.c
index 6293d221417..a36cdb8d8eb 100644
--- a/src/conn/api_version.c
+++ b/src/conn/api_version.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_api.c b/src/conn/conn_api.c
index bd14e1bf4fd..2f62950a36e 100644
--- a/src/conn/conn_api.c
+++ b/src/conn/conn_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -1605,6 +1605,7 @@ __wt_verbose_config(WT_SESSION_IMPL *session, const char *cfg[])
{ "mutex", WT_VERB_MUTEX },
{ "overflow", WT_VERB_OVERFLOW },
{ "read", WT_VERB_READ },
+ { "rebalance", WT_VERB_REBALANCE },
{ "reconcile", WT_VERB_RECONCILE },
{ "recovery", WT_VERB_RECOVERY },
{ "salvage", WT_VERB_SALVAGE },
@@ -1749,7 +1750,7 @@ __conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
WT_ERR_NOTFOUND_OK(ret);
/* Flush the handle and rename the file into place. */
- ret = __wt_sync_and_rename_fp(
+ ret = __wt_sync_fp_and_rename(
session, &fp, WT_BASECONFIG_SET, WT_BASECONFIG);
if (0) {
@@ -2003,6 +2004,9 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
WT_ERR(__wt_sweep_config(session, cfg));
WT_ERR(__wt_verbose_config(session, cfg));
+ /* Initialize the OS page size for mmap */
+ conn->page_size = __wt_get_vm_pagesize();
+
/* Now that we know if verbose is configured, output the version. */
WT_ERR(__wt_verbose(
session, WT_VERB_VERSION, "%s", WIREDTIGER_VERSION_STRING));
@@ -2061,7 +2065,7 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
* DATABASE HOME, IT'S WHAT WE USE TO DECIDE IF WE'RE CREATING OR NOT.
*/
WT_ERR(__wt_turtle_init(session));
- WT_ERR(__wt_metadata_open(session));
+ WT_ERR(__wt_metadata_cursor(session, NULL));
/* Start the worker threads and run recovery. */
WT_ERR(__wt_connection_workers(session, cfg));
diff --git a/src/conn/conn_cache.c b/src/conn/conn_cache.c
index a1d509e75bd..1831aad5895 100644
--- a/src/conn/conn_cache.c
+++ b/src/conn/conn_cache.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_cache_pool.c b/src/conn/conn_cache_pool.c
index 8d16f94c092..72f23b015b7 100644
--- a/src/conn/conn_cache_pool.c
+++ b/src/conn/conn_cache_pool.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_ckpt.c b/src/conn/conn_ckpt.c
index b47e2550b23..a23350a5e46 100644
--- a/src/conn/conn_ckpt.c
+++ b/src/conn/conn_ckpt.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index c6d5b535b86..dedafc2b102 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -119,46 +119,29 @@ __wt_conn_dhandle_find(
}
/*
- * __conn_dhandle_mark_dead --
- * Mark a data handle dead.
- */
-static int
-__conn_dhandle_mark_dead(WT_SESSION_IMPL *session)
-{
- bool evict_reset;
-
- /*
- * Handle forced discard (e.g., when dropping a file).
- *
- * We need exclusive access to the file -- disable ordinary
- * eviction and drain any blocks already queued.
- */
- WT_RET(__wt_evict_file_exclusive_on(session, &evict_reset));
- F_SET(session->dhandle, WT_DHANDLE_DEAD);
- if (evict_reset)
- __wt_evict_file_exclusive_off(session);
- return (0);
-}
-
-/*
* __wt_conn_btree_sync_and_close --
* Sync and close the underlying btree handle.
*/
int
__wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force)
{
+ WT_BM *bm;
WT_BTREE *btree;
WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
- bool marked_dead, no_schema_lock;
+ bool evict_reset, marked_dead, no_schema_lock;
btree = S2BT(session);
+ bm = btree->bm;
dhandle = session->dhandle;
marked_dead = false;
if (!F_ISSET(dhandle, WT_DHANDLE_OPEN))
return (0);
+ /* Ensure that we aren't racing with the eviction server */
+ WT_RET(__wt_evict_file_exclusive_on(session, &evict_reset));
+
/*
* If we don't already have the schema lock, make it an error to try
* to acquire it. The problem is that we are holding an exclusive
@@ -191,8 +174,16 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force)
*/
if (!F_ISSET(btree,
WT_BTREE_SALVAGE | WT_BTREE_UPGRADE | WT_BTREE_VERIFY)) {
- if (force && (btree->bm == NULL || btree->bm->map == NULL)) {
- WT_ERR(__conn_dhandle_mark_dead(session));
+ if (force && (bm == NULL || !bm->is_mapped(bm, session))) {
+ F_SET(session->dhandle, WT_DHANDLE_DEAD);
+
+ /*
+ * Reset the tree's eviction priority, and the tree is
+ * evictable by definition.
+ */
+ __wt_evict_priority_clear(session);
+ F_CLR(S2BT(session), WT_BTREE_NO_EVICTION);
+
marked_dead = true;
}
if (!marked_dead || final)
@@ -215,6 +206,9 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, bool final, bool force)
err: __wt_spin_unlock(session, &dhandle->close_lock);
+ if (evict_reset)
+ __wt_evict_file_exclusive_off(session);
+
if (no_schema_lock)
F_CLR(session, WT_SESSION_NO_SCHEMA_LOCK);
@@ -650,8 +644,9 @@ __wt_conn_dhandle_discard_single(
F_SET(S2C(session)->cache, WT_CACHE_CLEAR_WALKS);
/* Try to remove the handle, protected by the data handle lock. */
- WT_WITH_HANDLE_LIST_LOCK(session,
- WT_TRET(__conn_dhandle_remove(session, final)));
+ WT_WITH_HANDLE_LIST_LOCK(session, tret,
+ tret = __conn_dhandle_remove(session, final));
+ WT_TRET(tret);
/*
* After successfully removing the handle, clean it up.
@@ -709,6 +704,15 @@ restart:
__wt_session_close_cache(session);
F_SET(session, WT_SESSION_NO_DATA_HANDLES);
+ /*
+ * The connection may have an open metadata cursor handle. We cannot
+ * close it before now because it's potentially used when discarding
+ * other open data handles. Close it before discarding the underlying
+ * metadata handle.
+ */
+ if (session->meta_cursor != NULL)
+ WT_TRET(session->meta_cursor->close(session->meta_cursor));
+
/* Close the metadata file handle. */
while ((dhandle = TAILQ_FIRST(&conn->dhqh)) != NULL)
WT_WITH_DHANDLE(session, dhandle,
diff --git a/src/conn/conn_handle.c b/src/conn/conn_handle.c
index cc4e3ae2681..12b4e87e921 100644
--- a/src/conn/conn_handle.c
+++ b/src/conn/conn_handle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_log.c b/src/conn/conn_log.c
index 1d44d816467..ed226393fb0 100644
--- a/src/conn/conn_log.c
+++ b/src/conn/conn_log.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -511,7 +511,7 @@ typedef struct {
* write_lsn in LSN order after the buffer is written to the log file.
*/
int
-__wt_log_wrlsn(WT_SESSION_IMPL *session)
+__wt_log_wrlsn(WT_SESSION_IMPL *session, int *yield)
{
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
@@ -550,6 +550,8 @@ restart:
* based on the release LSN, and then look for them in order.
*/
if (written_i > 0) {
+ if (yield != NULL)
+ *yield = 0;
WT_INSERTION_SORT(written, written_i,
WT_LOG_WRLSN_ENTRY, WT_WRLSN_ENTRY_CMP_LT);
/*
@@ -660,22 +662,31 @@ __log_wrlsn_server(void *arg)
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
WT_SESSION_IMPL *session;
+ int yield;
session = arg;
conn = S2C(session);
+ yield = 0;
while (F_ISSET(conn, WT_CONN_LOG_SERVER_RUN)) {
/*
* Write out any log record buffers.
*/
- WT_ERR(__wt_log_wrlsn(session));
- WT_ERR(__wt_cond_wait(session, conn->log_wrlsn_cond, 10000));
+ WT_ERR(__wt_log_wrlsn(session, &yield));
+ /*
+ * If __wt_log_wrlsn did work we want to yield instead of sleep.
+ */
+ if (yield++ < WT_THOUSAND)
+ __wt_yield();
+ else
+ WT_ERR(__wt_cond_wait(
+ session, conn->log_wrlsn_cond, 10000));
}
/*
* On close we need to do this one more time because there could
* be straggling log writes that need to be written.
*/
WT_ERR(__wt_log_force_write(session, 1));
- WT_ERR(__wt_log_wrlsn(session));
+ WT_ERR(__wt_log_wrlsn(session, NULL));
if (0) {
err: __wt_err(session, ret, "log wrlsn server error");
}
@@ -694,12 +705,12 @@ __log_server(void *arg)
WT_LOG *log;
WT_SESSION_IMPL *session;
int freq_per_sec;
- bool signalled;
+ bool locked, signalled;
session = arg;
conn = S2C(session);
log = conn->log;
- signalled = false;
+ locked = signalled = false;
/*
* Set this to the number of times per second we want to force out the
@@ -740,8 +751,22 @@ __log_server(void *arg)
/*
* Perform log pre-allocation.
*/
- if (conn->log_prealloc > 0)
- WT_ERR(__log_prealloc_once(session));
+ if (conn->log_prealloc > 0) {
+ /*
+ * Log file pre-allocation is disabled when a
+ * hot backup cursor is open because we have
+ * agreed not to rename or remove any files in
+ * the database directory.
+ */
+ WT_ERR(__wt_readlock(
+ session, conn->hot_backup_lock));
+ locked = true;
+ if (!conn->hot_backup)
+ WT_ERR(__log_prealloc_once(session));
+ WT_ERR(__wt_readunlock(
+ session, conn->hot_backup_lock));
+ locked = false;
+ }
/*
* Perform the archive.
@@ -768,6 +793,9 @@ __log_server(void *arg)
if (0) {
err: __wt_err(session, ret, "log server error");
+ if (locked)
+ WT_TRET(__wt_readunlock(
+ session, conn->hot_backup_lock));
}
return (WT_THREAD_RET_VALUE);
}
diff --git a/src/conn/conn_open.c b/src/conn/conn_open.c
index 4fe1db1c524..58577b4587d 100644
--- a/src/conn/conn_open.c
+++ b/src/conn/conn_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c
index 31438e10606..9edc6091b10 100644
--- a/src/conn/conn_stat.c
+++ b/src/conn/conn_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -340,8 +340,8 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp)
* any that match the list of object sources.
*/
if (conn->stat_sources != NULL) {
- WT_WITH_HANDLE_LIST_LOCK(session, ret =
- __wt_conn_btree_apply(
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
+ ret = __wt_conn_btree_apply(
session, false, NULL, __statlog_apply, NULL));
WT_RET(ret);
}
diff --git a/src/conn/conn_sweep.c b/src/conn/conn_sweep.c
index b9b46f3211c..a15aabdd6fe 100644
--- a/src/conn/conn_sweep.c
+++ b/src/conn/conn_sweep.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -64,11 +64,9 @@ __sweep_expire_one(WT_SESSION_IMPL *session)
WT_BTREE *btree;
WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
- bool evict_reset;
btree = S2BT(session);
dhandle = session->dhandle;
- evict_reset = false;
/*
* Acquire an exclusive lock on the handle and mark it dead.
@@ -92,9 +90,6 @@ __sweep_expire_one(WT_SESSION_IMPL *session)
!__wt_txn_visible_all(session, btree->rec_max_txn))
goto err;
- /* Ensure that we aren't racing with the eviction server */
- WT_ERR(__wt_evict_file_exclusive_on(session, &evict_reset));
-
/*
* Mark the handle as dead and close the underlying file
* handle. Closing the handle decrements the open file count,
@@ -102,9 +97,6 @@ __sweep_expire_one(WT_SESSION_IMPL *session)
*/
ret = __wt_conn_btree_sync_and_close(session, false, true);
- if (evict_reset)
- __wt_evict_file_exclusive_off(session);
-
err: WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
return (ret);
@@ -243,7 +235,7 @@ __sweep_remove_handles(WT_SESSION_IMPL *session)
if (!WT_DHANDLE_CAN_DISCARD(dhandle))
continue;
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __sweep_remove_one(session, dhandle));
if (ret == 0)
WT_STAT_FAST_CONN_INCR(session, dh_sweep_remove);
diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c
index 62ac2203b97..6d5d68000ee 100644
--- a/src/cursor/cur_backup.c
+++ b/src/cursor/cur_backup.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -80,13 +80,14 @@ __curbackup_close(WT_CURSOR *cursor)
int tret;
cb = (WT_CURSOR_BACKUP *)cursor;
+
CURSOR_API_CALL(cursor, session, close, NULL);
WT_TRET(__backup_cleanup_handles(session, cb));
WT_TRET(__wt_cursor_close(cursor));
session->bkp_cursor = NULL;
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, tret,
tret = __backup_stop(session)); /* Stop the backup. */
WT_TRET(tret);
@@ -139,7 +140,8 @@ __wt_curbackup_open(WT_SESSION_IMPL *session,
* Start the backup and fill in the cursor's list. Acquire the schema
* lock, we need a consistent view when creating a copy.
*/
- WT_WITH_SCHEMA_LOCK(session, ret = __backup_start(session, cb, cfg));
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __backup_start(session, cb, cfg));
WT_ERR(ret);
/* __wt_cursor_init is last so we don't have to clean up on error. */
@@ -339,11 +341,8 @@ __backup_all(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb)
cursor = NULL;
- /*
- * Open a cursor on the metadata file and copy all of the entries to
- * the hot backup file.
- */
- WT_ERR(__wt_metadata_cursor(session, NULL, &cursor));
+ /* Copy all of the metadata entries to the hot backup file. */
+ WT_RET(__wt_metadata_cursor(session, &cursor));
while ((ret = cursor->next(cursor)) == 0) {
WT_ERR(cursor->get_key(cursor, &key));
WT_ERR(cursor->get_value(cursor, &value));
@@ -375,13 +374,13 @@ __backup_all(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb)
}
WT_ERR_NOTFOUND_OK(ret);
+ WT_ERR(__wt_metadata_cursor_release(session, &cursor));
+
/* Build a list of the file objects that need to be copied. */
- WT_WITH_HANDLE_LIST_LOCK(session,
- ret = __wt_meta_btree_apply(
- session, __backup_list_all_append, NULL));
+ WT_WITH_HANDLE_LIST_LOCK(session, ret, ret =
+ __wt_meta_btree_apply(session, __backup_list_all_append, NULL));
-err: if (cursor != NULL)
- WT_TRET(cursor->close(cursor));
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
diff --git a/src/cursor/cur_bulk.c b/src/cursor/cur_bulk.c
index b996b934464..c013383fa61 100644
--- a/src/cursor/cur_bulk.c
+++ b/src/cursor/cur_bulk.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -9,6 +9,25 @@
#include "wt_internal.h"
/*
+ * __bulk_col_keycmp_err --
+ * Error routine when column-store keys inserted out-of-order.
+ */
+static int
+__bulk_col_keycmp_err(WT_CURSOR_BULK *cbulk)
+{
+ WT_CURSOR *cursor;
+ WT_SESSION_IMPL *session;
+
+ session = (WT_SESSION_IMPL *)cbulk->cbt.iface.session;
+ cursor = &cbulk->cbt.iface;
+
+ WT_RET_MSG(session, EINVAL,
+ "bulk-load presented with out-of-order keys: %" PRIu64 " is less "
+ "than previously inserted key %" PRIu64,
+ cursor->recno, cbulk->recno);
+}
+
+/*
* __curbulk_insert_fix --
* Fixed-length column-store bulk cursor insert.
*/
@@ -19,6 +38,7 @@ __curbulk_insert_fix(WT_CURSOR *cursor)
WT_CURSOR_BULK *cbulk;
WT_DECL_RET;
WT_SESSION_IMPL *session;
+ uint64_t recno;
cbulk = (WT_CURSOR_BULK *)cursor;
btree = cbulk->cbt.btree;
@@ -29,13 +49,63 @@ __curbulk_insert_fix(WT_CURSOR *cursor)
* until the bulk cursor is closed.
*/
CURSOR_API_CALL(cursor, session, insert, btree);
+ WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
- WT_CURSOR_NEEDVALUE(cursor);
+ /*
+ * If the "append" flag was configured, the application doesn't have to
+ * supply a key, else require a key.
+ */
+ if (F_ISSET(cursor, WT_CURSTD_APPEND))
+ recno = cbulk->recno + 1;
+ else {
+ WT_CURSOR_CHECKKEY(cursor);
+ if ((recno = cursor->recno) <= cbulk->recno)
+ WT_ERR(__bulk_col_keycmp_err(cbulk));
+ }
+ WT_CURSOR_CHECKVALUE(cursor);
+
+ /*
+ * Insert any skipped records as deleted records, update the current
+ * record count.
+ */
+ for (; recno != cbulk->recno + 1; ++cbulk->recno)
+ WT_ERR(__wt_bulk_insert_fix(session, cbulk, true));
+ cbulk->recno = recno;
+
+ /* Insert the current record. */
+ ret = __wt_bulk_insert_fix(session, cbulk, false);
+
+err: API_END_RET(session, ret);
+}
+
+/*
+ * __curbulk_insert_fix_bitmap --
+ * Fixed-length column-store bulk cursor insert for bitmaps.
+ */
+static int
+__curbulk_insert_fix_bitmap(WT_CURSOR *cursor)
+{
+ WT_BTREE *btree;
+ WT_CURSOR_BULK *cbulk;
+ WT_DECL_RET;
+ WT_SESSION_IMPL *session;
- WT_ERR(__wt_bulk_insert_fix(session, cbulk));
+ cbulk = (WT_CURSOR_BULK *)cursor;
+ btree = cbulk->cbt.btree;
+ /*
+ * Bulk cursor inserts are updates, but don't need auto-commit
+ * transactions because they are single-threaded and not visible
+ * until the bulk cursor is closed.
+ */
+ CURSOR_API_CALL(cursor, session, insert, btree);
WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
+ WT_CURSOR_CHECKVALUE(cursor);
+
+ /* Insert the current record. */
+ ret = __wt_bulk_insert_fix_bitmap(session, cbulk);
+
err: API_END_RET(session, ret);
}
@@ -50,7 +120,7 @@ __curbulk_insert_var(WT_CURSOR *cursor)
WT_CURSOR_BULK *cbulk;
WT_DECL_RET;
WT_SESSION_IMPL *session;
- bool duplicate;
+ uint64_t recno;
cbulk = (WT_CURSOR_BULK *)cursor;
btree = cbulk->cbt.btree;
@@ -61,45 +131,63 @@ __curbulk_insert_var(WT_CURSOR *cursor)
* until the bulk cursor is closed.
*/
CURSOR_API_CALL(cursor, session, insert, btree);
-
- WT_CURSOR_NEEDVALUE(cursor);
+ WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
/*
- * If this isn't the first value inserted, compare it against the last
- * value and increment the RLE count.
- *
- * Instead of a "first time" variable, I'm using the RLE count, because
- * it is only zero before the first row is inserted.
+ * If the "append" flag was configured, the application doesn't have to
+ * supply a key, else require a key.
*/
- duplicate = false;
- if (cbulk->rle != 0) {
- if (cbulk->last.size == cursor->value.size &&
- memcmp(cbulk->last.data, cursor->value.data,
- cursor->value.size) == 0) {
- ++cbulk->rle;
- duplicate = true;
- } else
- WT_ERR(__wt_bulk_insert_var(session, cbulk));
+ if (F_ISSET(cursor, WT_CURSTD_APPEND))
+ recno = cbulk->recno + 1;
+ else {
+ WT_CURSOR_CHECKKEY(cursor);
+ if ((recno = cursor->recno) <= cbulk->recno)
+ WT_ERR(__bulk_col_keycmp_err(cbulk));
}
+ WT_CURSOR_CHECKVALUE(cursor);
+
+ if (!cbulk->first_insert) {
+ /*
+ * If not the first insert and the key space is sequential,
+ * compare the current value against the last value; if the
+ * same, just increment the RLE count.
+ */
+ if (recno == cbulk->recno + 1 &&
+ cbulk->last.size == cursor->value.size &&
+ memcmp(cbulk->last.data,
+ cursor->value.data, cursor->value.size) == 0) {
+ ++cbulk->rle;
+ ++cbulk->recno;
+ goto duplicate;
+ }
+
+ /* Insert the previous key/value pair. */
+ WT_ERR(__wt_bulk_insert_var(session, cbulk, false));
+ } else
+ cbulk->first_insert = false;
/*
- * Save a copy of the value for the next comparison and reset the RLE
- * counter.
+ * Insert any skipped records as deleted records, update the current
+ * record count and RLE counter.
*/
- if (!duplicate) {
- WT_ERR(__wt_buf_set(session,
- &cbulk->last, cursor->value.data, cursor->value.size));
- cbulk->rle = 1;
+ if (recno != cbulk->recno + 1) {
+ cbulk->rle = (recno - cbulk->recno) - 1;
+ WT_ERR(__wt_bulk_insert_var(session, cbulk, true));
}
+ cbulk->rle = 1;
+ cbulk->recno = recno;
- WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
+ /* Save a copy of the value for the next comparison. */
+ ret = __wt_buf_set(session,
+ &cbulk->last, cursor->value.data, cursor->value.size);
+duplicate:
err: API_END_RET(session, ret);
}
/*
* __bulk_row_keycmp_err --
- * Error routine when keys inserted out-of-order.
+ * Error routine when row-store keys inserted out-of-order.
*/
static int
__bulk_row_keycmp_err(WT_CURSOR_BULK *cbulk)
@@ -116,16 +204,13 @@ __bulk_row_keycmp_err(WT_CURSOR_BULK *cbulk)
WT_ERR(__wt_scr_alloc(session, 512, &a));
WT_ERR(__wt_scr_alloc(session, 512, &b));
- WT_ERR(__wt_buf_set_printable(
- session, a, cursor->key.data, cursor->key.size));
- WT_ERR(__wt_buf_set_printable(
- session, b, cbulk->last.data, cbulk->last.size));
-
WT_ERR_MSG(session, EINVAL,
- "bulk-load presented with out-of-order keys: %.*s compares smaller "
- "than previously inserted key %.*s",
- (int)a->size, (const char *)a->data,
- (int)b->size, (const char *)b->data);
+ "bulk-load presented with out-of-order keys: %s compares smaller "
+ "than previously inserted key %s",
+ __wt_buf_set_printable(
+ session, cursor->key.data, cursor->key.size, a),
+ __wt_buf_set_printable(
+ session, cbulk->last.data, cbulk->last.size, b));
err: __wt_scr_free(session, &a);
__wt_scr_free(session, &b);
@@ -154,6 +239,7 @@ __curbulk_insert_row(WT_CURSOR *cursor)
* until the bulk cursor is closed.
*/
CURSOR_API_CALL(cursor, session, insert, btree);
+ WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
WT_CURSOR_CHECKKEY(cursor);
WT_CURSOR_CHECKVALUE(cursor);
@@ -161,28 +247,20 @@ __curbulk_insert_row(WT_CURSOR *cursor)
/*
* If this isn't the first key inserted, compare it against the last key
* to ensure the application doesn't accidentally corrupt the table.
- *
- * Instead of a "first time" variable, I'm using the RLE count, because
- * it is only zero before the first row is inserted.
*/
- if (cbulk->rle != 0) {
+ if (!cbulk->first_insert) {
WT_ERR(__wt_compare(session,
btree->collator, &cursor->key, &cbulk->last, &cmp));
if (cmp <= 0)
WT_ERR(__bulk_row_keycmp_err(cbulk));
- }
+ } else
+ cbulk->first_insert = false;
- /*
- * Save a copy of the key for the next comparison and set the RLE
- * counter.
- */
+ /* Save a copy of the key for the next comparison. */
WT_ERR(__wt_buf_set(session,
&cbulk->last, cursor->key.data, cursor->key.size));
- cbulk->rle = 1;
-
- WT_ERR(__wt_bulk_insert_row(session, cbulk));
- WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
+ ret = __wt_bulk_insert_row(session, cbulk);
err: API_END_RET(session, ret);
}
@@ -208,13 +286,12 @@ __curbulk_insert_row_skip_check(WT_CURSOR *cursor)
* until the bulk cursor is closed.
*/
CURSOR_API_CALL(cursor, session, insert, btree);
+ WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
- WT_CURSOR_NEEDKEY(cursor);
- WT_CURSOR_NEEDVALUE(cursor);
-
- WT_ERR(__wt_bulk_insert_row(session, cbulk));
+ WT_CURSOR_CHECKKEY(cursor);
+ WT_CURSOR_CHECKVALUE(cursor);
- WT_STAT_FAST_DATA_INCR(session, cursor_insert_bulk);
+ ret = __wt_bulk_insert_row(session, cbulk);
err: API_END_RET(session, ret);
}
@@ -237,18 +314,25 @@ __wt_curbulk_init(WT_SESSION_IMPL *session,
__wt_cursor_set_notsup(c);
switch (cbt->btree->type) {
case BTREE_COL_FIX:
- c->insert = __curbulk_insert_fix;
+ c->insert = bitmap ?
+ __curbulk_insert_fix_bitmap : __curbulk_insert_fix;
break;
case BTREE_COL_VAR:
c->insert = __curbulk_insert_var;
break;
case BTREE_ROW:
+ /*
+ * Row-store order comparisons are expensive, so we optionally
+ * skip them when we know the input is correct.
+ */
c->insert = skip_sort_check ?
__curbulk_insert_row_skip_check : __curbulk_insert_row;
break;
WT_ILLEGAL_VALUE(session);
}
+ cbulk->first_insert = true;
+ cbulk->recno = 0;
cbulk->bitmap = bitmap;
if (bitmap)
F_SET(c, WT_CURSTD_RAW);
diff --git a/src/cursor/cur_config.c b/src/cursor/cur_config.c
index 348cfbab1dd..1b2fec0eb89 100644
--- a/src/cursor/cur_config.c
+++ b/src/cursor/cur_config.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_ds.c b/src/cursor/cur_ds.c
index ccc19717612..2a598c99523 100644
--- a/src/cursor/cur_ds.c
+++ b/src/cursor/cur_ds.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_dump.c b/src/cursor/cur_dump.c
index e5799fbad05..3324efd96cc 100644
--- a/src/cursor/cur_dump.c
+++ b/src/cursor/cur_dump.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_file.c b/src/cursor/cur_file.c
index b955b292292..8bbe1cc8eda 100644
--- a/src/cursor/cur_file.c
+++ b/src/cursor/cur_file.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -545,8 +545,8 @@ __wt_curfile_open(WT_SESSION_IMPL *session, const char *uri,
* failing with EBUSY due to a database-wide checkpoint.
*/
if (LF_ISSET(WT_DHANDLE_EXCLUSIVE))
- WT_WITH_CHECKPOINT_LOCK(session, ret =
- __wt_session_get_btree_ckpt(
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ ret = __wt_session_get_btree_ckpt(
session, uri, cfg, flags));
else
ret = __wt_session_get_btree_ckpt(
diff --git a/src/cursor/cur_index.c b/src/cursor/cur_index.c
index a909eaece99..6822055131a 100644
--- a/src/cursor/cur_index.c
+++ b/src/cursor/cur_index.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_join.c b/src/cursor/cur_join.c
index 395da22a80c..2cbefa68c5e 100644
--- a/src/cursor/cur_join.c
+++ b/src/cursor/cur_join.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -383,17 +383,14 @@ __curjoin_endpoint_init_key(WT_SESSION_IMPL *session,
allocbuf = NULL;
if ((cursor = endpoint->cursor) != NULL) {
if (entry->index != NULL) {
+ /* Extract and save the index's logical key. */
cindex = (WT_CURSOR_INDEX *)endpoint->cursor;
- if (cindex->index->extractor == NULL) {
- WT_ERR(__wt_struct_repack(session,
- cindex->child->key_format,
- entry->main->value_format,
- &cindex->child->key, &endpoint->key,
- &allocbuf));
- if (allocbuf != NULL)
- F_SET(endpoint, WT_CURJOIN_END_OWN_KEY);
- } else
- endpoint->key = cindex->child->key;
+ WT_ERR(__wt_struct_repack(session,
+ cindex->child->key_format,
+ cindex->iface.key_format,
+ &cindex->child->key, &endpoint->key, &allocbuf));
+ if (allocbuf != NULL)
+ F_SET(endpoint, WT_CURJOIN_END_OWN_KEY);
} else {
k = &((WT_CURSOR_TABLE *)cursor)->cg_cursors[0]->key;
if (WT_CURSOR_RECNO(cursor)) {
diff --git a/src/cursor/cur_json.c b/src/cursor/cur_json.c
index 8f858a5012f..fcb66d3e8b3 100644
--- a/src/cursor/cur_json.c
+++ b/src/cursor/cur_json.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -313,7 +313,6 @@ size_t
__wt_json_unpack_char(char ch, u_char *buf, size_t bufsz, bool force_unicode)
{
char abbrev;
- u_char h;
if (!force_unicode) {
if (isprint(ch) && ch != '\\' && ch != '"') {
@@ -354,16 +353,8 @@ __wt_json_unpack_char(char ch, u_char *buf, size_t bufsz, bool force_unicode)
*buf++ = 'u';
*buf++ = '0';
*buf++ = '0';
- h = (((u_char)ch) >> 4) & 0xF;
- if (h >= 10)
- *buf++ = 'A' + (h - 10);
- else
- *buf++ = '0' + h;
- h = ((u_char)ch) & 0xF;
- if (h >= 10)
- *buf++ = 'A' + (h - 10);
- else
- *buf++ = '0' + h;
+ *buf++ = __wt_hex[(ch & 0xf0) >> 4];
+ *buf++ = __wt_hex[ch & 0x0f];
}
return (6);
}
diff --git a/src/cursor/cur_log.c b/src/cursor/cur_log.c
index ade9fd18962..35a2d00e6ec 100644
--- a/src/cursor/cur_log.c
+++ b/src/cursor/cur_log.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_metadata.c b/src/cursor/cur_metadata.c
index 55da93859a6..df66ef34ddd 100644
--- a/src/cursor/cur_metadata.c
+++ b/src/cursor/cur_metadata.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -477,8 +477,12 @@ __wt_curmetadata_open(WT_SESSION_IMPL *session,
cursor->key_format = "S";
cursor->value_format = "S";
- /* Open the file cursor for operations on the regular metadata */
- WT_ERR(__wt_metadata_cursor(session, cfg[1], &mdc->file_cursor));
+ /*
+ * Open the file cursor for operations on the regular metadata; don't
+ * use the existing, cached session metadata cursor, the configuration
+ * may not be the same.
+ */
+ WT_ERR(__wt_metadata_cursor_open(session, cfg[1], &mdc->file_cursor));
WT_ERR(__wt_cursor_init(cursor, uri, owner, cfg, cursorp));
diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c
index e1d5b8eb91a..00a6ade21c6 100644
--- a/src/cursor/cur_stat.c
+++ b/src/cursor/cur_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -384,6 +384,7 @@ __curstat_file_init(WT_SESSION_IMPL *session,
{
WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
+ wt_off_t size;
const char *filename;
/*
@@ -395,8 +396,8 @@ __curstat_file_init(WT_SESSION_IMPL *session,
if (!WT_PREFIX_SKIP(filename, "file:"))
return (EINVAL);
__wt_stat_dsrc_init_single(&cst->u.dsrc_stats);
- WT_RET(__wt_block_manager_size(
- session, filename, &cst->u.dsrc_stats));
+ WT_RET(__wt_block_manager_named_size(session, filename, &size));
+ cst->u.dsrc_stats.block_size = size;
__wt_curstat_dsrc_final(cst);
return (0);
}
@@ -662,7 +663,7 @@ __wt_curstat_open(WT_SESSION_IMPL *session,
/*
* We return the statistics field's offset as the key, and a string
- * description, a string value, and a uint64_t value as the value
+ * description, a string value, and a uint64_t value as the value
* columns.
*/
cursor->key_format = "i";
diff --git a/src/cursor/cur_std.c b/src/cursor/cur_std.c
index da38988b6c2..051f36c8854 100644
--- a/src/cursor/cur_std.c
+++ b/src/cursor/cur_std.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/cursor/cur_table.c b/src/cursor/cur_table.c
index dca72a16ee5..d986577f640 100644
--- a/src/cursor/cur_table.c
+++ b/src/cursor/cur_table.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -758,6 +758,7 @@ err: API_END_RET(session, ret);
static int
__curtable_open_colgroups(WT_CURSOR_TABLE *ctable, const char *cfg_arg[])
{
+ WT_DECL_RET;
WT_SESSION_IMPL *session;
WT_TABLE *table;
WT_CURSOR **cp;
@@ -776,8 +777,10 @@ __curtable_open_colgroups(WT_CURSOR_TABLE *ctable, const char *cfg_arg[])
/* If the table is incomplete, wait on the table lock and recheck. */
complete = table->cg_complete;
- if (!complete)
- WT_WITH_TABLE_LOCK(session, complete = table->cg_complete);
+ if (!complete) {
+ WT_WITH_TABLE_LOCK(session, ret, complete = table->cg_complete);
+ WT_RET(ret);
+ }
if (!complete)
WT_RET_MSG(session, EINVAL,
"Can't use '%s' until all column groups are created",
@@ -968,8 +971,11 @@ __wt_curtable_open(WT_SESSION_IMPL *session,
WT_ERR(__wt_strdup(session, tmp->data, &ctable->cfg[1]));
if (0) {
-err: WT_TRET(__curtable_close(cursor));
- *cursorp = NULL;
+err: if (*cursorp != NULL) {
+ WT_TRET(__wt_cursor_close(*cursorp));
+ *cursorp = NULL;
+ }
+ WT_TRET(__curtable_close(cursor));
}
__wt_scr_free(session, &tmp);
diff --git a/src/docs/build-javadoc.sh b/src/docs/build-javadoc.sh
index 39c9d989b6c..be886937070 100755
--- a/src/docs/build-javadoc.sh
+++ b/src/docs/build-javadoc.sh
@@ -8,5 +8,5 @@ CLASSPATH=$THRIFT_HOME/libthrift.jar:$SLF4J_JAR javadoc -public -d $DOCS/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-2015 MongoDB, Inc. All rights reserved.</font>' \
+ -windowtitle 'WiredTiger Java API' -bottom '<font size=1>Copyright (c) 2008-2016 MongoDB, Inc. All rights reserved.</font>' \
com.wiredtiger com.wiredtiger.util
diff --git a/src/docs/command-line.dox b/src/docs/command-line.dox
index 745c5051be3..e2b376d5e3f 100644
--- a/src/docs/command-line.dox
+++ b/src/docs/command-line.dox
@@ -32,7 +32,7 @@ on success and non-zero on error.
The \c wt tool supports several commands. If configured in the underlying
database, some commands will run recovery when opening the database. If
-the user wants to force recovery on any command, use the \c -r option.
+the user wants to force recovery on any command, use the \c -R option.
In general, commands that modify the database or tables will run recovery
by default and commands that only read data will not run recovery.
@@ -46,7 +46,7 @@ opened as a WiredTiger database. See @ref backup for more information,
and @ref file_permissions for specifics on the copied file permissions.
@subsection util_backup_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] backup [-t uri] directory</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] backup [-t uri] directory</code>
@subsection util_backup_options Options
The following are command-specific options for the \c backup command:
@@ -64,7 +64,7 @@ The \c compact command attempts to rewrite the specified table or file
to consume less disk space.
@subsection util_compact_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] compact uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] compact uri</code>
@subsection util_compact_options Options
The \c compact command has no command-specific options.
@@ -78,7 +78,7 @@ configuration. It is equivalent to a call to WT_SESSION::create with
the specified string arguments.
@subsection util_create_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] create [-c config] uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] create [-c config] uri</code>
@subsection util_create_options Options
The following are command-specific options for the \c create command:
@@ -94,7 +94,7 @@ The \c drop command drops the specified \c uri. It is equivalent to a
call to WT_SESSION::drop with the "force" configuration argument.
@subsection util_drop_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] drop uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] drop uri</code>
@subsection util_drop_options Options
The \c drop command has no command-specific options.
@@ -109,7 +109,7 @@ which can be re-loaded into a new table using the \c load command.
See @subpage dump_formats for details of the dump file formats.
@subsection util_dump_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] dump [-jrx] [-c checkpoint] [-f output] uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] dump [-jrx] [-c checkpoint] [-f output] uri</code>
@subsection util_dump_options Options
The following are command-specific options for the \c dump command:
@@ -143,7 +143,7 @@ the database. If a URI is specified as an argument, only information about
that data source is printed.
@subsection util_list_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] list [-cv] [uri]</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] list [-cv] [uri]</code>
@subsection util_list_options Options
The following are command-specific options for the \c list command:
@@ -170,7 +170,7 @@ table will be overwritten by the new data (use the \c -n option to
make an attempt to overwrite existing data return an error).
@subsection util_load_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] load [-ajn] [-f input] [-r name] [uri configuration ...]</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] load [-ajn] [-f input] [-r name] [uri configuration ...]</code>
@subsection util_load_options Options
The following are command-specific options for the \c load command:
@@ -244,7 +244,7 @@ row-store table or file already exists, data in the table or file will
be overwritten by the new data.
@subsection util_loadtext_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] loadtext [-f input]</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] loadtext [-f input]</code>
@subsection util_loadtext_options Options
The following are command-specific options for the \c loadtext command:
@@ -260,7 +260,7 @@ Display the database log.
The \c printlog command outputs the database log.
@subsection util_printlog_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] printlog [-p] [-f output]</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] printlog [-x] [-f output]</code>
@subsection util_printlog_options Options
The following are command-specific options for the \c printlog command:
@@ -269,8 +269,9 @@ The following are command-specific options for the \c printlog command:
By default, the \c printlog command output is written to the standard
output; the \c -f option re-directs the output to the specified file.
-@par <code>-p</code>
-Display the log in a printable format.
+@par <code>-x</code>
+Keys and value items in the log are printed in hex format in addition
+to the default string format.
<hr>
@section util_read wt read
@@ -283,7 +284,7 @@ with string or record number keys and string values.
The \c read command exits non-zero if a specified record is not found.
@subsection util_read_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] read uri key ...</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] read uri key ...</code>
@subsection util_read_options Options
The \c read command has no command-specific options.
@@ -295,7 +296,7 @@ Rename a table or file.
The \c rename command renames the specified table or file.
@subsection util_rename_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] rename uri name</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] rename uri name</code>
@subsection util_rename_options Options
The \c rename command has no command-specific options.
@@ -309,7 +310,7 @@ data that cannot be recovered. Underlying files are re-written in
place, overwriting the original file contents.
@subsection util_salvage_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] salvage [-F force] uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] salvage [-F force] uri</code>
@subsection util_salvage_options Options
The following are command-specific options for the \c salvage command:
@@ -327,7 +328,7 @@ The \c stat command outputs run-time statistics for the WiredTiger
engine, or, if specified, for the URI on the command-line.
@subsection util_stat_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] stat [-f] [uri]</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] stat [-f] [uri]</code>
@subsection util_stat_options Options
The following are command-specific options for the \c stat command:
@@ -345,7 +346,7 @@ success if the data source is up-to-date, and failure if the data source
cannot be upgraded.
@subsection util_upgrade_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] upgrade uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] upgrade uri</code>
@subsection util_upgrade_options Options
The \c upgrade command has no command-specific options.
@@ -359,7 +360,7 @@ success if the data source is correct, and failure if the data source is
corrupted.
@subsection util_verify_synopsis Synopsis
-<code>wt [-rVv] [-C config] [-E secretkey ] [-h directory] verify uri</code>
+<code>wt [-RVv] [-C config] [-E secretkey ] [-h directory] verify uri</code>
@subsection util_verify_options Options
The \c verify command has no command-specific options.
@@ -381,9 +382,9 @@ Attempting to overwrite an already existing record will fail.
@subsection util_write_synopsis Synopsis
<code>
-wt [-rVv] [-C config] [-E secretkey ] [-h directory] write -a uri value ...
+wt [-RVv] [-C config] [-E secretkey ] [-h directory] write -a uri value ...
<br>
-wt [-rVv] [-C config] [-E secretkey ] [-h directory] write [-o] uri key value ...
+wt [-RVv] [-C config] [-E secretkey ] [-h directory] write [-o] uri key value ...
</code>
@subsection util_write_options Options
diff --git a/src/docs/license.dox b/src/docs/license.dox
index f34ebad19a7..febced2c6af 100644
--- a/src/docs/license.dox
+++ b/src/docs/license.dox
@@ -13,6 +13,19 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the
<b>GNU General Public License</b></a> for details.
+Additionally, portions of the WiredTiger distribution are distributed
+under the terms of the
+<a href="http://www.opensource.org/licenses/BSD-3-Clause">
+BSD-3-Clause License</a>. These files have
+<a href="http://www.opensource.org/licenses/BSD-3-Clause">
+BSD-3-Clause License</a>
+copyright notices, and may be freely used and redistributed under the
+terms of that notice.
+
+Additionally, portions of the WiredTiger distribution are public domain
+software. Public domain files have notices releasing the software into
+the public domain and may be freely used and redistributed.
+
For a license to use the WiredTiger software under conditions other than
those described above, or for technical support for this software, please
contact MongoDB, Inc. at
@@ -28,7 +41,7 @@ of the WiredTiger library should comply with these copyrights.
@hrow{Distribution Files, Copyright Holder, License}
@row{\c src/include/bitstring.i, University of California\, Berkeley, <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause License</a>}
@row{\c src/include/queue.h, University of California\, Berkeley, <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause License</a>}
-@row{\c src/os_posix/getopt.c, University of California\, Berkeley, <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause License</a>}
+@row{\c src/os_posix/os_getopt.c, University of California\, Berkeley, <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause License</a>}
@row{\c src/support/hash_city.c, Google\, Inc., <a href="http://www.opensource.org/licenses/MIT">The MIT License</a>}
@row{\c src/support/hash_fnv.c, Authors, Public Domain}
</table>
@@ -63,10 +76,4 @@ selected portions of the WiredTiger sources, please review the copyright
notices and LICENSE files included in the WiredTiger distribution for
the terms and conditions of such redistribution.
-@section license_public_domain Public domain software
-
-Many portions of the WiredTiger distribution are public domain software.
-Public domain files have notices releasing the software into the public
-domain and may be freely used and redistributed.
-
*/
diff --git a/src/docs/programming.dox b/src/docs/programming.dox
index f005f6d3e2d..5d79edd660b 100644
--- a/src/docs/programming.dox
+++ b/src/docs/programming.dox
@@ -40,11 +40,12 @@ each of which is ordered by one or more columns.
- @subpage compact
- @subpage checkpoint
- @subpage durability
+- @subpage cursor_join
+- @subpage cursor_log
- @ref transaction_named_snapshots
+- @subpage rebalance
- @subpage shared_cache
- @subpage statistics
-- @subpage cursor_join
-- @subpage cursor_log
- @subpage_single upgrade
@m_if{c}
diff --git a/src/docs/rebalance.dox b/src/docs/rebalance.dox
new file mode 100644
index 00000000000..a6acfe07ef5
--- /dev/null
+++ b/src/docs/rebalance.dox
@@ -0,0 +1,14 @@
+/*! @m_page{{c,java},rebalance,Rebalance}
+
+The WT_SESSION::rebalance method can be used to rebalance data sources'
+underlying btrees. If a tree has become unbalanced (that is, one part of
+the tree is excessively deep), WT_SESSION::rebalance rewrites the tree
+as a balanced tree.
+
+The data source must be quiescent.
+
+The WT_SESSION::rebalance method should never be needed, as WiredTiger
+btrees are maintained as balanced trees. It is only provided as a tool
+to handle the unexpected.
+
+ */
diff --git a/src/docs/schema.dox b/src/docs/schema.dox
index 66f8046965e..65ad7f6919c 100644
--- a/src/docs/schema.dox
+++ b/src/docs/schema.dox
@@ -89,6 +89,10 @@ struct module to describe the types of columns in a table:
The \c 'r' type is used for record number keys in column stores. It is
otherwise identical to the \c 'Q' type.
+The \c 's' type is used for fixed-length strings. If it is preceded by
+a size, that indicates the number of bytes to store; the default is a
+length of 1 byte.
+
The \c 'S' type is encoded as a C language string terminated by a
NUL character.
@m_if{java}
diff --git a/src/docs/spell.ok b/src/docs/spell.ok
index 86af82d8fd2..80597302cbb 100644
--- a/src/docs/spell.ok
+++ b/src/docs/spell.ok
@@ -66,6 +66,7 @@ NoSQL
OPTYPE
PRELOAD
README
+Rebalance
RedHat
RepMgr
Riak
@@ -120,6 +121,7 @@ boolean
booleans
br
btree
+btrees
bufs
builtin
builtins
@@ -378,6 +380,7 @@ readlock
realclean
realloc
realloc'd
+rebalance
recno
recnoN
recnum
diff --git a/src/docs/style/footer.html b/src/docs/style/footer.html
index 83f1254fa42..e5a7b30eef5 100644
--- a/src/docs/style/footer.html
+++ b/src/docs/style/footer.html
@@ -3,13 +3,13 @@
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
- <li class="footer">Copyright (c) 2008-2015 MongoDB, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.</li>
+ <li class="footer">Copyright (c) 2008-2016 MongoDB, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.</li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
-Copyright (c) 2008-2015 MongoDB, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.
+Copyright (c) 2008-2016 MongoDB, Inc. All rights reserved. Contact <a href="mailto:info@wiredtiger.com">info@wiredtiger.com</a> for more information.
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
diff --git a/src/docs/tools/doxfilter.py b/src/docs/tools/doxfilter.py
index 8ca68c0a1fe..b2d5f857df1 100755
--- a/src/docs/tools/doxfilter.py
+++ b/src/docs/tools/doxfilter.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/src/docs/tools/fixlinks.py b/src/docs/tools/fixlinks.py
index 84f56d219f8..7163246e3bd 100755
--- a/src/docs/tools/fixlinks.py
+++ b/src/docs/tools/fixlinks.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/src/docs/top/main.dox b/src/docs/top/main.dox
index ef2f5bf15a0..7e670541e7d 100644
--- a/src/docs/top/main.dox
+++ b/src/docs/top/main.dox
@@ -6,12 +6,12 @@ WiredTiger is an high performance, scalable, production quality, NoSQL,
@section releases Releases
<table>
-@row{<b>WiredTiger 2.6.1</b> (current),
+@row{<b>WiredTiger 2.7.0</b> (current),
+ <a href="releases/wiredtiger-2.7.0.tar.bz2"><b>[Release package]</b></a>,
+ <a href="2.7.0/index.html"><b>[Documentation]</b></a>}
+@row{<b>WiredTiger 2.6.1</b> (previous),
<a href="releases/wiredtiger-2.6.1.tar.bz2"><b>[Release package]</b></a>,
<a href="2.6.1/index.html"><b>[Documentation]</b></a>}
-@row{<b>WiredTiger 2.5.3</b> (previous),
- <a href="releases/wiredtiger-2.5.3.tar.bz2"><b>[Release package]</b></a>,
- <a href="2.5.3/index.html"><b>[Documentation]</b></a>}
@row{<b>Development branch</b>,
<a href="https://github.com/wiredtiger/wiredtiger"><b>[Source code]</b></a>,
<a href="develop/index.html"><b>[Documentation]</b></a>}
diff --git a/src/docs/tune-bulk-load.dox b/src/docs/tune-bulk-load.dox
index 8ee1061c76c..f5d28436dca 100644
--- a/src/docs/tune-bulk-load.dox
+++ b/src/docs/tune-bulk-load.dox
@@ -15,8 +15,12 @@ WT_CURSOR::close methods. Bulk load inserts are non-transactional: they
cannot be rolled back and ignore the transactional state of the WT_SESSION
in which they are opened.
-When bulk-loading row-store objects, keys must be loaded in sorted
-order.
+When doing a bulk-load insert, keys must be inserted in sorted order.
+When doing a bulk-load insert into a column-store object, any skipped
+records will be created as already-deleted rows. If a column-store
+bulk-load cursor is configured with \c append, the cursor key will be
+ignored and each inserted row will be assigned the next sequential
+record number.
When using the \c sort utility on a Linux or other POSIX-like system to
pre-sort keys, the locale specified by the environment affects the sort
diff --git a/src/docs/upgrading.dox b/src/docs/upgrading.dox
index 34f391b27f1..e0239919f0b 100644
--- a/src/docs/upgrading.dox
+++ b/src/docs/upgrading.dox
@@ -1,5 +1,33 @@
/*! @page upgrading Upgrading WiredTiger applications
+@section version_271 Upgrading to Version 2.7.1
+<dl>
+<dt>Column-store bulk-load cursors</dt>
+<dd>
+Historically, bulk-load of a column-store object ignored any key set in
+the cursor and automatically assigned each inserted row the next
+sequential record number for its key. In the 2.7.1 release, column-store
+objects match row-store behavior and require the cursor key be set
+before an insert. (This also allows allows sparse tables to be created
+in column-store objects, any skipped records are created as
+already-deleted rows.) To match the previous behavior, specify the
+\c append configuration string when opening the column-store bulk-load
+cursor; this causes the cursor's key to be ignored and each inserted row
+will be assigned the next record number.
+</dd>
+
+<dt>Change to WT_SESSION::truncate with URI</dt>
+<dd>
+If using the WT_SESSION::truncate API with a file: URI for a full table
+truncate, underlying algorithmic changes result in some visible differences.
+This call can now return WT_ROLLBACK. Applications should be prepared to
+handle this error. This method no longer requires exclusive access to the
+table. Also the underlying disk space may not be immediately
+reclaimed when the call returns. The performance of this API may differ
+from earlier releases.
+</dd>
+
+</dl><hr>
@section version_270 Upgrading to Version 2.7.0
<dl>
diff --git a/src/docs/wtperf.dox b/src/docs/wtperf.dox
index fb46a91a62c..64e25978dd8 100644
--- a/src/docs/wtperf.dox
+++ b/src/docs/wtperf.dox
@@ -173,6 +173,10 @@ taken to do the drop.
@par icount (unsigned int, default=5000)
number of records to initially populate. If multiple tables are
configured the count is spread evenly across all tables.
+@par idle_table_cycle (unsigned int, default=0)
+Enable regular create and drop of idle tables, value is the maximum
+number of seconds a create or drop is allowed before flagging an
+error. Default 0 which means disabled.
@par index (boolean, default=false)
Whether to create an index on the value field.
@par insert_rmw (boolean, default=false)
@@ -182,11 +186,17 @@ key size
@par log_partial (boolean, default=false)
perform partial logging on first table only.
@par min_throughput (unsigned int, default=0)
-abort if any throughput measured is less than this amount. Requires
+notify if any throughput measured is less than this amount. Aborts or
+prints warning based on min_throughput_fatal setting. Requires
sample_interval to be configured
+@par min_throughput_fatal (boolean, default=false)
+print warning (false) or abort (true) of min_throughput failure.
@par max_latency (unsigned int, default=0)
-abort if any latency measured exceeds this number of
-milliseconds.Requires sample_interval to be configured
+notify if any latency measured exceeds this number of
+milliseconds.Aborts or prints warning based on min_throughput_fatal
+setting. Requires sample_interval to be configured
+@par max_latency_fatal (boolean, default=false)
+print warning (false) or abort (true) of max_latency failure.
@par pareto (unsigned int, default=0)
use pareto distribution for random numbers. Zero to disable, otherwise
a percentage indicating how aggressive the distribution should be.
@@ -200,6 +210,8 @@ if non zero choose a value from within this range as the key for
insert operations
@par random_value (boolean, default=false)
generate random content for the value
+@par read_range (unsigned int, default=0)
+scan a range of keys after each search
@par reopen_connection (boolean, default=true)
close and reopen the connection between populate and workload phases
@par report_interval (unsigned int, default=2)
@@ -230,8 +242,9 @@ threads, and the 'insert', 'read' and 'update' entries are the ratios
of insert, read and update operations done by each worker thread; If a
throttle value is provided each thread will do a maximum of that
number of operations per second; multiple workload configurations may
-be specified; for example, a more complex threads configuration might
-be 'threads=((count=2,reads=1)(count=8,reads=1,inserts=2,updates=1))'
+be specified per threads configuration; for example, a more complex
+threads configuration might be
+'threads=((count=2,reads=1)(count=8,reads=1,inserts=2,updates=1))'
which would create 2 threads doing nothing but reads and 8 threads
each doing 50% inserts and 25% reads and updates. Allowed
configuration values are 'count', 'throttle', 'reads', 'inserts',
diff --git a/src/evict/evict_file.c b/src/evict/evict_file.c
index c5f6ae3d4d1..641864a8baa 100644
--- a/src/evict/evict_file.c
+++ b/src/evict/evict_file.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -85,7 +85,7 @@ __wt_evict_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
WT_ASSERT(session,
F_ISSET(session->dhandle, WT_DHANDLE_DEAD) ||
__wt_page_can_evict(session, ref, NULL));
- __wt_evict_page_clean_update(session, ref, true);
+ __wt_ref_out(session, ref);
break;
WT_ILLEGAL_VALUE_ERR(session);
}
diff --git a/src/evict/evict_lru.c b/src/evict/evict_lru.c
index ac481581c23..0536a06bc22 100644
--- a/src/evict/evict_lru.c
+++ b/src/evict/evict_lru.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -27,9 +27,12 @@ static int __evict_server_work(WT_SESSION_IMPL *);
static inline uint64_t
__evict_read_gen(const WT_EVICT_ENTRY *entry)
{
+ WT_BTREE *btree;
WT_PAGE *page;
uint64_t read_gen;
+ btree = entry->btree;
+
/* Never prioritize empty slots. */
if (entry->ref == NULL)
return (UINT64_MAX);
@@ -40,15 +43,23 @@ __evict_read_gen(const WT_EVICT_ENTRY *entry)
if (page->read_gen == WT_READGEN_OLDEST)
return (WT_READGEN_OLDEST);
+ /*
+ * Any leaf page from a dead tree is a great choice (not internal pages,
+ * they may have children and are not yet evictable).
+ */
+ if (!WT_PAGE_IS_INTERNAL(page) &&
+ F_ISSET(btree->dhandle, WT_DHANDLE_DEAD))
+ return (WT_READGEN_OLDEST);
+
/* Any empty page (leaf or internal), is a good choice. */
if (__wt_page_is_empty(page))
return (WT_READGEN_OLDEST);
/*
- * Skew the read generation for internal pages, we prefer to evict leaf
- * pages.
+ * The base read-generation is skewed by the eviction priority.
+ * Internal pages are also adjusted, we prefer to evict leaf pages.
*/
- read_gen = page->read_gen + entry->btree->evict_priority;
+ read_gen = page->read_gen + btree->evict_priority;
if (WT_PAGE_IS_INTERNAL(page))
read_gen += WT_EVICT_INT_SKEW;
@@ -727,6 +738,10 @@ __evict_request_walk_clear(WT_SESSION_IMPL *session)
F_CLR(session, WT_SESSION_CLEAR_EVICT_WALK);
+ /* An error is unexpected - flag the failure. */
+ if (ret != 0)
+ __wt_err(session, ret, "Failed to clear eviction walk point");
+
return (ret);
}
@@ -760,20 +775,18 @@ __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session, bool *evict_resetp)
{
WT_BTREE *btree;
WT_CACHE *cache;
+ WT_DECL_RET;
WT_EVICT_ENTRY *evict;
u_int i, elem;
+ *evict_resetp = false;
+
btree = S2BT(session);
cache = S2C(session)->cache;
- /*
- * If the file isn't evictable, there's no work to do.
- */
- if (F_ISSET(btree, WT_BTREE_NO_EVICTION)) {
- *evict_resetp = false;
+ /* If the file wasn't evictable, there's no work to do. */
+ if (F_ISSET(btree, WT_BTREE_NO_EVICTION))
return (0);
- }
- *evict_resetp = true;
/*
* Hold the walk lock to set the "no eviction" flag: no new pages from
@@ -784,7 +797,7 @@ __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session, bool *evict_resetp)
__wt_spin_unlock(session, &cache->evict_walk_lock);
/* Clear any existing LRU eviction walk for the file. */
- WT_RET(__evict_request_walk_clear(session));
+ WT_ERR(__evict_request_walk_clear(session));
/* Hold the evict lock to remove any queued pages from this file. */
__wt_spin_lock(session, &cache->evict_lock);
@@ -806,7 +819,11 @@ __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session, bool *evict_resetp)
while (btree->evict_busy > 0)
__wt_yield();
+ *evict_resetp = true;
return (0);
+
+err: F_CLR(btree, WT_BTREE_NO_EVICTION);
+ return (ret);
}
/*
@@ -852,9 +869,8 @@ __evict_lru_walk(WT_SESSION_IMPL *session)
{
WT_CACHE *cache;
WT_DECL_RET;
- WT_EVICT_ENTRY *evict;
uint64_t cutoff;
- uint32_t candidates, entries, i;
+ uint32_t candidates, entries;
cache = S2C(session)->cache;
@@ -872,6 +888,14 @@ __evict_lru_walk(WT_SESSION_IMPL *session)
while (entries > 0 && cache->evict_queue[entries - 1].ref == NULL)
--entries;
+ /*
+ * If we have more entries than the maximum tracked between walks,
+ * clear them. Do this before figuring out how many of the entries are
+ * candidates so we never end up with more candidates than entries.
+ */
+ while (entries > WT_EVICT_WALK_BASE)
+ __evict_list_clear(session, &cache->evict_queue[--entries]);
+
cache->evict_entries = entries;
if (entries == 0) {
@@ -916,15 +940,6 @@ __evict_lru_walk(WT_SESSION_IMPL *session)
cache->evict_candidates = candidates;
}
- /* If we have more than the minimum number of entries, clear them. */
- if (cache->evict_entries > WT_EVICT_WALK_BASE) {
- for (i = WT_EVICT_WALK_BASE, evict = cache->evict_queue + i;
- i < cache->evict_entries;
- i++, evict++)
- __evict_list_clear(session, evict);
- cache->evict_entries = WT_EVICT_WALK_BASE;
- }
-
cache->evict_current = cache->evict_queue;
__wt_spin_unlock(session, &cache->evict_lock);
@@ -982,6 +997,7 @@ __evict_walk(WT_SESSION_IMPL *session)
conn = S2C(session);
cache = S2C(session)->cache;
+ btree = NULL;
dhandle = NULL;
dhandle_locked = incr = false;
retries = 0;
@@ -1041,6 +1057,7 @@ retry: while (slot < max_entries && ret == 0) {
(void)__wt_atomic_subi32(
&dhandle->session_inuse, 1);
incr = false;
+ cache->evict_file_next = NULL;
}
dhandle = TAILQ_NEXT(dhandle, q);
}
@@ -1096,6 +1113,9 @@ retry: while (slot < max_entries && ret == 0) {
* exclusive access when a handle is being closed.
*/
if (!F_ISSET(btree, WT_BTREE_NO_EVICTION)) {
+ /* Remember the file to visit first, next loop. */
+ cache->evict_file_next = dhandle;
+
WT_WITH_DHANDLE(session, dhandle,
ret = __evict_walk_file(session, &slot));
WT_ASSERT(session, session->split_gen == 0);
@@ -1115,9 +1135,6 @@ retry: while (slot < max_entries && ret == 0) {
}
if (incr) {
- /* Remember the file we should visit first, next loop. */
- cache->evict_file_next = dhandle;
-
WT_ASSERT(session, dhandle->session_inuse > 0);
(void)__wt_atomic_subi32(&dhandle->session_inuse, 1);
incr = false;
@@ -1170,7 +1187,7 @@ __evict_init_candidate(
evict->ref = ref;
evict->btree = S2BT(session);
- /* Mark the page on the list */
+ /* Mark the page on the list; set last to flush the other updates. */
F_SET_ATOMIC(ref->page, WT_PAGE_EVICT_LRU);
}
@@ -1197,15 +1214,17 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp)
conn = S2C(session);
btree = S2BT(session);
cache = conn->cache;
- start = cache->evict_queue + *slotp;
- end = WT_MIN(start + WT_EVICT_WALK_PER_FILE,
- cache->evict_queue + cache->evict_slots);
internal_pages = restarts = 0;
enough = false;
- walk_flags = WT_READ_CACHE | WT_READ_NO_EVICT |
- WT_READ_NO_GEN | WT_READ_NO_WAIT;
+ start = cache->evict_queue + *slotp;
+ end = start + WT_EVICT_WALK_PER_FILE;
+ if (F_ISSET(session->dhandle, WT_DHANDLE_DEAD) ||
+ end > cache->evict_queue + cache->evict_slots)
+ end = cache->evict_queue + cache->evict_slots;
+ walk_flags =
+ WT_READ_CACHE | WT_READ_NO_EVICT | WT_READ_NO_GEN | WT_READ_NO_WAIT;
if (F_ISSET(cache, WT_CACHE_WALK_REVERSE))
walk_flags |= WT_READ_PREV;
@@ -1247,7 +1266,8 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp)
continue;
/* Pages we no longer need (clean or dirty), are found money. */
- if (__wt_page_is_empty(page))
+ if (__wt_page_is_empty(page) ||
+ F_ISSET(session->dhandle, WT_DHANDLE_DEAD))
goto fast;
/* Skip clean pages if appropriate. */
@@ -1508,8 +1528,8 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full)
if (txn_busy && pct_full < 100)
return (0);
- if (busy == 1)
- txn_busy = 1;
+ if (busy)
+ txn_busy = true;
/* Wake the eviction server if we need to do work. */
WT_RET(__wt_evict_server_wake(session));
@@ -1570,6 +1590,26 @@ __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full)
/* NOTREACHED */
}
+/*
+ * __wt_evict_priority_set --
+ * Set a tree's eviction priority.
+ */
+void
+__wt_evict_priority_set(WT_SESSION_IMPL *session, uint64_t v)
+{
+ S2BT(session)->evict_priority = v;
+}
+
+/*
+ * __wt_evict_priority_clear --
+ * Clear a tree's eviction priority.
+ */
+void
+__wt_evict_priority_clear(WT_SESSION_IMPL *session)
+{
+ S2BT(session)->evict_priority = 0;
+}
+
#ifdef HAVE_DIAGNOSTIC
/*
* __wt_cache_dump --
diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c
index 1cdf07a9a55..72c07eaa05d 100644
--- a/src/evict/evict_page.c
+++ b/src/evict/evict_page.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -8,8 +8,9 @@
#include "wt_internal.h"
-static int __evict_page_dirty_update(WT_SESSION_IMPL *, WT_REF *, bool);
-static int __evict_review(WT_SESSION_IMPL *, WT_REF *, bool *, bool);
+static int __evict_page_clean_update(WT_SESSION_IMPL *, WT_REF *, bool);
+static int __evict_page_dirty_update(WT_SESSION_IMPL *, WT_REF *, bool);
+static int __evict_review(WT_SESSION_IMPL *, WT_REF *, bool *, bool);
/*
* __evict_exclusive_clear --
@@ -117,7 +118,7 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
* Pages that belong to dead trees never write back to disk
* and can't support page splits.
*/
- WT_ERR(__wt_evict_page_clean_update(
+ WT_ERR(__evict_page_clean_update(
session, ref, tree_dead || closing));
else
WT_ERR(__evict_page_dirty_update(session, ref, closing));
@@ -200,12 +201,11 @@ __evict_delete_ref(WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
}
/*
- * __wt_evict_page_clean_update --
+ * __evict_page_clean_update --
* Update a clean page's reference on eviction.
*/
-int
-__wt_evict_page_clean_update(
- WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
+static int
+__evict_page_clean_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing)
{
WT_DECL_RET;
diff --git a/src/include/api.h b/src/include/api.h
index 4821b450f9e..c6a5af40698 100644
--- a/src/include/api.h
+++ b/src/include/api.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/async.h b/src/include/async.h
index fb9a64e774d..7a415a4a17a 100644
--- a/src/include/async.h
+++ b/src/include/async.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/bitstring.i b/src/include/bitstring.i
index 5449ffe6209..0d30e55d1ef 100644
--- a/src/include/bitstring.i
+++ b/src/include/bitstring.i
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/include/block.h b/src/include/block.h
index 4bff6c82783..27a140b73a4 100644
--- a/src/include/block.h
+++ b/src/include/block.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -173,6 +173,7 @@ struct __wt_bm {
int (*compact_skip)(WT_BM *, WT_SESSION_IMPL *, bool *);
int (*compact_start)(WT_BM *, WT_SESSION_IMPL *);
int (*free)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
+ bool (*is_mapped)(WT_BM *, WT_SESSION_IMPL *);
int (*preload)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
int (*read)
(WT_BM *, WT_SESSION_IMPL *, WT_ITEM *, const uint8_t *, size_t);
@@ -182,6 +183,7 @@ struct __wt_bm {
int (*salvage_start)(WT_BM *, WT_SESSION_IMPL *);
int (*salvage_valid)
(WT_BM *, WT_SESSION_IMPL *, uint8_t *, size_t, bool);
+ int (*size)(WT_BM *, WT_SESSION_IMPL *, wt_off_t *);
int (*stat)(WT_BM *, WT_SESSION_IMPL *, WT_DSRC_STATS *stats);
int (*sync)(WT_BM *, WT_SESSION_IMPL *, bool);
int (*verify_addr)(WT_BM *, WT_SESSION_IMPL *, const uint8_t *, size_t);
@@ -244,7 +246,10 @@ struct __wt_block {
bool ckpt_inprogress;/* Live checkpoint in progress */
/* Compaction support */
- int compact_pct_tenths; /* Percent to compact */
+ int compact_pct_tenths; /* Percent to compact */
+ uint64_t compact_pages_reviewed;/* Pages reviewed */
+ uint64_t compact_pages_skipped; /* Pages skipped */
+ uint64_t compact_pages_written; /* Pages rewritten */
/* Salvage support */
wt_off_t slvg_off; /* Salvage file offset */
diff --git a/src/include/bloom.h b/src/include/bloom.h
index a673ee9add2..ddc2d64a118 100644
--- a/src/include/bloom.h
+++ b/src/include/bloom.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/btmem.h b/src/include/btmem.h
index 6ee74c61a38..cfbd87f0cae 100644
--- a/src/include/btmem.h
+++ b/src/include/btmem.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -305,7 +305,7 @@ struct __wt_page_modify {
struct {
/*
* Appended items to column-stores: there is only a single one
- * of these per column-store tree.
+ * of these active at a time per column-store tree.
*/
WT_INSERT_HEAD **append;
@@ -319,9 +319,18 @@ struct __wt_page_modify {
* huge.
*/
WT_INSERT_HEAD **update;
+
+ /*
+ * Split-saved last column-store page record. If a column-store
+ * page is split, we save the first record number moved so that
+ * during reconciliation we know the page's last record and can
+ * write any implicitly created deleted records for the page.
+ */
+ uint64_t split_recno;
} leaf;
#define mod_append u2.leaf.append
#define mod_update u2.leaf.update
+#define mod_split_recno u2.leaf.split_recno
} u2;
/*
@@ -478,7 +487,7 @@ struct __wt_page {
#define pg_row_ins u.row.ins
#undef pg_row_upd
#define pg_row_upd u.row.upd
-#define pg_row_entries u.row.entries
+#undef pg_row_entries
#define pg_row_entries u.row.entries
/* Fixed-length column-store leaf page. */
@@ -544,8 +553,8 @@ struct __wt_page {
#define WT_PAGE_DISK_MAPPED 0x04 /* Disk image in mapped memory */
#define WT_PAGE_EVICT_LRU 0x08 /* Page is on the LRU queue */
#define WT_PAGE_OVERFLOW_KEYS 0x10 /* Page has overflow keys */
-#define WT_PAGE_SPLIT_INSERT 0x20 /* A leaf page was split for append */
-#define WT_PAGE_SPLIT_BLOCK 0x40 /* Split blocking eviction and splits */
+#define WT_PAGE_SPLIT_BLOCK 0x20 /* Split blocking eviction and splits */
+#define WT_PAGE_SPLIT_INSERT 0x40 /* A leaf page was split for append */
#define WT_PAGE_UPDATE_IGNORE 0x80 /* Ignore updates on page discard */
uint8_t flags_atomic; /* Atomic flags, use F_*_ATOMIC */
@@ -1049,7 +1058,7 @@ struct __wt_insert_head {
uint64_t __prev_split_gen = (session)->split_gen; \
if (__prev_split_gen == 0) \
do { \
- WT_PUBLISH((session)->split_gen, \
+ WT_PUBLISH((session)->split_gen, \
S2C(session)->split_gen); \
} while ((session)->split_gen != S2C(session)->split_gen)
diff --git a/src/include/btree.h b/src/include/btree.h
index a1d8e395cfc..703de0f2fc6 100644
--- a/src/include/btree.h
+++ b/src/include/btree.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -153,16 +153,18 @@ struct __wt_btree {
#define WT_BTREE_NO_CHECKPOINT 0x00800 /* Disable checkpoints */
#define WT_BTREE_NO_EVICTION 0x01000 /* Disable eviction */
#define WT_BTREE_NO_LOGGING 0x02000 /* Disable logging */
-#define WT_BTREE_SALVAGE 0x04000 /* Handle is for salvage */
-#define WT_BTREE_SKIP_CKPT 0x08000 /* Handle skipped checkpoint */
-#define WT_BTREE_UPGRADE 0x10000 /* Handle is for upgrade */
-#define WT_BTREE_VERIFY 0x20000 /* Handle is for verify */
+#define WT_BTREE_REBALANCE 0x04000 /* Handle is for rebalance */
+#define WT_BTREE_SALVAGE 0x08000 /* Handle is for salvage */
+#define WT_BTREE_SKIP_CKPT 0x10000 /* Handle skipped checkpoint */
+#define WT_BTREE_UPGRADE 0x20000 /* Handle is for upgrade */
+#define WT_BTREE_VERIFY 0x40000 /* Handle is for verify */
uint32_t flags;
};
/* Flags that make a btree handle special (not for normal use). */
#define WT_BTREE_SPECIAL_FLAGS \
- (WT_BTREE_BULK | WT_BTREE_SALVAGE | WT_BTREE_UPGRADE | WT_BTREE_VERIFY)
+ (WT_BTREE_BULK | WT_BTREE_REBALANCE | \
+ WT_BTREE_SALVAGE | WT_BTREE_UPGRADE | WT_BTREE_VERIFY)
/*
* WT_SALVAGE_COOKIE --
diff --git a/src/include/btree.i b/src/include/btree.i
index 23e0dfea2cd..94111397abd 100644
--- a/src/include/btree.i
+++ b/src/include/btree.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -1046,15 +1046,16 @@ __wt_leaf_page_can_split(WT_SESSION_IMPL *session, WT_PAGE *page)
* do it without making the appending threads wait. See if it's worth
* doing a split to let the threads continue before doing eviction.
*
- * Ignore anything other than large, dirty row-store leaf pages. The
- * split code only supports row-store pages, and we depend on the page
- * being dirty for correctness (the page must be reconciled again
+ * Ignore anything other than large, dirty leaf pages. We depend on the
+ * page being dirty for correctness (the page must be reconciled again
* before being evicted after the split, information from a previous
* reconciliation will be wrong, so we can't evict immediately).
*/
- if (page->type != WT_PAGE_ROW_LEAF ||
- page->memory_footprint < btree->splitmempage ||
- !__wt_page_is_modified(page))
+ if (page->memory_footprint < btree->splitmempage)
+ return (false);
+ if (WT_PAGE_IS_INTERNAL(page))
+ return (false);
+ if (!__wt_page_is_modified(page))
return (false);
/*
@@ -1071,9 +1072,11 @@ __wt_leaf_page_can_split(WT_SESSION_IMPL *session, WT_PAGE *page)
#define WT_MIN_SPLIT_COUNT 30
#define WT_MIN_SPLIT_MULTIPLIER 16 /* At level 2, we see 1/16th entries */
- ins_head = page->pg_row_entries == 0 ?
+ ins_head = page->type == WT_PAGE_ROW_LEAF ?
+ (page->pg_row_entries == 0 ?
WT_ROW_INSERT_SMALLEST(page) :
- WT_ROW_INSERT_SLOT(page, page->pg_row_entries - 1);
+ WT_ROW_INSERT_SLOT(page, page->pg_row_entries - 1)) :
+ WT_COL_APPEND(page);
if (ins_head == NULL)
return (false);
for (count = 0, size = 0, ins = ins_head->head[WT_MIN_SPLIT_DEPTH];
@@ -1280,8 +1283,8 @@ __wt_page_release(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags)
* coupling up/down the tree.
*/
static inline int
-__wt_page_swap_func(WT_SESSION_IMPL *session, WT_REF *held,
- WT_REF *want, uint32_t flags
+__wt_page_swap_func(
+ WT_SESSION_IMPL *session, WT_REF *held, WT_REF *want, uint32_t flags
#ifdef HAVE_DIAGNOSTIC
, const char *file, int line
#endif
@@ -1310,20 +1313,40 @@ __wt_page_swap_func(WT_SESSION_IMPL *session, WT_REF *held,
#endif
);
- /* Expected failures: page not found or restart. */
- if (ret == WT_NOTFOUND || ret == WT_RESTART)
- return (ret);
+ /*
+ * Expected failures: page not found or restart. Our callers list the
+ * errors they're expecting to handle.
+ */
+ if (LF_ISSET(WT_READ_NOTFOUND_OK) && ret == WT_NOTFOUND)
+ return (WT_NOTFOUND);
+ if (LF_ISSET(WT_READ_RESTART_OK) && ret == WT_RESTART)
+ return (WT_RESTART);
- /* Discard the original held page. */
+ /* Discard the original held page on either success or error. */
acquired = ret == 0;
WT_TRET(__wt_page_release(session, held, flags));
+ /* Fast-path expected success. */
+ if (ret == 0)
+ return (0);
+
/*
- * If there was an error discarding the original held page, discard
- * the acquired page too, keeping it is never useful.
+ * If there was an error at any point that our caller isn't prepared to
+ * handle, discard any page we acquired.
*/
- if (acquired && ret != 0)
+ if (acquired)
WT_TRET(__wt_page_release(session, want, flags));
+
+ /*
+ * If we're returning an error, don't let it be one our caller expects
+ * to handle as returned by page-in: the expectation includes the held
+ * page not having been released, and that's not the case.
+ */
+ if (LF_ISSET(WT_READ_NOTFOUND_OK) && ret == WT_NOTFOUND)
+ return (EINVAL);
+ if (LF_ISSET(WT_READ_RESTART_OK) && ret == WT_RESTART)
+ return (EINVAL);
+
return (ret);
}
@@ -1437,17 +1460,54 @@ __wt_split_intl_race(
*
* There's a page-split race when we walk the tree: if we're splitting
* an internal page into its parent, we update the parent's page index
- * and then update the page being split, and it's not an atomic update.
- * A thread could read the parent page's original page index, and then
- * read the page's replacement index. Because internal page splits work
- * by replacing the original page with the initial part of the original
- * page, the result of this race is we will have a key that's past the
- * end of the current page, and the parent's page index will have moved.
+ * before updating the split page's page index, and it's not an atomic
+ * update. A thread can read the parent page's original page index and
+ * then read the split page's replacement index.
+ *
+ * Because internal page splits work by truncating the original page to
+ * the initial part of the original page, the result of this race is we
+ * will have a search key that points past the end of the current page.
+ * This is only an issue when we search past the end of the page, if we
+ * find a WT_REF in the page with the namespace we're searching for, we
+ * don't care if the WT_REF moved or not while we were searching, we
+ * have the correct page.
+ *
+ * For example, imagine an internal page with 3 child pages, with the
+ * namespaces a-f, g-h and i-j; the first child page splits. The parent
+ * starts out with the following page-index:
+ *
+ * | ... | a | g | i | ... |
+ *
+ * which changes to this:
+ *
+ * | ... | a | c | e | g | i | ... |
+ *
+ * The child starts out with the following page-index:
+ *
+ * | a | b | c | d | e | f |
+ *
+ * which changes to this:
+ *
+ * | a | b |
+ *
+ * The thread searches the original parent page index for the key "cat",
+ * it couples to the "a" child page; if it uses the replacement child
+ * page index, it will search past the end of the page and couple to the
+ * "b" page, which is wrong.
+ *
+ * To detect the problem, we remember the parent page's page index used
+ * to descend the tree. Whenever we search past the end of a page, we
+ * check to see if the parent's page index has changed since our use of
+ * it during descent. As the problem only appears if we read the split
+ * page's replacement index, the parent page's index must already have
+ * changed, ensuring we detect the problem.
*
- * It's also possible a thread could read the parent page's replacement
- * page index, and then read the page's original index. Because internal
- * splits work by truncating the original page, the original page's old
- * content is compatible, this isn't a problem and we ignore this race.
+ * It's possible for the opposite race to happen (a thread could read
+ * the parent page's replacement page index and then read the split
+ * page's original index). This isn't a problem because internal splits
+ * work by truncating the split page, so the split page search is for
+ * content the split page retains after the split, and we ignore this
+ * race.
*/
WT_INTL_INDEX_GET(session, parent, pindex);
return (pindex != saved_pindex);
diff --git a/src/include/btree_cmp.i b/src/include/btree_cmp.i
index 8a7fe19a22f..1993c1be293 100644
--- a/src/include/btree_cmp.i
+++ b/src/include/btree_cmp.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/buf.i b/src/include/buf.i
index b8849396f01..95d945ec6d3 100644
--- a/src/include/buf.i
+++ b/src/include/buf.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -92,18 +92,6 @@ __wt_buf_setstr(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *s)
}
/*
- * __wt_buf_set_printable --
- * Set the contents of the buffer to a printable representation of a
- * byte string.
- */
-static inline int
-__wt_buf_set_printable(
- WT_SESSION_IMPL *session, WT_ITEM *buf, const void *from_arg, size_t size)
-{
- return (__wt_raw_to_esc_hex(session, from_arg, size, buf));
-}
-
-/*
* __wt_buf_free --
* Free a buffer.
*/
diff --git a/src/include/cache.h b/src/include/cache.h
index a0440f23a00..a3961d6043e 100644
--- a/src/include/cache.h
+++ b/src/include/cache.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/cache.i b/src/include/cache.i
index 7cbd72853c3..ee13eee84c5 100644
--- a/src/include/cache.i
+++ b/src/include/cache.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/cell.i b/src/include/cell.i
index 1410b30bb82..481d2a29764 100644
--- a/src/include/cell.i
+++ b/src/include/cell.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/column.i b/src/include/column.i
index fc1f372b2a9..9f3e2101f6f 100644
--- a/src/include/column.i
+++ b/src/include/column.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -176,6 +176,16 @@ __col_insert_search(WT_INSERT_HEAD *inshead,
continue;
}
+ /*
+ * When no exact match is found, the search returns the smallest
+ * key larger than the searched-for key, or the largest key
+ * smaller than the searched-for key, if there is no larger key.
+ * Our callers depend on that: specifically, the fixed-length
+ * column store cursor code interprets returning a key smaller
+ * than the searched-for key to mean the searched-for key is
+ * larger than any key on the page. Don't change that behavior,
+ * things will break.
+ */
ins_recno = WT_INSERT_RECNO(ret_ins);
cmp = (recno == ins_recno) ? 0 : (recno < ins_recno) ? -1 : 1;
@@ -204,9 +214,9 @@ __col_var_last_recno(WT_PAGE *page)
WT_COL_RLE *repeat;
/*
- * If there's an append list (the last page), then there may be more
- * records on the page. This function ignores those records, so our
- * callers have to handle that explicitly, if they care.
+ * If there's an append list, there may be more records on the page.
+ * This function ignores those records, our callers must handle that
+ * explicitly, if they care.
*/
if (page->pg_var_nrepeats == 0)
return (page->pg_var_entries == 0 ? 0 :
@@ -225,9 +235,9 @@ static inline uint64_t
__col_fix_last_recno(WT_PAGE *page)
{
/*
- * If there's an append list (the last page), then there may be more
- * records on the page. This function ignores those records, so our
- * callers have to handle that explicitly, if they care.
+ * If there's an append list, there may be more records on the page.
+ * This function ignores those records, our callers must handle that
+ * explicitly, if they care.
*/
return (page->pg_fix_entries == 0 ? 0 :
page->pg_fix_recno + (page->pg_fix_entries - 1));
@@ -282,7 +292,17 @@ __col_var_search(WT_PAGE *page, uint64_t recno, uint64_t *start_recnop)
start_recno = repeat->recno + repeat->rle;
}
- if (recno >= start_recno + (page->pg_var_entries - start_indx))
+ /*
+ * !!!
+ * The test could be written more simply as:
+ *
+ * (recno >= start_recno + (page->pg_var_entries - start_indx))
+ *
+ * It's split into two parts because the simpler test will overflow if
+ * searching for large record numbers.
+ */
+ if (recno >= start_recno &&
+ recno - start_recno >= page->pg_var_entries - start_indx)
return (NULL);
return (page->pg_var_d + start_indx + (uint32_t)(recno - start_recno));
diff --git a/src/include/compact.h b/src/include/compact.h
index 0698bf7b1a4..2bba52e7173 100644
--- a/src/include/compact.h
+++ b/src/include/compact.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/config.h b/src/include/config.h
index e836abaccba..e63db0e76cf 100644
--- a/src/include/config.h
+++ b/src/include/config.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -72,25 +72,26 @@ struct __wt_config_parser_impl {
#define WT_CONFIG_ENTRY_WT_SESSION_log_flush 20
#define WT_CONFIG_ENTRY_WT_SESSION_log_printf 21
#define WT_CONFIG_ENTRY_WT_SESSION_open_cursor 22
-#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 23
-#define WT_CONFIG_ENTRY_WT_SESSION_rename 24
-#define WT_CONFIG_ENTRY_WT_SESSION_reset 25
-#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 26
-#define WT_CONFIG_ENTRY_WT_SESSION_salvage 27
-#define WT_CONFIG_ENTRY_WT_SESSION_snapshot 28
-#define WT_CONFIG_ENTRY_WT_SESSION_strerror 29
-#define WT_CONFIG_ENTRY_WT_SESSION_transaction_sync 30
-#define WT_CONFIG_ENTRY_WT_SESSION_truncate 31
-#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 32
-#define WT_CONFIG_ENTRY_WT_SESSION_verify 33
-#define WT_CONFIG_ENTRY_colgroup_meta 34
-#define WT_CONFIG_ENTRY_file_meta 35
-#define WT_CONFIG_ENTRY_index_meta 36
-#define WT_CONFIG_ENTRY_table_meta 37
-#define WT_CONFIG_ENTRY_wiredtiger_open 38
-#define WT_CONFIG_ENTRY_wiredtiger_open_all 39
-#define WT_CONFIG_ENTRY_wiredtiger_open_basecfg 40
-#define WT_CONFIG_ENTRY_wiredtiger_open_usercfg 41
+#define WT_CONFIG_ENTRY_WT_SESSION_rebalance 23
+#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 24
+#define WT_CONFIG_ENTRY_WT_SESSION_rename 25
+#define WT_CONFIG_ENTRY_WT_SESSION_reset 26
+#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 27
+#define WT_CONFIG_ENTRY_WT_SESSION_salvage 28
+#define WT_CONFIG_ENTRY_WT_SESSION_snapshot 29
+#define WT_CONFIG_ENTRY_WT_SESSION_strerror 30
+#define WT_CONFIG_ENTRY_WT_SESSION_transaction_sync 31
+#define WT_CONFIG_ENTRY_WT_SESSION_truncate 32
+#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 33
+#define WT_CONFIG_ENTRY_WT_SESSION_verify 34
+#define WT_CONFIG_ENTRY_colgroup_meta 35
+#define WT_CONFIG_ENTRY_file_meta 36
+#define WT_CONFIG_ENTRY_index_meta 37
+#define WT_CONFIG_ENTRY_table_meta 38
+#define WT_CONFIG_ENTRY_wiredtiger_open 39
+#define WT_CONFIG_ENTRY_wiredtiger_open_all 40
+#define WT_CONFIG_ENTRY_wiredtiger_open_basecfg 41
+#define WT_CONFIG_ENTRY_wiredtiger_open_usercfg 42
/*
* configuration section: END
* DO NOT EDIT: automatically built by dist/flags.py.
diff --git a/src/include/connection.h b/src/include/connection.h
index 2367f5a0035..5d61f9456b3 100644
--- a/src/include/connection.h
+++ b/src/include/connection.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -415,6 +415,7 @@ struct __wt_connection_impl {
uint32_t direct_io;
uint32_t write_through; /* FILE_FLAG_WRITE_THROUGH type flags */
bool mmap; /* mmap configuration */
+ int page_size; /* OS page size for mmap alignment */
uint32_t verbose;
uint32_t flags;
diff --git a/src/include/cursor.h b/src/include/cursor.h
index 275e2f2db46..7f7b5dceb79 100644
--- a/src/include/cursor.h
+++ b/src/include/cursor.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -200,18 +200,23 @@ struct __wt_cursor_btree {
uint8_t append_tree; /* Cursor appended to the tree */
+#ifdef HAVE_DIAGNOSTIC
+ /* Check that cursor next/prev never returns keys out-of-order. */
+ WT_ITEM *lastkey, _lastkey;
+ uint64_t lastrecno;
+#endif
+
#define WT_CBT_ACTIVE 0x01 /* Active in the tree */
#define WT_CBT_ITERATE_APPEND 0x02 /* Col-store: iterating append list */
#define WT_CBT_ITERATE_NEXT 0x04 /* Next iteration configuration */
#define WT_CBT_ITERATE_PREV 0x08 /* Prev iteration configuration */
-#define WT_CBT_MAX_RECORD 0x10 /* Col-store: past end-of-table */
-#define WT_CBT_NO_TXN 0x20 /* Non-transactional cursor
+#define WT_CBT_NO_TXN 0x10 /* Non-transactional cursor
(e.g. on a checkpoint) */
-#define WT_CBT_SEARCH_SMALLEST 0x40 /* Row-store: small-key insert list */
+#define WT_CBT_SEARCH_SMALLEST 0x20 /* Row-store: small-key insert list */
#define WT_CBT_POSITION_MASK /* Flags associated with position */ \
(WT_CBT_ITERATE_APPEND | WT_CBT_ITERATE_NEXT | WT_CBT_ITERATE_PREV | \
- WT_CBT_MAX_RECORD | WT_CBT_SEARCH_SMALLEST)
+ WT_CBT_SEARCH_SMALLEST)
uint8_t flags;
};
@@ -219,33 +224,32 @@ struct __wt_cursor_btree {
struct __wt_cursor_bulk {
WT_CURSOR_BTREE cbt;
- WT_REF *ref; /* The leaf page */
- WT_PAGE *leaf;
-
/*
* Variable-length column store compares values during bulk load as
* part of RLE compression, row-store compares keys during bulk load
* to avoid corruption.
*/
- WT_ITEM last; /* Last key/value seen */
+ bool first_insert; /* First insert */
+ WT_ITEM last; /* Last key/value inserted */
/*
- * Variable-length column-store RLE counter (also overloaded to mean
- * the first time through the bulk-load insert routine, when set to 0).
+ * Additional column-store bulk load support.
*/
- uint64_t rle;
+ uint64_t recno; /* Record number */
+ uint64_t rle; /* Variable-length RLE counter */
/*
- * Fixed-length column-store current entry in memory chunk count, and
- * the maximum number of records per chunk.
+ * Additional fixed-length column store bitmap bulk load support:
+ * current entry in memory chunk count, and the maximum number of
+ * records per chunk.
*/
+ bool bitmap; /* Bitmap bulk load */
uint32_t entry; /* Entry count */
uint32_t nrecs; /* Max records per chunk */
- /* Special bitmap bulk load for fixed-length column stores. */
- bool bitmap;
-
- void *reconcile; /* Reconciliation information */
+ void *reconcile; /* Reconciliation support */
+ WT_REF *ref; /* The leaf page */
+ WT_PAGE *leaf;
};
struct __wt_cursor_config {
diff --git a/src/include/cursor.i b/src/include/cursor.i
index 2e382591313..8ab96c0a69d 100644
--- a/src/include/cursor.i
+++ b/src/include/cursor.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -246,8 +246,12 @@ __cursor_func_init(WT_CURSOR_BTREE *cbt, bool reenter)
session = (WT_SESSION_IMPL *)cbt->iface.session;
- if (reenter)
+ if (reenter) {
+#ifdef HAVE_DIAGNOSTIC
+ __wt_cursor_key_order_reset(cbt);
+#endif
WT_RET(__curfile_leave(cbt));
+ }
/*
* Any old insert position is now invalid. We rely on this being
diff --git a/src/include/dhandle.h b/src/include/dhandle.h
index 9a54b4ddb66..8b313428d06 100644
--- a/src/include/dhandle.h
+++ b/src/include/dhandle.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -33,6 +33,10 @@
(F_ISSET(dhandle, WT_DHANDLE_DEAD) || \
!F_ISSET(dhandle, WT_DHANDLE_EXCLUSIVE | WT_DHANDLE_OPEN))
+/* The metadata cursor's data handle. */
+#define WT_SESSION_META_DHANDLE(s) \
+ (((WT_CURSOR_BTREE *)((s)->meta_cursor))->btree->dhandle)
+
/*
* WT_DATA_HANDLE --
* A handle for a generic named data source.
diff --git a/src/include/dlh.h b/src/include/dlh.h
index c374ec36fb0..9e49c2ff3cb 100644
--- a/src/include/dlh.h
+++ b/src/include/dlh.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/error.h b/src/include/error.h
index e721855ce7c..5f24d205af9 100644
--- a/src/include/error.h
+++ b/src/include/error.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/extern.h b/src/include/extern.h
index d84403cc16d..b71f4b12486 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -14,6 +14,7 @@ extern int __wt_block_buffer_to_addr(WT_BLOCK *block, const uint8_t *p, wt_off_t
extern int __wt_block_addr_invalid(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, bool live);
extern int __wt_block_addr_string(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, const uint8_t *addr, size_t addr_size);
extern int __wt_block_buffer_to_ckpt(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *p, WT_BLOCK_CKPT *ci);
+extern int __wt_block_ckpt_decode(WT_SESSION *wt_session, size_t allocsize, const uint8_t *p, WT_BLOCK_CKPT *ci);
extern int __wt_block_ckpt_to_buffer(WT_SESSION_IMPL *session, WT_BLOCK *block, uint8_t **pp, WT_BLOCK_CKPT *ci);
extern int __wt_block_ckpt_init( WT_SESSION_IMPL *session, WT_BLOCK_CKPT *ci, const char *name);
extern int __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size, uint8_t *root_addr, size_t *root_addr_sizep, bool checkpoint);
@@ -43,14 +44,15 @@ extern void __wt_block_extlist_free(WT_SESSION_IMPL *session, WT_EXTLIST *el);
extern int __wt_block_map( WT_SESSION_IMPL *session, WT_BLOCK *block, void *mapp, size_t *maplenp, void **mappingcookie);
extern int __wt_block_unmap( WT_SESSION_IMPL *session, WT_BLOCK *block, void *map, size_t maplen, void **mappingcookie);
extern int __wt_block_manager_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BM **bmp);
-extern int __wt_block_manager_truncate( WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize);
+extern int __wt_block_manager_drop(WT_SESSION_IMPL *session, const char *filename);
extern int __wt_block_manager_create( WT_SESSION_IMPL *session, const char *filename, uint32_t allocsize);
extern void __wt_block_configure_first_fit(WT_BLOCK *block, bool on);
extern int __wt_block_open(WT_SESSION_IMPL *session, const char *filename, const char *cfg[], bool forced_salvage, bool readonly, uint32_t allocsize, WT_BLOCK **blockp);
extern int __wt_block_close(WT_SESSION_IMPL *session, WT_BLOCK *block);
extern int __wt_desc_init(WT_SESSION_IMPL *session, WT_FH *fh, uint32_t allocsize);
extern void __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_STATS *stats);
-extern int __wt_block_manager_size( WT_SESSION_IMPL *session, const char *filename, WT_DSRC_STATS *stats);
+extern int __wt_block_manager_size(WT_BM *bm, WT_SESSION_IMPL *session, wt_off_t *sizep);
+extern int __wt_block_manager_named_size( WT_SESSION_IMPL *session, const char *name, wt_off_t *sizep);
extern int __wt_bm_preload( WT_BM *bm, WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size);
extern int __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr, size_t addr_size);
extern int __wt_block_read_off_blind( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t offset);
@@ -89,6 +91,9 @@ extern int __wt_bloom_close(WT_BLOOM *bloom);
extern int __wt_bloom_drop(WT_BLOOM *bloom, const char *config);
extern int __wt_compact(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_compact_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp);
+extern int __wt_cursor_key_order_check( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, bool next);
+extern int __wt_cursor_key_order_init(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt);
+extern void __wt_cursor_key_order_reset(WT_CURSOR_BTREE *cbt);
extern void __wt_btcur_iterate_setup(WT_CURSOR_BTREE *cbt);
extern int __wt_btcur_next(WT_CURSOR_BTREE *cbt, bool truncating);
extern int __wt_btcur_prev(WT_CURSOR_BTREE *cbt, bool truncating);
@@ -129,7 +134,7 @@ extern int __wt_btree_open(WT_SESSION_IMPL *session, const char *op_cfg[]);
extern int __wt_btree_close(WT_SESSION_IMPL *session);
extern void __wt_root_ref_init(WT_REF *root_ref, WT_PAGE *root, bool is_recno);
extern int __wt_btree_tree_open( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size);
-extern int __wt_btree_new_leaf_page(WT_SESSION_IMPL *session, WT_PAGE **pagep);
+extern int __wt_btree_new_leaf_page( WT_SESSION_IMPL *session, uint64_t recno, WT_PAGE **pagep);
extern void __wt_btree_evictable(WT_SESSION_IMPL *session, bool on);
extern int __wt_btree_huffman_open(WT_SESSION_IMPL *session);
extern void __wt_btree_huffman_close(WT_SESSION_IMPL *session);
@@ -139,6 +144,7 @@ extern const char *__wt_page_type_string(u_int type);
extern const char *__wt_cell_type_string(uint8_t type);
extern const char *__wt_page_addr_string(WT_SESSION_IMPL *session, WT_REF *ref, WT_ITEM *buf);
extern const char *__wt_addr_string(WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size, WT_ITEM *buf);
+extern const char *__wt_buf_set_printable( WT_SESSION_IMPL *session, const void *p, size_t size, WT_ITEM *buf);
extern int __wt_ovfl_read(WT_SESSION_IMPL *session, WT_PAGE *page, WT_CELL_UNPACK *unpack, WT_ITEM *store);
extern int __wt_ovfl_cache(WT_SESSION_IMPL *session, WT_PAGE *page, void *cookie, WT_CELL_UNPACK *vpack);
extern int __wt_ovfl_discard(WT_SESSION_IMPL *session, WT_CELL *cell);
@@ -151,6 +157,7 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
, const char *file, int line
#endif
);
+extern int __wt_bt_rebalance(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd);
extern int __wt_bt_salvage(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, const char *cfg[]);
extern void __wt_split_stash_discard(WT_SESSION_IMPL *session);
@@ -170,7 +177,7 @@ extern int __wt_tree_walk(WT_SESSION_IMPL *session, WT_REF **refp, uint32_t flag
extern int __wt_tree_walk_count(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *walkcntp, uint32_t flags);
extern int __wt_tree_walk_skip(WT_SESSION_IMPL *session, WT_REF **refp, uint64_t *skipleafcntp, uint32_t flags);
extern int __wt_col_modify(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, uint64_t recno, WT_ITEM *value, WT_UPDATE *upd_arg, bool is_remove);
-extern int __wt_col_search(WT_SESSION_IMPL *session, uint64_t recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt);
+extern int __wt_col_search(WT_SESSION_IMPL *session, uint64_t search_recno, WT_REF *leaf, WT_CURSOR_BTREE *cbt);
extern int __wt_row_leaf_keys(WT_SESSION_IMPL *session, WT_PAGE *page);
extern int __wt_row_leaf_key_copy( WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip, WT_ITEM *key);
extern int __wt_row_leaf_key_work(WT_SESSION_IMPL *session, WT_PAGE *page, WT_ROW *rip_arg, WT_ITEM *keyb, bool instantiate);
@@ -192,7 +199,7 @@ extern int __wt_las_create(WT_SESSION_IMPL *session);
extern int __wt_las_destroy(WT_SESSION_IMPL *session);
extern void __wt_las_set_written(WT_SESSION_IMPL *session);
extern bool __wt_las_is_written(WT_SESSION_IMPL *session);
-extern int __wt_las_cursor_create(WT_SESSION_IMPL *session, WT_CURSOR **cursorp);
+extern int __wt_las_cursor_open(WT_SESSION_IMPL *session, WT_CURSOR **cursorp);
extern int __wt_las_cursor( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t *session_flags);
extern int __wt_las_cursor_close( WT_SESSION_IMPL *session, WT_CURSOR **cursorp, uint32_t session_flags);
extern int __wt_las_sweep(WT_SESSION_IMPL *session);
@@ -255,7 +262,7 @@ extern int __wt_connection_init(WT_CONNECTION_IMPL *conn);
extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn);
extern int __wt_logmgr_reconfig(WT_SESSION_IMPL *session, const char **cfg);
extern int __wt_log_truncate_files( WT_SESSION_IMPL *session, WT_CURSOR *cursor, const char *cfg[]);
-extern int __wt_log_wrlsn(WT_SESSION_IMPL *session);
+extern int __wt_log_wrlsn(WT_SESSION_IMPL *session, int *yield);
extern int __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_logmgr_open(WT_SESSION_IMPL *session);
extern int __wt_logmgr_destroy(WT_SESSION_IMPL *session);
@@ -333,9 +340,10 @@ extern int __wt_evict_destroy(WT_SESSION_IMPL *session);
extern int __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session, bool *evict_resetp);
extern void __wt_evict_file_exclusive_off(WT_SESSION_IMPL *session);
extern int __wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full);
+extern void __wt_evict_priority_set(WT_SESSION_IMPL *session, uint64_t v);
+extern void __wt_evict_priority_clear(WT_SESSION_IMPL *session);
extern int __wt_cache_dump(WT_SESSION_IMPL *session, const char *ofile);
extern int __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing);
-extern int __wt_evict_page_clean_update( WT_SESSION_IMPL *session, WT_REF *ref, bool closing);
extern int __wt_log_ckpt(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn);
extern int __wt_log_flush_lsn(WT_SESSION_IMPL *session, WT_LSN *lsn, bool start);
extern int __wt_log_background(WT_SESSION_IMPL *session, WT_LSN *lsn);
@@ -362,23 +370,23 @@ extern int __wt_logrec_read(WT_SESSION_IMPL *session, const uint8_t **pp, const
extern int __wt_logop_read(WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *optypep, uint32_t *opsizep);
extern int __wt_logop_col_put_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t recno, WT_ITEM *value);
extern int __wt_logop_col_put_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *recnop, WT_ITEM *valuep);
-extern int __wt_logop_col_put_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
+extern int __wt_logop_col_put_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
extern int __wt_logop_col_remove_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t recno);
extern int __wt_logop_col_remove_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *recnop);
-extern int __wt_logop_col_remove_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
+extern int __wt_logop_col_remove_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
extern int __wt_logop_col_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, uint64_t start, uint64_t stop);
extern int __wt_logop_col_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, uint64_t *startp, uint64_t *stopp);
-extern int __wt_logop_col_truncate_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
+extern int __wt_logop_col_truncate_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
extern int __wt_logop_row_put_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *key, WT_ITEM *value);
extern int __wt_logop_row_put_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *keyp, WT_ITEM *valuep);
-extern int __wt_logop_row_put_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
+extern int __wt_logop_row_put_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
extern int __wt_logop_row_remove_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *key);
extern int __wt_logop_row_remove_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *keyp);
-extern int __wt_logop_row_remove_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
+extern int __wt_logop_row_remove_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
extern int __wt_logop_row_truncate_pack( WT_SESSION_IMPL *session, WT_ITEM *logrec, uint32_t fileid, WT_ITEM *start, WT_ITEM *stop, uint32_t mode);
extern int __wt_logop_row_truncate_unpack( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, uint32_t *fileidp, WT_ITEM *startp, WT_ITEM *stopp, uint32_t *modep);
-extern int __wt_logop_row_truncate_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
-extern int __wt_txn_op_printlog( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out);
+extern int __wt_logop_row_truncate_print( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
+extern int __wt_txn_op_printlog( WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out, uint32_t flags);
extern void __wt_log_slot_activate(WT_SESSION_IMPL *session, WT_LOGSLOT *slot);
extern int __wt_log_slot_switch( WT_SESSION_IMPL *session, WT_MYSLOT *myslot, bool retry, bool forced);
extern int __wt_log_slot_new(WT_SESSION_IMPL *session);
@@ -447,12 +455,13 @@ extern int __wt_ext_metadata_search(WT_EXTENSION_API *wt_api, WT_SESSION *wt_ses
extern int __wt_ext_metadata_update(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *key, const char *value);
extern int __wt_metadata_get_ckptlist( WT_SESSION *session, const char *name, WT_CKPT **ckptbasep);
extern void __wt_metadata_free_ckptlist(WT_SESSION *session, WT_CKPT *ckptbase);
-extern int __wt_metadata_open(WT_SESSION_IMPL *session);
-extern int __wt_metadata_cursor( WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp);
+extern int __wt_metadata_cursor_open( WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp);
+extern int __wt_metadata_cursor(WT_SESSION_IMPL *session, WT_CURSOR **cursorp);
+extern int __wt_metadata_cursor_release(WT_SESSION_IMPL *session, WT_CURSOR **cursorp);
extern int __wt_metadata_insert( WT_SESSION_IMPL *session, const char *key, const char *value);
extern int __wt_metadata_update( WT_SESSION_IMPL *session, const char *key, const char *value);
extern int __wt_metadata_remove(WT_SESSION_IMPL *session, const char *key);
-extern int __wt_metadata_search( WT_SESSION_IMPL *session, const char *key, char **valuep);
+extern int __wt_metadata_search(WT_SESSION_IMPL *session, const char *key, char **valuep);
extern void __wt_meta_track_discard(WT_SESSION_IMPL *session);
extern int __wt_meta_track_on(WT_SESSION_IMPL *session);
extern int __wt_meta_track_off(WT_SESSION_IMPL *session, bool need_sync, bool unroll);
@@ -468,7 +477,7 @@ extern int __wt_meta_track_init(WT_SESSION_IMPL *session);
extern int __wt_meta_track_destroy(WT_SESSION_IMPL *session);
extern int __wt_turtle_init(WT_SESSION_IMPL *session);
extern int __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep);
-extern int __wt_turtle_update( WT_SESSION_IMPL *session, const char *key, const char *value);
+extern int __wt_turtle_update(WT_SESSION_IMPL *session, const char *key, const char *value);
extern void __wt_abort(WT_SESSION_IMPL *session) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn));
extern int __wt_calloc(WT_SESSION_IMPL *session, size_t number, size_t size, void *retp);
extern int __wt_realloc(WT_SESSION_IMPL *session, size_t *bytes_allocated_ret, size_t bytes_to_allocate, void *retp);
@@ -488,7 +497,7 @@ extern int __wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep);
extern int __wt_filesize_name(WT_SESSION_IMPL *session, const char *filename, bool silent, wt_off_t *sizep);
extern int __wt_bytelock(WT_FH *fhp, wt_off_t byte, bool lock);
extern int __wt_directory_sync_fh(WT_SESSION_IMPL *session, WT_FH *fh);
-extern int __wt_directory_sync(WT_SESSION_IMPL *session, char *path);
+extern int __wt_directory_sync(WT_SESSION_IMPL *session, const char *path);
extern int __wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh);
extern int __wt_fsync_async(WT_SESSION_IMPL *session, WT_FH *fh);
extern int __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len);
@@ -514,6 +523,7 @@ extern int __wt_rwlock_destroy(WT_SESSION_IMPL *session, WT_RWLOCK **rwlockp);
extern int __wt_once(void (*init_routine)(void));
extern int __wt_open(WT_SESSION_IMPL *session, const char *name, bool ok_create, bool exclusive, int dio_type, WT_FH **fhp);
extern int __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp);
+extern int __wt_get_vm_pagesize(void);
extern bool __wt_absolute_path(const char *path);
extern const char *__wt_path_separator(void);
extern bool __wt_has_priv(void);
@@ -558,8 +568,9 @@ extern uint32_t __wt_split_page_size(WT_BTREE *btree, uint32_t maxpagesize);
extern int __wt_bulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk);
extern int __wt_bulk_wrapup(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk);
extern int __wt_bulk_insert_row(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk);
-extern int __wt_bulk_insert_fix(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk);
-extern int __wt_bulk_insert_var(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk);
+extern int __wt_bulk_insert_fix( WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted);
+extern int __wt_bulk_insert_fix_bitmap(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk);
+extern int __wt_bulk_insert_var( WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted);
extern int __wt_schema_create_strip(WT_SESSION_IMPL *session, const char *v1, const char *v2, char **value_ret);
extern int __wt_direct_io_size_check(WT_SESSION_IMPL *session, const char **cfg, const char *config_name, uint32_t *allocsizep);
extern int __wt_schema_colgroup_source(WT_SESSION_IMPL *session, WT_TABLE *table, const char *cgname, const char *config, WT_ITEM *buf);
@@ -606,6 +617,7 @@ extern int __wt_session_release_resources(WT_SESSION_IMPL *session);
extern int __wt_open_cursor(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *owner, const char *cfg[], WT_CURSOR **cursorp);
extern int __wt_session_create( WT_SESSION_IMPL *session, const char *uri, const char *config);
extern int __wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]);
+extern int __wt_session_range_truncate(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *start, WT_CURSOR *stop);
extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, bool open_metadata, WT_SESSION_IMPL **sessionp);
extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name, bool open_metadata, uint32_t session_flags, WT_SESSION_IMPL **sessionp);
extern int __wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, bool *skipp);
@@ -639,8 +651,9 @@ extern int __wt_bad_object_type(WT_SESSION_IMPL *session, const char *uri);
extern int __wt_filename(WT_SESSION_IMPL *session, const char *name, char **path);
extern int __wt_nfilename( WT_SESSION_IMPL *session, const char *name, size_t namelen, char **path);
extern int __wt_remove_if_exists(WT_SESSION_IMPL *session, const char *name);
-extern int __wt_sync_and_rename_fh( WT_SESSION_IMPL *session, WT_FH **fhp, const char *from, const char *to);
-extern int __wt_sync_and_rename_fp( WT_SESSION_IMPL *session, FILE **fpp, const char *from, const char *to);
+extern int __wt_rename_and_sync_directory( WT_SESSION_IMPL *session, const char *from, const char *to);
+extern int __wt_fh_sync_and_rename( WT_SESSION_IMPL *session, WT_FH **fhp, const char *from, const char *to);
+extern int __wt_sync_fp_and_rename( WT_SESSION_IMPL *session, FILE **fpp, const char *from, const char *to);
extern int __wt_library_init(void);
extern int __wt_breakpoint(void);
extern void __wt_attach(WT_SESSION_IMPL *session);
@@ -654,6 +667,7 @@ __wt_hazard_set(WT_SESSION_IMPL *session, WT_REF *ref, bool *busyp
);
extern int __wt_hazard_clear(WT_SESSION_IMPL *session, WT_PAGE *page);
extern void __wt_hazard_close(WT_SESSION_IMPL *session);
+extern void __wt_fill_hex(const uint8_t *src, size_t src_max, uint8_t *dest, size_t dest_max, size_t *lenp);
extern int __wt_raw_to_hex( WT_SESSION_IMPL *session, const uint8_t *from, size_t size, WT_ITEM *to);
extern int __wt_raw_to_esc_hex( WT_SESSION_IMPL *session, const uint8_t *from, size_t size, WT_ITEM *to);
extern int __wt_hex2byte(const u_char *from, u_char *to);
@@ -671,6 +685,7 @@ extern uint32_t __wt_log2_int(uint32_t n);
extern bool __wt_ispo2(uint32_t v);
extern uint32_t __wt_rduppo2(uint32_t n, uint32_t po2);
extern void __wt_random_init(WT_RAND_STATE volatile *rnd_state);
+extern int __wt_random_init_seed( WT_SESSION_IMPL *session, WT_RAND_STATE volatile *rnd_state);
extern uint32_t __wt_random(WT_RAND_STATE volatile *rnd_state);
extern int __wt_buf_grow_worker(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size);
extern int __wt_buf_fmt(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4)));
@@ -732,7 +747,7 @@ extern int __wt_txn_checkpoint_logread( WT_SESSION_IMPL *session, const uint8_t
extern int __wt_txn_checkpoint_log( WT_SESSION_IMPL *session, bool full, uint32_t flags, WT_LSN *lsnp);
extern int __wt_txn_truncate_log( WT_SESSION_IMPL *session, WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop);
extern int __wt_txn_truncate_end(WT_SESSION_IMPL *session);
-extern int __wt_txn_printlog(WT_SESSION *wt_session, FILE *out);
+extern int __wt_txn_printlog(WT_SESSION *wt_session, FILE *out, uint32_t flags);
extern int __wt_txn_named_snapshot_begin(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_txn_named_snapshot_drop(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_txn_named_snapshot_get(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *nameval);
diff --git a/src/include/flags.h b/src/include/flags.h
index bafff92fbc0..24fae4abccd 100644
--- a/src/include/flags.h
+++ b/src/include/flags.h
@@ -39,15 +39,17 @@
#define WT_LOG_SYNC_ENABLED 0x00000010
#define WT_READ_CACHE 0x00000001
#define WT_READ_COMPACT 0x00000002
-#define WT_READ_NO_EMPTY 0x00000004
-#define WT_READ_NO_EVICT 0x00000008
-#define WT_READ_NO_GEN 0x00000010
-#define WT_READ_NO_WAIT 0x00000020
-#define WT_READ_PREV 0x00000040
-#define WT_READ_SKIP_INTL 0x00000080
-#define WT_READ_SKIP_LEAF 0x00000100
-#define WT_READ_TRUNCATE 0x00000200
-#define WT_READ_WONT_NEED 0x00000400
+#define WT_READ_NOTFOUND_OK 0x00000004
+#define WT_READ_NO_EMPTY 0x00000008
+#define WT_READ_NO_EVICT 0x00000010
+#define WT_READ_NO_GEN 0x00000020
+#define WT_READ_NO_WAIT 0x00000040
+#define WT_READ_PREV 0x00000080
+#define WT_READ_RESTART_OK 0x00000100
+#define WT_READ_SKIP_INTL 0x00000200
+#define WT_READ_SKIP_LEAF 0x00000400
+#define WT_READ_TRUNCATE 0x00000800
+#define WT_READ_WONT_NEED 0x00001000
#define WT_SESSION_CAN_WAIT 0x00000001
#define WT_SESSION_CLEAR_EVICT_WALK 0x00000002
#define WT_SESSION_INTERNAL 0x00000004
@@ -57,15 +59,16 @@
#define WT_SESSION_LOCKED_SLOT 0x00000040
#define WT_SESSION_LOCKED_TABLE 0x00000080
#define WT_SESSION_LOCKED_TURTLE 0x00000100
-#define WT_SESSION_LOGGING_INMEM 0x00000200
-#define WT_SESSION_LOOKASIDE_CURSOR 0x00000400
-#define WT_SESSION_NO_CACHE 0x00000800
-#define WT_SESSION_NO_DATA_HANDLES 0x00001000
-#define WT_SESSION_NO_EVICTION 0x00002000
-#define WT_SESSION_NO_LOGGING 0x00004000
-#define WT_SESSION_NO_SCHEMA_LOCK 0x00008000
-#define WT_SESSION_QUIET_CORRUPT_FILE 0x00010000
-#define WT_SESSION_SERVER_ASYNC 0x00020000
+#define WT_SESSION_LOCK_NO_WAIT 0x00000200
+#define WT_SESSION_LOGGING_INMEM 0x00000400
+#define WT_SESSION_LOOKASIDE_CURSOR 0x00000800
+#define WT_SESSION_NO_CACHE 0x00001000
+#define WT_SESSION_NO_DATA_HANDLES 0x00002000
+#define WT_SESSION_NO_EVICTION 0x00004000
+#define WT_SESSION_NO_LOGGING 0x00008000
+#define WT_SESSION_NO_SCHEMA_LOCK 0x00010000
+#define WT_SESSION_QUIET_CORRUPT_FILE 0x00020000
+#define WT_SESSION_SERVER_ASYNC 0x00040000
#define WT_TXN_LOG_CKPT_CLEANUP 0x00000001
#define WT_TXN_LOG_CKPT_PREPARE 0x00000002
#define WT_TXN_LOG_CKPT_START 0x00000004
@@ -85,16 +88,17 @@
#define WT_VERB_MUTEX 0x00000800
#define WT_VERB_OVERFLOW 0x00001000
#define WT_VERB_READ 0x00002000
-#define WT_VERB_RECONCILE 0x00004000
-#define WT_VERB_RECOVERY 0x00008000
-#define WT_VERB_SALVAGE 0x00010000
-#define WT_VERB_SHARED_CACHE 0x00020000
-#define WT_VERB_SPLIT 0x00040000
-#define WT_VERB_TEMPORARY 0x00080000
-#define WT_VERB_TRANSACTION 0x00100000
-#define WT_VERB_VERIFY 0x00200000
-#define WT_VERB_VERSION 0x00400000
-#define WT_VERB_WRITE 0x00800000
+#define WT_VERB_REBALANCE 0x00004000
+#define WT_VERB_RECONCILE 0x00008000
+#define WT_VERB_RECOVERY 0x00010000
+#define WT_VERB_SALVAGE 0x00020000
+#define WT_VERB_SHARED_CACHE 0x00040000
+#define WT_VERB_SPLIT 0x00080000
+#define WT_VERB_TEMPORARY 0x00100000
+#define WT_VERB_TRANSACTION 0x00200000
+#define WT_VERB_VERIFY 0x00400000
+#define WT_VERB_VERSION 0x00800000
+#define WT_VERB_WRITE 0x01000000
#define WT_VISIBILITY_ERR 0x00000010
/*
* flags section: END
diff --git a/src/include/gcc.h b/src/include/gcc.h
index 01e33792d73..6ccc0de3c03 100644
--- a/src/include/gcc.h
+++ b/src/include/gcc.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -156,8 +156,7 @@ __wt_atomic_cas_ptr(void *vp, void *old, void *new)
#if defined(x86_64) || defined(__x86_64__)
/* Pause instruction to prevent excess processor bus usage */
-#define WT_PAUSE() __asm__ volatile("pause\n" ::: "memory")
-
+#define WT_PAUSE() __asm__ volatile("pause\n" ::: "memory")
#define WT_FULL_BARRIER() do { \
__asm__ volatile ("mfence" ::: "memory"); \
} while (0)
@@ -169,7 +168,7 @@ __wt_atomic_cas_ptr(void *vp, void *old, void *new)
} while (0)
#elif defined(i386) || defined(__i386__)
-#define WT_PAUSE() __asm__ volatile("pause\n" ::: "memory")
+#define WT_PAUSE() __asm__ volatile("pause\n" ::: "memory")
#define WT_FULL_BARRIER() do { \
__asm__ volatile ("lock; addl $0, 0(%%esp)" ::: "memory"); \
} while (0)
@@ -177,23 +176,58 @@ __wt_atomic_cas_ptr(void *vp, void *old, void *new)
#define WT_WRITE_BARRIER() WT_FULL_BARRIER()
#elif defined(__PPC64__) || defined(PPC64)
+/* ori 0,0,0 is the PPC64 noop instruction */
#define WT_PAUSE() __asm__ volatile("ori 0,0,0" ::: "memory")
-#define WT_FULL_BARRIER() do {
+#define WT_FULL_BARRIER() do { \
__asm__ volatile ("sync" ::: "memory"); \
} while (0)
-#define WT_READ_BARRIER() WT_FULL_BARRIER()
-#define WT_WRITE_BARRIER() WT_FULL_BARRIER()
+
+/* TODO: ISA 2.07 Elemental Memory Barriers would be better,
+ specifically mbll, and mbss, but they are not supported by POWER 8 */
+#define WT_READ_BARRIER() do { \
+ __asm__ volatile ("lwsync" ::: "memory"); \
+} while (0)
+#define WT_WRITE_BARRIER() do { \
+ __asm__ volatile ("lwsync" ::: "memory"); \
+} while (0)
#elif defined(__aarch64__)
#define WT_PAUSE() __asm__ volatile("yield" ::: "memory")
#define WT_FULL_BARRIER() do { \
- __asm__ volatile ("dsb sy" ::: "memory"); \
+ __asm__ volatile ("dsb sy" ::: "memory"); \
+} while (0)
+#define WT_READ_BARRIER() do { \
+ __asm__ volatile ("dsb ld" ::: "memory"); \
+} while (0)
+#define WT_WRITE_BARRIER() do { \
+ __asm__ volatile ("dsb st" ::: "memory"); \
+} while (0)
+
+#elif defined(__s390x__)
+#define WT_PAUSE() __asm__ volatile("lr 0,0" ::: "memory")
+#define WT_FULL_BARRIER() do { \
+ __asm__ volatile ("bcr 15,0\n" ::: "memory"); \
} while (0)
+#define WT_READ_BARRIER() WT_FULL_BARRIER()
+#define WT_WRITE_BARRIER() WT_FULL_BARRIER()
+
+#elif defined(__sparc__)
+#define WT_PAUSE() __asm__ volatile("rd %%ccr, %%g0" ::: "memory")
+
+#define WT_FULL_BARRIER() do { \
+ __asm__ volatile ("membar #StoreLoad" ::: "memory"); \
+} while (0)
+
+/*
+ * On UltraSparc machines, TSO is used, and so there is no need for membar.
+ * READ_BARRIER = #LoadLoad, and WRITE_BARRIER = #StoreStore are noop.
+ */
#define WT_READ_BARRIER() do { \
- __asm__ volatile ("dsb ld" ::: "memory"); \
+ __asm__ volatile ("" ::: "memory"); \
} while (0)
+
#define WT_WRITE_BARRIER() do { \
- __asm__ volatile ("dsb st" ::: "memory"); \
+ __asm__ volatile ("" ::: "memory"); \
} while (0)
#else
diff --git a/src/include/hardware.h b/src/include/hardware.h
index 1ab2c3d39c4..93ed8a868b6 100644
--- a/src/include/hardware.h
+++ b/src/include/hardware.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/intpack.i b/src/include/intpack.i
index a13ad05451d..b27afd24e6c 100644
--- a/src/include/intpack.i
+++ b/src/include/intpack.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/lint.h b/src/include/lint.h
index f288fb98683..f8b17022968 100644
--- a/src/include/lint.h
+++ b/src/include/lint.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/log.h b/src/include/log.h
index 521de567fc0..577f6a888a3 100644
--- a/src/include/log.h
+++ b/src/include/log.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -160,9 +160,9 @@ struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_logslot {
#define WT_SLOT_INIT_FLAGS 0
-#define WT_WITH_SLOT_LOCK(session, log, op) do { \
+#define WT_WITH_SLOT_LOCK(session, log, ret, op) do { \
WT_ASSERT(session, !F_ISSET(session, WT_SESSION_LOCKED_SLOT)); \
- WT_WITH_LOCK(session, \
+ WT_WITH_LOCK(session, ret, \
&log->log_slot_lock, WT_SESSION_LOCKED_SLOT, op); \
} while (0)
@@ -267,6 +267,11 @@ struct __wt_log_desc {
};
/*
+ * Flags for __wt_txn_op_printlog.
+ */
+#define WT_TXN_PRINTLOG_HEX 0x0001 /* Add hex output */
+
+/*
* WT_LOG_REC_DESC --
* A descriptor for a log record type.
*/
diff --git a/src/include/log.i b/src/include/log.i
index ff309c31265..fcdbc72c388 100644
--- a/src/include/log.i
+++ b/src/include/log.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/lsm.h b/src/include/lsm.h
index d15dab3aa45..7cb3ccc895d 100644
--- a/src/include/lsm.h
+++ b/src/include/lsm.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/meta.h b/src/include/meta.h
index 938101e9caa..e29ec4202dc 100644
--- a/src/include/meta.h
+++ b/src/include/meta.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -43,9 +43,9 @@
* WT_WITH_TURTLE_LOCK --
* Acquire the turtle file lock, perform an operation, drop the lock.
*/
-#define WT_WITH_TURTLE_LOCK(session, op) do { \
+#define WT_WITH_TURTLE_LOCK(session, ret, op) do { \
WT_ASSERT(session, !F_ISSET(session, WT_SESSION_LOCKED_TURTLE));\
- WT_WITH_LOCK(session, \
+ WT_WITH_LOCK(session, ret, \
&S2C(session)->turtle_lock, WT_SESSION_LOCKED_TURTLE, op); \
} while (0)
diff --git a/src/include/misc.h b/src/include/misc.h
index e542baec642..78997661851 100644
--- a/src/include/misc.h
+++ b/src/include/misc.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -268,3 +268,6 @@ union __wt_rand_state {
uint32_t w, z;
} x;
};
+
+/* Shared array for converting to hex */
+extern const u_char __wt_hex[];
diff --git a/src/include/misc.i b/src/include/misc.i
index 75068706b70..04376441340 100644
--- a/src/include/misc.i
+++ b/src/include/misc.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/msvc.h b/src/include/msvc.h
index 8f5aa9abde8..99260a44875 100644
--- a/src/include/msvc.h
+++ b/src/include/msvc.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/mutex.h b/src/include/mutex.h
index b67e5e610e8..f798bfb3ece 100644
--- a/src/include/mutex.h
+++ b/src/include/mutex.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/mutex.i b/src/include/mutex.i
index 7eb042dd79f..52250f84ab3 100644
--- a/src/include/mutex.i
+++ b/src/include/mutex.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/os.h b/src/include/os.h
index d135fd9eb1f..fbba7f05f88 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/os_windows.h b/src/include/os_windows.h
index de97143335f..65938ac9f17 100644
--- a/src/include/os_windows.h
+++ b/src/include/os_windows.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/packing.i b/src/include/packing.i
index 9be38251703..784a55ef2ae 100644
--- a/src/include/packing.i
+++ b/src/include/packing.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -25,7 +25,8 @@ typedef struct {
char type;
} WT_PACK_VALUE;
-#define WT_PACK_VALUE_INIT { { 0 }, 0, 0, 0 }
+/* Default to size = 1 if there is no size prefix. */
+#define WT_PACK_VALUE_INIT { { 0 }, 1, 0, 0 }
#define WT_DECL_PACK_VALUE(pv) WT_PACK_VALUE pv = WT_PACK_VALUE_INIT
typedef struct {
@@ -151,7 +152,14 @@ next: if (pack->cur == pack->end)
switch (pv->type) {
case 'S':
+ return (0);
case 's':
+ if (pv->size < 1)
+ WT_RET_MSG(pack->session, EINVAL,
+ "Fixed length strings must be at least 1 byte "
+ "in format '%.*s'",
+ (int)(pack->end - pack->orig), pack->orig);
+ return (0);
case 'x':
return (0);
case 't':
@@ -266,9 +274,10 @@ __pack_size(WT_SESSION_IMPL *session, WT_PACK_VALUE *pv)
return (s);
case 's':
case 'S':
- if (pv->type == 's' || pv->havesize)
+ if (pv->type == 's' || pv->havesize) {
s = pv->size;
- else
+ WT_ASSERT(session, s != 0);
+ } else
s = strlen(pv->u.s) + 1;
return (s);
case 'U':
@@ -460,9 +469,10 @@ __unpack_read(WT_SESSION_IMPL *session,
break;
case 's':
case 'S':
- if (pv->type == 's' || pv->havesize)
+ if (pv->type == 's' || pv->havesize) {
s = pv->size;
- else
+ WT_ASSERT(session, s != 0);
+ } else
s = strlen((const char *)*pp) + 1;
if (s > 0)
pv->u.s = (const char *)*pp;
@@ -667,7 +677,6 @@ __wt_struct_unpackv(WT_SESSION_IMPL *session,
if (fmt[0] != '\0' && fmt[1] == '\0') {
pv.type = fmt[0];
- pv.size = 1;
if ((ret = __unpack_read(session, &pv, &p, size)) == 0)
WT_UNPACK_PUT(session, pv, ap);
return (0);
diff --git a/src/include/posix.h b/src/include/posix.h
index 1aa629c98e7..2593c7b6797 100644
--- a/src/include/posix.h
+++ b/src/include/posix.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/schema.h b/src/include/schema.h
index 023fd398f1c..88a3a39f8b3 100644
--- a/src/include/schema.h
+++ b/src/include/schema.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -82,9 +82,17 @@ struct __wt_table {
* WT_WITH_LOCK --
* Acquire a lock, perform an operation, drop the lock.
*/
-#define WT_WITH_LOCK(session, lock, flag, op) do { \
+#define WT_WITH_LOCK(session, ret, lock, flag, op) do { \
+ ret = 0; \
if (F_ISSET(session, (flag))) { \
op; \
+ } else if (F_ISSET(session, WT_SESSION_LOCK_NO_WAIT)) { \
+ if ((ret = __wt_spin_trylock(session, (lock))) == 0) { \
+ F_SET(session, (flag)); \
+ op; \
+ F_CLR(session, (flag)); \
+ __wt_spin_unlock(session, (lock)); \
+ } \
} else { \
__wt_spin_lock(session, (lock)); \
F_SET(session, (flag)); \
@@ -98,16 +106,16 @@ struct __wt_table {
* WT_WITH_CHECKPOINT_LOCK --
* Acquire the checkpoint lock, perform an operation, drop the lock.
*/
-#define WT_WITH_CHECKPOINT_LOCK(session, op) \
- WT_WITH_LOCK(session, \
+#define WT_WITH_CHECKPOINT_LOCK(session, ret, op) \
+ WT_WITH_LOCK(session, ret, \
&S2C(session)->checkpoint_lock, WT_SESSION_LOCKED_CHECKPOINT, op)
/*
* WT_WITH_HANDLE_LIST_LOCK --
* Acquire the data handle list lock, perform an operation, drop the lock.
*/
-#define WT_WITH_HANDLE_LIST_LOCK(session, op) \
- WT_WITH_LOCK(session, \
+#define WT_WITH_HANDLE_LIST_LOCK(session, ret, op) \
+ WT_WITH_LOCK(session, ret, \
&S2C(session)->dhandle_lock, WT_SESSION_LOCKED_HANDLE_LIST, op)
/*
* WT_WITH_SCHEMA_LOCK --
@@ -115,12 +123,12 @@ struct __wt_table {
* Check that we are not already holding some other lock: the schema lock
* must be taken first.
*/
-#define WT_WITH_SCHEMA_LOCK(session, op) do { \
+#define WT_WITH_SCHEMA_LOCK(session, ret, op) do { \
WT_ASSERT(session, \
F_ISSET(session, WT_SESSION_LOCKED_SCHEMA) || \
!F_ISSET(session, WT_SESSION_LOCKED_HANDLE_LIST | \
WT_SESSION_NO_SCHEMA_LOCK | WT_SESSION_LOCKED_TABLE)); \
- WT_WITH_LOCK(session, \
+ WT_WITH_LOCK(session, ret, \
&S2C(session)->schema_lock, WT_SESSION_LOCKED_SCHEMA, op); \
} while (0)
@@ -128,11 +136,11 @@ struct __wt_table {
* WT_WITH_TABLE_LOCK --
* Acquire the table lock, perform an operation, drop the lock.
*/
-#define WT_WITH_TABLE_LOCK(session, op) do { \
+#define WT_WITH_TABLE_LOCK(session, ret, op) do { \
WT_ASSERT(session, \
F_ISSET(session, WT_SESSION_LOCKED_TABLE) || \
!F_ISSET(session, WT_SESSION_LOCKED_HANDLE_LIST)); \
- WT_WITH_LOCK(session, \
+ WT_WITH_LOCK(session, ret, \
&S2C(session)->table_lock, WT_SESSION_LOCKED_TABLE, op); \
} while (0)
diff --git a/src/include/serial.i b/src/include/serial.i
index ca22ce12d81..fa920de7e37 100644
--- a/src/include/serial.i
+++ b/src/include/serial.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/session.h b/src/include/session.h
index 5c3bcfb8ed0..5c3291230b4 100644
--- a/src/include/session.h
+++ b/src/include/session.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -74,19 +74,22 @@ struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_session_impl {
TAILQ_HEAD(__cursors, __wt_cursor) cursors;
WT_CURSOR_BACKUP *bkp_cursor; /* Hot backup cursor */
- WT_COMPACT *compact; /* Compact state */
+
+ WT_COMPACT *compact; /* Compaction information */
+ enum { WT_COMPACT_NONE=0,
+ WT_COMPACT_RUNNING, WT_COMPACT_SUCCESS } compact_state;
/*
* Lookaside table cursor, sweep and eviction worker threads only.
*/
WT_CURSOR *las_cursor; /* Lookaside table cursor */
- WT_DATA_HANDLE *meta_dhandle; /* Metadata file */
- void *meta_track; /* Metadata operation tracking */
- void *meta_track_next; /* Current position */
- void *meta_track_sub; /* Child transaction / save point */
- size_t meta_track_alloc; /* Currently allocated */
- int meta_track_nest; /* Nesting level of meta transaction */
+ WT_CURSOR *meta_cursor; /* Metadata file */
+ void *meta_track; /* Metadata operation tracking */
+ void *meta_track_next; /* Current position */
+ void *meta_track_sub; /* Child transaction / save point */
+ size_t meta_track_alloc; /* Currently allocated */
+ int meta_track_nest; /* Nesting level of meta transaction */
#define WT_META_TRACKING(session) (session->meta_track_next != NULL)
/*
@@ -134,8 +137,6 @@ struct WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) __wt_session_impl {
void *reconcile; /* Reconciliation support */
int (*reconcile_cleanup)(WT_SESSION_IMPL *);
- bool compaction; /* Compaction did some work */
-
uint32_t flags;
/*
diff --git a/src/include/stat.h b/src/include/stat.h
index dfe7ee5c6cd..51d2fa332e7 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -139,8 +139,8 @@ __wt_stats_clear(void *stats_arg, int slot)
*/
#define WT_STAT_READ(stats, fld) \
__wt_stats_aggregate(stats, WT_STATS_FIELD_TO_SLOT(stats, fld))
-#define WT_STAT_WRITE(session, stats, fld) \
- ((stats)[WT_STATS_SLOT_ID(session)]->fld);
+#define WT_STAT_WRITE(stats, fld, v) \
+ (stats)->fld = (int64_t)(v)
#define WT_STAT_DECRV(session, stats, fld, value) \
(stats)[WT_STATS_SLOT_ID(session)]->fld -= (int64_t)(value)
diff --git a/src/include/txn.h b/src/include/txn.h
index 936164fa9a7..1e82e2d982a 100644
--- a/src/include/txn.h
+++ b/src/include/txn.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/txn.i b/src/include/txn.i
index 1005d4a395d..46f2ff3e5f1 100644
--- a/src/include/txn.i
+++ b/src/include/txn.i
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -185,9 +185,7 @@ __wt_txn_visible(WT_SESSION_IMPL *session, uint64_t id)
if (id == WT_TXN_ABORTED)
return (false);
- /*
- * Read-uncommitted transactions see all other changes.
- */
+ /* Read-uncommitted transactions see all other changes. */
if (txn->isolation == WT_ISO_READ_UNCOMMITTED)
return (true);
diff --git a/src/include/verify_build.h b/src/include/verify_build.h
index 6a97def12be..477b9b7c134 100644
--- a/src/include/verify_build.h
+++ b/src/include/verify_build.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index bdd8bb65910..676f95d9b05 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -566,20 +566,21 @@ struct __wt_cursor {
*/
const char *internal_uri;
-#define WT_CURSTD_APPEND 0x0001
-#define WT_CURSTD_BULK 0x0002
-#define WT_CURSTD_DUMP_HEX 0x0004
-#define WT_CURSTD_DUMP_JSON 0x0008
-#define WT_CURSTD_DUMP_PRINT 0x0010
-#define WT_CURSTD_KEY_EXT 0x0020 /* Key points out of the tree. */
-#define WT_CURSTD_KEY_INT 0x0040 /* Key points into the tree. */
+#define WT_CURSTD_APPEND 0x00001
+#define WT_CURSTD_BULK 0x00002
+#define WT_CURSTD_DUMP_HEX 0x00004
+#define WT_CURSTD_DUMP_JSON 0x00008
+#define WT_CURSTD_DUMP_PRINT 0x00010
+#define WT_CURSTD_JOINED 0x00020
+#define WT_CURSTD_KEY_EXT 0x00040 /* Key points out of the tree. */
+#define WT_CURSTD_KEY_INT 0x00080 /* Key points into the tree. */
#define WT_CURSTD_KEY_SET (WT_CURSTD_KEY_EXT | WT_CURSTD_KEY_INT)
-#define WT_CURSTD_JOINED 0x0080
-#define WT_CURSTD_OPEN 0x0100
-#define WT_CURSTD_OVERWRITE 0x0200
-#define WT_CURSTD_RAW 0x0400
-#define WT_CURSTD_VALUE_EXT 0x0800 /* Value points out of the tree. */
-#define WT_CURSTD_VALUE_INT 0x1000 /* Value points into the tree. */
+#define WT_CURSTD_META_INUSE 0x00100
+#define WT_CURSTD_OPEN 0x00200
+#define WT_CURSTD_OVERWRITE 0x00400
+#define WT_CURSTD_RAW 0x00800
+#define WT_CURSTD_VALUE_EXT 0x01000 /* Value points out of the tree. */
+#define WT_CURSTD_VALUE_INT 0x02000 /* Value points into the tree. */
#define WT_CURSTD_VALUE_SET (WT_CURSTD_VALUE_EXT | WT_CURSTD_VALUE_INT)
uint32_t flags;
#endif
@@ -1236,6 +1237,9 @@ struct __wt_session {
* @configstart{WT_SESSION.drop, see dist/api_data.py}
* @config{force, return success if the object does not exist., a
* boolean flag; default \c false.}
+ * @config{lock_wait, wait for locks\, if \c lock_wait=false\, fail if
+ * any required locks are not available immediately., a boolean flag;
+ * default \c true.}
* @config{remove_files, should the underlying files be removed?., a
* boolean flag; default \c true.}
* @configend
@@ -1329,6 +1333,19 @@ struct __wt_session {
int __F(log_printf)(WT_SESSION *session, const char *fmt, ...);
/*!
+ * Rebalance a table, see @ref rebalance.
+ *
+ * @snippet ex_all.c Rebalance a table
+ *
+ * @param session the session handle
+ * @param uri the current URI of the object, such as \c "table:mytable"
+ * @configempty{WT_SESSION.rebalance, see dist/api_data.py}
+ * @ebusy_errors
+ */
+ int __F(rebalance)(
+ WT_SESSION *session, const char *uri, const char *config);
+
+ /*!
* Rename an object.
*
* @snippet ex_all.c Rename a table
@@ -1920,9 +1937,10 @@ struct __wt_connection {
* "block"\, \c "checkpoint"\, \c "compact"\, \c "evict"\, \c
* "evictserver"\, \c "fileops"\, \c "log"\, \c "lsm"\, \c
* "lsm_manager"\, \c "metadata"\, \c "mutex"\, \c "overflow"\, \c
- * "read"\, \c "reconcile"\, \c "recovery"\, \c "salvage"\, \c
- * "shared_cache"\, \c "split"\, \c "temporary"\, \c "transaction"\, \c
- * "verify"\, \c "version"\, \c "write"; default empty.}
+ * "read"\, \c "rebalance"\, \c "reconcile"\, \c "recovery"\, \c
+ * "salvage"\, \c "shared_cache"\, \c "split"\, \c "temporary"\, \c
+ * "transaction"\, \c "verify"\, \c "version"\, \c "write"; default
+ * empty.}
* @configend
* @errors
*/
@@ -2405,9 +2423,9 @@ struct __wt_connection {
* values chosen from the following options: \c "api"\, \c "block"\, \c
* "checkpoint"\, \c "compact"\, \c "evict"\, \c "evictserver"\, \c "fileops"\,
* \c "log"\, \c "lsm"\, \c "lsm_manager"\, \c "metadata"\, \c "mutex"\, \c
- * "overflow"\, \c "read"\, \c "reconcile"\, \c "recovery"\, \c "salvage"\, \c
- * "shared_cache"\, \c "split"\, \c "temporary"\, \c "transaction"\, \c
- * "verify"\, \c "version"\, \c "write"; default empty.}
+ * "overflow"\, \c "read"\, \c "rebalance"\, \c "reconcile"\, \c "recovery"\, \c
+ * "salvage"\, \c "shared_cache"\, \c "split"\, \c "temporary"\, \c
+ * "transaction"\, \c "verify"\, \c "version"\, \c "write"; default empty.}
* @config{write_through, Use \c FILE_FLAG_WRITE_THROUGH on Windows to write to
* files. Ignored on non-Windows systems. Options are given as a list\, such
* as <code>"write_through=[data]"</code>. Configuring \c write_through requires
diff --git a/src/include/wiredtiger_ext.h b/src/include/wiredtiger_ext.h
index 28fd8e18329..0db876b56f3 100644
--- a/src/include/wiredtiger_ext.h
+++ b/src/include/wiredtiger_ext.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/include/wt_internal.h b/src/include/wt_internal.h
index 0a1e143ce70..54b5dfd19f4 100644
--- a/src/include/wt_internal.h
+++ b/src/include/wt_internal.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/log/log.c b/src/log/log.c
index 118e081c3ec..3bf04d025d8 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -47,7 +47,7 @@ __wt_log_flush_lsn(WT_SESSION_IMPL *session, WT_LSN *lsn, bool start)
conn = S2C(session);
log = conn->log;
WT_RET(__wt_log_force_write(session, 1));
- WT_RET(__wt_log_wrlsn(session));
+ WT_RET(__wt_log_wrlsn(session, NULL));
if (start)
*lsn = log->write_start_lsn;
else
@@ -669,8 +669,7 @@ __log_openfile(WT_SESSION_IMPL *session,
* check that the magic number and versions are correct.
*/
if (!ok_create) {
- __wt_scr_free(session, &buf);
- WT_ERR(__wt_scr_alloc(session, allocsize, &buf));
+ WT_ERR(__wt_buf_grow(session, buf, allocsize));
memset(buf->mem, 0, allocsize);
WT_ERR(__wt_read(session, *fh, 0, allocsize, buf->mem));
logrec = (WT_LOG_RECORD *)buf->mem;
@@ -771,7 +770,7 @@ __log_newfile(WT_SESSION_IMPL *session, bool conn_open, bool *created)
WT_ASSERT(session, F_ISSET(session, WT_SESSION_LOCKED_SLOT));
while (log->log_close_fh != NULL) {
WT_STAT_FAST_CONN_INCR(session, log_close_yields);
- WT_RET(__wt_log_wrlsn(session));
+ WT_RET(__wt_log_wrlsn(session, NULL));
if (++yield_cnt > 10000)
return (EBUSY);
__wt_yield();
@@ -791,9 +790,10 @@ __log_newfile(WT_SESSION_IMPL *session, bool conn_open, bool *created)
WT_FULL_BARRIER();
/*
* If we're pre-allocating log files, look for one. If there aren't any
- * or we're not pre-allocating, then create one.
+ * or we're not pre-allocating, or a backup cursor is open, then
+ * create one.
*/
- if (conn->log_prealloc > 0) {
+ if (conn->log_prealloc > 0 && !conn->hot_backup) {
ret = __log_alloc_prealloc(session, log->fileid);
/*
* If ret is 0 it means we found a pre-allocated file.
@@ -1120,7 +1120,7 @@ __wt_log_open(WT_SESSION_IMPL *session)
* Start logging at the beginning of the next log file, no matter
* where the previous log file ends.
*/
- WT_WITH_SLOT_LOCK(session, log,
+ WT_WITH_SLOT_LOCK(session, log, ret,
ret = __log_newfile(session, true, NULL));
WT_ERR(ret);
@@ -1970,6 +1970,14 @@ err:
myslot.slot != NULL)
ret = myslot.slot->slot_error;
+ /*
+ * If one of the sync flags is set, assert the proper LSN has moved to
+ * match.
+ */
+ WT_ASSERT(session, !LF_ISSET(WT_LOG_FLUSH) ||
+ __wt_log_cmp(&log->write_lsn, &lsn) >= 0);
+ WT_ASSERT(session,
+ !LF_ISSET(WT_LOG_FSYNC) || __wt_log_cmp(&log->sync_lsn, &lsn) >= 0);
return (ret);
}
diff --git a/src/log/log_auto.c b/src/log/log_auto.c
index 5a1d03b1976..54df01d01ab 100644
--- a/src/log/log_auto.c
+++ b/src/log/log_auto.c
@@ -69,7 +69,7 @@ __logrec_json_unpack_str(char *dest, size_t destlen, const char *src,
}
static int
-__logrec_jsonify_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
+__logrec_make_json_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
{
size_t needed;
@@ -79,6 +79,17 @@ __logrec_jsonify_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
return (0);
}
+static int
+__logrec_make_hex_str(WT_SESSION_IMPL *session, char **destp, WT_ITEM *item)
+{
+ size_t needed;
+
+ needed = item->size * 2 + 1;
+ WT_RET(__wt_realloc(session, NULL, needed, destp));
+ __wt_fill_hex(item->data, item->size, (uint8_t *)*destp, needed, NULL);
+ return (0);
+}
+
int
__wt_logop_col_put_pack(
WT_SESSION_IMPL *session, WT_ITEM *logrec,
@@ -121,7 +132,8 @@ __wt_logop_col_put_unpack(
int
__wt_logop_col_put_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
WT_DECL_RET;
uint32_t fileid;
@@ -138,9 +150,14 @@ __wt_logop_col_put_print(
" \"fileid\": \"%" PRIu32 "\",\n", fileid));
WT_ERR(__wt_fprintf(out,
" \"recno\": \"%" PRIu64 "\",\n", recno));
- WT_ERR(__logrec_jsonify_str(session, &escaped, &value));
+ WT_ERR(__logrec_make_json_str(session, &escaped, &value));
WT_ERR(__wt_fprintf(out,
" \"value\": \"%s\"", escaped));
+ if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {
+ WT_ERR(__logrec_make_hex_str(session, &escaped, &value));
+ WT_ERR(__wt_fprintf(out,
+ ",\n \"value-hex\": \"%s\"", escaped));
+ }
err: __wt_free(session, escaped);
return (ret);
@@ -188,11 +205,13 @@ __wt_logop_col_remove_unpack(
int
__wt_logop_col_remove_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
uint32_t fileid;
uint64_t recno;
+ WT_UNUSED(flags);
WT_RET(__wt_logop_col_remove_unpack(
session, pp, end, &fileid, &recno));
@@ -246,12 +265,14 @@ __wt_logop_col_truncate_unpack(
int
__wt_logop_col_truncate_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
uint32_t fileid;
uint64_t start;
uint64_t stop;
+ WT_UNUSED(flags);
WT_RET(__wt_logop_col_truncate_unpack(
session, pp, end, &fileid, &start, &stop));
@@ -307,7 +328,8 @@ __wt_logop_row_put_unpack(
int
__wt_logop_row_put_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
WT_DECL_RET;
uint32_t fileid;
@@ -322,12 +344,22 @@ __wt_logop_row_put_print(
WT_RET(__wt_fprintf(out, " \"optype\": \"row_put\",\n"));
WT_ERR(__wt_fprintf(out,
" \"fileid\": \"%" PRIu32 "\",\n", fileid));
- WT_ERR(__logrec_jsonify_str(session, &escaped, &key));
+ WT_ERR(__logrec_make_json_str(session, &escaped, &key));
WT_ERR(__wt_fprintf(out,
" \"key\": \"%s\",\n", escaped));
- WT_ERR(__logrec_jsonify_str(session, &escaped, &value));
+ if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {
+ WT_ERR(__logrec_make_hex_str(session, &escaped, &key));
+ WT_ERR(__wt_fprintf(out,
+ " \"key-hex\": \"%s\",\n", escaped));
+ }
+ WT_ERR(__logrec_make_json_str(session, &escaped, &value));
WT_ERR(__wt_fprintf(out,
" \"value\": \"%s\"", escaped));
+ if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {
+ WT_ERR(__logrec_make_hex_str(session, &escaped, &value));
+ WT_ERR(__wt_fprintf(out,
+ ",\n \"value-hex\": \"%s\"", escaped));
+ }
err: __wt_free(session, escaped);
return (ret);
@@ -375,7 +407,8 @@ __wt_logop_row_remove_unpack(
int
__wt_logop_row_remove_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
WT_DECL_RET;
uint32_t fileid;
@@ -389,9 +422,14 @@ __wt_logop_row_remove_print(
WT_RET(__wt_fprintf(out, " \"optype\": \"row_remove\",\n"));
WT_ERR(__wt_fprintf(out,
" \"fileid\": \"%" PRIu32 "\",\n", fileid));
- WT_ERR(__logrec_jsonify_str(session, &escaped, &key));
+ WT_ERR(__logrec_make_json_str(session, &escaped, &key));
WT_ERR(__wt_fprintf(out,
" \"key\": \"%s\"", escaped));
+ if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {
+ WT_ERR(__logrec_make_hex_str(session, &escaped, &key));
+ WT_ERR(__wt_fprintf(out,
+ ",\n \"key-hex\": \"%s\"", escaped));
+ }
err: __wt_free(session, escaped);
return (ret);
@@ -439,7 +477,8 @@ __wt_logop_row_truncate_unpack(
int
__wt_logop_row_truncate_print(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
WT_DECL_RET;
uint32_t fileid;
@@ -455,12 +494,22 @@ __wt_logop_row_truncate_print(
WT_RET(__wt_fprintf(out, " \"optype\": \"row_truncate\",\n"));
WT_ERR(__wt_fprintf(out,
" \"fileid\": \"%" PRIu32 "\",\n", fileid));
- WT_ERR(__logrec_jsonify_str(session, &escaped, &start));
+ WT_ERR(__logrec_make_json_str(session, &escaped, &start));
WT_ERR(__wt_fprintf(out,
" \"start\": \"%s\",\n", escaped));
- WT_ERR(__logrec_jsonify_str(session, &escaped, &stop));
+ if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {
+ WT_ERR(__logrec_make_hex_str(session, &escaped, &start));
+ WT_ERR(__wt_fprintf(out,
+ " \"start-hex\": \"%s\",\n", escaped));
+ }
+ WT_ERR(__logrec_make_json_str(session, &escaped, &stop));
WT_ERR(__wt_fprintf(out,
" \"stop\": \"%s\",\n", escaped));
+ if (LF_ISSET(WT_TXN_PRINTLOG_HEX)) {
+ WT_ERR(__logrec_make_hex_str(session, &escaped, &stop));
+ WT_ERR(__wt_fprintf(out,
+ " \"stop-hex\": \"%s\",\n", escaped));
+ }
WT_ERR(__wt_fprintf(out,
" \"mode\": \"%" PRIu32 "\"", mode));
@@ -470,7 +519,8 @@ err: __wt_free(session, escaped);
int
__wt_txn_op_printlog(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end,
+ FILE *out, uint32_t flags)
{
uint32_t optype, opsize;
@@ -480,27 +530,33 @@ __wt_txn_op_printlog(
switch (optype) {
case WT_LOGOP_COL_PUT:
- WT_RET(__wt_logop_col_put_print(session, pp, end, out));
+ WT_RET(__wt_logop_col_put_print(session, pp, end, out,
+ flags));
break;
case WT_LOGOP_COL_REMOVE:
- WT_RET(__wt_logop_col_remove_print(session, pp, end, out));
+ WT_RET(__wt_logop_col_remove_print(session, pp, end, out,
+ flags));
break;
case WT_LOGOP_COL_TRUNCATE:
- WT_RET(__wt_logop_col_truncate_print(session, pp, end, out));
+ WT_RET(__wt_logop_col_truncate_print(session, pp, end, out,
+ flags));
break;
case WT_LOGOP_ROW_PUT:
- WT_RET(__wt_logop_row_put_print(session, pp, end, out));
+ WT_RET(__wt_logop_row_put_print(session, pp, end, out,
+ flags));
break;
case WT_LOGOP_ROW_REMOVE:
- WT_RET(__wt_logop_row_remove_print(session, pp, end, out));
+ WT_RET(__wt_logop_row_remove_print(session, pp, end, out,
+ flags));
break;
case WT_LOGOP_ROW_TRUNCATE:
- WT_RET(__wt_logop_row_truncate_print(session, pp, end, out));
+ WT_RET(__wt_logop_row_truncate_print(session, pp, end, out,
+ flags));
break;
WT_ILLEGAL_VALUE(session);
diff --git a/src/log/log_slot.c b/src/log/log_slot.c
index 8155397d823..760e8888de6 100644
--- a/src/log/log_slot.c
+++ b/src/log/log_slot.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -187,7 +187,7 @@ __wt_log_slot_switch(
* because we are responsible for setting up the new slot.
*/
do {
- WT_WITH_SLOT_LOCK(session, log,
+ WT_WITH_SLOT_LOCK(session, log, ret,
ret = __log_slot_switch_internal(session, myslot, forced));
if (ret == EBUSY) {
WT_STAT_FAST_CONN_INCR(session, log_slot_switch_busy);
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c
index 953698476ef..1bb9a7238fe 100644
--- a/src/lsm/lsm_cursor.c
+++ b/src/lsm/lsm_cursor.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -254,7 +254,7 @@ __clsm_enter(WT_CURSOR_LSM *clsm, bool reset, bool update)
(!update && F_ISSET(clsm, WT_CLSM_OPEN_READ))))
break;
-open: WT_WITH_SCHEMA_LOCK(session,
+open: WT_WITH_SCHEMA_LOCK(session, ret,
ret = __clsm_open_cursors(clsm, update, 0, 0));
WT_RET(ret);
}
@@ -710,7 +710,7 @@ __wt_clsm_init_merge(
F_SET(clsm, WT_CLSM_MINOR_MERGE);
clsm->nchunks = nchunks;
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __clsm_open_cursors(clsm, false, start_chunk, start_id));
return (ret);
}
@@ -1543,7 +1543,7 @@ __wt_clsm_open(WT_SESSION_IMPL *session,
bulk = cval.val != 0;
/* Get the LSM tree. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, uri, bulk, &lsm_tree));
/*
* Check whether the exclusive open for a bulk load succeeded, and
diff --git a/src/lsm/lsm_cursor_bulk.c b/src/lsm/lsm_cursor_bulk.c
index 65e8fe1e9a7..607ca0c9705 100644
--- a/src/lsm/lsm_cursor_bulk.c
+++ b/src/lsm/lsm_cursor_bulk.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -114,7 +114,7 @@ __wt_clsm_open_bulk(WT_CURSOR_LSM *clsm, const char *cfg[])
* switch inline, since switch needs a schema lock and online index
* creation opens a bulk cursor while holding the schema lock.
*/
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_lsm_tree_switch(session, lsm_tree));
WT_RET(ret);
diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c
index d8cf36f2cc1..dac8d987328 100644
--- a/src/lsm/lsm_manager.c
+++ b/src/lsm/lsm_manager.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c
index 1a2608803e4..29325066da7 100644
--- a/src/lsm/lsm_merge.c
+++ b/src/lsm/lsm_merge.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -437,7 +437,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id)
F_SET(src, WT_CURSTD_RAW);
WT_ERR(__wt_clsm_init_merge(src, start_chunk, start_id, nchunks));
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_lsm_tree_setup_chunk(session, lsm_tree, chunk));
WT_ERR(ret);
if (create_bloom) {
@@ -607,12 +607,13 @@ err: if (locked)
if (ret != 0 && created_chunk) {
/* Drop the newly-created files on error. */
if (chunk->uri != NULL) {
- WT_WITH_SCHEMA_LOCK(session, tret =
- __wt_schema_drop(session, chunk->uri, drop_cfg));
+ WT_WITH_SCHEMA_LOCK(session, tret,
+ tret = __wt_schema_drop(
+ session, chunk->uri, drop_cfg));
WT_TRET(tret);
}
if (create_bloom && chunk->bloom_uri != NULL) {
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, tret,
tret = __wt_schema_drop(
session, chunk->bloom_uri, drop_cfg));
WT_TRET(tret);
diff --git a/src/lsm/lsm_meta.c b/src/lsm/lsm_meta.c
index 64ca283e2c8..d76b2a48aa7 100644
--- a/src/lsm/lsm_meta.c
+++ b/src/lsm/lsm_meta.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c
index c1eb7a2a389..c147cf5774a 100644
--- a/src/lsm/lsm_stat.c
+++ b/src/lsm/lsm_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -33,7 +33,7 @@ __curstat_lsm_init(
"checkpoint=" WT_CHECKPOINT, NULL, NULL };
locked = false;
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, uri, false, &lsm_tree));
WT_RET(ret);
WT_ERR(__wt_scr_alloc(session, 0, &uribuf));
@@ -91,7 +91,7 @@ __curstat_lsm_init(
* top-level.
*/
new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor);
- new->lsm_generation_max = chunk->generation;
+ WT_STAT_WRITE(new, lsm_generation_max, chunk->generation);
/* Aggregate statistics from each new chunk. */
__wt_stat_dsrc_aggregate_single(new, stats);
@@ -115,37 +115,40 @@ __curstat_lsm_init(
* into the top-level.
*/
new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor);
- new->bloom_size =
- (int64_t)((chunk->count * lsm_tree->bloom_bit_count) / 8);
- new->bloom_page_evict =
- new->cache_eviction_clean + new->cache_eviction_dirty;
- new->bloom_page_read = new->cache_read;
+ WT_STAT_WRITE(new, bloom_size,
+ (int64_t)((chunk->count * lsm_tree->bloom_bit_count) / 8));
+ WT_STAT_WRITE(new, bloom_page_evict,
+ new->cache_eviction_clean + new->cache_eviction_dirty);
+ WT_STAT_WRITE(new, bloom_page_read, new->cache_read);
__wt_stat_dsrc_aggregate_single(new, stats);
WT_ERR(stat_cursor->close(stat_cursor));
}
/* Set statistics that aren't aggregated directly into the cursor */
- stats->bloom_count = bloom_count;
- stats->lsm_chunk_count = lsm_tree->nchunks;
+ WT_STAT_WRITE(stats, bloom_count, bloom_count);
+ WT_STAT_WRITE(stats, lsm_chunk_count, lsm_tree->nchunks);
/* Include, and optionally clear, LSM-level specific information. */
- stats->bloom_miss = lsm_tree->bloom_miss;
+ WT_STAT_WRITE(stats, bloom_miss, lsm_tree->bloom_miss);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->bloom_miss = 0;
- stats->bloom_hit = lsm_tree->bloom_hit;
+ WT_STAT_WRITE(stats, bloom_hit, lsm_tree->bloom_hit);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->bloom_hit = 0;
- stats->bloom_false_positive = lsm_tree->bloom_false_positive;
+ WT_STAT_WRITE(
+ stats, bloom_false_positive, lsm_tree->bloom_false_positive);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->bloom_false_positive = 0;
- stats->lsm_lookup_no_bloom = lsm_tree->lsm_lookup_no_bloom;
+ WT_STAT_WRITE(
+ stats, lsm_lookup_no_bloom, lsm_tree->lsm_lookup_no_bloom);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->lsm_lookup_no_bloom = 0;
- stats->lsm_checkpoint_throttle = lsm_tree->lsm_checkpoint_throttle;
+ WT_STAT_WRITE(
+ stats, lsm_checkpoint_throttle, lsm_tree->lsm_checkpoint_throttle);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->lsm_checkpoint_throttle = 0;
- stats->lsm_merge_throttle = lsm_tree->lsm_merge_throttle;
+ WT_STAT_WRITE(stats, lsm_merge_throttle, lsm_tree->lsm_merge_throttle);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->lsm_merge_throttle = 0;
@@ -173,7 +176,7 @@ __wt_curstat_lsm_init(
* Grab the schema lock because we will be locking the LSM tree and we
* may need to open some files.
*/
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __curstat_lsm_init(session, uri, cst));
return (ret);
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index 5d819607413..ff6e66fd1a1 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -243,7 +243,7 @@ __lsm_tree_cleanup_old(WT_SESSION_IMPL *session, const char *uri)
WT_RET(__wt_exist(session, uri + strlen("file:"), &exists));
if (exists)
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_drop(session, uri, cfg));
return (ret);
}
@@ -315,7 +315,7 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
char *tmpconfig;
/* If the tree is open, it already exists. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, uri, false, &lsm_tree));
if (ret == 0) {
__wt_lsm_tree_release(session, lsm_tree);
@@ -447,7 +447,7 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
* tracking macros handle cleaning up on failure.
*/
if (ret == 0)
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __lsm_tree_open(session, uri, true, &lsm_tree));
if (ret == 0)
__wt_lsm_tree_release(session, lsm_tree);
@@ -954,13 +954,14 @@ __wt_lsm_tree_drop(
WT_DECL_RET;
WT_LSM_CHUNK *chunk;
WT_LSM_TREE *lsm_tree;
+ int tret;
u_int i;
bool locked;
locked = false;
/* Get the LSM tree. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, name, true, &lsm_tree));
WT_RET(ret);
@@ -996,8 +997,9 @@ __wt_lsm_tree_drop(
err: if (locked)
WT_TRET(__wt_lsm_tree_writeunlock(session, lsm_tree));
- WT_WITH_HANDLE_LIST_LOCK(session,
- WT_TRET(__lsm_tree_discard(session, lsm_tree, false)));
+ WT_WITH_HANDLE_LIST_LOCK(session, tret,
+ tret = __lsm_tree_discard(session, lsm_tree, false));
+ WT_TRET(tret);
return (ret);
}
@@ -1013,6 +1015,7 @@ __wt_lsm_tree_rename(WT_SESSION_IMPL *session,
WT_LSM_CHUNK *chunk;
WT_LSM_TREE *lsm_tree;
const char *old;
+ int tret;
u_int i;
bool locked;
@@ -1020,7 +1023,7 @@ __wt_lsm_tree_rename(WT_SESSION_IMPL *session,
locked = false;
/* Get the LSM tree. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, olduri, true, &lsm_tree));
WT_RET(ret);
@@ -1070,8 +1073,9 @@ err: if (locked)
* Discard this LSM tree structure. The first operation on the renamed
* tree will create a new one.
*/
- WT_WITH_HANDLE_LIST_LOCK(session,
- WT_TRET(__lsm_tree_discard(session, lsm_tree, false)));
+ WT_WITH_HANDLE_LIST_LOCK(session, tret,
+ tret = __lsm_tree_discard(session, lsm_tree, false));
+ WT_TRET(tret);
return (ret);
}
@@ -1086,6 +1090,7 @@ __wt_lsm_tree_truncate(
WT_DECL_RET;
WT_LSM_CHUNK *chunk;
WT_LSM_TREE *lsm_tree;
+ int tret;
bool locked;
WT_UNUSED(cfg);
@@ -1093,7 +1098,7 @@ __wt_lsm_tree_truncate(
locked = false;
/* Get the LSM tree. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, name, true, &lsm_tree));
WT_RET(ret);
@@ -1132,8 +1137,9 @@ err: if (locked)
* the last good version of the metadata will be used, resulting
* in a valid (not truncated) tree.
*/
- WT_WITH_HANDLE_LIST_LOCK(session,
- WT_TRET(__lsm_tree_discard(session, lsm_tree, false)));
+ WT_WITH_HANDLE_LIST_LOCK(session, tret,
+ tret = __lsm_tree_discard(session, lsm_tree, false));
+ WT_TRET(tret);
}
return (ret);
}
@@ -1231,7 +1237,7 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, bool *skipp)
/* Tell __wt_schema_worker not to look inside the LSM tree. */
*skipp = true;
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, name, false, &lsm_tree));
WT_RET(ret);
@@ -1429,7 +1435,7 @@ __wt_lsm_tree_worker(WT_SESSION_IMPL *session,
locked = false;
exclusive = FLD_ISSET(open_flags, WT_DHANDLE_EXCLUSIVE);
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_lsm_tree_get(session, uri, exclusive, &lsm_tree));
WT_RET(ret);
diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c
index 4741cf52608..4faa25967ad 100644
--- a/src/lsm/lsm_work_unit.c
+++ b/src/lsm/lsm_work_unit.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -168,7 +168,7 @@ __wt_lsm_work_switch(
*entryp = NULL;
if (F_ISSET(entry->lsm_tree, WT_LSM_TREE_NEED_SWITCH)) {
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_lsm_tree_switch(session, entry->lsm_tree));
/* Failing to complete the switch is fine */
if (ret == EBUSY) {
@@ -272,7 +272,7 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
if (F_ISSET(chunk, WT_LSM_CHUNK_ONDISK) &&
!F_ISSET(chunk, WT_LSM_CHUNK_STABLE) &&
!chunk->evicted) {
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __lsm_discard_handle(session, chunk->uri, NULL));
if (ret == 0)
chunk->evicted = 1;
@@ -336,7 +336,8 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
* necessary handle locks.
*/
WT_ERR(__wt_meta_track_on(session));
- WT_WITH_SCHEMA_LOCK(session, ret = __wt_schema_worker(
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __wt_schema_worker(
session, chunk->uri, __wt_checkpoint, NULL, NULL, 0));
WT_TRET(__wt_meta_track_off(session, false, ret != 0));
if (ret != 0)
@@ -505,7 +506,7 @@ __lsm_drop_file(WT_SESSION_IMPL *session, const char *uri)
*
* This will fail with EBUSY if the file is still in use.
*/
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __lsm_discard_handle(session, uri, WT_CHECKPOINT));
WT_RET(ret);
@@ -514,7 +515,7 @@ __lsm_drop_file(WT_SESSION_IMPL *session, const char *uri)
* results in the hot backup lock being taken when it updates the
* metadata (which would be too late to prevent our drop).
*/
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_drop(session, uri, drop_cfg));
if (ret == 0)
diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c
index 625783ac16c..7562cb1cae3 100644
--- a/src/lsm/lsm_worker.c
+++ b/src/lsm/lsm_worker.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_apply.c b/src/meta/meta_apply.c
index 95c5b9807ca..92766213b33 100644
--- a/src/meta/meta_apply.c
+++ b/src/meta/meta_apply.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -9,27 +9,23 @@
#include "wt_internal.h"
/*
- * __wt_meta_btree_apply --
+ * __meta_btree_apply --
* Apply a function to all files listed in the metadata, apart from the
* metadata file.
*/
-int
-__wt_meta_btree_apply(WT_SESSION_IMPL *session,
+static inline int
+__meta_btree_apply(WT_SESSION_IMPL *session, WT_CURSOR *cursor,
int (*func)(WT_SESSION_IMPL *, const char *[]), const char *cfg[])
{
- WT_CURSOR *cursor;
- WT_DATA_HANDLE *saved_dhandle;
WT_DECL_RET;
const char *uri;
- int cmp, tret;
+ int cmp;
- saved_dhandle = session->dhandle;
- WT_RET(__wt_metadata_cursor(session, NULL, &cursor));
cursor->set_key(cursor, "file:");
- if ((tret = cursor->search_near(cursor, &cmp)) == 0 && cmp < 0)
- tret = cursor->next(cursor);
- for (; tret == 0; tret = cursor->next(cursor)) {
- WT_ERR(cursor->get_key(cursor, &uri));
+ if ((ret = cursor->search_near(cursor, &cmp)) == 0 && cmp < 0)
+ ret = cursor->next(cursor);
+ for (; ret == 0; ret = cursor->next(cursor)) {
+ WT_RET(cursor->get_key(cursor, &uri));
if (!WT_PREFIX_MATCH(uri, "file:"))
break;
if (strcmp(uri, WT_METAFILE_URI) == 0)
@@ -43,8 +39,7 @@ __wt_meta_btree_apply(WT_SESSION_IMPL *session,
*/
ret = __wt_session_get_btree(session, uri, NULL, NULL, 0);
if (ret == 0) {
- WT_SAVE_DHANDLE(session,
- ret = func(session, cfg));
+ WT_SAVE_DHANDLE(session, ret = func(session, cfg));
if (WT_META_TRACKING(session))
WT_TRET(__wt_meta_track_handle_lock(
session, false));
@@ -53,12 +48,29 @@ __wt_meta_btree_apply(WT_SESSION_IMPL *session,
} else if (ret == EBUSY)
ret = __wt_conn_btree_apply_single(
session, uri, NULL, func, cfg);
- WT_ERR(ret);
+ WT_RET(ret);
}
+ WT_RET_NOTFOUND_OK(ret);
+
+ return (0);
+}
+
+/*
+ * __wt_meta_btree_apply --
+ * Apply a function to all files listed in the metadata, apart from the
+ * metadata file.
+ */
+int
+__wt_meta_btree_apply(WT_SESSION_IMPL *session,
+ int (*func)(WT_SESSION_IMPL *, const char *[]), const char *cfg[])
+{
+ WT_CURSOR *cursor;
+ WT_DECL_RET;
+
+ WT_RET(__wt_metadata_cursor(session, &cursor));
+ WT_SAVE_DHANDLE(session,
+ ret = __meta_btree_apply(session, cursor, func, cfg));
+ WT_TRET(__wt_metadata_cursor_release(session, &cursor));
- if (tret != WT_NOTFOUND)
- WT_TRET(tret);
-err: WT_TRET(cursor->close(cursor));
- session->dhandle = saved_dhandle;
return (ret);
}
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index 70c9bf8dfcd..f7da8525639 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_ext.c b/src/meta/meta_ext.c
index 423b7d2e76b..b48f7205807 100644
--- a/src/meta/meta_ext.c
+++ b/src/meta/meta_ext.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/meta/meta_table.c b/src/meta/meta_table.c
index e7074a9c1b5..9938cb07a5c 100644
--- a/src/meta/meta_table.c
+++ b/src/meta/meta_table.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -31,21 +31,28 @@ __metadata_turtle(const char *key)
}
/*
- * __wt_metadata_open --
- * Opens the metadata file, sets session->meta_dhandle.
+ * __wt_metadata_cursor_open --
+ * Opens a cursor on the metadata.
*/
int
-__wt_metadata_open(WT_SESSION_IMPL *session)
+__wt_metadata_cursor_open(
+ WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp)
{
WT_BTREE *btree;
+ WT_DECL_RET;
+ const char *open_cursor_cfg[] = {
+ WT_CONFIG_BASE(session, WT_SESSION_open_cursor), config, NULL };
- if (session->meta_dhandle != NULL)
- return (0);
-
- WT_RET(__wt_session_get_btree(session, WT_METAFILE_URI, NULL, NULL, 0));
+ WT_WITHOUT_DHANDLE(session, ret = __wt_open_cursor(
+ session, WT_METAFILE_URI, NULL, open_cursor_cfg, cursorp));
+ WT_RET(ret);
- session->meta_dhandle = session->dhandle;
- WT_ASSERT(session, session->meta_dhandle != NULL);
+ /*
+ * Retrieve the btree from the cursor, rather than the session because
+ * we don't always switch the metadata handle in to the session before
+ * entering this function.
+ */
+ btree = ((WT_CURSOR_BTREE *)(*cursorp))->btree;
/*
* Set special flags for the metadata file: eviction (the metadata file
@@ -56,7 +63,6 @@ __wt_metadata_open(WT_SESSION_IMPL *session)
* opens (the first update is safe because it's single-threaded from
* wiredtiger_open).
*/
- btree = S2BT(session);
if (!F_ISSET(btree, WT_BTREE_IN_MEMORY))
F_SET(btree, WT_BTREE_IN_MEMORY);
if (!F_ISSET(btree, WT_BTREE_NO_EVICTION))
@@ -64,44 +70,81 @@ __wt_metadata_open(WT_SESSION_IMPL *session)
if (F_ISSET(btree, WT_BTREE_NO_LOGGING))
F_CLR(btree, WT_BTREE_NO_LOGGING);
- /* The metadata handle doesn't need to stay locked -- release it. */
- return (__wt_session_release_btree(session));
+ return (0);
}
/*
* __wt_metadata_cursor --
- * Opens a cursor on the metadata.
+ * Returns the session's cached metadata cursor, unless it's in use, in
+ * which case it opens and returns another metadata cursor.
*/
int
-__wt_metadata_cursor(
- WT_SESSION_IMPL *session, const char *config, WT_CURSOR **cursorp)
+__wt_metadata_cursor(WT_SESSION_IMPL *session, WT_CURSOR **cursorp)
{
- WT_DATA_HANDLE *saved_dhandle;
- WT_DECL_RET;
- bool is_dead;
- const char *cfg[] =
- { WT_CONFIG_BASE(session, WT_SESSION_open_cursor), config, NULL };
+ WT_CURSOR *cursor;
- saved_dhandle = session->dhandle;
- WT_ERR(__wt_metadata_open(session));
+ /*
+ * If we don't have a cached metadata cursor, or it's already in use,
+ * we'll need to open a new one.
+ */
+ cursor = NULL;
+ if (session->meta_cursor == NULL ||
+ F_ISSET(session->meta_cursor, WT_CURSTD_META_INUSE)) {
+ WT_RET(__wt_metadata_cursor_open(session, NULL, &cursor));
+ if (session->meta_cursor == NULL) {
+ session->meta_cursor = cursor;
+ cursor = NULL;
+ }
+ }
- session->dhandle = session->meta_dhandle;
+ /*
+ * If there's no cursor return, we're done, our caller should have just
+ * been triggering the creation of the session's cached cursor. There
+ * should not be an open local cursor in that case, but caution doesn't
+ * cost anything.
+ */
+ if (cursorp == NULL)
+ return (cursor == NULL ? 0 : cursor->close(cursor));
- /*
- * We use the metadata a lot, so we have a handle cached; lock it and
- * increment the in-use counter once the cursor is open.
+ /*
+ * If the cached cursor is in use, return the newly opened cursor, else
+ * mark the cached cursor in use and return it.
*/
- WT_ERR(__wt_session_lock_dhandle(session, 0, &is_dead));
+ if (F_ISSET(session->meta_cursor, WT_CURSTD_META_INUSE))
+ *cursorp = cursor;
+ else {
+ *cursorp = session->meta_cursor;
+ F_SET(session->meta_cursor, WT_CURSTD_META_INUSE);
+ }
+ return (0);
+}
- /* The metadata should never be closed. */
- WT_ASSERT(session, !is_dead);
+/*
+ * __wt_metadata_cursor_release --
+ * Release a metadata cursor.
+ */
+int
+__wt_metadata_cursor_release(WT_SESSION_IMPL *session, WT_CURSOR **cursorp)
+{
+ WT_CURSOR *cursor;
- WT_ERR(__wt_curfile_create(session, NULL, cfg, false, false, cursorp));
- __wt_cursor_dhandle_incr_use(session);
+ WT_UNUSED(session);
- /* Restore the caller's btree. */
-err: session->dhandle = saved_dhandle;
- return (ret);
+ if ((cursor = *cursorp) == NULL)
+ return (0);
+ *cursorp = NULL;
+
+ /*
+ * If using the session's cached metadata cursor, clear the in-use flag
+ * and reset it, otherwise, discard the cursor.
+ */
+ if (F_ISSET(cursor, WT_CURSTD_META_INUSE)) {
+ WT_ASSERT(session, cursor == session->meta_cursor);
+
+ F_CLR(cursor, WT_CURSTD_META_INUSE);
+ return (cursor->reset(cursor));
+ }
+ return (cursor->close(cursor));
}
/*
@@ -124,14 +167,13 @@ __wt_metadata_insert(
WT_RET_MSG(session, EINVAL,
"%s: insert not supported on the turtle file", key);
- WT_RET(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_RET(__wt_metadata_cursor(session, &cursor));
cursor->set_key(cursor, key);
cursor->set_value(cursor, value);
WT_ERR(cursor->insert(cursor));
if (WT_META_TRACKING(session))
WT_ERR(__wt_meta_track_insert(session, key));
-
-err: WT_TRET(cursor->close(cursor));
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
@@ -152,7 +194,7 @@ __wt_metadata_update(
__metadata_turtle(key) ? "" : "not "));
if (__metadata_turtle(key)) {
- WT_WITH_TURTLE_LOCK(session,
+ WT_WITH_TURTLE_LOCK(session, ret,
ret = __wt_turtle_update(session, key, value));
return (ret);
}
@@ -160,12 +202,14 @@ __wt_metadata_update(
if (WT_META_TRACKING(session))
WT_RET(__wt_meta_track_update(session, key));
- WT_RET(__wt_metadata_cursor(session, "overwrite", &cursor));
+ WT_RET(__wt_metadata_cursor(session, &cursor));
+ /* This cursor needs to have overwrite semantics. */
+ WT_ASSERT(session, F_ISSET(cursor, WT_CURSTD_OVERWRITE));
+
cursor->set_key(cursor, key);
cursor->set_value(cursor, value);
WT_ERR(cursor->insert(cursor));
-
-err: WT_TRET(cursor->close(cursor));
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
@@ -188,14 +232,13 @@ __wt_metadata_remove(WT_SESSION_IMPL *session, const char *key)
WT_RET_MSG(session, EINVAL,
"%s: remove not supported on the turtle file", key);
- WT_RET(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_RET(__wt_metadata_cursor(session, &cursor));
cursor->set_key(cursor, key);
WT_ERR(cursor->search(cursor));
if (WT_META_TRACKING(session))
WT_ERR(__wt_meta_track_update(session, key));
WT_ERR(cursor->remove(cursor));
-
-err: WT_TRET(cursor->close(cursor));
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
@@ -205,8 +248,7 @@ err: WT_TRET(cursor->close(cursor));
* The caller is responsible for freeing the allocated memory.
*/
int
-__wt_metadata_search(
- WT_SESSION_IMPL *session, const char *key, char **valuep)
+__wt_metadata_search(WT_SESSION_IMPL *session, const char *key, char **valuep)
{
WT_CURSOR *cursor;
WT_DECL_RET;
@@ -230,7 +272,7 @@ __wt_metadata_search(
* Metadata updates use non-transactional techniques (such as the
* schema and metadata locks) to protect access to in-flight updates.
*/
- WT_RET(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_RET(__wt_metadata_cursor(session, &cursor));
cursor->set_key(cursor, key);
WT_WITH_TXN_ISOLATION(session, WT_ISO_READ_UNCOMMITTED,
ret = cursor->search(cursor));
@@ -238,7 +280,6 @@ __wt_metadata_search(
WT_ERR(cursor->get_value(cursor, &value));
WT_ERR(__wt_strdup(session, value, valuep));
-
-err: WT_TRET(cursor->close(cursor));
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
diff --git a/src/meta/meta_track.c b/src/meta/meta_track.c
index ea1757129c5..1baab2deae1 100644
--- a/src/meta/meta_track.c
+++ b/src/meta/meta_track.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -141,7 +141,7 @@ __meta_track_apply(WT_SESSION_IMPL *session, WT_META_TRACK *trk)
ret = bm->checkpoint_resolve(bm, session));
break;
case WT_ST_DROP_COMMIT:
- if ((ret = __wt_remove_if_exists(session, trk->a)) != 0)
+ if ((ret = __wt_block_manager_drop(session, trk->a)) != 0)
__wt_err(session, ret,
"metadata remove dropped file %s", trk->a);
break;
@@ -189,7 +189,7 @@ __meta_track_unroll(WT_SESSION_IMPL *session, WT_META_TRACK *trk)
* For removes, b is NULL.
*/
if (trk->a != NULL && trk->b != NULL &&
- (ret = __wt_rename(session,
+ (ret = __wt_rename_and_sync_directory(session,
trk->b + strlen("file:"), trk->a + strlen("file:"))) != 0)
__wt_err(session, ret,
"metadata unroll rename %s to %s", trk->b, trk->a);
@@ -262,16 +262,17 @@ __wt_meta_track_off(WT_SESSION_IMPL *session, bool need_sync, bool unroll)
}
/*
- * If we don't have the metadata handle (e.g, we're in the process of
+ * If we don't have the metadata cursor (e.g, we're in the process of
* creating the metadata), we can't sync it.
*/
- if (!need_sync || session->meta_dhandle == NULL ||
+ if (!need_sync || session->meta_cursor == NULL ||
F_ISSET(S2C(session), WT_CONN_IN_MEMORY))
goto done;
/* If we're logging, make sure the metadata update was flushed. */
if (FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_ENABLED)) {
- WT_WITH_DHANDLE(session, session->meta_dhandle,
+ WT_WITH_DHANDLE(session,
+ WT_SESSION_META_DHANDLE(session),
ret = __wt_txn_checkpoint_log(
session, false, WT_TXN_LOG_CKPT_SYNC, NULL));
WT_RET(ret);
@@ -284,12 +285,14 @@ __wt_meta_track_off(WT_SESSION_IMPL *session, bool need_sync, bool unroll)
*/
ckpt_session->txn.id = session->txn.id;
F_SET(ckpt_session, WT_SESSION_LOCKED_SCHEMA);
- WT_WITH_DHANDLE(ckpt_session, session->meta_dhandle, ret =
- __wt_checkpoint(ckpt_session, NULL));
+ WT_WITH_DHANDLE(ckpt_session,
+ WT_SESSION_META_DHANDLE(session),
+ ret = __wt_checkpoint(ckpt_session, NULL));
F_CLR(ckpt_session, WT_SESSION_LOCKED_SCHEMA);
ckpt_session->txn.id = WT_TXN_NONE;
WT_RET(ret);
- WT_WITH_DHANDLE(session, session->meta_dhandle,
+ WT_WITH_DHANDLE(session,
+ WT_SESSION_META_DHANDLE(session),
ret = __wt_checkpoint_sync(session, NULL));
WT_RET(ret);
}
diff --git a/src/meta/meta_turtle.c b/src/meta/meta_turtle.c
index 13e8b31916f..7182bb0fe5f 100644
--- a/src/meta/meta_turtle.c
+++ b/src/meta/meta_turtle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -55,7 +55,7 @@ __metadata_init(WT_SESSION_IMPL *session)
* We're single-threaded, but acquire the schema lock regardless: the
* lower level code checks that it is appropriately synchronized.
*/
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_create(session, WT_METAFILE_URI, NULL));
return (ret);
@@ -120,7 +120,7 @@ __metadata_load_bulk(WT_SESSION_IMPL *session)
* If a file was being bulk-loaded during the hot backup, it will appear
* in the metadata file, but the file won't exist. Create on demand.
*/
- WT_ERR(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_RET(__wt_metadata_cursor(session, &cursor));
while ((ret = cursor->next(cursor)) == 0) {
WT_ERR(cursor->get_key(cursor, &key));
if (!WT_PREFIX_SKIP(key, "file:"))
@@ -141,9 +141,7 @@ __metadata_load_bulk(WT_SESSION_IMPL *session)
}
WT_ERR_NOTFOUND_OK(ret);
-err: if (cursor != NULL)
- WT_TRET(cursor->close(cursor));
-
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
@@ -202,7 +200,8 @@ __wt_turtle_init(WT_SESSION_IMPL *session)
/* Create the turtle file. */
WT_RET(__metadata_config(session, &metaconf));
- WT_WITH_TURTLE_LOCK(session, ret = __wt_turtle_update(
+ WT_WITH_TURTLE_LOCK(session, ret,
+ ret = __wt_turtle_update(
session, WT_METAFILE_URI, metaconf));
WT_ERR(ret);
}
@@ -271,8 +270,7 @@ err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_READ));
* Update the turtle file.
*/
int
-__wt_turtle_update(
- WT_SESSION_IMPL *session, const char *key, const char *value)
+__wt_turtle_update(WT_SESSION_IMPL *session, const char *key, const char *value)
{
WT_FH *fh;
WT_DECL_ITEM(buf);
@@ -299,7 +297,7 @@ __wt_turtle_update(
WT_ERR(__wt_write(session, fh, 0, buf->size, buf->data));
/* Flush the handle and rename the file into place. */
- ret = __wt_sync_and_rename_fh(
+ ret = __wt_fh_sync_and_rename(
session, &fh, WT_METADATA_TURTLE_SET, WT_METADATA_TURTLE);
/* Close any file handle left open, remove any temporary file. */
diff --git a/src/os_posix/os_abort.c b/src/os_posix/os_abort.c
index 5bb6aeb6e16..034eedcfbf8 100644
--- a/src/os_posix/os_abort.c
+++ b/src/os_posix/os_abort.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_alloc.c b/src/os_posix/os_alloc.c
index eb2482723ec..3876f9a1afe 100644
--- a/src/os_posix/os_alloc.c
+++ b/src/os_posix/os_alloc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_dir.c b/src/os_posix/os_dir.c
index 9eba641ca51..83e77aa5312 100644
--- a/src/os_posix/os_dir.c
+++ b/src/os_posix/os_dir.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_dlopen.c b/src/os_posix/os_dlopen.c
index 2b5fa249163..9a74eb4813d 100644
--- a/src/os_posix/os_dlopen.c
+++ b/src/os_posix/os_dlopen.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_errno.c b/src/os_posix/os_errno.c
index 229b68e0008..a58ae88447e 100644
--- a/src/os_posix/os_errno.c
+++ b/src/os_posix/os_errno.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_exist.c b/src/os_posix/os_exist.c
index 644a27dca9a..87f0e219d2e 100644
--- a/src/os_posix/os_exist.c
+++ b/src/os_posix/os_exist.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_fallocate.c b/src/os_posix/os_fallocate.c
index 6280e334afb..9d160afd179 100644
--- a/src/os_posix/os_fallocate.c
+++ b/src/os_posix/os_fallocate.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_filesize.c b/src/os_posix/os_filesize.c
index c58f73b0665..72242e351bf 100644
--- a/src/os_posix/os_filesize.c
+++ b/src/os_posix/os_filesize.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_flock.c b/src/os_posix/os_flock.c
index 07393481e7d..e2056f7636c 100644
--- a/src/os_posix/os_flock.c
+++ b/src/os_posix/os_flock.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_fsync.c b/src/os_posix/os_fsync.c
index b0c04e98258..f5afddc557b 100644
--- a/src/os_posix/os_fsync.c
+++ b/src/os_posix/os_fsync.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -75,12 +75,13 @@ __wt_directory_sync_fh(WT_SESSION_IMPL *session, WT_FH *fh)
* Flush a directory to ensure a file creation is durable.
*/
int
-__wt_directory_sync(WT_SESSION_IMPL *session, char *path)
+__wt_directory_sync(WT_SESSION_IMPL *session, const char *path)
{
#ifdef __linux__
WT_DECL_RET;
int fd, tret;
- char *dir;
+ const char *dir;
+ char *copy;
/*
* POSIX 1003.1 does not require that fsync of a file handle ensures the
@@ -88,15 +89,22 @@ __wt_directory_sync(WT_SESSION_IMPL *session, char *path)
* there are historic Linux filesystems requiring this), do an explicit
* fsync on a file descriptor for the directory to be sure.
*/
- if (path == NULL || (dir = strrchr(path, '/')) == NULL) {
- dir = NULL;
- path = (char *)S2C(session)->home;
- } else
- *dir = '\0';
+ copy = NULL;
+ if (path == NULL || (dir = strrchr(path, '/')) == NULL)
+ path = S2C(session)->home;
+ else {
+ /*
+ * Copy the directory name, leaving the trailing slash in place,
+ * so a path of "/foo" doesn't result in an empty string.
+ */
+ WT_RET(__wt_strndup(
+ session, path, (size_t)(dir - path) + 1, &copy));
+ path = copy;
+ }
+
WT_SYSCALL_RETRY(((fd =
open(path, O_RDONLY, 0444)) == -1 ? 1 : 0), ret);
- if (dir != NULL)
- *dir = '/';
+ __wt_free(session, copy);
if (ret != 0)
WT_RET_MSG(session, ret, "%s: open", path);
diff --git a/src/os_posix/os_ftruncate.c b/src/os_posix/os_ftruncate.c
index 696d8da54f4..2af90512f26 100644
--- a/src/os_posix/os_ftruncate.c
+++ b/src/os_posix/os_ftruncate.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_getenv.c b/src/os_posix/os_getenv.c
index e1e0051a120..7a086145cee 100644
--- a/src/os_posix/os_getenv.c
+++ b/src/os_posix/os_getenv.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_getline.c b/src/os_posix/os_getline.c
index 7c4ee8d1746..c0ca96852de 100644
--- a/src/os_posix/os_getline.c
+++ b/src/os_posix/os_getline.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_getopt.c b/src/os_posix/os_getopt.c
index 486d85286bc..0306ad1d79d 100644
--- a/src/os_posix/os_getopt.c
+++ b/src/os_posix/os_getopt.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/os_posix/os_map.c b/src/os_posix/os_map.c
index e95ccb0ade2..42aeeac4a5e 100644
--- a/src/os_posix/os_map.c
+++ b/src/os_posix/os_map.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -48,8 +48,6 @@ __wt_mmap(WT_SESSION_IMPL *session,
return (0);
}
-#define WT_VM_PAGESIZE 4096
-
/*
* __wt_mmap_preload --
* Cause a section of a memory map to be faulted in.
@@ -59,9 +57,10 @@ __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size)
{
#ifdef HAVE_POSIX_MADVISE
/* Linux requires the address be aligned to a 4KB boundary. */
+ WT_CONNECTION_IMPL *conn = S2C(session);
WT_BM *bm = S2BT(session)->bm;
WT_DECL_RET;
- void *blk = (void *)((uintptr_t)p & ~(uintptr_t)(WT_VM_PAGESIZE - 1));
+ void *blk = (void *)((uintptr_t)p & ~(uintptr_t)(conn->page_size - 1));
size += WT_PTRDIFF(p, blk);
/* XXX proxy for "am I doing a scan?" -- manual read-ahead */
@@ -78,9 +77,9 @@ __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size)
* Manual pages aren't clear on whether alignment is required for the
* size, so we will be conservative.
*/
- size &= ~(size_t)(WT_VM_PAGESIZE - 1);
+ size &= ~(size_t)(conn->page_size - 1);
- if (size > WT_VM_PAGESIZE &&
+ if (size > (size_t)conn->page_size &&
(ret = posix_madvise(blk, size, POSIX_MADV_WILLNEED)) != 0)
WT_RET_MSG(session, ret, "posix_madvise will need");
#else
@@ -101,8 +100,9 @@ __wt_mmap_discard(WT_SESSION_IMPL *session, void *p, size_t size)
{
#ifdef HAVE_POSIX_MADVISE
/* Linux requires the address be aligned to a 4KB boundary. */
+ WT_CONNECTION_IMPL *conn = S2C(session);
WT_DECL_RET;
- void *blk = (void *)((uintptr_t)p & ~(uintptr_t)(WT_VM_PAGESIZE - 1));
+ void *blk = (void *)((uintptr_t)p & ~(uintptr_t)(conn->page_size - 1));
size += WT_PTRDIFF(p, blk);
if ((ret = posix_madvise(blk, size, POSIX_MADV_DONTNEED)) != 0)
diff --git a/src/os_posix/os_mtx_cond.c b/src/os_posix/os_mtx_cond.c
index d5fc86b648b..5f4e9a7cf2b 100644
--- a/src/os_posix/os_mtx_cond.c
+++ b/src/os_posix/os_mtx_cond.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_mtx_rw.c b/src/os_posix/os_mtx_rw.c
index 46f134feabb..b6876cdfbdc 100644
--- a/src/os_posix/os_mtx_rw.c
+++ b/src/os_posix/os_mtx_rw.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/os_posix/os_once.c b/src/os_posix/os_once.c
index bfe0b9819ac..8d900042330 100644
--- a/src/os_posix/os_once.c
+++ b/src/os_posix/os_once.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_open.c b/src/os_posix/os_open.c
index a87272db391..b085676c53b 100644
--- a/src/os_posix/os_open.c
+++ b/src/os_posix/os_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_pagesize.c b/src/os_posix/os_pagesize.c
new file mode 100644
index 00000000000..4a7e7084cc6
--- /dev/null
+++ b/src/os_posix/os_pagesize.c
@@ -0,0 +1,19 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+#include "wt_internal.h"
+
+/*
+ * __wt_get_vm_pagesize --
+ * Return the default page size of a virtual memory page.
+ */
+int
+__wt_get_vm_pagesize(void)
+{
+ return (getpagesize());
+}
diff --git a/src/os_posix/os_path.c b/src/os_posix/os_path.c
index af28e1b3b56..6dc54675eb8 100644
--- a/src/os_posix/os_path.c
+++ b/src/os_posix/os_path.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_priv.c b/src/os_posix/os_priv.c
index a8479668d67..5ffbbf7a1f2 100644
--- a/src/os_posix/os_priv.c
+++ b/src/os_posix/os_priv.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_remove.c b/src/os_posix/os_remove.c
index 96bbba9bab2..bc244c12e46 100644
--- a/src/os_posix/os_remove.c
+++ b/src/os_posix/os_remove.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_rename.c b/src/os_posix/os_rename.c
index 811604e7f0f..301190305c4 100644
--- a/src/os_posix/os_rename.c
+++ b/src/os_posix/os_rename.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_rw.c b/src/os_posix/os_rw.c
index 24d6d1aa879..8733bfe0f53 100644
--- a/src/os_posix/os_rw.c
+++ b/src/os_posix/os_rw.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_sleep.c b/src/os_posix/os_sleep.c
index 4e90edabc53..8633b8d1ec0 100644
--- a/src/os_posix/os_sleep.c
+++ b/src/os_posix/os_sleep.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_stdio.c b/src/os_posix/os_stdio.c
index da880f5521e..7ab107eda1e 100644
--- a/src/os_posix/os_stdio.c
+++ b/src/os_posix/os_stdio.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_strtouq.c b/src/os_posix/os_strtouq.c
index 0b7a540959c..0ae604fc761 100644
--- a/src/os_posix/os_strtouq.c
+++ b/src/os_posix/os_strtouq.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_thread.c b/src/os_posix/os_thread.c
index c7222aac6c4..35a23622ddc 100644
--- a/src/os_posix/os_thread.c
+++ b/src/os_posix/os_thread.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_time.c b/src/os_posix/os_time.c
index c3052df62e7..0e5a1cdadfb 100644
--- a/src/os_posix/os_time.c
+++ b/src/os_posix/os_time.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_posix/os_yield.c b/src/os_posix/os_yield.c
index 297ec7deaee..052a46940b7 100644
--- a/src/os_posix/os_yield.c
+++ b/src/os_posix/os_yield.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_dir.c b/src/os_win/os_dir.c
index aff916c25f5..00ec4f252e4 100644
--- a/src/os_win/os_dir.c
+++ b/src/os_win/os_dir.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_dlopen.c b/src/os_win/os_dlopen.c
index 1c57d5f8073..0bad39d681d 100644
--- a/src/os_win/os_dlopen.c
+++ b/src/os_win/os_dlopen.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_errno.c b/src/os_win/os_errno.c
index a9d3d521052..6a9daf8443f 100644
--- a/src/os_win/os_errno.c
+++ b/src/os_win/os_errno.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_exist.c b/src/os_win/os_exist.c
index 4a727801569..ec1369cc727 100644
--- a/src/os_win/os_exist.c
+++ b/src/os_win/os_exist.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_fallocate.c b/src/os_win/os_fallocate.c
index 030c2e4c6c7..cdc7a1c46ee 100644
--- a/src/os_win/os_fallocate.c
+++ b/src/os_win/os_fallocate.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_filesize.c b/src/os_win/os_filesize.c
index 7f231b5ba9a..c9925fb18a8 100644
--- a/src/os_win/os_filesize.c
+++ b/src/os_win/os_filesize.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_flock.c b/src/os_win/os_flock.c
index 947d7bdcde7..60a981499a5 100644
--- a/src/os_win/os_flock.c
+++ b/src/os_win/os_flock.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_fsync.c b/src/os_win/os_fsync.c
index 7a01b5cd61d..913b7ca5a4e 100644
--- a/src/os_win/os_fsync.c
+++ b/src/os_win/os_fsync.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -25,7 +25,7 @@ __wt_directory_sync_fh(WT_SESSION_IMPL *session, WT_FH *fh)
* Flush a directory to ensure a file creation is durable.
*/
int
-__wt_directory_sync(WT_SESSION_IMPL *session, char *path)
+__wt_directory_sync(WT_SESSION_IMPL *session, const char *path)
{
WT_UNUSED(session);
WT_UNUSED(path);
diff --git a/src/os_win/os_ftruncate.c b/src/os_win/os_ftruncate.c
index cc635306a71..0c11b5509b7 100644
--- a/src/os_win/os_ftruncate.c
+++ b/src/os_win/os_ftruncate.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_getenv.c b/src/os_win/os_getenv.c
index 9b3a20abad7..c9084769cd5 100644
--- a/src/os_win/os_getenv.c
+++ b/src/os_win/os_getenv.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_map.c b/src/os_win/os_map.c
index 3c4edb59ea8..dc040b4fa54 100644
--- a/src/os_win/os_map.c
+++ b/src/os_win/os_map.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_mtx_cond.c b/src/os_win/os_mtx_cond.c
index b909afa9ba6..14bac2a99d9 100644
--- a/src/os_win/os_mtx_cond.c
+++ b/src/os_win/os_mtx_cond.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_once.c b/src/os_win/os_once.c
index bb5e059452e..9ea3fe044eb 100644
--- a/src/os_win/os_once.c
+++ b/src/os_win/os_once.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_open.c b/src/os_win/os_open.c
index c3106763452..3ec53daf001 100644
--- a/src/os_win/os_open.c
+++ b/src/os_win/os_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_pagesize.c b/src/os_win/os_pagesize.c
new file mode 100644
index 00000000000..648105c0e7c
--- /dev/null
+++ b/src/os_win/os_pagesize.c
@@ -0,0 +1,23 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+#include "wt_internal.h"
+
+/*
+ * __wt_get_vm_pagesize --
+ * Return the default page size of a virtual memory page.
+ */
+int
+__wt_get_vm_pagesize(void)
+{
+ SYSTEM_INFO system_info;
+
+ GetSystemInfo(&system_info);
+
+ return (system_info.dwPageSize);
+}
diff --git a/src/os_win/os_path.c b/src/os_win/os_path.c
index 9d001e50571..e9532de2b38 100644
--- a/src/os_win/os_path.c
+++ b/src/os_win/os_path.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_priv.c b/src/os_win/os_priv.c
index 5c32d6b5999..8c1f3893920 100644
--- a/src/os_win/os_priv.c
+++ b/src/os_win/os_priv.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_remove.c b/src/os_win/os_remove.c
index 55b50030064..5682a25d7f2 100644
--- a/src/os_win/os_remove.c
+++ b/src/os_win/os_remove.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_rename.c b/src/os_win/os_rename.c
index a0f33843218..829ab1d16e9 100644
--- a/src/os_win/os_rename.c
+++ b/src/os_win/os_rename.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_rw.c b/src/os_win/os_rw.c
index bafefcfba24..49f011001a4 100644
--- a/src/os_win/os_rw.c
+++ b/src/os_win/os_rw.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_sleep.c b/src/os_win/os_sleep.c
index 33e04c1d8a9..1d4b316488a 100644
--- a/src/os_win/os_sleep.c
+++ b/src/os_win/os_sleep.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_snprintf.c b/src/os_win/os_snprintf.c
index ebb14fd32e8..a6056ff9342 100644
--- a/src/os_win/os_snprintf.c
+++ b/src/os_win/os_snprintf.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_thread.c b/src/os_win/os_thread.c
index b5f13aea4e9..3be0ccb9393 100644
--- a/src/os_win/os_thread.c
+++ b/src/os_win/os_thread.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_time.c b/src/os_win/os_time.c
index 2292c317a64..e784b5d8a36 100644
--- a/src/os_win/os_time.c
+++ b/src/os_win/os_time.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_vsnprintf.c b/src/os_win/os_vsnprintf.c
index 205b63751c7..63f96e79d5b 100644
--- a/src/os_win/os_vsnprintf.c
+++ b/src/os_win/os_vsnprintf.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/os_win/os_yield.c b/src/os_win/os_yield.c
index dd3eb67de8b..aab1559e072 100644
--- a/src/os_win/os_yield.c
+++ b/src/os_win/os_yield.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/packing/pack_api.c b/src/packing/pack_api.c
index efe999505bf..4c65406cd64 100644
--- a/src/packing/pack_api.c
+++ b/src/packing/pack_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/packing/pack_impl.c b/src/packing/pack_impl.c
index 30d28dfb63c..0e3ed44ba6a 100644
--- a/src/packing/pack_impl.c
+++ b/src/packing/pack_impl.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -176,6 +176,8 @@ __wt_struct_repack(WT_SESSION_IMPL *session, const char *infmt,
/* Outfmt should complete before infmt */
while ((ret = __pack_next(&packout, &pvout)) == 0) {
+ if (p >= end)
+ WT_ERR(EINVAL);
WT_ERR(__pack_next(&packin, &pvin));
before = p;
WT_ERR(__unpack_read(session, &pvin, &p, (size_t)(end - p)));
diff --git a/src/packing/pack_stream.c b/src/packing/pack_stream.c
index 1f3449d79d3..98da5b405c3 100644
--- a/src/packing/pack_stream.c
+++ b/src/packing/pack_stream.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/reconcile/rec_track.c b/src/reconcile/rec_track.c
index 18ed5c6b551..4a3a8a7e988 100644
--- a/src/reconcile/rec_track.c
+++ b/src/reconcile/rec_track.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 21cc68ed119..332449027a9 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -630,12 +630,12 @@ __rec_root_write(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t flags)
*/
switch (page->type) {
case WT_PAGE_COL_INT:
- WT_RET(__wt_page_alloc(session,
- WT_PAGE_COL_INT, 1, mod->mod_multi_entries, false, &next));
+ WT_RET(__wt_page_alloc(session, WT_PAGE_COL_INT,
+ 1, mod->mod_multi_entries, false, &next));
break;
case WT_PAGE_ROW_INT:
- WT_RET(__wt_page_alloc(session,
- WT_PAGE_ROW_INT, 0, mod->mod_multi_entries, false, &next));
+ WT_RET(__wt_page_alloc(session, WT_PAGE_ROW_INT,
+ WT_RECNO_OOB, mod->mod_multi_entries, false, &next));
break;
WT_ILLEGAL_VALUE(session);
}
@@ -1276,6 +1276,8 @@ __rec_txn_read(WT_SESSION_IMPL *session, WT_RECONCILE *r,
for (upd = upd_list; upd->next != NULL; upd = upd->next)
;
upd->next = append;
+ __wt_cache_page_inmem_incr(
+ session, page, WT_UPDATE_MEMSIZE(append));
}
/*
@@ -1756,7 +1758,7 @@ __rec_key_state_update(WT_RECONCILE *r, bool ovfl_key)
* Figure out the maximum leaf page size for the reconciliation.
*/
static inline uint32_t
-__rec_leaf_page_max(WT_SESSION_IMPL *session, WT_RECONCILE *r)
+__rec_leaf_page_max(WT_SESSION_IMPL *session, WT_RECONCILE *r)
{
WT_BTREE *btree;
WT_PAGE *page;
@@ -3263,7 +3265,14 @@ supd_check_complete:
memset(WT_BLOCK_HEADER_REF(dsk), 0, btree->block_header);
bnd->cksum = __wt_cksum(buf->data, buf->size);
- if (mod->rec_result == WT_PM_REC_MULTIBLOCK &&
+ /*
+ * One last check: don't reuse blocks if compacting, the reason
+ * for compaction is to move blocks to different locations. We
+ * do this check after calculating the checksums, hopefully the
+ * next write can be skipped.
+ */
+ if (session->compact_state == WT_COMPACT_NONE &&
+ mod->rec_result == WT_PM_REC_MULTIBLOCK &&
mod->mod_multi_entries > bnd_slot) {
multi = &mod->mod_multi[bnd_slot];
if (multi->size == bnd->size &&
@@ -3502,7 +3511,7 @@ __wt_bulk_wrapup(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
break;
case BTREE_COL_VAR:
if (cbulk->rle != 0)
- WT_RET(__wt_bulk_insert_var(session, cbulk));
+ WT_RET(__wt_bulk_insert_var(session, cbulk, false));
break;
case BTREE_ROW:
break;
@@ -3625,43 +3634,20 @@ __rec_col_fix_bulk_insert_split_check(WT_CURSOR_BULK *cbulk)
* Fixed-length column-store bulk insert.
*/
int
-__wt_bulk_insert_fix(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
+__wt_bulk_insert_fix(
+ WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted)
{
WT_BTREE *btree;
WT_CURSOR *cursor;
WT_RECONCILE *r;
- uint32_t entries, offset, page_entries, page_size;
- const uint8_t *data;
r = cbulk->reconcile;
btree = S2BT(session);
cursor = &cbulk->cbt.iface;
- if (cbulk->bitmap) {
- if (((r->recno - 1) * btree->bitcnt) & 0x7)
- WT_RET_MSG(session, EINVAL,
- "Bulk bitmap load not aligned on a byte boundary");
- for (data = cursor->value.data,
- entries = (uint32_t)cursor->value.size;
- entries > 0;
- entries -= page_entries, data += page_size) {
- WT_RET(__rec_col_fix_bulk_insert_split_check(cbulk));
-
- page_entries =
- WT_MIN(entries, cbulk->nrecs - cbulk->entry);
- page_size = __bitstr_size(page_entries * btree->bitcnt);
- offset = __bitstr_size(cbulk->entry * btree->bitcnt);
- memcpy(r->first_free + offset, data, page_size);
- cbulk->entry += page_entries;
- r->recno += page_entries;
- }
- return (0);
- }
-
WT_RET(__rec_col_fix_bulk_insert_split_check(cbulk));
-
- __bit_setv(r->first_free,
- cbulk->entry, btree->bitcnt, ((uint8_t *)cursor->value.data)[0]);
+ __bit_setv(r->first_free, cbulk->entry,
+ btree->bitcnt, deleted ? 0 : ((uint8_t *)cursor->value.data)[0]);
++cbulk->entry;
++r->recno;
@@ -3669,11 +3655,48 @@ __wt_bulk_insert_fix(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
}
/*
+ * __wt_bulk_insert_fix_bitmap --
+ * Fixed-length column-store bulk insert.
+ */
+int
+__wt_bulk_insert_fix_bitmap(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
+{
+ WT_BTREE *btree;
+ WT_CURSOR *cursor;
+ WT_RECONCILE *r;
+ uint32_t entries, offset, page_entries, page_size;
+ const uint8_t *data;
+
+ r = cbulk->reconcile;
+ btree = S2BT(session);
+ cursor = &cbulk->cbt.iface;
+
+ if (((r->recno - 1) * btree->bitcnt) & 0x7)
+ WT_RET_MSG(session, EINVAL,
+ "Bulk bitmap load not aligned on a byte boundary");
+ for (data = cursor->value.data,
+ entries = (uint32_t)cursor->value.size;
+ entries > 0;
+ entries -= page_entries, data += page_size) {
+ WT_RET(__rec_col_fix_bulk_insert_split_check(cbulk));
+
+ page_entries = WT_MIN(entries, cbulk->nrecs - cbulk->entry);
+ page_size = __bitstr_size(page_entries * btree->bitcnt);
+ offset = __bitstr_size(cbulk->entry * btree->bitcnt);
+ memcpy(r->first_free + offset, data, page_size);
+ cbulk->entry += page_entries;
+ r->recno += page_entries;
+ }
+ return (0);
+}
+
+/*
* __wt_bulk_insert_var --
* Variable-length column-store bulk insert.
*/
int
-__wt_bulk_insert_var(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
+__wt_bulk_insert_var(
+ WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk, bool deleted)
{
WT_BTREE *btree;
WT_KV *val;
@@ -3682,14 +3705,20 @@ __wt_bulk_insert_var(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
r = cbulk->reconcile;
btree = S2BT(session);
- /*
- * Store the bulk cursor's last buffer, not the current value, we're
- * creating a duplicate count, which means we want the previous value
- * seen, not the current value.
- */
val = &r->v;
- WT_RET(__rec_cell_build_val(
- session, r, cbulk->last.data, cbulk->last.size, cbulk->rle));
+ if (deleted) {
+ val->cell_len = __wt_cell_pack_del(&val->cell, cbulk->rle);
+ val->buf.data = NULL;
+ val->buf.size = 0;
+ val->len = val->cell_len;
+ } else
+ /*
+ * Store the bulk cursor's last buffer, not the current value,
+ * we're tracking duplicates, which means we want the previous
+ * value seen, not the current value.
+ */
+ WT_RET(__rec_cell_build_val(session,
+ r, cbulk->last.data, cbulk->last.size, cbulk->rle));
/* Boundary: split or write the page. */
if (val->len > r->space_avail)
@@ -3923,16 +3952,49 @@ __rec_col_fix(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
r->recno += entry;
/* Walk any append list. */
- WT_SKIP_FOREACH(ins, WT_COL_APPEND(page)) {
- WT_RET(__rec_txn_read(session, r, ins, NULL, NULL, &upd));
- if (upd == NULL)
- continue;
+ for (ins =
+ WT_SKIP_FIRST(WT_COL_APPEND(page));; ins = WT_SKIP_NEXT(ins)) {
+ if (ins == NULL) {
+ /*
+ * If the page split, instantiate any missing records in
+ * the page's name space. (Imagine record 98 is
+ * transactionally visible, 99 wasn't created or is not
+ * yet visible, 100 is visible. Then the page splits and
+ * record 100 moves to another page. When we reconcile
+ * the original page, we write record 98, then we don't
+ * see record 99 for whatever reason. If we've moved
+ * record 1000, we don't know to write a deleted record
+ * 99 on the page.)
+ *
+ * The record number recorded during the split is the
+ * first key on the split page, that is, one larger than
+ * the last key on this page, we have to decrement it.
+ */
+ if ((recno =
+ page->modify->mod_split_recno) == WT_RECNO_OOB)
+ break;
+ recno -= 1;
+
+ /*
+ * The following loop assumes records to write, and the
+ * previous key might have been visible.
+ */
+ if (r->recno > recno)
+ break;
+ upd = NULL;
+ } else {
+ WT_RET(
+ __rec_txn_read(session, r, ins, NULL, NULL, &upd));
+ if (upd == NULL)
+ continue;
+ recno = WT_INSERT_RECNO(ins);
+ }
for (;;) {
/*
* The application may have inserted records which left
* gaps in the name space.
*/
- for (recno = WT_INSERT_RECNO(ins);
+ for (;
nrecs > 0 && r->recno < recno;
--nrecs, ++entry, ++r->recno)
__bit_setv(
@@ -3940,6 +4002,7 @@ __rec_col_fix(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
if (nrecs > 0) {
__bit_setv(r->first_free, entry, btree->bitcnt,
+ upd == NULL ? 0 :
((uint8_t *)WT_UPDATE_DATA(upd))[0]);
--nrecs;
++entry;
@@ -3961,6 +4024,13 @@ __rec_col_fix(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
entry = 0;
nrecs = WT_FIX_BYTES_TO_ENTRIES(btree, r->space_avail);
}
+
+ /*
+ * Execute this loop once without an insert item to catch any
+ * missing records due to a split, then quit.
+ */
+ if (ins == NULL)
+ break;
}
/* Update the counters. */
@@ -4441,11 +4511,36 @@ compare: /*
}
/* Walk any append list. */
- WT_SKIP_FOREACH(ins, WT_COL_APPEND(page)) {
- WT_ERR(__rec_txn_read(session, r, ins, NULL, NULL, &upd));
- if (upd == NULL)
- continue;
- for (n = WT_INSERT_RECNO(ins); src_recno <= n; ++src_recno) {
+ for (ins =
+ WT_SKIP_FIRST(WT_COL_APPEND(page));; ins = WT_SKIP_NEXT(ins)) {
+ if (ins == NULL) {
+ /*
+ * If the page split, instantiate any missing records in
+ * the page's name space. (Imagine record 98 is
+ * transactionally visible, 99 wasn't created or is not
+ * yet visible, 100 is visible. Then the page splits and
+ * record 100 moves to another page. When we reconcile
+ * the original page, we write record 98, then we don't
+ * see record 99 for whatever reason. If we've moved
+ * record 1000, we don't know to write a deleted record
+ * 99 on the page.)
+ *
+ * The record number recorded during the split is the
+ * first key on the split page, that is, one larger than
+ * the last key on this page, we have to decrement it.
+ */
+ if ((n = page->modify->mod_split_recno) == WT_RECNO_OOB)
+ break;
+ n -= 1;
+ upd = NULL;
+ } else {
+ WT_ERR(
+ __rec_txn_read(session, r, ins, NULL, NULL, &upd));
+ if (upd == NULL)
+ continue;
+ n = WT_INSERT_RECNO(ins);
+ }
+ while (src_recno <= n) {
/*
* The application may have inserted records which left
* gaps in the name space, and these gaps can be huge.
@@ -4468,7 +4563,8 @@ compare: /*
src_recno += skip;
}
} else {
- deleted = WT_UPDATE_DELETED_ISSET(upd);
+ deleted = upd == NULL ||
+ WT_UPDATE_DELETED_ISSET(upd);
if (!deleted) {
data = WT_UPDATE_DATA(upd);
size = upd->size;
@@ -4485,7 +4581,7 @@ compare: /*
last->size == size &&
memcmp(last->data, data, size) == 0)) {
++rle;
- continue;
+ goto next;
}
WT_ERR(__rec_col_var_helper(session, r,
salvage, last, last_deleted, 0, rle));
@@ -4504,7 +4600,23 @@ compare: /*
}
last_deleted = deleted;
rle = 1;
+
+ /*
+ * Move to the next record. It's not a simple increment
+ * because if it's the maximum record, incrementing it
+ * wraps to 0 and this turns into an infinite loop.
+ */
+next: if (src_recno == UINT64_MAX)
+ break;
+ ++src_recno;
}
+
+ /*
+ * Execute this loop once without an insert item to catch any
+ * missing records due to a split, then quit.
+ */
+ if (ins == NULL)
+ break;
}
/* If we were tracking a record, write it. */
@@ -5343,11 +5455,10 @@ __rec_split_dump_keys(WT_SESSION_IMPL *session, WT_PAGE *page, WT_RECONCILE *r)
switch (page->type) {
case WT_PAGE_ROW_INT:
case WT_PAGE_ROW_LEAF:
- WT_ERR(__wt_buf_set_printable(
- session, tkey, bnd->key.data, bnd->key.size));
WT_ERR(__wt_verbose(session, WT_VERB_SPLIT,
- "starting key %.*s",
- (int)tkey->size, (const char *)tkey->data));
+ "starting key %s",
+ __wt_buf_set_printable(
+ session, bnd->key.data, bnd->key.size, tkey)));
break;
case WT_PAGE_COL_FIX:
case WT_PAGE_COL_INT:
diff --git a/src/schema/schema_create.c b/src/schema/schema_create.c
index db4658cbd0e..8cdcbbcad54 100644
--- a/src/schema/schema_create.c
+++ b/src/schema/schema_create.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -74,11 +74,11 @@ __create_file(WT_SESSION_IMPL *session,
{
WT_DECL_ITEM(val);
WT_DECL_RET;
- uint32_t allocsize;
- bool is_metadata;
const char *filename, **p, *filecfg[] =
{ WT_CONFIG_BASE(session, file_meta), config, NULL, NULL };
char *fileconf;
+ uint32_t allocsize;
+ bool is_metadata;
fileconf = NULL;
@@ -97,7 +97,7 @@ __create_file(WT_SESSION_IMPL *session,
}
/* Sanity check the allocation size. */
- WT_RET(__wt_direct_io_size_check(
+ WT_ERR(__wt_direct_io_size_check(
session, filecfg, "allocation_size", &allocsize));
/* Create the file. */
@@ -197,13 +197,15 @@ __create_colgroup(WT_SESSION_IMPL *session,
{ WT_CONFIG_BASE(session, colgroup_meta), config, NULL, NULL };
const char *sourcecfg[] = { config, NULL, NULL };
const char *cgname, *source, *sourceconf, *tablename;
- char *cgconf, *oldconf;
+ char *cgconf, *origconf;
+ bool exists;
sourceconf = NULL;
- cgconf = oldconf = NULL;
+ cgconf = origconf = NULL;
WT_CLEAR(fmt);
WT_CLEAR(confbuf);
WT_CLEAR(namebuf);
+ exists = false;
tablename = name;
if (!WT_PREFIX_SKIP(tablename, "colgroup:"))
@@ -228,6 +230,14 @@ __create_colgroup(WT_SESSION_IMPL *session,
"Column group '%s' not found in table '%.*s'",
cgname, (int)tlen, tablename);
+ /* Check if the column group already exists. */
+ if ((ret = __wt_metadata_search(session, name, &origconf)) == 0) {
+ if (exclusive)
+ WT_ERR(EEXIST);
+ exists = true;
+ }
+ WT_ERR_NOTFOUND_OK(ret);
+
/* Find the first NULL entry in the cfg stack. */
for (cfgp = &cfg[1]; *cfgp; cfgp++)
;
@@ -262,25 +272,22 @@ __create_colgroup(WT_SESSION_IMPL *session,
}
sourcecfg[1] = fmt.data;
WT_ERR(__wt_config_merge(session, sourcecfg, NULL, &sourceconf));
-
WT_ERR(__wt_schema_create(session, source, sourceconf));
WT_ERR(__wt_config_collapse(session, cfg, &cgconf));
- if ((ret = __wt_metadata_insert(session, name, cgconf)) != 0) {
- /*
- * If the entry already exists in the metadata, we're done.
- * This is an error for exclusive creates but okay otherwise.
- */
- if (ret == WT_DUPLICATE_KEY)
- ret = exclusive ? EEXIST : 0;
+ if (exists) {
+ if (strcmp(cgconf, origconf) != 0)
+ WT_ERR_MSG(session, EINVAL,
+ "%s: does not match existing configuration", name);
goto err;
}
+ WT_ERR(__wt_metadata_insert(session, name, cgconf));
WT_ERR(__wt_schema_open_colgroups(session, table));
err: __wt_free(session, cgconf);
__wt_free(session, sourceconf);
- __wt_free(session, oldconf);
+ __wt_free(session, origconf);
__wt_buf_free(session, &confbuf);
__wt_buf_free(session, &fmt);
__wt_buf_free(session, &namebuf);
@@ -382,18 +389,18 @@ __create_index(WT_SESSION_IMPL *session,
{ WT_CONFIG_BASE(session, index_meta), NULL, NULL, NULL };
const char *sourcecfg[] = { config, NULL, NULL };
const char *source, *sourceconf, *idxname, *tablename;
- char *idxconf;
+ char *idxconf, *origconf;
size_t tlen;
- bool have_extractor;
+ bool exists, have_extractor;
u_int i, npublic_cols;
sourceconf = NULL;
- idxconf = NULL;
+ idxconf = origconf = NULL;
WT_CLEAR(confbuf);
WT_CLEAR(fmt);
WT_CLEAR(extra_cols);
WT_CLEAR(namebuf);
- have_extractor = false;
+ exists = have_extractor = false;
tablename = name;
if (!WT_PREFIX_SKIP(tablename, "index:"))
@@ -411,9 +418,17 @@ __create_index(WT_SESSION_IMPL *session,
(int)tlen, tablename);
if (table->is_simple)
- WT_RET_MSG(session, EINVAL,
+ WT_ERR_MSG(session, EINVAL,
"%s requires a table with named columns", name);
+ /* Check if the index already exists. */
+ if ((ret = __wt_metadata_search(session, name, &origconf)) == 0) {
+ if (exclusive)
+ WT_ERR(EEXIST);
+ exists = true;
+ }
+ WT_ERR_NOTFOUND_OK(ret);
+
if (__wt_config_getones(session, config, "source", &cval) == 0) {
WT_ERR(__wt_buf_fmt(session, &namebuf,
"%.*s", (int)cval.len, cval.str));
@@ -488,8 +503,7 @@ __create_index(WT_SESSION_IMPL *session,
WT_ERR(__wt_buf_catfmt(
session, &extra_cols, "%.*s,", (int)ckey.len, ckey.str));
}
- if (ret != 0 && ret != WT_NOTFOUND)
- goto err;
+ WT_ERR_NOTFOUND_OK(ret);
/* Index values are empty: all columns are packed into the index key. */
WT_ERR(__wt_buf_fmt(session, &fmt, "value_format=,key_format="));
@@ -525,23 +539,22 @@ __create_index(WT_SESSION_IMPL *session,
cfg[1] = sourceconf;
cfg[2] = confbuf.data;
WT_ERR(__wt_config_collapse(session, cfg, &idxconf));
- if ((ret = __wt_metadata_insert(session, name, idxconf)) != 0) {
- /*
- * If the entry already exists in the metadata, we're done.
- * This is an error for exclusive creates but okay otherwise.
- */
- if (ret == WT_DUPLICATE_KEY)
- ret = exclusive ? EEXIST : 0;
+ if (exists) {
+ if (strcmp(idxconf, origconf) != 0)
+ WT_ERR_MSG(session, EINVAL,
+ "%s: does not match existing configuration", name);
goto err;
}
+ WT_ERR(__wt_metadata_insert(session, name, idxconf));
/* Make sure that the configuration is valid. */
WT_ERR(__wt_schema_open_index(
session, table, idxname, strlen(idxname), &idx));
-
- WT_ERR(__fill_index(session, table, idx));
+ if (!exists)
+ WT_ERR(__fill_index(session, table, idx));
err: __wt_free(session, idxconf);
+ __wt_free(session, origconf);
__wt_free(session, sourceconf);
__wt_buf_free(session, &confbuf);
__wt_buf_free(session, &extra_cols);
@@ -570,10 +583,12 @@ __create_table(WT_SESSION_IMPL *session,
char *tableconf, *cgname;
size_t cgsize;
int ncolgroups;
+ bool exists;
cgname = NULL;
table = NULL;
tableconf = NULL;
+ exists = false;
tablename = name;
if (!WT_PREFIX_SKIP(tablename, "table:"))
@@ -581,8 +596,9 @@ __create_table(WT_SESSION_IMPL *session,
if ((ret = __wt_schema_get_table(session,
tablename, strlen(tablename), false, &table)) == 0) {
- __wt_schema_release_table(session, table);
- return (exclusive ? EEXIST : 0);
+ if (exclusive)
+ WT_ERR(EEXIST);
+ exists = true;
}
WT_RET_NOTFOUND_OK(ret);
@@ -595,15 +611,13 @@ __create_table(WT_SESSION_IMPL *session,
WT_ERR_NOTFOUND_OK(ret);
WT_ERR(__wt_config_collapse(session, cfg, &tableconf));
- if ((ret = __wt_metadata_insert(session, name, tableconf)) != 0) {
- /*
- * If the entry already exists in the metadata, we're done.
- * This is an error for exclusive creates but okay otherwise.
- */
- if (ret == WT_DUPLICATE_KEY)
- ret = exclusive ? EEXIST : 0;
+ if (exists) {
+ if (strcmp(tableconf, table->config) != 0)
+ WT_ERR_MSG(session, EINVAL,
+ "%s: does not match existing configuration", name);
goto err;
}
+ WT_ERR(__wt_metadata_insert(session, name, tableconf));
/* Attempt to open the table now to catch any errors. */
WT_ERR(__wt_schema_get_table(
diff --git a/src/schema/schema_drop.c b/src/schema/schema_drop.c
index 9b9f3a23961..6ac76930c9a 100644
--- a/src/schema/schema_drop.c
+++ b/src/schema/schema_drop.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -29,7 +29,7 @@ __drop_file(
return (EINVAL);
/* Close all btree handles associated with this file. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_conn_dhandle_close_all(session, uri, force));
WT_RET(ret);
diff --git a/src/schema/schema_list.c b/src/schema/schema_list.c
index da5f033ad40..5e9caf94b7a 100644
--- a/src/schema/schema_list.c
+++ b/src/schema/schema_list.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -21,9 +21,9 @@ __schema_add_table(WT_SESSION_IMPL *session,
uint64_t bucket;
/* Make sure the metadata is open before getting other locks. */
- WT_RET(__wt_metadata_open(session));
+ WT_RET(__wt_metadata_cursor(session, NULL));
- WT_WITH_TABLE_LOCK(session,
+ WT_WITH_TABLE_LOCK(session, ret,
ret = __wt_schema_open_table(
session, name, namelen, ok_incomplete, &table));
WT_RET(ret);
diff --git a/src/schema/schema_open.c b/src/schema/schema_open.c
index ba8664f2e39..49318f80959 100644
--- a/src/schema/schema_open.c
+++ b/src/schema/schema_open.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -291,7 +291,7 @@ __schema_open_index(WT_SESSION_IMPL *session,
WT_ERR(__wt_buf_fmt(session, tmp, "index:%s:", tablename));
/* Find matching indices. */
- WT_ERR(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_ERR(__wt_metadata_cursor(session, &cursor));
cursor->set_key(cursor, tmp->data);
if ((ret = cursor->search_near(cursor, &cmp)) == 0 && cmp < 0)
ret = cursor->next(cursor);
@@ -379,10 +379,10 @@ __schema_open_index(WT_SESSION_IMPL *session,
table->idx_complete = true;
}
-err: __wt_scr_free(session, &tmp);
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
WT_TRET(__wt_schema_destroy_index(session, &idx));
- if (cursor != NULL)
- WT_TRET(cursor->close(cursor));
+
+ __wt_scr_free(session, &tmp);
return (ret);
}
@@ -438,7 +438,7 @@ __schema_open_table(WT_SESSION_IMPL *session,
WT_ERR(__wt_buf_fmt(session, buf, "table:%.*s", (int)namelen, name));
WT_ERR(__wt_strndup(session, buf->data, buf->size, &tablename));
- WT_ERR(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_ERR(__wt_metadata_cursor(session, &cursor));
cursor->set_key(cursor, tablename);
WT_ERR(cursor->search(cursor));
WT_ERR(cursor->get_value(cursor, &tconfig));
@@ -508,8 +508,7 @@ __schema_open_table(WT_SESSION_IMPL *session,
if (0) {
err: WT_TRET(__wt_schema_destroy_table(session, &table));
}
- if (cursor != NULL)
- WT_TRET(cursor->close(cursor));
+ WT_TRET(__wt_metadata_cursor_release(session, &cursor));
__wt_free(session, tablename);
__wt_scr_free(session, &buf);
diff --git a/src/schema/schema_plan.c b/src/schema/schema_plan.c
index 066e666190b..612a2d2d192 100644
--- a/src/schema/schema_plan.c
+++ b/src/schema/schema_plan.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_project.c b/src/schema/schema_project.c
index be5f73b48ed..4d29b2baa13 100644
--- a/src/schema/schema_project.c
+++ b/src/schema/schema_project.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_rename.c b/src/schema/schema_rename.c
index 3f368417d40..4ec126394dd 100644
--- a/src/schema/schema_rename.c
+++ b/src/schema/schema_rename.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -30,7 +30,7 @@ __rename_file(
return (EINVAL);
/* Close any btree handles in the file. */
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_conn_dhandle_close_all(session, uri, false));
WT_ERR(ret);
diff --git a/src/schema/schema_stat.c b/src/schema/schema_stat.c
index 82c2e2a15dc..d3d0605c60a 100644
--- a/src/schema/schema_stat.c
+++ b/src/schema/schema_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_truncate.c b/src/schema/schema_truncate.c
index c39bba4753c..e7752b60ca4 100644
--- a/src/schema/schema_truncate.c
+++ b/src/schema/schema_truncate.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -9,43 +9,6 @@
#include "wt_internal.h"
/*
- * __truncate_file --
- * WT_SESSION::truncate for a file.
- */
-static int
-__truncate_file(WT_SESSION_IMPL *session, const char *uri)
-{
- WT_DECL_RET;
- const char *filename;
- uint32_t allocsize;
-
- filename = uri;
- if (!WT_PREFIX_SKIP(filename, "file:"))
- return (EINVAL);
-
- /* Open and lock the file. */
- WT_RET(__wt_session_get_btree(
- session, uri, NULL, NULL, WT_DHANDLE_EXCLUSIVE));
- WT_STAT_FAST_DATA_INCR(session, cursor_truncate);
-
- /* Get the allocation size. */
- allocsize = S2BT(session)->allocsize;
-
- WT_RET(__wt_session_release_btree(session));
-
- /* Close any btree handles in the file. */
- WT_WITH_HANDLE_LIST_LOCK(session,
- ret = __wt_conn_dhandle_close_all(session, uri, false));
- WT_RET(ret);
-
- /* Delete the root address and truncate the file. */
- WT_RET(__wt_meta_checkpoint_clear(session, uri));
- WT_RET(__wt_block_manager_truncate(session, filename, allocsize));
-
- return (0);
-}
-
-/*
* __truncate_table --
* WT_SESSION::truncate for a table.
*/
@@ -112,9 +75,12 @@ __wt_schema_truncate(
tablename = uri;
- if (WT_PREFIX_MATCH(uri, "file:")) {
- ret = __truncate_file(session, uri);
- } else if (WT_PREFIX_MATCH(uri, "lsm:"))
+ if (WT_PREFIX_MATCH(uri, "file:"))
+ /*
+ * File truncate translates into a range truncate.
+ */
+ ret = __wt_session_range_truncate(session, uri, NULL, NULL);
+ else if (WT_PREFIX_MATCH(uri, "lsm:"))
ret = __wt_lsm_tree_truncate(session, uri, cfg);
else if (WT_PREFIX_SKIP(tablename, "table:"))
ret = __truncate_table(session, tablename, cfg);
diff --git a/src/schema/schema_util.c b/src/schema/schema_util.c
index 1e810e8adc9..d1c84dc8d85 100644
--- a/src/schema/schema_util.c
+++ b/src/schema/schema_util.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/schema/schema_worker.c b/src/schema/schema_worker.c
index 64218923173..a2fe5244c4d 100644
--- a/src/schema/schema_worker.c
+++ b/src/schema/schema_worker.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -49,7 +49,7 @@ __wt_schema_worker(WT_SESSION_IMPL *session,
* any open file handles, including checkpoints.
*/
if (FLD_ISSET(open_flags, WT_DHANDLE_EXCLUSIVE)) {
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_conn_dhandle_close_all(
session, uri, false));
WT_ERR(ret);
@@ -63,7 +63,7 @@ __wt_schema_worker(WT_SESSION_IMPL *session,
} else if (ret == EBUSY) {
WT_ASSERT(session, !FLD_ISSET(
open_flags, WT_DHANDLE_EXCLUSIVE));
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_conn_btree_apply_single_ckpt(
session, uri, file_func, cfg));
}
diff --git a/src/session/session_api.c b/src/session/session_api.c
index 053f69ee7f8..c03b5fdc044 100644
--- a/src/session/session_api.c
+++ b/src/session/session_api.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -148,7 +148,7 @@ __session_close(WT_SESSION *wt_session, const char *config)
* via the registered close callback.
*/
if (session->event_handler->handle_close != NULL &&
- !WT_STREQ(cursor->uri, WT_LAS_URI))
+ !WT_STREQ(cursor->internal_uri, WT_LAS_URI))
WT_TRET(session->event_handler->handle_close(
session->event_handler, wt_session, cursor));
WT_TRET(cursor->close(cursor));
@@ -442,8 +442,8 @@ __wt_session_create(
{
WT_DECL_RET;
- WT_WITH_SCHEMA_LOCK(session,
- WT_WITH_TABLE_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
ret = __wt_schema_create(session, uri, config)));
return (ret);
}
@@ -554,6 +554,32 @@ err: API_END_RET(session, ret);
}
/*
+ * __session_rebalance --
+ * WT_SESSION->rebalance method.
+ */
+static int
+__session_rebalance(WT_SESSION *wt_session, const char *uri, const char *config)
+{
+ WT_DECL_RET;
+ WT_SESSION_IMPL *session;
+
+ session = (WT_SESSION_IMPL *)wt_session;
+
+ SESSION_API_CALL(session, rebalance, config, cfg);
+
+ if (F_ISSET(S2C(session), WT_CONN_IN_MEMORY))
+ WT_ERR(ENOTSUP);
+
+ /* Block out checkpoints to avoid spurious EBUSY errors. */
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __wt_schema_worker(session, uri, __wt_bt_rebalance,
+ NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_REBALANCE)));
+
+err: API_END_RET_NOTFOUND_MAP(session, ret);
+}
+
+/*
* __session_rename --
* WT_SESSION->rename method.
*/
@@ -571,8 +597,8 @@ __session_rename(WT_SESSION *wt_session,
WT_ERR(__wt_str_name_check(session, uri));
WT_ERR(__wt_str_name_check(session, newuri));
- WT_WITH_SCHEMA_LOCK(session,
- WT_WITH_TABLE_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
ret = __wt_schema_rename(session, uri, newuri, cfg)));
err: API_END_RET_NOTFOUND_MAP(session, ret);
@@ -611,10 +637,22 @@ int
__wt_session_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
{
WT_DECL_RET;
+ WT_CONFIG_ITEM cval;
+ bool lock_wait;
+
+ WT_RET(__wt_config_gets_def(session, cfg, "lock_wait", 1, &cval));
+ lock_wait = cval.val != 0 || F_ISSET(session, WT_SESSION_LOCK_NO_WAIT);
- WT_WITH_SCHEMA_LOCK(session,
- WT_WITH_TABLE_LOCK(session,
+ if (!lock_wait)
+ F_SET(session, WT_SESSION_LOCK_NO_WAIT);
+
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
ret = __wt_schema_drop(session, uri, cfg)));
+
+ if (!lock_wait)
+ F_CLR(session, WT_SESSION_LOCK_NO_WAIT);
+
return (ret);
}
@@ -648,6 +686,7 @@ static int
__session_join(WT_SESSION *wt_session, WT_CURSOR *join_cursor,
WT_CURSOR *ref_cursor, const char *config)
{
+ WT_CURSOR *firstcg;
WT_CONFIG_ITEM cval;
WT_CURSOR_INDEX *cindex;
WT_CURSOR_JOIN *cjoin;
@@ -661,6 +700,7 @@ __session_join(WT_SESSION *wt_session, WT_CURSOR *join_cursor,
uint8_t flags, range;
count = 0;
+ firstcg = NULL;
session = (WT_SESSION_IMPL *)wt_session;
SESSION_API_CALL(session, join, config, cfg);
table = NULL;
@@ -672,15 +712,18 @@ __session_join(WT_SESSION *wt_session, WT_CURSOR *join_cursor,
cindex = (WT_CURSOR_INDEX *)ref_cursor;
idx = cindex->index;
table = cindex->table;
- WT_CURSOR_CHECKKEY(ref_cursor);
+ firstcg = cindex->cg_cursors[0];
} else if (WT_PREFIX_MATCH(ref_cursor->uri, "table:")) {
idx = NULL;
ctable = (WT_CURSOR_TABLE *)ref_cursor;
table = ctable->table;
- WT_CURSOR_CHECKKEY(ctable->cg_cursors[0]);
+ firstcg = ctable->cg_cursors[0];
} else
WT_ERR_MSG(session, EINVAL, "not an index or table cursor");
+ if (!F_ISSET(firstcg, WT_CURSTD_KEY_SET))
+ WT_ERR_MSG(session, EINVAL,
+ "requires reference cursor be positioned");
cjoin = (WT_CURSOR_JOIN *)join_cursor;
if (cjoin->table != table)
WT_ERR_MSG(session, EINVAL,
@@ -771,71 +814,48 @@ __session_salvage(WT_SESSION *wt_session, const char *uri, const char *config)
WT_ERR(ENOTSUP);
/* Block out checkpoints to avoid spurious EBUSY errors. */
- WT_WITH_CHECKPOINT_LOCK(session,
- WT_WITH_SCHEMA_LOCK(session, ret =
- __wt_schema_worker(session, uri, __wt_salvage,
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __wt_schema_worker(session, uri, __wt_salvage,
NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_SALVAGE)));
err: API_END_RET_NOTFOUND_MAP(session, ret);
}
/*
- * __session_truncate --
- * WT_SESSION->truncate method.
+ * __wt_session_range_truncate --
+ * Session handling of a range truncate.
*/
-static int
-__session_truncate(WT_SESSION *wt_session,
- const char *uri, WT_CURSOR *start, WT_CURSOR *stop, const char *config)
+int
+__wt_session_range_truncate(WT_SESSION_IMPL *session,
+ const char *uri, WT_CURSOR *start, WT_CURSOR *stop)
{
- WT_DECL_RET;
- WT_SESSION_IMPL *session;
WT_CURSOR *cursor;
+ WT_DECL_RET;
int cmp;
bool local_start;
local_start = false;
-
- session = (WT_SESSION_IMPL *)wt_session;
- SESSION_TXN_API_CALL(session, truncate, config, cfg);
- WT_STAT_FAST_CONN_INCR(session, cursor_truncate);
-
- /*
- * If the URI is specified, we don't need a start/stop, if start/stop
- * is specified, we don't need a URI. One exception is the log URI
- * which may truncate (archive) log files for a backup cursor.
- *
- * If no URI is specified, and both cursors are specified, start/stop
- * must reference the same object.
- *
- * Any specified cursor must have been initialized.
- */
- if ((uri == NULL && start == NULL && stop == NULL) ||
- (uri != NULL && !WT_PREFIX_MATCH(uri, "log:") &&
- (start != NULL || stop != NULL)))
- WT_ERR_MSG(session, EINVAL,
- "the truncate method should be passed either a URI or "
- "start/stop cursors, but not both");
-
if (uri != NULL) {
- /* Disallow objects in the WiredTiger name space. */
- WT_ERR(__wt_str_name_check(session, uri));
-
- if (WT_PREFIX_MATCH(uri, "log:")) {
+ WT_ASSERT(session, WT_PREFIX_MATCH(uri, "file:"));
+ /*
+ * A URI file truncate becomes a range truncate where we
+ * set a start cursor at the beginning. We already
+ * know the NULL stop goes to the end of the range.
+ */
+ WT_ERR(__session_open_cursor(
+ (WT_SESSION *)session, uri, NULL, NULL, &start));
+ local_start = true;
+ ret = start->next(start);
+ if (ret == WT_NOTFOUND) {
/*
- * Verify the user only gave the URI prefix and not
- * a specific target name after that.
+ * If there are no elements, there is nothing
+ * to do.
*/
- if (!WT_STREQ(uri, "log:"))
- WT_ERR_MSG(session, EINVAL,
- "the truncate method should not specify any"
- "target after the log: URI prefix.");
- ret = __wt_log_truncate_files(session, start, cfg);
- } else
- /* Wait for checkpoints to avoid EBUSY errors. */
- WT_WITH_CHECKPOINT_LOCK(session,
- WT_WITH_SCHEMA_LOCK(session,
- ret = __wt_schema_truncate(session, uri, cfg)));
- goto done;
+ ret = 0;
+ goto done;
+ }
+ WT_ERR(ret);
}
/*
@@ -893,7 +913,7 @@ __session_truncate(WT_SESSION *wt_session,
*/
if (start == NULL) {
WT_ERR(__session_open_cursor(
- wt_session, stop->uri, NULL, NULL, &start));
+ (WT_SESSION *)session, stop->uri, NULL, NULL, &start));
local_start = true;
WT_ERR(start->next(start));
}
@@ -910,13 +930,72 @@ __session_truncate(WT_SESSION *wt_session,
WT_ERR(__wt_schema_range_truncate(session, start, stop));
done:
-err: TXN_API_END_RETRY(session, ret, 0);
-
- /*
+err: /*
* Close any locally-opened start cursor.
*/
if (local_start)
WT_TRET(start->close(start));
+ return (ret);
+}
+
+/*
+ * __session_truncate --
+ * WT_SESSION->truncate method.
+ */
+static int
+__session_truncate(WT_SESSION *wt_session,
+ const char *uri, WT_CURSOR *start, WT_CURSOR *stop, const char *config)
+{
+ WT_DECL_RET;
+ WT_SESSION_IMPL *session;
+
+ session = (WT_SESSION_IMPL *)wt_session;
+ SESSION_TXN_API_CALL(session, truncate, config, cfg);
+ WT_STAT_FAST_CONN_INCR(session, cursor_truncate);
+
+ /*
+ * If the URI is specified, we don't need a start/stop, if start/stop
+ * is specified, we don't need a URI. One exception is the log URI
+ * which may truncate (archive) log files for a backup cursor.
+ *
+ * If no URI is specified, and both cursors are specified, start/stop
+ * must reference the same object.
+ *
+ * Any specified cursor must have been initialized.
+ */
+ if ((uri == NULL && start == NULL && stop == NULL) ||
+ (uri != NULL && !WT_PREFIX_MATCH(uri, "log:") &&
+ (start != NULL || stop != NULL)))
+ WT_ERR_MSG(session, EINVAL,
+ "the truncate method should be passed either a URI or "
+ "start/stop cursors, but not both");
+
+ if (uri != NULL) {
+ /* Disallow objects in the WiredTiger name space. */
+ WT_ERR(__wt_str_name_check(session, uri));
+
+ if (WT_PREFIX_MATCH(uri, "log:")) {
+ /*
+ * Verify the user only gave the URI prefix and not
+ * a specific target name after that.
+ */
+ if (!WT_STREQ(uri, "log:"))
+ WT_ERR_MSG(session, EINVAL,
+ "the truncate method should not specify any"
+ "target after the log: URI prefix.");
+ WT_ERR(__wt_log_truncate_files(session, start, cfg));
+ } else if (WT_PREFIX_MATCH(uri, "file:"))
+ WT_ERR(__wt_session_range_truncate(
+ session, uri, start, stop));
+ else
+ /* Wait for checkpoints to avoid EBUSY errors. */
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __wt_schema_truncate(session, uri, cfg)));
+ } else
+ WT_ERR(__wt_session_range_truncate(session, uri, start, stop));
+
+err: TXN_API_END_RETRY(session, ret, 0);
/*
* Only map WT_NOTFOUND to ENOENT if a URI was specified.
@@ -938,8 +1017,8 @@ __session_upgrade(WT_SESSION *wt_session, const char *uri, const char *config)
SESSION_API_CALL(session, upgrade, config, cfg);
/* Block out checkpoints to avoid spurious EBUSY errors. */
- WT_WITH_CHECKPOINT_LOCK(session,
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_worker(session, uri, __wt_upgrade,
NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_UPGRADE)));
@@ -964,8 +1043,8 @@ __session_verify(WT_SESSION *wt_session, const char *uri, const char *config)
WT_ERR(ENOTSUP);
/* Block out checkpoints to avoid spurious EBUSY errors. */
- WT_WITH_CHECKPOINT_LOCK(session,
- WT_WITH_SCHEMA_LOCK(session,
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_worker(session, uri, __wt_verify,
NULL, cfg, WT_DHANDLE_EXCLUSIVE | WT_BTREE_VERIFY)));
@@ -1287,6 +1366,7 @@ __open_session(WT_CONNECTION_IMPL *conn,
__session_join,
__session_log_flush,
__session_log_printf,
+ __session_rebalance,
__session_rename,
__session_reset,
__session_salvage,
@@ -1443,7 +1523,7 @@ __wt_open_session(WT_CONNECTION_IMPL *conn,
*/
if (open_metadata) {
WT_ASSERT(session, !F_ISSET(session, WT_SESSION_LOCKED_SCHEMA));
- if ((ret = __wt_metadata_open(session)) != 0) {
+ if ((ret = __wt_metadata_cursor(session, NULL)) != 0) {
wt_session = &session->iface;
WT_TRET(wt_session->close(wt_session, NULL));
return (ret);
@@ -1486,14 +1566,11 @@ __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name,
* deadlocked getting the cursor late in the process. Be defensive,
* get it now.
*/
- if (F_ISSET(session, WT_SESSION_LOOKASIDE_CURSOR)) {
- WT_WITHOUT_DHANDLE(session, ret =
- __wt_las_cursor_create(session, &session->las_cursor));
- if (ret != 0) {
- wt_session = &session->iface;
- WT_TRET(wt_session->close(wt_session, NULL));
- return (ret);
- }
+ if (F_ISSET(session, WT_SESSION_LOOKASIDE_CURSOR) &&
+ (ret = __wt_las_cursor_open(session, &session->las_cursor)) != 0) {
+ wt_session = &session->iface;
+ WT_TRET(wt_session->close(wt_session, NULL));
+ return (ret);
}
*sessionp = session;
diff --git a/src/session/session_compact.c b/src/session/session_compact.c
index 456fcd3ce03..5abccbd1366 100644
--- a/src/session/session_compact.c
+++ b/src/session/session_compact.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -172,12 +172,12 @@ __compact_file(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
for (i = 0; i < 100; ++i) {
WT_ERR(__wt_txn_checkpoint(session, checkpoint_cfg));
- session->compaction = false;
- WT_WITH_SCHEMA_LOCK(session,
+ session->compact_state = WT_COMPACT_RUNNING;
+ WT_WITH_SCHEMA_LOCK(session, ret,
ret = __wt_schema_worker(
session, uri, __wt_compact, NULL, cfg, 0));
WT_ERR(ret);
- if (!session->compaction)
+ if (session->compact_state != WT_COMPACT_SUCCESS)
break;
WT_ERR(__wt_txn_checkpoint(session, checkpoint_cfg));
@@ -185,7 +185,9 @@ __compact_file(WT_SESSION_IMPL *session, const char *uri, const char *cfg[])
WT_ERR(__session_compact_check_timeout(session, start_time));
}
-err: __wt_scr_free(session, &t);
+err: session->compact_state = WT_COMPACT_NONE;
+
+ __wt_scr_free(session, &t);
return (ret);
}
@@ -226,7 +228,8 @@ __wt_session_compact(
session->compact->max_time = (uint64_t)cval.val;
/* Find the types of data sources are being compacted. */
- WT_WITH_SCHEMA_LOCK(session, ret = __wt_schema_worker(
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ ret = __wt_schema_worker(
session, uri, NULL, __wt_compact_uri_analyze, cfg, 0));
WT_ERR(ret);
diff --git a/src/session/session_dhandle.c b/src/session/session_dhandle.c
index dd5094fb480..1ac758c0cee 100644
--- a/src/session/session_dhandle.c
+++ b/src/session/session_dhandle.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -453,8 +453,8 @@ __session_get_dhandle(
* We didn't find a match in the session cache, search the shared
* handle list and cache the handle we find.
*/
- WT_WITH_HANDLE_LIST_LOCK(session, ret =
- __session_find_shared_dhandle(session, uri, checkpoint));
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
+ ret = __session_find_shared_dhandle(session, uri, checkpoint));
if (ret == 0)
ret = __session_add_dhandle(session, NULL);
@@ -509,9 +509,9 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
F_CLR(dhandle, WT_DHANDLE_EXCLUSIVE);
WT_RET(__wt_writeunlock(session, dhandle->rwlock));
- WT_WITH_SCHEMA_LOCK(session,
- WT_WITH_HANDLE_LIST_LOCK(session, ret =
- __wt_session_get_btree(
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
+ ret = __wt_session_get_btree(
session, uri, checkpoint, cfg, flags)));
return (ret);
diff --git a/src/session/session_salvage.c b/src/session/session_salvage.c
index 07f68e4c194..983b28dd8ea 100644
--- a/src/session/session_salvage.c
+++ b/src/session/session_salvage.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/cksum.c b/src/support/cksum.c
index a8b5823100d..c2982c40015 100644
--- a/src/support/cksum.c
+++ b/src/support/cksum.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/crypto.c b/src/support/crypto.c
index b1102163e7b..1049621fb44 100644
--- a/src/support/crypto.c
+++ b/src/support/crypto.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/err.c b/src/support/err.c
index de518cbf08b..875bd3efcf3 100644
--- a/src/support/err.c
+++ b/src/support/err.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/filename.c b/src/support/filename.c
index 02a83803e25..215f5b47997 100644
--- a/src/support/filename.c
+++ b/src/support/filename.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -65,11 +65,49 @@ __wt_remove_if_exists(WT_SESSION_IMPL *session, const char *name)
}
/*
- * __wt_sync_and_rename_fh --
+ * __wt_rename_and_sync_directory --
+ * Rename a file and sync the enclosing directory.
+ */
+int
+__wt_rename_and_sync_directory(
+ WT_SESSION_IMPL *session, const char *from, const char *to)
+{
+ const char *fp, *tp;
+ bool same_directory;
+
+ /* Rename the source file to the target. */
+ WT_RET(__wt_rename(session, from, to));
+
+ /*
+ * Flush the backing directory to guarantee the rename. My reading of
+ * POSIX 1003.1 is there's no guarantee flushing only one of the from
+ * or to directories, or flushing a common parent, is sufficient, and
+ * even if POSIX were to make that guarantee, existing filesystems are
+ * known to not provide the guarantee or only provide the guarantee
+ * with specific mount options. Flush both of the from/to directories
+ * until it's a performance problem.
+ */
+ WT_RET(__wt_directory_sync(session, from));
+
+ /*
+ * In almost all cases, we're going to be renaming files in the same
+ * directory, we can at least fast-path that.
+ */
+ fp = strrchr(from, '/');
+ tp = strrchr(to, '/');
+ same_directory = (fp == NULL && tp == NULL) ||
+ (fp != NULL && tp != NULL &&
+ fp - from == tp - to && memcmp(from, to, (size_t)(fp - from)) == 0);
+
+ return (same_directory ? 0 : __wt_directory_sync(session, to));
+}
+
+/*
+ * __wt_fh_sync_and_rename --
* Sync and close a file, and swap it into place.
*/
int
-__wt_sync_and_rename_fh(
+__wt_fh_sync_and_rename(
WT_SESSION_IMPL *session, WT_FH **fhp, const char *from, const char *to)
{
WT_DECL_RET;
@@ -83,19 +121,15 @@ __wt_sync_and_rename_fh(
WT_TRET(__wt_close(session, &fh));
WT_RET(ret);
- /* Rename the source file to the target. */
- WT_RET(__wt_rename(session, from, to));
-
- /* Flush the backing directory to guarantee the rename. */
- return (__wt_directory_sync(session, NULL));
+ return (__wt_rename_and_sync_directory(session, from, to));
}
/*
- * __wt_sync_and_rename_fp --
+ * __wt_sync_fp_and_rename --
* Sync and close a file, and swap it into place.
*/
int
-__wt_sync_and_rename_fp(
+__wt_sync_fp_and_rename(
WT_SESSION_IMPL *session, FILE **fpp, const char *from, const char *to)
{
FILE *fp;
@@ -106,9 +140,5 @@ __wt_sync_and_rename_fp(
/* Flush to disk and close the handle. */
WT_RET(__wt_fclose(&fp, WT_FHANDLE_WRITE));
- /* Rename the source file to the target. */
- WT_RET(__wt_rename(session, from, to));
-
- /* Flush the backing directory to guarantee the rename. */
- return (__wt_directory_sync(session, NULL));
+ return (__wt_rename_and_sync_directory(session, from, to));
}
diff --git a/src/support/global.c b/src/support/global.c
index 1e32f5b4453..0234455b6ce 100644
--- a/src/support/global.c
+++ b/src/support/global.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -12,28 +12,6 @@ WT_PROCESS __wt_process; /* Per-process structure */
static int __wt_pthread_once_failed; /* If initialization failed */
/*
- * __system_is_little_endian --
- * Check if the system is little endian.
- */
-static int
-__system_is_little_endian(void)
-{
- uint64_t v;
- bool little;
-
- v = 1;
- little = *((uint8_t *)&v) != 0;
-
- if (little)
- return (0);
-
- fprintf(stderr,
- "This release of the WiredTiger data engine does not support "
- "big-endian systems; contact WiredTiger for more information.\n");
- return (EINVAL);
-}
-
-/*
* __wt_global_once --
* Global initialization, run once.
*/
@@ -42,11 +20,6 @@ __wt_global_once(void)
{
WT_DECL_RET;
- if ((ret = __system_is_little_endian()) != 0) {
- __wt_pthread_once_failed = ret;
- return;
- }
-
if ((ret =
__wt_spin_init(NULL, &__wt_process.spinlock, "global")) != 0) {
__wt_pthread_once_failed = ret;
@@ -115,7 +88,7 @@ __wt_attach(WT_SESSION_IMPL *session)
/* Sleep forever, the debugger will interrupt us when it attaches. */
for (;;)
- __wt_sleep(100, 0);
+ __wt_sleep(10, 0);
#else
WT_UNUSED(session);
#endif
diff --git a/src/support/hash_city.c b/src/support/hash_city.c
index 9a4a6464f40..5780cd7b459 100644
--- a/src/support/hash_city.c
+++ b/src/support/hash_city.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -99,6 +99,12 @@ static uint32_t UNALIGNED_LOAD32(const char *p) {
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)
+#elif defined(__sun)
+
+#include <sys/byteorder.h>
+#define bswap_32 BSWAP_32
+#define bswap_64 BSWAP_64
+
#else
#include <byteswap.h>
#endif
diff --git a/src/support/hash_fnv.c b/src/support/hash_fnv.c
index e780931454d..35e7e5f3a73 100644
--- a/src/support/hash_fnv.c
+++ b/src/support/hash_fnv.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/hazard.c b/src/support/hazard.c
index 0fc7051fb90..13e0eb3b9ac 100644
--- a/src/support/hazard.c
+++ b/src/support/hazard.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/hex.c b/src/support/hex.c
index eb9f420911a..d42a84154ca 100644
--- a/src/support/hex.c
+++ b/src/support/hex.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -8,7 +8,7 @@
#include "wt_internal.h"
-static const u_char hex[] = "0123456789abcdef";
+const u_char __wt_hex[] = "0123456789abcdef";
/*
* __fill_hex --
@@ -25,8 +25,8 @@ __fill_hex(const uint8_t *src, size_t src_max,
--dest_max;
for (; src_max > 0 && dest_max > 1;
src_max -= 1, dest_max -= 2, ++src) {
- *dest++ = hex[(*src & 0xf0) >> 4];
- *dest++ = hex[*src & 0x0f];
+ *dest++ = __wt_hex[(*src & 0xf0) >> 4];
+ *dest++ = __wt_hex[*src & 0x0f];
}
*dest++ = '\0';
if (lenp != NULL)
@@ -34,6 +34,17 @@ __fill_hex(const uint8_t *src, size_t src_max,
}
/*
+ * __wt_fill_hex --
+ * In-memory conversion of raw bytes to a hexadecimal representation.
+ */
+void
+__wt_fill_hex(const uint8_t *src, size_t src_max,
+ uint8_t *dest, size_t dest_max, size_t *lenp)
+{
+ __fill_hex(src, src_max, dest, dest_max, lenp);
+}
+
+/*
* __wt_raw_to_hex --
* Convert a chunk of data to a nul-terminated printable hex string.
*/
@@ -72,10 +83,6 @@ __wt_raw_to_esc_hex(
*/
WT_RET(__wt_buf_init(session, to, size * 3 + 1));
- /*
- * In the worst case, every character takes up 3 spaces, plus a
- * trailing nul byte.
- */
for (p = from, t = to->mem, i = size; i > 0; --i, ++p)
if (isprint((int)*p)) {
if (*p == '\\')
@@ -83,8 +90,8 @@ __wt_raw_to_esc_hex(
*t++ = *p;
} else {
*t++ = '\\';
- *t++ = hex[(*p & 0xf0) >> 4];
- *t++ = hex[*p & 0x0f];
+ *t++ = __wt_hex[(*p & 0xf0) >> 4];
+ *t++ = __wt_hex[*p & 0x0f];
}
*t++ = '\0';
to->size = WT_PTRDIFF(t, to->mem);
diff --git a/src/support/huffman.c b/src/support/huffman.c
index 4bda365cb10..edd0bc9f648 100644
--- a/src/support/huffman.c
+++ b/src/support/huffman.c
@@ -1,9 +1,31 @@
-/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+/*
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
- * See the file LICENSE for redistribution information.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name MongoDB or the name WiredTiger
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY MONGODB INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#include "wt_internal.h"
diff --git a/src/support/pow.c b/src/support/pow.c
index 0f50bfe56a1..028263581d3 100644
--- a/src/support/pow.c
+++ b/src/support/pow.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/src/support/rand.c b/src/support/rand.c
index f5ecb12633e..d2e4cd27aab 100644
--- a/src/support/rand.c
+++ b/src/support/rand.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -60,6 +60,29 @@ __wt_random_init(WT_RAND_STATE volatile * rnd_state)
}
/*
+ * __wt_random_init_seed --
+ * Initialize the state of a 32-bit pseudo-random number.
+ * Use this, instead of __wt_random_init if we are running with multiple
+ * threads and we want each thread to initialize its own random state based
+ * on a different random seed.
+ */
+int
+__wt_random_init_seed(
+ WT_SESSION_IMPL *session, WT_RAND_STATE volatile * rnd_state)
+{
+ struct timespec ts;
+ WT_RAND_STATE rnd;
+
+ WT_RET(__wt_epoch(session, &ts));
+ M_W(rnd) = (uint32_t)(ts.tv_nsec + 521288629);
+ M_Z(rnd) = (uint32_t)(ts.tv_nsec + 362436069);
+
+ *rnd_state = rnd;
+
+ return (0);
+}
+
+/*
* __wt_random --
* Return a 32-bit pseudo-random number.
*/
diff --git a/src/support/scratch.c b/src/support/scratch.c
index f0c403c9ec8..94020ba2621 100644
--- a/src/support/scratch.c
+++ b/src/support/scratch.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/support/stat.c b/src/support/stat.c
index 4d7cd65fd18..7a615131628 100644
--- a/src/support/stat.c
+++ b/src/support/stat.c
@@ -250,19 +250,24 @@ __wt_stat_dsrc_aggregate_single(
to->block_alloc += from->block_alloc;
to->block_free += from->block_free;
to->block_checkpoint_size += from->block_checkpoint_size;
- to->allocation_size = from->allocation_size;
+ if (from->allocation_size > to->allocation_size)
+ to->allocation_size = from->allocation_size;
to->block_reuse_bytes += from->block_reuse_bytes;
- to->block_magic = from->block_magic;
- to->block_major = from->block_major;
+ if (from->block_magic > to->block_magic)
+ to->block_magic = from->block_magic;
+ if (from->block_major > to->block_major)
+ to->block_major = from->block_major;
to->block_size += from->block_size;
- to->block_minor = from->block_minor;
+ if (from->block_minor > to->block_minor)
+ to->block_minor = from->block_minor;
to->btree_checkpoint_generation += from->btree_checkpoint_generation;
to->btree_column_fix += from->btree_column_fix;
to->btree_column_internal += from->btree_column_internal;
to->btree_column_deleted += from->btree_column_deleted;
to->btree_column_variable += from->btree_column_variable;
to->btree_column_rle += from->btree_column_rle;
- to->btree_fixed_len = from->btree_fixed_len;
+ if (from->btree_fixed_len > to->btree_fixed_len)
+ to->btree_fixed_len = from->btree_fixed_len;
if (from->btree_maxintlkey > to->btree_maxintlkey)
to->btree_maxintlkey = from->btree_maxintlkey;
if (from->btree_maxintlpage > to->btree_maxintlpage)
@@ -367,12 +372,16 @@ __wt_stat_dsrc_aggregate(
to->block_free += WT_STAT_READ(from, block_free);
to->block_checkpoint_size +=
WT_STAT_READ(from, block_checkpoint_size);
- to->allocation_size = from[0]->allocation_size;
+ if ((v = WT_STAT_READ(from, allocation_size)) > to->allocation_size)
+ to->allocation_size = v;
to->block_reuse_bytes += WT_STAT_READ(from, block_reuse_bytes);
- to->block_magic = from[0]->block_magic;
- to->block_major = from[0]->block_major;
+ if ((v = WT_STAT_READ(from, block_magic)) > to->block_magic)
+ to->block_magic = v;
+ if ((v = WT_STAT_READ(from, block_major)) > to->block_major)
+ to->block_major = v;
to->block_size += WT_STAT_READ(from, block_size);
- to->block_minor = from[0]->block_minor;
+ if ((v = WT_STAT_READ(from, block_minor)) > to->block_minor)
+ to->block_minor = v;
to->btree_checkpoint_generation +=
WT_STAT_READ(from, btree_checkpoint_generation);
to->btree_column_fix += WT_STAT_READ(from, btree_column_fix);
@@ -382,15 +391,14 @@ __wt_stat_dsrc_aggregate(
to->btree_column_variable +=
WT_STAT_READ(from, btree_column_variable);
to->btree_column_rle += WT_STAT_READ(from, btree_column_rle);
- to->btree_fixed_len = from[0]->btree_fixed_len;
- if ((v = WT_STAT_READ(from, btree_maxintlkey)) >
- to->btree_maxintlkey)
+ if ((v = WT_STAT_READ(from, btree_fixed_len)) > to->btree_fixed_len)
+ to->btree_fixed_len = v;
+ if ((v = WT_STAT_READ(from, btree_maxintlkey)) > to->btree_maxintlkey)
to->btree_maxintlkey = v;
if ((v = WT_STAT_READ(from, btree_maxintlpage)) >
to->btree_maxintlpage)
to->btree_maxintlpage = v;
- if ((v = WT_STAT_READ(from, btree_maxleafkey)) >
- to->btree_maxleafkey)
+ if ((v = WT_STAT_READ(from, btree_maxleafkey)) > to->btree_maxleafkey)
to->btree_maxleafkey = v;
if ((v = WT_STAT_READ(from, btree_maxleafpage)) >
to->btree_maxleafpage)
diff --git a/src/txn/txn.c b/src/txn/txn.c
index f835fea8f67..e8fd8c0c119 100644
--- a/src/txn/txn.c
+++ b/src/txn/txn.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -216,6 +216,7 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, bool force)
conn = S2C(session);
txn_global = &conn->txn_global;
+retry:
current_id = last_running = txn_global->current;
oldest_session = NULL;
prev_oldest_id = txn_global->oldest_id;
@@ -287,43 +288,60 @@ __wt_txn_update_oldest(WT_SESSION_IMPL *session, bool force)
WT_TXNID_LT(txn_global->last_running, last_running);
/* Update the oldest ID. */
- if ((WT_TXNID_LT(prev_oldest_id, oldest_id) || last_running_moved) &&
- __wt_atomic_casiv32(&txn_global->scan_count, 1, -1)) {
- WT_ORDERED_READ(session_cnt, conn->session_cnt);
- for (i = 0, s = txn_global->states; i < session_cnt; i++, s++) {
- if ((id = s->id) != WT_TXN_NONE &&
- WT_TXNID_LT(id, last_running))
- last_running = id;
- if ((id = s->snap_min) != WT_TXN_NONE &&
- WT_TXNID_LT(id, oldest_id))
- oldest_id = id;
- }
-
- if (WT_TXNID_LT(last_running, oldest_id))
- oldest_id = last_running;
-
-#ifdef HAVE_DIAGNOSTIC
+ if (WT_TXNID_LT(prev_oldest_id, oldest_id) || last_running_moved) {
/*
- * Make sure the ID doesn't move past any named snapshots.
- *
- * Don't include the read/assignment in the assert statement.
- * Coverity complains if there are assignments only done in
- * diagnostic builds, and when the read is from a volatile.
+ * We know we want to update. Check if we're racing.
*/
- id = txn_global->nsnap_oldest_id;
- WT_ASSERT(session,
- id == WT_TXN_NONE || !WT_TXNID_LT(id, oldest_id));
+ if (__wt_atomic_casiv32(&txn_global->scan_count, 1, -1)) {
+ WT_ORDERED_READ(session_cnt, conn->session_cnt);
+ for (i = 0, s = txn_global->states;
+ i < session_cnt; i++, s++) {
+ if ((id = s->id) != WT_TXN_NONE &&
+ WT_TXNID_LT(id, last_running))
+ last_running = id;
+ if ((id = s->snap_min) != WT_TXN_NONE &&
+ WT_TXNID_LT(id, oldest_id))
+ oldest_id = id;
+ }
+
+ if (WT_TXNID_LT(last_running, oldest_id))
+ oldest_id = last_running;
+
+#ifdef HAVE_DIAGNOSTIC
+ /*
+ * Make sure the ID doesn't move past any named
+ * snapshots.
+ *
+ * Don't include the read/assignment in the assert
+ * statement. Coverity complains if there are
+ * assignments only done in diagnostic builds, and
+ * when the read is from a volatile.
+ */
+ id = txn_global->nsnap_oldest_id;
+ WT_ASSERT(session,
+ id == WT_TXN_NONE || !WT_TXNID_LT(id, oldest_id));
#endif
- if (WT_TXNID_LT(txn_global->last_running, last_running))
- txn_global->last_running = last_running;
- if (WT_TXNID_LT(txn_global->oldest_id, oldest_id))
- txn_global->oldest_id = oldest_id;
- WT_ASSERT(session, txn_global->scan_count == -1);
- txn_global->scan_count = 0;
+ if (WT_TXNID_LT(txn_global->last_running, last_running))
+ txn_global->last_running = last_running;
+ if (WT_TXNID_LT(txn_global->oldest_id, oldest_id))
+ txn_global->oldest_id = oldest_id;
+ WT_ASSERT(session, txn_global->scan_count == -1);
+ txn_global->scan_count = 0;
+ } else {
+ /*
+ * We wanted to update the oldest ID but we're racing
+ * another thread. Retry if this is a forced update.
+ */
+ WT_ASSERT(session, txn_global->scan_count > 0);
+ (void)__wt_atomic_subiv32(&txn_global->scan_count, 1);
+ if (force) {
+ __wt_yield();
+ goto retry;
+ }
+ }
} else {
if (WT_VERBOSE_ISSET(session, WT_VERB_TRANSACTION) &&
- current_id - oldest_id > 10000 && last_running_moved &&
- oldest_session != NULL) {
+ current_id - oldest_id > 10000 && oldest_session != NULL) {
(void)__wt_verbose(session, WT_VERB_TRANSACTION,
"old snapshot %" PRIu64
" pinned in session %d [%s]"
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index bc1537ca878..7d4d4d5c27c 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -56,7 +56,7 @@ __checkpoint_name_check(WT_SESSION_IMPL *session, const char *uri)
* confirm the metadata file contains no non-file objects.
*/
if (uri == NULL) {
- WT_ERR(__wt_metadata_cursor(session, NULL, &cursor));
+ WT_RET(__wt_metadata_cursor(session, &cursor));
while ((ret = cursor->next(cursor)) == 0) {
WT_ERR(cursor->get_key(cursor, &uri));
if (!WT_PREFIX_MATCH(uri, "colgroup:") &&
@@ -79,8 +79,7 @@ __checkpoint_name_check(WT_SESSION_IMPL *session, const char *uri)
WT_ERR_MSG(session, EINVAL,
"%s object does not support named checkpoints", fail);
-err: if (cursor != NULL)
- WT_TRET(cursor->close(cursor));
+err: WT_TRET(__wt_metadata_cursor_release(session, &cursor));
return (ret);
}
@@ -185,7 +184,7 @@ __checkpoint_apply(WT_SESSION_IMPL *session, const char *cfg[],
session->ckpt_handle[i].dhandle,
ret = (*op)(session, cfg));
else
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __wt_conn_btree_apply_single(session,
session->ckpt_handle[i].name, NULL, op, cfg));
WT_RET(ret);
@@ -371,7 +370,7 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
full = idle = logging = tracking = false;
/* Ensure the metadata table is open before taking any locks. */
- WT_RET(__wt_metadata_open(session));
+ WT_RET(__wt_metadata_cursor(session, NULL));
/*
* Do a pass over the configuration arguments and figure out what kind
@@ -386,9 +385,9 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
* Get a list of handles we want to flush; this may pull closed objects
* into the session cache, but we're going to do that eventually anyway.
*/
- WT_WITH_SCHEMA_LOCK(session,
- WT_WITH_TABLE_LOCK(session,
- WT_WITH_HANDLE_LIST_LOCK(session,
+ WT_WITH_SCHEMA_LOCK(session, ret,
+ WT_WITH_TABLE_LOCK(session, ret,
+ WT_WITH_HANDLE_LIST_LOCK(session, ret,
ret = __checkpoint_apply_all(
session, cfg, __wt_checkpoint_list, NULL))));
WT_ERR(ret);
@@ -551,14 +550,16 @@ __txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
saved_meta_next = session->meta_track_next;
session->meta_track_next = NULL;
WT_WITH_DHANDLE(session,
- session->meta_dhandle, ret = __wt_checkpoint(session, cfg));
+ WT_SESSION_META_DHANDLE(session),
+ ret = __wt_checkpoint(session, cfg));
session->meta_track_next = saved_meta_next;
WT_ERR(ret);
WT_ERR(__checkpoint_verbose_track(session,
"metadata sync completed", &verb_timer));
} else
- WT_WITH_DHANDLE(session, session->meta_dhandle,
+ WT_WITH_DHANDLE(session,
+ WT_SESSION_META_DHANDLE(session),
ret = __wt_txn_checkpoint_log(
session, false, WT_TXN_LOG_CKPT_SYNC, NULL));
@@ -601,8 +602,8 @@ err: /*
*/
if (full && logging) {
if (ret == 0 &&
- F_ISSET((WT_BTREE *)session->meta_dhandle->handle,
- WT_BTREE_SKIP_CKPT))
+ F_ISSET(((WT_CURSOR_BTREE *)
+ session->meta_cursor)->btree, WT_BTREE_SKIP_CKPT))
idle = true;
WT_TRET(__wt_txn_checkpoint_log(session, full,
(ret == 0 && !idle) ?
@@ -665,7 +666,8 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
*/
WT_STAT_FAST_CONN_SET(session, txn_checkpoint_running, 1);
- WT_WITH_CHECKPOINT_LOCK(session, ret = __txn_checkpoint(session, cfg));
+ WT_WITH_CHECKPOINT_LOCK(session, ret,
+ ret = __txn_checkpoint(session, cfg));
WT_STAT_FAST_CONN_SET(session, txn_checkpoint_running, 0);
@@ -1037,12 +1039,13 @@ nockpt: F_SET(btree, WT_BTREE_SKIP_CKPT);
"for a bulk-loaded file");
fake_ckpt = true;
goto fake;
+ case WT_BTREE_REBALANCE:
case WT_BTREE_SALVAGE:
case WT_BTREE_UPGRADE:
case WT_BTREE_VERIFY:
WT_ERR_MSG(session, EINVAL,
- "checkpoints are blocked during salvage, upgrade "
- "or verify operations");
+ "checkpoints are blocked during rebalance, "
+ "salvage, upgrade or verify operations");
}
/*
diff --git a/src/txn/txn_ext.c b/src/txn/txn_ext.c
index 36d42a8996f..9ea1af6c4f8 100644
--- a/src/txn/txn_ext.c
+++ b/src/txn/txn_ext.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/txn/txn_log.c b/src/txn/txn_log.c
index c5fa52dea6a..4c4a7fb3132 100644
--- a/src/txn/txn_log.c
+++ b/src/txn/txn_log.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -8,6 +8,12 @@
#include "wt_internal.h"
+/* Cookie passed to __txn_printlog. */
+typedef struct {
+ FILE *out;
+ uint32_t flags;
+} WT_TXN_PRINTLOG_ARGS;
+
/*
* __txn_op_log --
* Log an operation for the current transaction.
@@ -64,7 +70,8 @@ err: __wt_buf_free(session, &key);
*/
static int
__txn_commit_printlog(
- WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out)
+ WT_SESSION_IMPL *session, const uint8_t **pp, const uint8_t *end, FILE *out,
+ uint32_t flags)
{
bool firstrecord;
@@ -79,7 +86,7 @@ __txn_commit_printlog(
firstrecord = false;
- WT_RET(__wt_txn_op_printlog(session, pp, end, out));
+ WT_RET(__wt_txn_op_printlog(session, pp, end, out, flags));
WT_RET(__wt_fprintf(out, "\n }"));
}
@@ -459,6 +466,7 @@ __txn_printlog(WT_SESSION_IMPL *session,
FILE *out;
WT_LOG_RECORD *logrec;
WT_LSN ckpt_lsn;
+ WT_TXN_PRINTLOG_ARGS *args;
const uint8_t *end, *p;
const char *msg;
uint64_t txnid;
@@ -467,7 +475,8 @@ __txn_printlog(WT_SESSION_IMPL *session,
bool compressed;
WT_UNUSED(next_lsnp);
- out = cookie;
+ args = cookie;
+ out = args->out;
p = WT_LOG_SKIP_HEADER(rawrec->data);
end = (const uint8_t *)rawrec->data + rawrec->size;
@@ -506,7 +515,8 @@ __txn_printlog(WT_SESSION_IMPL *session,
WT_RET(__wt_fprintf(out, " \"type\" : \"commit\",\n"));
WT_RET(__wt_fprintf(out,
" \"txnid\" : %" PRIu64 ",\n", txnid));
- WT_RET(__txn_commit_printlog(session, &p, end, out));
+ WT_RET(__txn_commit_printlog(session, &p, end, out,
+ args->flags));
break;
case WT_LOGREC_FILE_SYNC:
@@ -537,15 +547,18 @@ __txn_printlog(WT_SESSION_IMPL *session,
* Print the log in a human-readable format.
*/
int
-__wt_txn_printlog(WT_SESSION *wt_session, FILE *out)
+__wt_txn_printlog(WT_SESSION *wt_session, FILE *out, uint32_t flags)
{
WT_SESSION_IMPL *session;
+ WT_TXN_PRINTLOG_ARGS args;
session = (WT_SESSION_IMPL *)wt_session;
+ args.out = out;
+ args.flags = flags;
WT_RET(__wt_fprintf(out, "[\n"));
WT_RET(__wt_log_scan(
- session, NULL, WT_LOGSCAN_FIRST, __txn_printlog, out));
+ session, NULL, WT_LOGSCAN_FIRST, __txn_printlog, &args));
WT_RET(__wt_fprintf(out, "\n]\n"));
return (0);
diff --git a/src/txn/txn_nsnap.c b/src/txn/txn_nsnap.c
index 169929a46de..eddcca9248f 100644
--- a/src/txn/txn_nsnap.c
+++ b/src/txn/txn_nsnap.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c
index d0b3b909f09..8051d059d7e 100644
--- a/src/txn/txn_recover.c
+++ b/src/txn/txn_recover.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -427,7 +427,7 @@ __wt_txn_recover(WT_SESSION_IMPL *session)
WT_ERR(__wt_metadata_search(session, WT_METAFILE_URI, &config));
WT_ERR(__recovery_setup_file(&r, WT_METAFILE_URI, config));
- WT_ERR(__wt_metadata_cursor(session, NULL, &metac));
+ WT_ERR(__wt_metadata_cursor_open(session, NULL, &metac));
metafile = &r.files[WT_METAFILE_ID];
metafile->c = metac;
diff --git a/src/utilities/util.h b/src/utilities/util.h
index 08d0537956f..3882d814e3a 100644
--- a/src/utilities/util.h
+++ b/src/utilities/util.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -42,6 +42,7 @@ char *util_name(WT_SESSION *, const char *, const char *);
int util_printlog(WT_SESSION *, int, char *[]);
int util_read(WT_SESSION *, int, char *[]);
int util_read_line(WT_SESSION *, ULINE *, bool, bool *);
+int util_rebalance(WT_SESSION *, int, char *[]);
int util_rename(WT_SESSION *, int, char *[]);
int util_salvage(WT_SESSION *, int, char *[]);
int util_stat(WT_SESSION *, int, char *[]);
diff --git a/src/utilities/util_backup.c b/src/utilities/util_backup.c
index d07c99afc19..b3afc78e9e8 100644
--- a/src/utilities/util_backup.c
+++ b/src/utilities/util_backup.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_compact.c b/src/utilities/util_compact.c
index 153d2d11a6d..c114eb207fa 100644
--- a/src/utilities/util_compact.c
+++ b/src/utilities/util_compact.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_cpyright.c b/src/utilities/util_cpyright.c
index df135b68d2c..7de0eab6dc6 100644
--- a/src/utilities/util_cpyright.c
+++ b/src/utilities/util_cpyright.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -11,7 +11,7 @@
void
util_copyright(void)
{
- printf("%s\n", "Copyright (c) 2008-2015 MongoDB, Inc.");
+ printf("%s\n", "Copyright (c) 2008-2016 MongoDB, Inc.");
printf("%s\n\n", "All rights reserved.");
printf("%s\n\n",
diff --git a/src/utilities/util_create.c b/src/utilities/util_create.c
index 06ea5edd8cc..4e609736f2d 100644
--- a/src/utilities/util_create.c
+++ b/src/utilities/util_create.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_drop.c b/src/utilities/util_drop.c
index 9717b102857..ba41445dfb6 100644
--- a/src/utilities/util_drop.c
+++ b/src/utilities/util_drop.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_dump.c b/src/utilities/util_dump.c
index 7dfac50b724..ca761a52d8a 100644
--- a/src/utilities/util_dump.c
+++ b/src/utilities/util_dump.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_list.c b/src/utilities/util_list.c
index 99a1455a74e..c7afea04b1c 100644
--- a/src/utilities/util_list.c
+++ b/src/utilities/util_list.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -8,6 +8,7 @@
#include "util.h"
+static int list_get_allocsize(WT_SESSION *, const char *, size_t *);
static int list_print(WT_SESSION *, const char *, bool, bool);
static int list_print_checkpoint(WT_SESSION *, const char *);
static int usage(void);
@@ -56,6 +57,48 @@ util_list(WT_SESSION *session, int argc, char *argv[])
}
/*
+ * list_get_allocsize --
+ * Get the allocation size for this file from the metadata.
+ */
+static int
+list_get_allocsize(WT_SESSION *session, const char *key, size_t *allocsize)
+{
+ WT_CONFIG_ITEM szvalue;
+ WT_CONFIG_PARSER *parser;
+ WT_DECL_RET;
+ WT_EXTENSION_API *wt_api;
+ char *config;
+
+ wt_api = session->connection->get_extension_api(session->connection);
+ if ((ret =
+ wt_api->metadata_search(wt_api, session, key, &config)) != 0) {
+ fprintf(stderr, "%s: %s: extension_api.metadata_search: %s\n",
+ progname, key, session->strerror(session, ret));
+ return (ret);
+ }
+ if ((ret = wt_api->config_parser_open(wt_api, session, config,
+ strlen(config), &parser)) != 0) {
+ fprintf(stderr, "%s: extension_api.config_parser_open: %s\n",
+ progname, session->strerror(session, ret));
+ return (ret);
+ }
+ if ((ret = parser->get(parser, "allocation_size", &szvalue)) != 0) {
+ if (ret != WT_NOTFOUND)
+ fprintf(stderr, "%s: config_parser.get: %s\n",
+ progname, session->strerror(session, ret));
+ (void)parser->close(parser);
+ return (ret);
+ }
+ if ((ret = parser->close(parser)) != 0) {
+ fprintf(stderr, "%s: config_parser.close: %s\n",
+ progname, session->strerror(session, ret));
+ return (ret);
+ }
+ *allocsize = (size_t)szvalue.val;
+ return (0);
+}
+
+/*
* list_print --
* List the high-level objects in the database.
*/
@@ -137,9 +180,10 @@ list_print(WT_SESSION *session, const char *name, bool cflag, bool vflag)
static int
list_print_checkpoint(WT_SESSION *session, const char *key)
{
+ WT_BLOCK_CKPT ci;
WT_DECL_RET;
WT_CKPT *ckpt, *ckptbase;
- size_t len;
+ size_t allocsize, len;
time_t t;
uint64_t v;
@@ -151,6 +195,14 @@ list_print_checkpoint(WT_SESSION *session, const char *key)
if ((ret = __wt_metadata_get_ckptlist(session, key, &ckptbase)) != 0)
return (ret == WT_NOTFOUND ? 0 : ret);
+ /* We need the allocation size for decoding the checkpoint addr */
+ if ((ret = list_get_allocsize(session, key, &allocsize)) != 0) {
+ if (ret == WT_NOTFOUND)
+ allocsize = 0;
+ else
+ return (ret);
+ }
+
/* Find the longest name, so we can pretty-print. */
len = 0;
WT_CKPT_FOREACH(ckptbase, ckpt)
@@ -158,7 +210,15 @@ list_print_checkpoint(WT_SESSION *session, const char *key)
len = strlen(ckpt->name);
++len;
+ memset(&ci, 0, sizeof(ci));
WT_CKPT_FOREACH(ckptbase, ckpt) {
+ if (allocsize != 0 && (ret = __wt_block_ckpt_decode(
+ session, allocsize, ckpt->raw.data, &ci)) != 0) {
+ fprintf(stderr, "%s: __wt_block_buffer_to_ckpt: %s\n",
+ progname, session->strerror(session, ret));
+ /* continue if damaged */
+ ci.root_size = 0;
+ }
/*
* Call ctime, not ctime_r; ctime_r has portability problems,
* the Solaris version is different from the POSIX standard.
@@ -179,6 +239,17 @@ list_print_checkpoint(WT_SESSION *session, const char *key)
printf(" (%" PRIu64 " KB)\n", v / WT_KILOBYTE);
else
printf(" (%" PRIu64 " B)\n", v);
+ if (ci.root_size != 0) {
+ printf("\t\t" "root offset: %" PRIuMAX
+ " (0x%" PRIxMAX ")\n",
+ (intmax_t)ci.root_offset, (intmax_t)ci.root_offset);
+ printf("\t\t" "root size: %" PRIu32
+ " (0x%" PRIx32 ")\n",
+ ci.root_size, ci.root_size);
+ printf("\t\t" "root checksum: %" PRIu32
+ " (0x%" PRIx32 ")\n",
+ ci.root_cksum, ci.root_cksum);
+ }
}
__wt_metadata_free_ckptlist(session, ckptbase);
diff --git a/src/utilities/util_load.c b/src/utilities/util_load.c
index a40fa60361f..696dc68630a 100644
--- a/src/utilities/util_load.c
+++ b/src/utilities/util_load.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_load.h b/src/utilities/util_load.h
index ca359ce662b..710b18bfe83 100644
--- a/src/utilities/util_load.h
+++ b/src/utilities/util_load.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_load_json.c b/src/utilities/util_load_json.c
index c7d4893ae20..9349d39bb1e 100644
--- a/src/utilities/util_load_json.c
+++ b/src/utilities/util_load_json.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_loadtext.c b/src/utilities/util_loadtext.c
index c6cd264c423..f9c5b6e9a1f 100644
--- a/src/utilities/util_loadtext.c
+++ b/src/utilities/util_loadtext.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_main.c b/src/utilities/util_main.c
index 9cbda08690e..e18d8d7d1f5 100644
--- a/src/utilities/util_main.c
+++ b/src/utilities/util_main.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -159,6 +159,8 @@ main(int argc, char *argv[])
case 'r':
if (strcmp(command, "read") == 0)
func = util_read;
+ else if (strcmp(command, "rebalance") == 0)
+ func = util_rebalance;
else if (strcmp(command, "rename") == 0)
func = util_rename;
break;
@@ -226,7 +228,6 @@ main(int argc, char *argv[])
ret = func(session, argc, argv);
/* Close the database. */
-
err: if (conn != NULL && (tret = conn->close(conn, NULL)) != 0 && ret == 0)
ret = tret;
@@ -260,9 +261,10 @@ usage(void)
"\t" "dump\t dump an object\n"
"\t" "list\t list database objects\n"
"\t" "load\t load an object\n"
- "\t" "loadtext\t load an object from a text file\n"
+ "\t" "loadtext load an object from a text file\n"
"\t" "printlog display the database log\n"
"\t" "read\t read values from an object\n"
+ "\t" "rebalance rebalance an object\n"
"\t" "rename\t rename an object\n"
"\t" "salvage\t salvage a file\n"
"\t" "stat\t display statistics for an object\n"
diff --git a/src/utilities/util_misc.c b/src/utilities/util_misc.c
index 76cb37b30dc..f45f6b339f2 100644
--- a/src/utilities/util_misc.c
+++ b/src/utilities/util_misc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_printlog.c b/src/utilities/util_printlog.c
index d202b09b228..9a2bdc8a9ba 100644
--- a/src/utilities/util_printlog.c
+++ b/src/utilities/util_printlog.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
@@ -15,10 +15,10 @@ util_printlog(WT_SESSION *session, int argc, char *argv[])
{
WT_DECL_RET;
int ch;
- bool printable;
+ uint32_t flags;
- printable = false;
- while ((ch = __wt_getopt(progname, argc, argv, "f:p")) != EOF)
+ flags = 0;
+ while ((ch = __wt_getopt(progname, argc, argv, "f:x")) != EOF)
switch (ch) {
case 'f': /* output file */
if (freopen(__wt_optarg, "w", stdout) == NULL) {
@@ -27,8 +27,8 @@ util_printlog(WT_SESSION *session, int argc, char *argv[])
return (1);
}
break;
- case 'p':
- printable = true;
+ case 'x': /* hex output */
+ LF_SET(WT_TXN_PRINTLOG_HEX);
break;
case '?':
default:
@@ -41,8 +41,7 @@ util_printlog(WT_SESSION *session, int argc, char *argv[])
if (argc != 0)
return (usage());
- WT_UNUSED(printable);
- ret = __wt_txn_printlog(session, stdout);
+ ret = __wt_txn_printlog(session, stdout, flags);
if (ret != 0) {
fprintf(stderr, "%s: printlog failed: %s\n",
@@ -61,7 +60,7 @@ usage(void)
{
(void)fprintf(stderr,
"usage: %s %s "
- "printlog [-p] [-f output-file]\n",
+ "printlog [-x] [-f output-file]\n",
progname, usage_prefix);
return (1);
}
diff --git a/src/utilities/util_read.c b/src/utilities/util_read.c
index a2fcc330c7d..2e766377aa9 100644
--- a/src/utilities/util_read.c
+++ b/src/utilities/util_read.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_rebalance.c b/src/utilities/util_rebalance.c
new file mode 100644
index 00000000000..45f161487e5
--- /dev/null
+++ b/src/utilities/util_rebalance.c
@@ -0,0 +1,63 @@
+/*-
+ * Copyright (c) 2014-2016 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+#include "util.h"
+
+static int usage(void);
+
+int
+util_rebalance(WT_SESSION *session, int argc, char *argv[])
+{
+ WT_DECL_RET;
+ int ch;
+ char *name;
+
+ name = NULL;
+ while ((ch = __wt_getopt(progname, argc, argv, "")) != EOF)
+ switch (ch) {
+ case '?':
+ default:
+ return (usage());
+ }
+ argc -= __wt_optind;
+ argv += __wt_optind;
+
+ /* The remaining argument is the table name. */
+ if (argc != 1)
+ return (usage());
+ if ((name = util_name(session, *argv, "table")) == NULL)
+ return (1);
+
+ if ((ret = session->rebalance(session, name, NULL)) != 0) {
+ fprintf(stderr, "%s: rebalance(%s): %s\n",
+ progname, name, session->strerror(session, ret));
+ goto err;
+ }
+
+ /* Verbose configures a progress counter, move to the next line. */
+ if (verbose)
+ printf("\n");
+
+ if (0) {
+err: ret = 1;
+ }
+
+ free(name);
+
+ return (ret);
+}
+
+static int
+usage(void)
+{
+ (void)fprintf(stderr,
+ "usage: %s %s "
+ "rebalance uri\n",
+ progname, usage_prefix);
+ return (1);
+}
diff --git a/src/utilities/util_rename.c b/src/utilities/util_rename.c
index 29347690ccc..aee299c6e63 100644
--- a/src/utilities/util_rename.c
+++ b/src/utilities/util_rename.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_salvage.c b/src/utilities/util_salvage.c
index e791d2f1dda..679d1074457 100644
--- a/src/utilities/util_salvage.c
+++ b/src/utilities/util_salvage.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_stat.c b/src/utilities/util_stat.c
index b7558ee3be0..e511ca4f7e8 100644
--- a/src/utilities/util_stat.c
+++ b/src/utilities/util_stat.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_upgrade.c b/src/utilities/util_upgrade.c
index 0f2e655d1dd..63b23f28c16 100644
--- a/src/utilities/util_upgrade.c
+++ b/src/utilities/util_upgrade.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_verbose.c b/src/utilities/util_verbose.c
index 084cce3f610..e568ec0a414 100644
--- a/src/utilities/util_verbose.c
+++ b/src/utilities/util_verbose.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_verify.c b/src/utilities/util_verify.c
index 12f76e9d4ed..2df4fa65f43 100644
--- a/src/utilities/util_verify.c
+++ b/src/utilities/util_verify.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/src/utilities/util_write.c b/src/utilities/util_write.c
index 7871040411b..7d9bce02b36 100644
--- a/src/utilities/util_write.c
+++ b/src/utilities/util_write.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2014-2016 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c
index 2ad548ed18a..04fc8d1c371 100644
--- a/test/bloom/test_bloom.c
+++ b/test/bloom/test_bloom.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/checkpointer.c b/test/checkpoint/checkpointer.c
index c4f36ac69ba..ef49a9492ce 100644
--- a/test/checkpoint/checkpointer.c
+++ b/test/checkpoint/checkpointer.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -98,7 +98,7 @@ real_checkpointer(void)
"Checkpoint thread started stopped\n", EINVAL, 1));
while (g.ntables > g.ntables_created)
- sched_yield();
+ __wt_yield();
if ((ret = g.conn->open_session(g.conn, NULL, NULL, &session)) != 0)
return (log_print_err("conn.open_session", ret, 1));
diff --git a/test/checkpoint/test_checkpoint.c b/test/checkpoint/test_checkpoint.c
index 3131a30bba4..1914ad0188a 100644
--- a/test/checkpoint/test_checkpoint.c
+++ b/test/checkpoint/test_checkpoint.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/test_checkpoint.h b/test/checkpoint/test_checkpoint.h
index dd2426ef2f2..09edaeb84bc 100644
--- a/test/checkpoint/test_checkpoint.h
+++ b/test/checkpoint/test_checkpoint.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/checkpoint/workers.c b/test/checkpoint/workers.c
index b8ca5a37d2b..e4fe7bd1b29 100644
--- a/test/checkpoint/workers.c
+++ b/test/checkpoint/workers.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -195,7 +195,7 @@ real_worker(void)
goto err;
}
- for (i = 0; i < g.nops && g.running; ++i, sched_yield()) {
+ for (i = 0; i < g.nops && g.running; ++i, __wt_yield()) {
if ((ret = session->begin_transaction(session, NULL)) != 0) {
(void)log_print_err(
"real_worker:begin_transaction", ret, 1);
diff --git a/test/fops/file.c b/test/fops/file.c
index c2eb9593056..4cd92e7b590 100644
--- a/test/fops/file.c
+++ b/test/fops/file.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -45,7 +45,7 @@ obj_bulk(void)
testutil_die(ret, "session.create");
if (ret == 0) {
- sched_yield();
+ __wt_yield();
if ((ret = session->open_cursor(
session, uri, NULL, "bulk", &c)) == 0) {
if ((ret = c->close(c)) != 0)
@@ -78,7 +78,7 @@ obj_bulk_unique(int force)
if ((ret = session->create(session, new_uri, config)) != 0)
testutil_die(ret, "session.create: %s", new_uri);
- sched_yield();
+ __wt_yield();
if ((ret =
session->open_cursor(session, new_uri, NULL, "bulk", &c)) != 0)
testutil_die(ret, "session.open_cursor: %s", new_uri);
@@ -154,7 +154,7 @@ obj_create_unique(int force)
if ((ret = session->create(session, new_uri, config)) != 0)
testutil_die(ret, "session.create");
- sched_yield();
+ __wt_yield();
while ((ret = session->drop(
session, new_uri, force ? "force" : NULL)) != 0)
if (ret != EBUSY)
@@ -200,6 +200,23 @@ obj_checkpoint(void)
}
void
+obj_rebalance(void)
+{
+ WT_SESSION *session;
+ int ret;
+
+ if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
+ testutil_die(ret, "conn.session");
+
+ if ((ret = session->rebalance(session, uri, NULL)) != 0)
+ if (ret != ENOENT && ret != EBUSY)
+ testutil_die(ret, "session.rebalance");
+
+ if ((ret = session->close(session, NULL)) != 0)
+ testutil_die(ret, "session.close");
+}
+
+void
obj_upgrade(void)
{
WT_SESSION *session;
diff --git a/test/fops/fops.c b/test/fops/fops.c
index 0a83e8511f4..fbc9d9c6048 100644
--- a/test/fops/fops.c
+++ b/test/fops/fops.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -39,6 +39,7 @@ typedef struct {
int create_unique; /* session.create of new file */
int cursor; /* session.open_cursor */
int drop; /* session.drop */
+ int rebalance; /* session.rebalance */
int upgrade; /* session.upgrade */
int verify; /* session.verify */
} STATS;
@@ -102,12 +103,12 @@ fop(void *arg)
u_int i;
id = (uintptr_t)arg;
- sched_yield(); /* Get all the threads created. */
+ __wt_yield(); /* Get all the threads created. */
s = &run_stats[id];
__wt_random_init(&rnd);
- for (i = 0; i < nops; ++i, sched_yield())
+ for (i = 0; i < nops; ++i, __wt_yield())
switch (__wt_random(&rnd) % 9) {
case 0:
++s->bulk;
@@ -134,14 +135,18 @@ fop(void *arg)
obj_upgrade();
break;
case 6:
+ ++s->rebalance;
+ obj_rebalance();
+ break;
+ case 7:
++s->verify;
obj_verify();
break;
- case 7:
+ case 8:
++s->bulk_unique;
obj_bulk_unique(__wt_random(&rnd) & 1);
break;
- case 8:
+ case 9:
++s->create_unique;
obj_create_unique(__wt_random(&rnd) & 1);
break;
@@ -163,9 +168,10 @@ print_stats(u_int nthreads)
s = run_stats;
for (id = 0; id < nthreads; ++id, ++s)
printf(
- "%2d: bulk %3d, ckpt %3d, create %3d, cursor %3d, "
- "drop %3d, upg %3d, vrfy %3d\n",
+ "%2d:"
+ "\t" "bulk %3d, checkpoint %3d, create %3d, cursor %3d,\n"
+ "\t" "drop %3d, rebalance %3d, upgrade %3d, verify %3d\n",
id, s->bulk + s->bulk_unique, s->ckpt,
s->create + s->create_unique, s->cursor,
- s->drop, s->upgrade, s->verify);
+ s->drop, s->rebalance, s->upgrade, s->verify);
}
diff --git a/test/fops/t.c b/test/fops/t.c
index 12535f152fd..0881c23d7d4 100644
--- a/test/fops/t.c
+++ b/test/fops/t.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/fops/thread.h b/test/fops/thread.h
index 79c081592c1..f9707c14590 100644
--- a/test/fops/thread.h
+++ b/test/fops/thread.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -63,5 +63,6 @@ void obj_create(void);
void obj_create_unique(int);
void obj_cursor(void);
void obj_drop(int);
+void obj_rebalance(void);
void obj_upgrade(void);
void obj_verify(void);
diff --git a/test/format/Makefile.am b/test/format/Makefile.am
index 17cbd53222b..8a2e2b49e4b 100644
--- a/test/format/Makefile.am
+++ b/test/format/Makefile.am
@@ -9,7 +9,7 @@ noinst_PROGRAMS = t
noinst_SCRIPTS = s_dumpcmp
t_SOURCES =\
config.h format.h backup.c bulk.c compact.c config.c lrt.c ops.c \
- salvage.c t.c util.c wts.c
+ rebalance.c salvage.c t.c util.c wts.c
if HAVE_BERKELEY_DB
t_SOURCES += bdb.c
diff --git a/test/format/backup.c b/test/format/backup.c
index 5805012e1e0..748494bf841 100644
--- a/test/format/backup.c
+++ b/test/format/backup.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/bdb.c b/test/format/bdb.c
index fec23112549..d7b4bca62f2 100644
--- a/test/format/bdb.c
+++ b/test/format/bdb.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/bulk.c b/test/format/bulk.c
index 75a158af741..28189e25b65 100644
--- a/test/format/bulk.c
+++ b/test/format/bulk.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -52,23 +52,17 @@ wts_load(void)
/*
* No bulk load with data-sources.
*
- * XXX
- * No bulk load with in-memory configurations (currently, WiredTiger
- * fails in the column-store case unless you specify the key).
- *
* No bulk load with custom collators, the order of insertion will not
* match the collation order.
*/
is_bulk = true;
if (DATASOURCE("kvsbdb") && DATASOURCE("helium"))
is_bulk = false;
- if (g.c_in_memory)
- is_bulk = false;
if (g.c_reverse)
is_bulk = false;
if ((ret = session->open_cursor(session, g.uri, NULL,
- is_bulk ? "bulk" : NULL, &cursor)) != 0)
+ is_bulk ? "bulk,append" : NULL, &cursor)) != 0)
die(ret, "session.open_cursor");
/* Set up the key/value buffers. */
diff --git a/test/format/compact.c b/test/format/compact.c
index ad603504023..fdfa597e07e 100644
--- a/test/format/compact.c
+++ b/test/format/compact.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/config.c b/test/format/config.c
index 7aa4575efbd..866e210e556 100644
--- a/test/format/config.c
+++ b/test/format/config.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -327,10 +327,14 @@ config_in_memory(void)
g.c_backups = 0;
if (!config_is_perm("checkpoints"))
g.c_checkpoints = 0;
- if (!config_is_perm("compression"))
- g.c_compression = 0;
+ if (!config_is_perm("compression")) {
+ g.c_compression = dstrdup("none");
+ g.c_compression_flag = COMPRESS_NONE;
+ }
if (!config_is_perm("logging"))
g.c_logging = 0;
+ if (!config_is_perm("rebalance"))
+ g.c_rebalance = 0;
if (!config_is_perm("salvage"))
g.c_salvage = 0;
if (!config_is_perm("verify"))
@@ -496,7 +500,7 @@ config_clear(void)
F_CLR(cp, C_TEMP);
if (!F_ISSET(cp, C_PERM) &&
F_ISSET(cp, C_STRING) && cp->vstr != NULL) {
- free(*cp->vstr);
+ free((void *)*cp->vstr);
*cp->vstr = NULL;
}
}
@@ -561,7 +565,7 @@ config_single(const char *s, int perm)
&g.c_logging_compression_flag);
*cp->vstr = strdup(ep);
} else {
- free(*cp->vstr);
+ free((void *)*cp->vstr);
*cp->vstr = strdup(ep);
}
if (*cp->vstr == NULL)
diff --git a/test/format/config.h b/test/format/config.h
index a259217690c..a5190469c7f 100644
--- a/test/format/config.h
+++ b/test/format/config.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -263,8 +263,12 @@ static CONFIG c[] = {
"the number of runs",
C_IGNORE, 0, UINT_MAX, UINT_MAX, &g.c_runs, NULL },
+ { "rebalance",
+ "rebalance testing", /* 100% */
+ C_BOOL, 100, 1, 0, &g.c_rebalance, NULL },
+
{ "salvage",
- "verify integrity via salvage", /* 100% */
+ "salvage testing", /* 100% */
C_BOOL, 100, 1, 0, &g.c_salvage, NULL },
{ "split_pct",
diff --git a/test/format/format.h b/test/format/format.h
index 88300c28292..bf4d1c0a277 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -122,6 +122,8 @@ typedef struct {
char *helium_mount; /* Helium volume */
+ char wiredtiger_open_config[8 * 1024]; /* Database open config */
+
#ifdef HAVE_BERKELEY_DB
void *bdb; /* BDB comparison handle */
void *dbc; /* BDB cursor handle */
@@ -176,26 +178,26 @@ typedef struct {
uint32_t c_cache;
uint32_t c_compact;
uint32_t c_checkpoints;
- char *c_checksum;
+ char *c_checksum;
uint32_t c_chunk_size;
- char *c_compression;
- char *c_encryption;
- char *c_config_open;
+ char *c_compression;
+ char *c_encryption;
+ char *c_config_open;
uint32_t c_data_extend;
- char *c_data_source;
+ char *c_data_source;
uint32_t c_delete_pct;
uint32_t c_dictionary;
uint32_t c_direct_io;
uint32_t c_evict_max;
uint32_t c_firstfit;
- char *c_file_type;
+ char *c_file_type;
uint32_t c_huffman_key;
uint32_t c_huffman_value;
uint32_t c_in_memory;
uint32_t c_insert_pct;
uint32_t c_internal_key_truncation;
uint32_t c_intl_page_max;
- char *c_isolation;
+ char *c_isolation;
uint32_t c_key_gap;
uint32_t c_key_max;
uint32_t c_key_min;
@@ -203,7 +205,7 @@ typedef struct {
uint32_t c_leak_memory;
uint32_t c_logging;
uint32_t c_logging_archive;
- char *c_logging_compression;
+ char *c_logging_compression;
uint32_t c_logging_prealloc;
uint32_t c_long_running_txn;
uint32_t c_lsm_worker_threads;
@@ -216,6 +218,7 @@ typedef struct {
uint32_t c_reverse;
uint32_t c_rows;
uint32_t c_runs;
+ uint32_t c_rebalance;
uint32_t c_salvage;
uint32_t c_split_pct;
uint32_t c_statistics;
@@ -309,6 +312,7 @@ void config_print(int);
void config_setup(void);
void config_single(const char *, int);
void *dmalloc(size_t);
+char *dstrdup(const char *);
void fclose_and_clear(FILE **);
void key_gen(uint8_t *, size_t *, uint64_t);
void key_gen_insert(WT_RAND_STATE *, uint8_t *, size_t *, uint64_t);
@@ -328,6 +332,8 @@ void wts_load(void);
void wts_open(const char *, int, WT_CONNECTION **);
void wts_ops(int);
void wts_read_scan(void);
+void wts_rebalance(void);
+void wts_reopen(void);
void wts_salvage(void);
void wts_stats(void);
void wts_verify(const char *);
diff --git a/test/format/lrt.c b/test/format/lrt.c
index 85b6e29f224..b7392829d30 100644
--- a/test/format/lrt.c
+++ b/test/format/lrt.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/ops.c b/test/format/ops.c
index c705d362fe8..36d56df1505 100644
--- a/test/format/ops.c
+++ b/test/format/ops.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -504,7 +504,7 @@ skip_insert: if (col_update(tinfo,
*/
if (!insert) {
dir = (int)mmrand(&tinfo->rnd, 0, 1);
- for (np = 0; np < mmrand(&tinfo->rnd, 1, 8); ++np) {
+ for (np = 0; np < mmrand(&tinfo->rnd, 1, 100); ++np) {
if (notfound)
break;
if (nextprev(cursor, dir, &notfound))
diff --git a/test/format/rebalance.c b/test/format/rebalance.c
new file mode 100644
index 00000000000..8e8fa1a371f
--- /dev/null
+++ b/test/format/rebalance.c
@@ -0,0 +1,84 @@
+/*-
+ * Public Domain 2014-2016 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.
+ */
+
+#include "format.h"
+
+void
+wts_rebalance(void)
+{
+ WT_CONNECTION *conn;
+ WT_SESSION *session;
+ int ret;
+ char cmd[1024];
+
+ if (g.c_rebalance == 0)
+ return;
+
+ track("rebalance", 0ULL, NULL);
+
+ /* Dump the current object. */
+ (void)snprintf(cmd, sizeof(cmd),
+ "../../wt -h %s dump -f %s/rebalance.orig %s",
+ g.home, g.home, g.uri);
+ if ((ret = system(cmd)) != 0)
+ die(ret, "command failed: %s", cmd);
+
+ /* Rebalance, then verify the object. */
+ wts_reopen();
+ conn = g.wts_conn;
+ if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
+ die(ret, "connection.open_session");
+ if (g.logging != 0)
+ (void)g.wt_api->msg_printf(g.wt_api, session,
+ "=============== rebalance start ===============");
+
+ if ((ret = session->rebalance(session, g.uri, NULL)) != 0)
+ die(ret, "session.rebalance: %s: %s", g.uri);
+
+ if (g.logging != 0)
+ (void)g.wt_api->msg_printf(g.wt_api, session,
+ "=============== rebalance stop ===============");
+ if ((ret = session->close(session, NULL)) != 0)
+ die(ret, "session.close");
+
+ wts_verify("post-rebalance verify");
+ wts_close();
+
+ (void)snprintf(cmd, sizeof(cmd),
+ "../../wt -h %s dump -f %s/rebalance.new %s",
+ g.home, g.home, g.uri);
+ if ((ret = system(cmd)) != 0)
+ die(ret, "command failed: %s", cmd);
+
+ /* Compare the old/new versions of the object. */
+ (void)snprintf(cmd, sizeof(cmd),
+ "cmp %s/rebalance.orig %s/rebalance.new > /dev/null",
+ g.home, g.home);
+ if ((ret = system(cmd)) != 0)
+ die(ret, "command failed: %s", cmd);
+}
diff --git a/test/format/salvage.c b/test/format/salvage.c
index 33902525786..d0358e998b4 100644
--- a/test/format/salvage.c
+++ b/test/format/salvage.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/format/t.c b/test/format/t.c
index 603706e0ba1..37ba982c987 100644
--- a/test/format/t.c
+++ b/test/format/t.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -238,6 +238,11 @@ main(int argc, char *argv[])
wts_close();
/*
+ * Rebalance testing.
+ */
+ wts_rebalance();
+
+ /*
* If single-threaded, we can dump and compare the WiredTiger
* and Berkeley DB data sets.
*/
diff --git a/test/format/util.c b/test/format/util.c
index 88a41f2eef1..2b6b9d67fc3 100644
--- a/test/format/util.c
+++ b/test/format/util.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -50,7 +50,7 @@ dmalloc(size_t len)
* dstrdup --
* Call strdup, dying on failure.
*/
-static char *
+char *
dstrdup(const char *str)
{
char *p;
diff --git a/test/format/wts.c b/test/format/wts.c
index c1ea469d7b5..b75a0c793eb 100644
--- a/test/format/wts.c
+++ b/test/format/wts.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -132,12 +132,12 @@ wts_open(const char *home, int set_api, WT_CONNECTION **connp)
{
WT_CONNECTION *conn;
int ret;
- char config[4096], *end, *p;
+ char *config, *end, *p, helium_config[1024];
*connp = NULL;
- p = config;
- end = config + sizeof(config);
+ config = p = g.wiredtiger_open_config;
+ end = config + sizeof(g.wiredtiger_open_config);
p += snprintf(p, REMAIN(p, end),
"create,checkpoint_sync=false,cache_size=%" PRIu32 "MB",
@@ -257,22 +257,36 @@ wts_open(const char *home, int set_api, WT_CONNECTION **connp)
if (DATASOURCE("helium")) {
if (g.helium_mount == NULL)
die(EINVAL, "no Helium mount point specified");
- (void)snprintf(config, sizeof(config),
+ (void)snprintf(helium_config, sizeof(helium_config),
"entry=wiredtiger_extension_init,config=["
"helium_verbose=0,"
"dev1=[helium_devices=\"he://./%s\","
"helium_o_volume_truncate=1]]",
g.helium_mount);
- if ((ret =
- conn->load_extension(conn, HELIUM_PATH, config)) != 0)
+ if ((ret = conn->load_extension(
+ conn, HELIUM_PATH, helium_config)) != 0)
die(ret,
"WT_CONNECTION.load_extension: %s:%s",
- HELIUM_PATH, config);
+ HELIUM_PATH, helium_config);
}
*connp = conn;
}
/*
+ * wts_reopen --
+ * Re-open a connection to a WiredTiger database.
+ */
+void
+wts_reopen(void)
+{
+ int ret;
+
+ if ((ret = wiredtiger_open(g.home,
+ &event_handler, g.wiredtiger_open_config, &g.wts_conn)) != 0)
+ die(ret, "wiredtiger_open: %s", g.home);
+}
+
+/*
* wts_create --
* Create the underlying store.
*/
@@ -452,6 +466,8 @@ wts_close(void)
if ((ret = conn->close(conn, config)) != 0)
die(ret, "connection.close");
+ g.wts_conn = NULL;
+ g.wt_api = NULL;
}
void
diff --git a/test/huge/huge.c b/test/huge/huge.c
index 097dce16acb..d09f6f375fb 100644
--- a/test/huge/huge.c
+++ b/test/huge/huge.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/AsyncTest.java b/test/java/com/wiredtiger/test/AsyncTest.java
index 326a86b93cb..fc28e669313 100644
--- a/test/java/com/wiredtiger/test/AsyncTest.java
+++ b/test/java/com/wiredtiger/test/AsyncTest.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/AutoCloseTest.java b/test/java/com/wiredtiger/test/AutoCloseTest.java
index b55dbb0df03..d7304bb8a44 100644
--- a/test/java/com/wiredtiger/test/AutoCloseTest.java
+++ b/test/java/com/wiredtiger/test/AutoCloseTest.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/BackupCursorTest.java b/test/java/com/wiredtiger/test/BackupCursorTest.java
index c27b85619fc..dd25e4df7d6 100644
--- a/test/java/com/wiredtiger/test/BackupCursorTest.java
+++ b/test/java/com/wiredtiger/test/BackupCursorTest.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/ConfigTest.java b/test/java/com/wiredtiger/test/ConfigTest.java
new file mode 100644
index 00000000000..2afde7df2dc
--- /dev/null
+++ b/test/java/com/wiredtiger/test/ConfigTest.java
@@ -0,0 +1,192 @@
+/*-
+ * Public Domain 2014-2016 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/test/java/com/wiredtiger/test/CursorTest.java b/test/java/com/wiredtiger/test/CursorTest.java
index f332382dc34..4cd244e5b10 100644
--- a/test/java/com/wiredtiger/test/CursorTest.java
+++ b/test/java/com/wiredtiger/test/CursorTest.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/CursorTest02.java b/test/java/com/wiredtiger/test/CursorTest02.java
index 87eec66f71a..f107bf0b8f2 100644
--- a/test/java/com/wiredtiger/test/CursorTest02.java
+++ b/test/java/com/wiredtiger/test/CursorTest02.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/ExceptionTest.java b/test/java/com/wiredtiger/test/ExceptionTest.java
index b6330c62e0e..0c71ea4371b 100644
--- a/test/java/com/wiredtiger/test/ExceptionTest.java
+++ b/test/java/com/wiredtiger/test/ExceptionTest.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/PackTest.java b/test/java/com/wiredtiger/test/PackTest.java
index ed60db86d96..f24ca6e2def 100644
--- a/test/java/com/wiredtiger/test/PackTest.java
+++ b/test/java/com/wiredtiger/test/PackTest.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/PackTest02.java b/test/java/com/wiredtiger/test/PackTest02.java
index 63f4283710b..847e3c4ab08 100644
--- a/test/java/com/wiredtiger/test/PackTest02.java
+++ b/test/java/com/wiredtiger/test/PackTest02.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/PackTest03.java b/test/java/com/wiredtiger/test/PackTest03.java
index 2f19f3f8f04..c3ae854dcaf 100644
--- a/test/java/com/wiredtiger/test/PackTest03.java
+++ b/test/java/com/wiredtiger/test/PackTest03.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/java/com/wiredtiger/test/WiredTigerSuite.java b/test/java/com/wiredtiger/test/WiredTigerSuite.java
index a690b094323..5bd98d53fac 100644
--- a/test/java/com/wiredtiger/test/WiredTigerSuite.java
+++ b/test/java/com/wiredtiger/test/WiredTigerSuite.java
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -35,6 +35,7 @@ import org.junit.runners.Suite;
AsyncTest.class,
AutoCloseTest.class,
BackupCursorTest.class,
+ ConfigTest.class,
CursorTest.class,
CursorTest02.class,
ExceptionTest.class,
diff --git a/test/packing/intpack-test.c b/test/packing/intpack-test.c
index 361ee696b20..a48f9fc4fe4 100644
--- a/test/packing/intpack-test.c
+++ b/test/packing/intpack-test.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/packing/intpack-test2.c b/test/packing/intpack-test2.c
index 02df8447908..68f794f0bf5 100644
--- a/test/packing/intpack-test2.c
+++ b/test/packing/intpack-test2.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/packing/intpack-test3.c b/test/packing/intpack-test3.c
index 7005bda8546..2bce88c3568 100644
--- a/test/packing/intpack-test3.c
+++ b/test/packing/intpack-test3.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/packing/packing-test.c b/test/packing/packing-test.c
index 0c3eb78da02..1d2194bee50 100644
--- a/test/packing/packing-test.c
+++ b/test/packing/packing-test.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -43,7 +43,7 @@ check(const char *fmt, ...)
assert(__wt_struct_sizev(NULL, &len, fmt, ap) == 0);
va_end(ap);
- assert(len < sizeof(buf));
+ assert(len > 0 && len < sizeof(buf));
va_start(ap, fmt);
assert(__wt_struct_packv(NULL, buf, sizeof(buf), fmt, ap) == 0);
@@ -61,6 +61,7 @@ main(void)
check("iii", 0, 101, -99);
check("3i", 0, 101, -99);
check("iS", 42, "forty two");
+ check("s", "a big string");
#if 0
/* TODO: need a WT_ITEM */
check("u", r"\x42" * 20)
diff --git a/test/recovery/recovery.c b/test/recovery/recovery.c
index f7fbf76038b..5772865f030 100644
--- a/test/recovery/recovery.c
+++ b/test/recovery/recovery.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c
index a23c95c694c..c2ad6224b11 100644
--- a/test/salvage/salvage.c
+++ b/test/salvage/salvage.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -518,7 +518,7 @@ build(int ikey, int ivalue, int cnt)
}
CHECK(session->create(session, "file:" LOAD, config) == 0);
CHECK(session->open_cursor(
- session, "file:" LOAD, NULL, "bulk", &cursor) == 0);
+ session, "file:" LOAD, NULL, "bulk,append", &cursor) == 0);
for (; cnt > 0; --cnt, ++ikey, ++ivalue) {
switch (page_type) { /* Build the key. */
case WT_PAGE_COL_FIX:
diff --git a/test/suite/helper.py b/test/suite/helper.py
index 35803eaa843..3c460e23d08 100644
--- a/test/suite/helper.py
+++ b/test/suite/helper.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/run.py b/test/suite/run.py
index 5e7b76a79b9..f7f0d1399ff 100644
--- a/test/suite/run.py
+++ b/test/suite/run.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/suite_random.py b/test/suite/suite_random.py
index edb59b80e15..fd580cec43b 100644
--- a/test/suite/suite_random.py
+++ b/test/suite/suite_random.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/suite_subprocess.py b/test/suite/suite_subprocess.py
index 66381ed8a0d..df89d82e4c9 100644
--- a/test/suite/suite_subprocess.py
+++ b/test/suite/suite_subprocess.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_async01.py b/test/suite/test_async01.py
index fee5e8232f1..71a18a68121 100644
--- a/test/suite/test_async01.py
+++ b/test/suite/test_async01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -28,7 +28,7 @@
import sys, threading, wiredtiger, wttest
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, WiredTigerError
+from wiredtiger import WiredTigerError
from wtscenario import check_scenarios
# TODO - tmp code
@@ -132,18 +132,10 @@ class test_async01(wttest.WiredTigerTestCase, suite_subprocess):
('table-row', dict(tablekind='row',uri='table')),
])
- # Overrides WiredTigerTestCase so that we can configure
- # async operations.
- def setUpConnectionOpen(self, dir):
- self.home = dir
- conn_params = \
- 'create,error_prefix="%s: ",' % self.shortid() + \
- 'async=(enabled=true,ops_max=%s,' % self.async_ops + \
- 'threads=%s)' % self.async_threads
- sys.stdout.flush()
- conn = wiredtiger_open(dir, conn_params)
- self.pr(`conn`)
- return conn
+ # Enable async for this test.
+ def conn_config(self, dir):
+ return 'async=(enabled=true,ops_max=%s,' % self.async_ops + \
+ 'threads=%s)' % self.async_threads
def genkey(self, i):
if self.tablekind == 'row':
diff --git a/test/suite/test_async02.py b/test/suite/test_async02.py
index c878e8dd114..7aa1b85a2f3 100644
--- a/test/suite/test_async02.py
+++ b/test/suite/test_async02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -28,15 +28,9 @@
import sys, threading, wiredtiger, wttest
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, WiredTigerError
+from wiredtiger import WiredTigerError
from wtscenario import check_scenarios
-# TODO - tmp code
-def tty_pr(s):
- o = open('/dev/tty', 'w')
- o.write(s + '\n')
- o.close()
-
class Callback(wiredtiger.AsyncCallback):
def __init__(self, current):
self.current = current
@@ -49,7 +43,7 @@ class Callback(wiredtiger.AsyncCallback):
self.lock = threading.RLock()
def notify_error(self, key, value, optype, exp, desc):
- tty_pr('ERROR: notify(' + str(key) + ',' + str(value) + ',' +
+ self.tty('ERROR: notify(' + str(key) + ',' + str(value) + ',' +
str(optype) + '): ' + 'Expected: ' + str(exp) + ' ' + desc)
def notify(self, op, op_ret, flags):
@@ -105,7 +99,7 @@ class Callback(wiredtiger.AsyncCallback):
self.nerror += 1
self.lock.release()
except (BaseException) as err:
- tty_pr('ERROR: exception in notify: ' + str(err))
+ self.tty('ERROR: exception in notify: ' + str(err))
raise
return 0
@@ -135,18 +129,10 @@ class test_async02(wttest.WiredTigerTestCase, suite_subprocess):
('table-row', dict(tablekind='row',uri='table')),
])
- # Overrides WiredTigerTestCase so that we can configure
- # async operations.
- def setUpConnectionOpen(self, dir):
- self.home = dir
- conn_params = \
- 'create,error_prefix="%s: ",' % self.shortid() + \
- 'async=(enabled=true,ops_max=%s,' % self.async_ops + \
- 'threads=%s)' % self.async_threads
- sys.stdout.flush()
- conn = wiredtiger_open(dir, conn_params)
- self.pr(`conn`)
- return conn
+ # Enable async for this test.
+ def conn_config(self, dir):
+ return 'async=(enabled=true,ops_max=%s,' % self.async_ops + \
+ 'threads=%s)' % self.async_threads
def genkey(self, i):
if self.tablekind == 'row':
diff --git a/test/suite/test_async03.py b/test/suite/test_async03.py
index ea62f8c525b..41939bb578a 100644
--- a/test/suite/test_async03.py
+++ b/test/suite/test_async03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -26,7 +26,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
-from wiredtiger import wiredtiger_open, WiredTigerError
+from wiredtiger import WiredTigerError
import sys, threading, wiredtiger, wttest
class Callback(wiredtiger.AsyncCallback):
@@ -47,19 +47,9 @@ class test_async03(wttest.WiredTigerTestCase):
"""
table_name1 = 'test_async03'
- # Overrides WiredTigerTestCase so that we can configure
- # async operations.
- def setUpConnectionOpen(self, dir):
- self.home = dir
- # Note: this usage is intentionally wrong,
- # it is missing async=(enabled=true,...
- conn_params = \
- 'create,error_prefix="%s: ",' % self.shortid() + \
- 'async=(ops_max=50,threads=3)' # missing enabled=true !
- sys.stdout.flush()
- conn = wiredtiger_open(dir, conn_params)
- self.pr(`conn`)
- return conn
+ # Note: this usage is intentionally wrong, it is missing
+ # async=(enabled=true,...
+ conn_config = 'async=(ops_max=50,threads=3)'
def test_ops(self):
tablearg = 'table:' + self.table_name1
diff --git a/test/suite/test_autoclose.py b/test/suite/test_autoclose.py
index 166e4190283..c5633d5a21e 100644
--- a/test/suite/test_autoclose.py
+++ b/test/suite/test_autoclose.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_backup01.py b/test/suite/test_backup01.py
index f6e9cd87291..92d39514440 100644
--- a/test/suite/test_backup01.py
+++ b/test/suite/test_backup01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -98,7 +98,7 @@ class test_backup(wttest.WiredTigerTestCase, suite_subprocess):
# Check that a URI doesn't exist, both the meta-data and the file names.
def confirmPathDoesNotExist(self, uri):
- conn = wiredtiger.wiredtiger_open(self.dir)
+ conn = self.wiredtiger_open(self.dir)
session = conn.open_session()
self.assertRaises(wiredtiger.WiredTigerError,
lambda: session.open_cursor(uri, None, None))
diff --git a/test/suite/test_backup02.py b/test/suite/test_backup02.py
index 79044e04986..095bfbe404a 100644
--- a/test/suite/test_backup02.py
+++ b/test/suite/test_backup02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_backup03.py b/test/suite/test_backup03.py
index 880469c2486..e810a2ec714 100644
--- a/test/suite/test_backup03.py
+++ b/test/suite/test_backup03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -75,13 +75,8 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess):
]
scenarios = number_scenarios(multiply_scenarios('.', list))
-
# Create a large cache, otherwise this test runs quite slowly.
- def setUpConnectionOpen(self, dir):
- wtopen_args = 'create,cache_size=1G'
- conn = wiredtiger.wiredtiger_open(dir, wtopen_args)
- self.pr(`conn`)
- return conn
+ conn_config = 'cache_size=1G'
# Populate a set of objects.
def populate(self):
@@ -102,7 +97,7 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess):
# Check that a URI doesn't exist, both the meta-data and the file names.
def confirmPathDoesNotExist(self, uri):
- conn = wiredtiger.wiredtiger_open(self.dir)
+ conn = self.wiredtiger_open(self.dir)
session = conn.open_session()
self.assertRaises(wiredtiger.WiredTigerError,
lambda: session.open_cursor(uri, None, None))
diff --git a/test/suite/test_backup04.py b/test/suite/test_backup04.py
index a0a52f49817..852a22c1e0c 100644
--- a/test/suite/test_backup04.py
+++ b/test/suite/test_backup04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -59,13 +59,9 @@ class test_backup_target(wttest.WiredTigerTestCase, suite_subprocess):
])
# Create a large cache, otherwise this test runs quite slowly.
- def setUpConnectionOpen(self, dir):
- wtopen_args = \
- 'create,cache_size=1G,log=(archive=false,enabled,file_max=%s)' % \
+ def conn_config(self, dir):
+ return 'cache_size=1G,log=(archive=false,enabled,file_max=%s)' % \
self.logmax
- conn = wiredtiger.wiredtiger_open(dir, wtopen_args)
- self.pr(`conn`)
- return conn
def populate(self, uri, dsize, rows):
self.pr('populate: ' + uri + ' with ' + str(rows) + ' rows')
diff --git a/test/suite/test_backup05.py b/test/suite/test_backup05.py
index 8ab329f761a..8b176d0f7d7 100644
--- a/test/suite/test_backup05.py
+++ b/test/suite/test_backup05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -35,7 +35,6 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
from helper import copy_wiredtiger_home
import wttest
diff --git a/test/suite/test_base01.py b/test/suite/test_base01.py
index 8d4c03e2bda..2a5f96cbae2 100644
--- a/test/suite/test_base01.py
+++ b/test/suite/test_base01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_base02.py b/test/suite/test_base02.py
index 491899fd0ed..70117573241 100644
--- a/test/suite/test_base02.py
+++ b/test/suite/test_base02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_base03.py b/test/suite/test_base03.py
index 6a9a53112b9..fe6fa53c288 100644
--- a/test/suite/test_base03.py
+++ b/test/suite/test_base03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_base04.py b/test/suite/test_base04.py
index feb68bf8a08..973ee1327a5 100644
--- a/test/suite/test_base04.py
+++ b/test/suite/test_base04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_base05.py b/test/suite/test_base05.py
index 7d5ff59b2c9..f191f23561f 100644
--- a/test/suite/test_base05.py
+++ b/test/suite/test_base05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_baseconfig.py b/test/suite/test_baseconfig.py
index 6ac3654af11..89b3b29544e 100644
--- a/test/suite/test_baseconfig.py
+++ b/test/suite/test_baseconfig.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -35,7 +35,7 @@ class test_baseconfig(wttest.WiredTigerTestCase):
def test_baseconfig(self):
# Open up another database and modify the baseconfig
os.mkdir("A")
- conn = wiredtiger.wiredtiger_open("A", 'create')
+ conn = self.wiredtiger_open("A", 'create')
self.assertTrue(os.path.exists("A/WiredTiger.basecfg"))
with open("A/WiredTiger.basecfg", "a") as basecfg_file:
basecfg_file.write("foo!")
@@ -44,10 +44,10 @@ class test_baseconfig(wttest.WiredTigerTestCase):
# Open a database, we should assert here as the basecfg is invalid
self.assertRaisesWithMessage(
wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open("A", ''),
+ lambda: self.wiredtiger_open("A", ''),
'/unknown configuration key/')
- conn = wiredtiger.wiredtiger_open("A", "create,config_base=false")
+ conn = self.wiredtiger_open("A", "create,config_base=false")
conn.close()
if __name__ == '__main__':
diff --git a/test/suite/test_bug001.py b/test/suite/test_bug001.py
index 08177369309..79ade05d2c7 100644
--- a/test/suite/test_bug001.py
+++ b/test/suite/test_bug001.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug003.py b/test/suite/test_bug003.py
index e4a2196e7d8..739279a0141 100644
--- a/test/suite/test_bug003.py
+++ b/test/suite/test_bug003.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug004.py b/test/suite/test_bug004.py
index 5f8d35f2404..a8b9a0a0dde 100644
--- a/test/suite/test_bug004.py
+++ b/test/suite/test_bug004.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug005.py b/test/suite/test_bug005.py
index 3e06bea8694..6e888c3b00b 100644
--- a/test/suite/test_bug005.py
+++ b/test/suite/test_bug005.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug006.py b/test/suite/test_bug006.py
index fbf83b84e7f..e522cdf96f7 100644
--- a/test/suite/test_bug006.py
+++ b/test/suite/test_bug006.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -58,9 +58,6 @@ class test_bug006(wttest.WiredTigerTestCase):
self.assertRaises(
wiredtiger.WiredTigerError, lambda: self.session.salvage(uri, None))
self.assertRaises(
- wiredtiger.WiredTigerError,
- lambda: self.session.truncate(uri, None, None, None))
- self.assertRaises(
wiredtiger.WiredTigerError, lambda: self.session.upgrade(uri, None))
self.assertRaises(
wiredtiger.WiredTigerError, lambda: self.session.verify(uri, None))
diff --git a/test/suite/test_bug007.py b/test/suite/test_bug007.py
index 8a10175d28b..1add6512df3 100644
--- a/test/suite/test_bug007.py
+++ b/test/suite/test_bug007.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug008.py b/test/suite/test_bug008.py
index 75cbd989cd1..8f0526d9cef 100644
--- a/test/suite/test_bug008.py
+++ b/test/suite/test_bug008.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug009.py b/test/suite/test_bug009.py
index 6f66674944a..4d10e4391d9 100644
--- a/test/suite/test_bug009.py
+++ b/test/suite/test_bug009.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug010.py b/test/suite/test_bug010.py
index 0266cb82446..89f21e1da04 100644
--- a/test/suite/test_bug010.py
+++ b/test/suite/test_bug010.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -39,14 +39,9 @@ class test_bug010(wttest.WiredTigerTestCase):
uri = 'table:' + name
num_tables = 1000
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
- # Disable checkpoint sync, to make checkpoints faster and
- # increase the likelyhood of triggering the symptom
- conn_params = ',create,checkpoint_sync=false'
- conn = wiredtiger.wiredtiger_open(dir, conn_params)
- return conn
+ # Disable checkpoint sync, to make checkpoints faster and
+ # increase the likelyhood of triggering the symptom
+ conn_config = 'checkpoint_sync=false'
def test_checkpoint_dirty(self):
# Create a lot of tables
diff --git a/test/suite/test_bug011.py b/test/suite/test_bug011.py
index b93fc3a75b7..50dba1c48be 100644
--- a/test/suite/test_bug011.py
+++ b/test/suite/test_bug011.py
@@ -1,6 +1,6 @@
#!usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -40,15 +40,9 @@ class test_bug011(wttest.WiredTigerTestCase):
ntables = 50
nrows = 10000
nops = 10000
-
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
- conn_params = 'create,cache_size=10MB,' \
- 'hazard_max=' + str(self.ntables / 2)
- conn = wiredtiger.wiredtiger_open(dir, conn_params)
- self.pr(`conn`)
- return conn
+ # Add connection configuration for this test.
+ def conn_config(self, dir):
+ return 'cache_size=10MB,hazard_max=' + str(self.ntables / 2)
def test_eviction(self):
cursors = []
diff --git a/test/suite/test_bug012.py b/test/suite/test_bug012.py
index 921940df255..a28834f36d2 100644
--- a/test/suite/test_bug012.py
+++ b/test/suite/test_bug012.py
@@ -1,6 +1,6 @@
#!usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug013.py b/test/suite/test_bug013.py
index e22e21b5eeb..a42809aea5f 100644
--- a/test/suite/test_bug013.py
+++ b/test/suite/test_bug013.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug014.py b/test/suite/test_bug014.py
index 4df5f39d89f..c951cb45293 100644
--- a/test/suite/test_bug014.py
+++ b/test/suite/test_bug014.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bug015.py b/test/suite/test_bug015.py
index 65b5b8e1755..7892f66759d 100644
--- a/test/suite/test_bug015.py
+++ b/test/suite/test_bug015.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_bulk01.py b/test/suite/test_bulk01.py
index 4c8747033d2..1add11af26b 100644
--- a/test/suite/test_bulk01.py
+++ b/test/suite/test_bulk01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -60,36 +60,126 @@ class test_bulk_load(wttest.WiredTigerTestCase):
self.session.create(uri,
'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
cursor = self.session.open_cursor(uri, None, "bulk")
- for i in range(1, 100):
+ for i in range(1, 1000):
cursor[key_populate(cursor, i)] = value_populate(cursor, i)
+
+ # Test a bulk-load triggers variable-length column-store RLE correctly.
+ def test_bulk_load_var_rle(self):
+ if self.keyfmt != 'r' or self.valfmt == '8t':
+ return
+
+ # We can't directly test RLE, it's internal to WiredTiger. However,
+ # diagnostic builds catch records that should have been RLE compressed,
+ # but weren't, so setting matching values should be sufficient.
+ uri = self.type + self.name
+ self.session.create(uri,
+ 'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
+ cursor = self.session.open_cursor(uri, None, "bulk")
+ for i in range(1, 1000):
+ cursor[key_populate(cursor, i)] = value_populate(cursor, i/7)
+
+ # Test a bulk-load variable-length column-store append ignores any key.
+ def test_bulk_load_var_append(self):
+ if self.keyfmt != 'r':
+ return
+
+ uri = self.type + self.name
+ self.session.create(uri,
+ 'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
+ cursor = self.session.open_cursor(uri, None, "bulk,append")
+ for i in range(1, 1000):
+ cursor[key_populate(cursor, 37)] = value_populate(cursor, i)
cursor.close()
+ cursor = self.session.open_cursor(uri, None, None)
+ for i in range(1, 1000):
+ cursor.set_key(key_populate(cursor, i))
+ cursor.search()
+ self.assertEqual(cursor.get_value(), value_populate(cursor, i))
+ # Test that column-store bulk-load handles skipped records correctly.
+ def test_bulk_load_col_delete(self):
+ if self.keyfmt != 'r':
+ return
-# Test that out-of-order insert in a row-store fails by default, but
-# works if key order validation is turned off.
-class test_bulk_load_row_order(wttest.WiredTigerTestCase):
- name = 'test_bulk'
+ uri = self.type + self.name
+ self.session.create(uri,
+ 'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
+ cursor = self.session.open_cursor(uri, None, "bulk")
+ for i in range(1, 1000):
+ if i % 7 == 0:
+ cursor[key_populate(cursor, i)] = value_populate(cursor, i)
- scenarios = check_scenarios([
- ('file', dict(type='file:')),
- ('table', dict(type='table:'))
- ])
+ # Ensure we create all the missing records.
+ i = i + 1
+ cursor[key_populate(cursor, i)] = value_populate(cursor, i)
+
+ cursor.close()
+ cursor = self.session.open_cursor(uri, None, None)
+
+ # Verify all the records are there, in their proper state.
+ for i in range(1, 1000):
+ cursor.set_key(key_populate(cursor, i))
+ if i % 7 == 0:
+ cursor.search()
+ self.assertEqual(cursor.get_value(), value_populate(cursor, i))
+ elif cursor.value_format == '8t':
+ cursor.search()
+ self.assertEqual(cursor.get_value(), 0)
+ else:
+ self.assertEqual(cursor.search(), wiredtiger.WT_NOTFOUND)
+
+ # Test that variable-length column-store bulk-load efficiently creates big
+ # records.
+ def test_bulk_load_col_big(self):
+ if self.keyfmt != 'r' or self.valfmt == '8t':
+ return
- def test_bulk_load_row_order_check(self):
uri = self.type + self.name
- self.session.create(uri, 'key_format=S,value_format=S')
+ self.session.create(uri,
+ 'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
+ cursor = self.session.open_cursor(uri, None, "bulk")
+ for i in range(1, 10):
+ cursor[key_populate(cursor, i)] = value_populate(cursor, i)
+
+ # A big record -- if it's not efficient, we'll just hang.
+ big = 18446744073709551606
+ cursor[key_populate(cursor, big)] = value_populate(cursor, big)
+
+ cursor.close()
+ cursor = self.session.open_cursor(uri, None, None)
+ cursor.set_key(key_populate(cursor, big))
+ cursor.search()
+ self.assertEqual(cursor.get_value(), value_populate(cursor, big))
+
+ # Test that bulk-load out-of-order fails.
+ def test_bulk_load_order_check(self):
+ uri = self.type + self.name
+ self.session.create(uri,
+ 'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
cursor = self.session.open_cursor(uri, None, "bulk")
cursor[key_populate(cursor, 10)] = value_populate(cursor, 10)
- cursor.set_key(key_populate(cursor, 1))
- cursor.set_value(value_populate(cursor, 1))
- msg = '/compares smaller than previously inserted key/'
- self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: cursor.insert(), msg)
+ for i in [1, 9, 10]:
+ cursor.set_key(key_populate(cursor, 1))
+ cursor.set_value(value_populate(cursor, 1))
+ msg = '/than previously inserted key/'
+ self.assertRaisesWithMessage(
+ wiredtiger.WiredTigerError, lambda: cursor.insert(), msg)
+ cursor[key_populate(cursor, 11)] = value_populate(cursor, 11)
+
+ # Test that row-store bulk-load out-of-order can succeed.
def test_bulk_load_row_order_nocheck(self):
+ # Row-store offers an optional fast-past that skips the relatively
+ # expensive key-order checks, used when the input is known to be
+ # correct. Column-store comparisons are cheap, so it doesn't have
+ # that fast-path support.
+ if self.keyfmt != 'S':
+ return
+
uri = self.type + self.name
- self.session.create(uri, 'key_format=S,value_format=S')
+ self.session.create(uri,
+ 'key_format=' + self.keyfmt + ',value_format=' + self.valfmt)
cursor = self.session.open_cursor(uri, None, "bulk,skip_sort_check")
cursor[key_populate(cursor, 10)] = value_populate(cursor, 10)
cursor[key_populate(cursor, 1)] = value_populate(cursor, 1)
@@ -102,16 +192,7 @@ class test_bulk_load_row_order(wttest.WiredTigerTestCase):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: self.conn.close(), msg)
-
-# Test that inserting into the file blocks a subsequent bulk-load.
-class test_bulk_load_not_empty(wttest.WiredTigerTestCase):
- name = 'test_bulk'
-
- scenarios = check_scenarios([
- ('file', dict(type='file:')),
- ('table', dict(type='table:'))
- ])
-
+ # Test bulk-load only permitted on newly created objects.
def test_bulk_load_not_empty(self):
uri = self.type + self.name
self.session.create(uri, 'key_format=S,value_format=S')
@@ -123,6 +204,7 @@ class test_bulk_load_not_empty(wttest.WiredTigerTestCase):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: self.session.open_cursor(uri, None, "bulk"), msg)
+ # Test that bulk-load objects cannot be opened by other cursors.
def test_bulk_load_busy(self):
uri = self.type + self.name
self.session.create(uri, 'key_format=S,value_format=S')
diff --git a/test/suite/test_bulk02.py b/test/suite/test_bulk02.py
index 4af1314c0d8..eeca6a56967 100644
--- a/test/suite/test_bulk02.py
+++ b/test/suite/test_bulk02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -104,7 +104,7 @@ class test_bulkload_backup(wttest.WiredTigerTestCase, suite_subprocess):
self.backup(backupdir, session)
# Open the target directory, and confirm the object has no contents.
- conn = wiredtiger.wiredtiger_open(backupdir)
+ conn = self.wiredtiger_open(backupdir)
session = conn.open_session()
cursor = session.open_cursor(self.uri, None, None)
self.assertEqual(cursor.next(), wiredtiger.WT_NOTFOUND)
diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py
index 799e6ded1ea..7d4503b84b7 100644
--- a/test/suite/test_checkpoint01.py
+++ b/test/suite/test_checkpoint01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_checkpoint02.py b/test/suite/test_checkpoint02.py
index cf625493f7c..71c8792359c 100644
--- a/test/suite/test_checkpoint02.py
+++ b/test/suite/test_checkpoint02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_colgap.py b/test/suite/test_colgap.py
index 4192f14c5e6..46682c23167 100644
--- a/test/suite/test_colgap.py
+++ b/test/suite/test_colgap.py
@@ -1,6 +1,6 @@
#!usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -28,6 +28,7 @@
import wiredtiger, wttest
from helper import simple_populate, key_populate, value_populate
+from wtscenario import check_scenarios, multiply_scenarios, number_scenarios
# test_colgap.py
# Test variable-length column-store gap performance.
@@ -119,5 +120,90 @@ class test_column_store_gap(wttest.WiredTigerTestCase):
self.backward(cursor, list(reversed(v)))
+# Basic testing of variable-length column-store with big records.
+class test_colmax(wttest.WiredTigerTestCase):
+ name = 'test_colmax'
+
+ types = [
+ ('file', dict(type='file:')),
+ ('table', dict(type='table:'))
+ ]
+ valfmt = [
+ ('integer', dict(valfmt='i')),
+ ('string', dict(valfmt='S')),
+ ]
+ record_number = [
+ ('big', dict(recno=18446744073709551606)),
+ ('max', dict(recno=18446744073709551615)),
+ ]
+ bulk = [
+ ('bulk', dict(bulk=1)),
+ ('not-bulk', dict(bulk=0)),
+ ]
+ reopen = [
+ ('reopen', dict(reopen=1)),
+ ('not-reopen', dict(reopen=0)),
+ ]
+ single = [
+ ('single', dict(single=1)),
+ ('not-single', dict(single=0)),
+ ]
+
+ scenarios = number_scenarios(multiply_scenarios(\
+ '.', types, valfmt, record_number, bulk, reopen, single))
+
+ # Test that variable-length column-store correctly/efficiently handles big
+ # records (if it's not efficient, we'll just hang).
+ def test_colmax_op(self):
+ recno = self.recno
+
+ uri = self.type + self.name
+ self.session.create(uri, 'key_format=r' +',value_format=' + self.valfmt)
+
+ # Insert a big record with/without a bulk cursor.
+ bulk_config = ""
+ if self.bulk:
+ bulk_config = "bulk"
+ cursor = self.session.open_cursor(uri, None, bulk_config)
+
+ # Optionaly make the big record the only record in the table.
+ if not self.single:
+ for i in range(1, 723):
+ cursor[key_populate(cursor, i)] = value_populate(cursor, i)
+
+ # Confirm searching past the end of the table works.
+ if not self.bulk:
+ cursor.set_key(recno)
+ self.assertEqual(cursor.search(), wiredtiger.WT_NOTFOUND)
+
+ # Insert the big record.
+ cursor[key_populate(cursor, recno)] = value_populate(cursor, recno)
+
+ # Optionally flush to disk; re-open the cursor as necessary.
+ if self.bulk or self.reopen:
+ cursor.close()
+ if self.reopen == 1:
+ self.reopen_conn()
+ if self.bulk or self.reopen:
+ cursor = self.session.open_cursor(uri, None, None)
+
+ # Search for the large record.
+ cursor.set_key(recno)
+ self.assertEqual(cursor.search(), 0)
+ self.assertEqual(cursor.get_value(), value_populate(cursor, recno))
+
+ # Update it.
+ cursor[key_populate(cursor, recno)] = value_populate(cursor, 37)
+ cursor.set_key(recno)
+ self.assertEqual(cursor.search(), 0)
+ self.assertEqual(cursor.get_value(), value_populate(cursor, 37))
+
+ # Remove it.
+ cursor.set_key(recno)
+ self.assertEqual(cursor.remove(), 0)
+ cursor.set_key(key_populate(cursor, recno))
+ self.assertEqual(cursor.search(), wiredtiger.WT_NOTFOUND)
+
+
if __name__ == '__main__':
wttest.run()
diff --git a/test/suite/test_compact.py b/test/suite/test_compact01.py
index c7269785115..3af550708ed 100644
--- a/test/suite/test_compact.py
+++ b/test/suite/test_compact01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -54,14 +54,9 @@ class test_compact(wttest.WiredTigerTestCase, suite_subprocess):
('utility', dict(utility=1,reopen=0)),
]
scenarios = number_scenarios(multiply_scenarios('.', types, compact))
-
- # Override WiredTigerTestCase, we want a large cache so that eviction
- # doesn't happen (which could skew our compaction results).
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,cache_size=250MB,statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ # We want a large cache so that eviction doesn't happen
+ # (which could skew our compaction results).
+ conn_config = 'cache_size=250MB,statistics=(all)'
# Test compaction.
def test_compact(self):
diff --git a/test/suite/test_compact02.py b/test/suite/test_compact02.py
new file mode 100644
index 00000000000..14781b0f050
--- /dev/null
+++ b/test/suite/test_compact02.py
@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2016 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_compact02.py
+# Test that compact reduces the file size.
+#
+
+import wiredtiger, wttest
+from wiredtiger import stat
+from wtscenario import multiply_scenarios, number_scenarios
+
+# Test basic compression
+class test_compact02(wttest.WiredTigerTestCase):
+
+ types = [
+ ('file', dict(uri='file:test_compact02')),
+ ]
+ cacheSize = [
+ ('default', dict(cacheSize='')),
+ ('1mb', dict(cacheSize='cache_size=1MB')),
+ ('10gb', dict(cacheSize='cache_size=10GB')),
+ ]
+
+ # There's a balance between the pages we create and the size of the records
+ # being stored: compaction doesn't work on tables with many overflow items
+ # because we don't rewrite them. Experimentally, 8KB is as small as the test
+ # can go. Additionally, we can't set the maximum page size too large because
+ # there won't be enough pages to rewrite. Experimentally, 32KB (the default)
+ # is as large as the test can go.
+ fileConfig = [
+ ('default', dict(fileConfig='')),
+ ('8KB', dict(fileConfig='leaf_page_max=8kb')),
+ ]
+ scenarios = \
+ number_scenarios(multiply_scenarios('.', types, cacheSize, fileConfig))
+
+ # We want about 22K records that total about 130Mb. That is an average
+ # of 6196 bytes per record. Half the records should be smaller, about
+ # 2700 bytes (about 30Mb) and the other half should be larger, 9666 bytes
+ # per record (about 100Mb).
+ #
+ # Test flow is as follows.
+ #
+ # 1. Create a table with the data, alternating record size.
+ # 2. Checkpoint and get stats on the table to confirm the size.
+ # 3. Delete the half of the records with the larger record size.
+ # 4. Call compact.
+ # 5. Get stats on compacted table.
+ #
+ nrecords = 22000
+ bigvalue = "abcdefghi" * 1074 # 9*1074 == 9666
+ smallvalue = "ihgfedcba" * 303 # 9*303 == 2727
+
+ fullsize = nrecords / 2 * len(bigvalue) + nrecords / 2 * len(smallvalue)
+
+ # Return the size of the file
+ def getSize(self):
+ cstat = self.session.open_cursor(
+ 'statistics:' + self.uri, None, 'statistics=(size)')
+ sz = cstat[stat.dsrc.block_size][2]
+ cstat.close()
+ return sz
+
+ # This test varies the cache size and so needs to set up its own connection.
+ # Override the standard methods.
+ def setUpConnectionOpen(self, dir):
+ return None
+ def setUpSessionOpen(self, conn):
+ return None
+ def ConnectionOpen(self, cacheSize):
+ self.home = '.'
+ conn_params = 'create,' + \
+ cacheSize + ',error_prefix="%s: ",' % self.shortid() + \
+ 'statistics=(fast)'
+ try:
+ self.conn = wiredtiger.wiredtiger_open(self.home, conn_params)
+ except wiredtiger.WiredTigerError as e:
+ print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
+ self.session = self.conn.open_session(None)
+
+ # Create a table, add keys with both big and small values.
+ def test_compact02(self):
+ self.ConnectionOpen(self.cacheSize)
+
+ mb = 1024 * 1024
+ params = 'key_format=i,value_format=S,' + self.fileConfig
+
+ # 1. Create a table with the data, alternating record size.
+ self.session.create(self.uri, params)
+ c = self.session.open_cursor(self.uri, None)
+ for i in range(self.nrecords):
+ if i % 2 == 0:
+ c[i] = str(i) + self.bigvalue
+ else:
+ c[i] = str(i) + self.smallvalue
+ c.close()
+
+ # 2. Checkpoint and get stats on the table to confirm the size.
+ self.session.checkpoint()
+ sz = self.getSize()
+ self.pr('After populate ' + str(sz / mb) + 'MB')
+ self.assertGreater(sz, self.fullsize)
+
+ # 3. Delete the half of the records with the larger record size.
+ c = self.session.open_cursor(self.uri, None)
+ count = 0
+ for i in range(self.nrecords):
+ if i % 2 == 0:
+ count += 1
+ c.set_key(i)
+ c.remove()
+ c.close()
+ self.pr('Removed total ' + str((count * 9666) / mb) + 'MB')
+
+ # 4. Call compact.
+ self.session.compact(self.uri, None)
+
+ # 5. Get stats on compacted table.
+ sz = self.getSize()
+ self.pr('After compact ' + str(sz / mb) + 'MB')
+
+ # After compact, the file size should be less than half the full size.
+ self.assertLess(sz, self.fullsize / 2)
+
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/test/suite/test_compress01.py b/test/suite/test_compress01.py
index 17d87403a0f..e97953a53cd 100644
--- a/test/suite/test_compress01.py
+++ b/test/suite/test_compress01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -52,13 +52,9 @@ class test_compress01(wttest.WiredTigerTestCase):
nrecords = 10000
bigvalue = "abcdefghij" * 1000
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open( dir, 'create,' +
- ('error_prefix="%s: ",' % self.shortid()) +
- self.extensionArg(self.compress))
- self.pr(`conn`)
- return conn
+ # Load the compression extension, compression is enabled elsewhere.
+ def conn_config(self, dir):
+ return self.extensionArg(self.compress)
# Return the wiredtiger_open extension argument for a shared library.
def extensionArg(self, name):
diff --git a/test/suite/test_config01.py b/test/suite/test_config01.py
index f40f9df3b20..cbcb6835525 100644
--- a/test/suite/test_config01.py
+++ b/test/suite/test_config01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -41,7 +41,7 @@ class test_config01(test_base03.test_base03):
wtopen_args = 'create'
if hasattr(self, 'cache_size'):
wtopen_args += ',cache_size=' + str(self.cache_size)
- conn = wiredtiger.wiredtiger_open(dir, wtopen_args)
+ conn = self.wiredtiger_open(dir, wtopen_args)
self.pr(`conn`)
return conn
diff --git a/test/suite/test_config02.py b/test/suite/test_config02.py
index 53c9989eb5d..112a93ef2e0 100644
--- a/test/suite/test_config02.py
+++ b/test/suite/test_config02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -82,7 +82,7 @@ class test_config02(wttest.WiredTigerTestCase):
else:
os.putenv('WIREDTIGER_HOME', homeenv)
try:
- self.conn = wiredtiger.wiredtiger_open(homearg, configarg)
+ self.conn = self.wiredtiger_open(homearg, configarg)
self.session = self.conn.open_session(None)
self.populate_and_check()
finally:
@@ -144,7 +144,7 @@ class test_config02(wttest.WiredTigerTestCase):
def test_home_does_not_exist(self):
dir = 'nondir'
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open(dir, 'create'),
+ lambda: self.wiredtiger_open(dir, 'create'),
'/(No such file or directory|The system cannot find the path specified)/')
def test_home_not_writeable(self):
@@ -154,7 +154,7 @@ class test_config02(wttest.WiredTigerTestCase):
os.mkdir(dir)
os.chmod(dir, 0555)
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open(dir, 'create'),
+ lambda: self.wiredtiger_open(dir, 'create'),
'/Permission denied/')
if __name__ == '__main__':
diff --git a/test/suite/test_config03.py b/test/suite/test_config03.py
index 3a1bbd76773..e91c5de62f8 100644
--- a/test/suite/test_config03.py
+++ b/test/suite/test_config03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -127,7 +127,7 @@ class test_config03(test_base03.test_base03):
args = successargs
self.verbose(3, 'wiredtiger_open with args: ' + args)
- conn = wiredtiger.wiredtiger_open(dir, args)
+ conn = self.wiredtiger_open(dir, args)
self.pr(`conn`)
return conn
diff --git a/test/suite/test_config04.py b/test/suite/test_config04.py
index 31deced73d0..7186bc3a716 100644
--- a/test/suite/test_config04.py
+++ b/test/suite/test_config04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -76,7 +76,7 @@ class test_config04(wttest.WiredTigerTestCase):
configarg = 'create,statistics=(fast)'
if configextra != None:
configarg += ',' + configextra
- self.conn = wiredtiger.wiredtiger_open('.', configarg)
+ self.conn = self.wiredtiger_open('.', configarg)
self.session = self.conn.open_session(None)
self.populate_and_check()
@@ -89,7 +89,7 @@ class test_config04(wttest.WiredTigerTestCase):
def test_bad_config(self):
msg = '/unknown configuration key/'
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open('.', 'not_valid,another_bad=10'),
+ lambda: self.wiredtiger_open('.', 'not_valid,another_bad=10'),
msg)
def test_cache_size_number(self):
@@ -123,14 +123,14 @@ class test_config04(wttest.WiredTigerTestCase):
def test_cache_too_small(self):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open('.', 'create,cache_size=900000'),
+ lambda: self.wiredtiger_open('.', 'create,cache_size=900000'),
"/Value too small for key 'cache_size' the minimum is/")
def test_cache_too_large(self):
T11 = 11 * self.T # 11 Terabytes
configstr = 'create,cache_size=' + str(T11)
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open('.', configstr),
+ lambda: self.wiredtiger_open('.', configstr),
"/Value too large for key 'cache_size' the maximum is/")
def test_eviction(self):
@@ -139,20 +139,35 @@ class test_config04(wttest.WiredTigerTestCase):
def test_eviction_bad(self):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda:
- wiredtiger.wiredtiger_open('.', 'create,eviction_target=91,' +
- 'eviction_trigger=81'),
+ self.wiredtiger_open('.', 'create,eviction_target=91,' +
+ 'eviction_trigger=81'),
"/eviction target must be lower than the eviction trigger/")
def test_eviction_bad2(self):
self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda:
- wiredtiger.wiredtiger_open('.', 'create,eviction_target=86,' +
- 'eviction_trigger=86'),
+ self.wiredtiger_open('.', 'create,eviction_target=86,' +
+ 'eviction_trigger=86'),
"/eviction target must be lower than the eviction trigger/")
def test_hazard_max(self):
# Note: There isn't any direct way to know that this was set.
self.common_test('hazard_max=50')
+ def test_invalid_config(self):
+ msg = '/Unbalanced brackets/'
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.wiredtiger_open('.', '}'), msg)
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.wiredtiger_open('.', '{'), msg)
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.wiredtiger_open('.', '{}}'), msg)
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.wiredtiger_open('.', '(]}'), msg)
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.wiredtiger_open('.', '(create=]}'), msg)
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.wiredtiger_open('.', '(create='), msg)
+
def test_session_max(self):
# Note: There isn't any direct way to know that this was set,
# but we'll have a separate functionality test to test for
diff --git a/test/suite/test_config05.py b/test/suite/test_config05.py
index 8687552eefe..bee63d48da6 100644
--- a/test/suite/test_config05.py
+++ b/test/suite/test_config05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -75,35 +75,35 @@ class test_config05(wttest.WiredTigerTestCase):
cursor.close()
def test_one(self):
- self.conn = wiredtiger.wiredtiger_open('.', 'create')
+ self.conn = self.wiredtiger_open('.', 'create')
self.session = self.conn.open_session(None)
self.populate(self.session)
self.verify_entries(self.session)
def test_one_session(self):
- self.conn = wiredtiger.wiredtiger_open('.', 'create,session_max=1')
+ self.conn = self.wiredtiger_open('.', 'create,session_max=1')
self.session = self.conn.open_session(None)
self.populate(self.session)
self.verify_entries(self.session)
def test_too_many_sessions(self):
- self.conn = wiredtiger.wiredtiger_open('.', 'create,session_max=1')
+ self.conn = self.wiredtiger_open('.', 'create,session_max=1')
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: [self.conn.open_session(None) for i in range(100)],
'/configured to support/')
def test_exclusive_create(self):
- self.conn = wiredtiger.wiredtiger_open('.', 'create,exclusive')
+ self.conn = self.wiredtiger_open('.', 'create,exclusive')
self.conn.close()
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open('.', 'exclusive'),
+ lambda: self.wiredtiger_open('.', 'exclusive'),
'/WiredTiger database already exists/')
def test_multi_create(self):
- self.conn = wiredtiger.wiredtiger_open('.', 'create')
+ self.conn = self.wiredtiger_open('.', 'create')
self.session = self.conn.open_session(None)
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open('.', 'create'),
+ lambda: self.wiredtiger_open('.', 'create'),
'/WiredTiger database is already being managed/')
if __name__ == '__main__':
diff --git a/test/suite/test_config06.py b/test/suite/test_config06.py
new file mode 100644
index 00000000000..d426bfe2de9
--- /dev/null
+++ b/test/suite/test_config06.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2016 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_config06.py
+# Test session.create configurations.
+class test_config06(wttest.WiredTigerTestCase):
+ uri = 'table:test_config06'
+ key = 'keyABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ value = 'valueABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
+ def session_config(self, config):
+ msg = '/Invalid argument/'
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.session.create(self.uri, config), msg)
+
+ # Edge cases for key/value formats.
+ def test_session_config(self):
+ self.session_config('key_format=A,value_format=S')
+ self.session_config('key_format=S,value_format=A')
+ self.session_config('key_format=0s,value_format=s')
+ self.session_config('key_format=s,value_format=0s')
+ self.session_config('key_format=0t,value_format=4t')
+ self.session_config('key_format=4t,value_format=0t')
+
+ # Smoke-test the string formats with length specifiers; both formats should
+ # ignore trailing bytes, verify that.
+ def format_string(self, fmt, len):
+ k = self.key
+ v = self.value
+ self.session.create(self.uri, \
+ "key_format=" + str(len) + fmt + ",value_format=" + str(len) + fmt)
+ cursor = self.session.open_cursor(self.uri, None)
+ cursor[k] = v
+ self.assertEquals(cursor[k[:len]], v[:len])
+ def test_format_string_S_1(self):
+ self.format_string('S', 1)
+ def test_format_string_S_4(self):
+ self.format_string('S', 4)
+ def test_format_string_S_10(self):
+ self.format_string('S', 10)
+ def test_format_string_s_1(self):
+ self.format_string('s', 1)
+ def test_format_string_s_4(self):
+ self.format_string('s', 4)
+ def test_format_string_s_10(self):
+ self.format_string('s', 10)
+
+ def test_format_string_S_default(self):
+ k = self.key
+ v = self.value
+ self.session.create(self.uri, "key_format=S,value_format=S")
+ cursor = self.session.open_cursor(self.uri, None)
+ cursor[k] = v
+ self.assertEquals(cursor[k], v)
+
+ def test_format_string_s_default(self):
+ k = self.key
+ v = self.value
+ self.session.create(self.uri, "key_format=s,value_format=s")
+ cursor = self.session.open_cursor(self.uri, None)
+ cursor[k] = v
+ self.assertEquals(cursor[k[:1]], v[:1])
+
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/test/suite/test_cursor01.py b/test/suite/test_cursor01.py
index 47cc7f6c5b7..cf39d4a4ba4 100644
--- a/test/suite/test_cursor01.py
+++ b/test/suite/test_cursor01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor02.py b/test/suite/test_cursor02.py
index e2b3ec69f86..eb1ba4dfc41 100644
--- a/test/suite/test_cursor02.py
+++ b/test/suite/test_cursor02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor03.py b/test/suite/test_cursor03.py
index d27c578bafd..63237f942ca 100644
--- a/test/suite/test_cursor03.py
+++ b/test/suite/test_cursor03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor04.py b/test/suite/test_cursor04.py
index 08f1a7240a5..6576c623f8a 100644
--- a/test/suite/test_cursor04.py
+++ b/test/suite/test_cursor04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor05.py b/test/suite/test_cursor05.py
index c98bcf63fa8..4c276f06ff4 100644
--- a/test/suite/test_cursor05.py
+++ b/test/suite/test_cursor05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor06.py b/test/suite/test_cursor06.py
index fdda4bfe8a5..ff7c1144344 100644
--- a/test/suite/test_cursor06.py
+++ b/test/suite/test_cursor06.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor07.py b/test/suite/test_cursor07.py
index 1fadf58c81f..d8de0874d7f 100644
--- a/test/suite/test_cursor07.py
+++ b/test/suite/test_cursor07.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat
+from wiredtiger import stat
from wtscenario import check_scenarios
import wttest
@@ -48,23 +48,10 @@ class test_cursor07(wttest.WiredTigerTestCase, suite_subprocess):
('regular', dict(reopen=False)),
('reopen', dict(reopen=True))
])
-
- # Overrides WiredTigerTestCase - add logging
- def setUpConnectionOpen(self, dir):
- self.home = dir
- self.txn_sync = '(method=dsync,enabled)'
- conn_params = \
- 'log=(archive=false,enabled,file_max=%s)' % self.logmax + \
- ',create,error_prefix="%s: ",' % self.shortid() + \
- 'transaction_sync="%s",' % self.txn_sync
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- try:
- conn = wiredtiger_open(dir, conn_params)
- except wiredtiger.WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
- self.pr(`conn`)
- self.session2 = conn.open_session()
- return conn
+ # Enable logging for this test.
+ def conn_config(self, dir):
+ return 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
+ 'transaction_sync="(method=dsync,enabled)"'
def test_log_cursor(self):
# print "Creating %s with config '%s'" % (self.uri, self.create_params)
diff --git a/test/suite/test_cursor08.py b/test/suite/test_cursor08.py
index 663451eb5b5..f7bd37a2a3c 100644
--- a/test/suite/test_cursor08.py
+++ b/test/suite/test_cursor08.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat, WiredTigerError
+from wiredtiger import stat, WiredTigerError
from wtscenario import multiply_scenarios, number_scenarios, check_scenarios
import wttest
@@ -54,6 +54,12 @@ class test_cursor08(wttest.WiredTigerTestCase, suite_subprocess):
('none', dict(compress='none')),
])
scenarios = number_scenarios(multiply_scenarios('.', reopens, compress))
+ # Load the compression extension, and enable it for logging.
+ def conn_config(self, dir):
+ return 'log=(archive=false,enabled,file_max=%s,' % self.logmax + \
+ 'compressor=%s),' % self.compress + \
+ 'transaction_sync="(method=dsync,enabled)",' + \
+ self.extensionArg(self.compress)
# Return the wiredtiger_open extension argument for a shared library.
def extensionArg(self, name):
@@ -68,25 +74,6 @@ class test_cursor08(wttest.WiredTigerTestCase, suite_subprocess):
self.skipTest('compression extension "' + extfile + '" not built')
return ',extensions=["' + extfile + '"]'
- # Overrides WiredTigerTestCase - add logging
- def setUpConnectionOpen(self, dir):
- self.home = dir
- self.txn_sync = '(method=dsync,enabled)'
- conn_params = \
- 'log=(archive=false,enabled,file_max=%s,' % self.logmax + \
- 'compressor=%s)' % self.compress + \
- ',create,error_prefix="%s: ",' % self.shortid() + \
- 'transaction_sync="%s",' % self.txn_sync + \
- self.extensionArg(self.compress)
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- try:
- conn = wiredtiger_open(dir, conn_params)
- except WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
- self.pr(`conn`)
- self.session2 = conn.open_session()
- return conn
-
def test_log_cursor(self):
# print "Creating %s with config '%s'" % (self.uri, self.create_params)
create_params = 'key_format=i,value_format=S'
diff --git a/test/suite/test_cursor09.py b/test/suite/test_cursor09.py
index 185c5fe88bb..b77336bc1d7 100644
--- a/test/suite/test_cursor09.py
+++ b/test/suite/test_cursor09.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor_compare.py b/test/suite/test_cursor_compare.py
index 07bc533839d..130f4e8ca96 100644
--- a/test/suite/test_cursor_compare.py
+++ b/test/suite/test_cursor_compare.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor_pin.py b/test/suite/test_cursor_pin.py
index b739a69892a..329759d8fc8 100644
--- a/test/suite/test_cursor_pin.py
+++ b/test/suite/test_cursor_pin.py
@@ -1,6 +1,6 @@
#!usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor_random.py b/test/suite/test_cursor_random.py
index b424dbbc7e3..2cef62b218a 100644
--- a/test/suite/test_cursor_random.py
+++ b/test/suite/test_cursor_random.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_cursor_random02.py b/test/suite/test_cursor_random02.py
new file mode 100644
index 00000000000..84ac0279fc4
--- /dev/null
+++ b/test/suite/test_cursor_random02.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2016 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
+from helper import complex_populate, simple_populate
+from helper import key_populate, value_populate
+from wtscenario import check_scenarios, multiply_scenarios, number_scenarios
+
+# test_cursor_random02.py
+# Cursor next_random operations
+class test_cursor_random02(wttest.WiredTigerTestCase):
+ type = 'table:random'
+ config = [
+ ('not-sample', dict(config='next_random=true'))
+ ]
+ records = [
+ ('1', dict(records=1)),
+ ('250', dict(records=250)),
+ ('500', dict(records=500)),
+ ('5000', dict(records=5000)),
+ ('10000', dict(records=10000)),
+ ('50000', dict(records=50000)),
+ ]
+ scenarios = number_scenarios(multiply_scenarios('.', config, records))
+
+ # Check that next_random works in the presence of a larger set of values,
+ # where the values are in an insert list.
+ def test_cursor_random_reasonable_distribution(self):
+ uri = self.type
+ num_entries = self.records
+
+ # Set the leaf-page-max value, otherwise the page might split.
+ simple_populate(self, uri,
+ 'leaf_page_max=100MB,key_format=S', num_entries)
+ # Setup an array to track which keys are seen
+ visitedKeys = [0] * (num_entries + 1)
+
+ cursor = self.session.open_cursor(uri, None, 'next_random=true')
+ for i in range(0, num_entries):
+ self.assertEqual(cursor.next(), 0)
+ current = cursor.get_key()
+ current = int(current)
+ visitedKeys[current] = visitedKeys[current] + 1
+
+ differentKeys = sum(x > 0 for x in visitedKeys)
+
+ #print visitedKeys
+ #print differentKeys
+ '''
+ self.tty('differentKeys: ' + str(differentKeys) + ' of ' + \
+ str(num_entries) + ', ' + \
+ str((int)((differentKeys * 100) / num_entries)) + '%')
+ '''
+
+ self.assertGreater(differentKeys, num_entries / 4,
+ 'next_random random distribution not adequate')
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/test/suite/test_cursor_tracker.py b/test/suite/test_cursor_tracker.py
index 742dea4c32b..a703e6cea70 100644
--- a/test/suite/test_cursor_tracker.py
+++ b/test/suite/test_cursor_tracker.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_drop.py b/test/suite/test_drop.py
index 8ca63f0b191..5663b85d661 100644
--- a/test/suite/test_drop.py
+++ b/test/suite/test_drop.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_drop_create.py b/test/suite/test_drop_create.py
index 9cd6a32c9bf..654f054a583 100644
--- a/test/suite/test_drop_create.py
+++ b/test/suite/test_drop_create.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_dump.py b/test/suite/test_dump.py
index 6d81c102028..c850d1b5d3f 100644
--- a/test/suite/test_dump.py
+++ b/test/suite/test_dump.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -109,7 +109,7 @@ class test_dump(wttest.WiredTigerTestCase, suite_subprocess):
self.runWt(['-h', self.dir, 'load', '-f', 'dump.out'])
# Check the contents
- conn = wiredtiger.wiredtiger_open(self.dir)
+ conn = self.wiredtiger_open(self.dir)
session = conn.open_session()
cursor = session.open_cursor(uri, None, None)
self.populate_check(self, cursor, self.nentries)
@@ -119,7 +119,7 @@ class test_dump(wttest.WiredTigerTestCase, suite_subprocess):
self.runWt(['-h', self.dir, 'load', '-f', 'dump.out'])
# Check the contents, they shouldn't have changed.
- conn = wiredtiger.wiredtiger_open(self.dir)
+ conn = self.wiredtiger_open(self.dir)
session = conn.open_session()
cursor = session.open_cursor(uri, None, None)
self.populate_check(self, cursor, self.nentries)
diff --git a/test/suite/test_dupc.py b/test/suite/test_dupc.py
index c28dd928ab6..ec55a36df4c 100644
--- a/test/suite/test_dupc.py
+++ b/test/suite/test_dupc.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_durability01.py b/test/suite/test_durability01.py
index 8d00d05fa14..f578a79baf1 100644
--- a/test/suite/test_durability01.py
+++ b/test/suite/test_durability01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -34,7 +34,6 @@
import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
diff --git a/test/suite/test_empty.py b/test/suite/test_empty.py
index 93ec65e1f94..50b79db70e4 100644
--- a/test/suite/test_empty.py
+++ b/test/suite/test_empty.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_encrypt01.py b/test/suite/test_encrypt01.py
index 9feaa7f88a3..0521f7c8e8a 100644
--- a/test/suite/test_encrypt01.py
+++ b/test/suite/test_encrypt01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -79,7 +79,7 @@ class test_encrypt01(wttest.WiredTigerTestCase):
('encryptors', self.file_encrypt),
('compressors', self.block_compress),
('compressors', self.log_compress)])
- conn = wiredtiger.wiredtiger_open(dir,
+ conn = self.wiredtiger_open(dir,
'create,error_prefix="{0}: ",{1}{2}{3}'.format(
self.shortid(), encarg, comparg, extarg))
self.pr(`conn`)
diff --git a/test/suite/test_encrypt02.py b/test/suite/test_encrypt02.py
index db6cdedf983..0376b3e42e4 100644
--- a/test/suite/test_encrypt02.py
+++ b/test/suite/test_encrypt02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -81,7 +81,7 @@ class test_encrypt02(wttest.WiredTigerTestCase, suite_subprocess):
extarg = self.extensionArg([('encryptors', self.encrypt)])
connarg = 'create,error_prefix="{0}: ",{1},{2}'.format(
self.shortid(), encarg, extarg)
- conn = wiredtiger.wiredtiger_open(dir, connarg)
+ conn = self.wiredtiger_open(dir, connarg)
self.pr(`conn`)
return conn
diff --git a/test/suite/test_encrypt03.py b/test/suite/test_encrypt03.py
index 0e19ad39263..702d0a2369f 100644
--- a/test/suite/test_encrypt03.py
+++ b/test/suite/test_encrypt03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -57,7 +57,7 @@ class test_encrypt03(wttest.WiredTigerTestCase):
extarg = self.extensionArg([('encryptors', self.sys_encrypt),
('encryptors', self.file_encrypt)])
self.pr('encarg = ' + encarg + ' extarg = ' + extarg)
- conn = wiredtiger.wiredtiger_open(dir,
+ conn = self.wiredtiger_open(dir,
'create,error_prefix="{0}: ",{1}{2}'.format(
self.shortid(), encarg, extarg))
self.pr(`conn`)
diff --git a/test/suite/test_encrypt04.py b/test/suite/test_encrypt04.py
index 41fd0f6dd48..d7c12d2cba8 100644
--- a/test/suite/test_encrypt04.py
+++ b/test/suite/test_encrypt04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -107,7 +107,7 @@ class test_encrypt04(wttest.WiredTigerTestCase, suite_subprocess):
self.pr('encarg = ' + encarg + ' extarg = ' + extarg)
completed = False
try:
- conn = wiredtiger.wiredtiger_open(dir,
+ conn = self.wiredtiger_open(dir,
'create,error_prefix="{0}: ",{1}{2}'.format(
self.shortid(), encarg, extarg))
except (BaseException) as err:
diff --git a/test/suite/test_encrypt05.py b/test/suite/test_encrypt05.py
index 8a69e5f909f..afd8a8103f9 100644
--- a/test/suite/test_encrypt05.py
+++ b/test/suite/test_encrypt05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -61,7 +61,7 @@ class test_encrypt05(wttest.WiredTigerTestCase):
('encryptors', self.file_encrypt),
('compressors', self.block_compress),
('compressors', self.log_compress)])
- conn = wiredtiger.wiredtiger_open(dir,
+ conn = self.wiredtiger_open(dir,
'create,error_prefix="{0}: ",{1}{2}{3}'.format(
self.shortid(), encarg, comparg, extarg))
self.pr(`conn`)
diff --git a/test/suite/test_encrypt06.py b/test/suite/test_encrypt06.py
index 5b2007fe6e7..5c88b698aeb 100644
--- a/test/suite/test_encrypt06.py
+++ b/test/suite/test_encrypt06.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -99,7 +99,7 @@ class test_encrypt06(wttest.WiredTigerTestCase):
('encryptors', self.file1_encrypt)])
self.open_params = 'create,error_prefix="{0}: ",{1}{2}{3}'.format(
self.shortid(), encarg, comparg, extarg)
- conn = wiredtiger.wiredtiger_open(dir, self.open_params)
+ conn = self.wiredtiger_open(dir, self.open_params)
self.pr(`conn`)
return conn
diff --git a/test/suite/test_encrypt07.py b/test/suite/test_encrypt07.py
index cf55e4f16b4..30f28e096a8 100644
--- a/test/suite/test_encrypt07.py
+++ b/test/suite/test_encrypt07.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -50,7 +50,7 @@ class test_encrypt07(test_salvage.test_salvage):
encarg = 'encryption=(name={0}{1}),'.format(
self.sys_encrypt, self.sys_encrypt_args)
extarg = self.extensionArg([('encryptors', self.sys_encrypt)])
- conn = wiredtiger.wiredtiger_open(dir,
+ conn = self.wiredtiger_open(dir,
'create,error_prefix="{0}: ",{1}{2}'.format(
self.shortid(), encarg, extarg))
self.pr(`conn`)
diff --git a/test/suite/test_env01.py b/test/suite/test_env01.py
index 0d650426383..491ef9e8eac 100644
--- a/test/suite/test_env01.py
+++ b/test/suite/test_env01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -99,7 +99,7 @@ class test_priv01(wttest.WiredTigerTestCase):
else:
os.putenv('WIREDTIGER_HOME', homeenv)
try:
- self.conn = wiredtiger.wiredtiger_open(homearg, configarg)
+ self.conn = self.wiredtiger_open(homearg, configarg)
self.session = self.conn.open_session(None)
self.populate_and_check()
finally:
diff --git a/test/suite/test_excl.py b/test/suite/test_excl.py
index 960e653e723..90926f51877 100644
--- a/test/suite/test_excl.py
+++ b/test/suite/test_excl.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_home.py b/test/suite/test_home.py
index ed85a3224c2..2cdcf2429af 100644
--- a/test/suite/test_home.py
+++ b/test/suite/test_home.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -70,8 +70,9 @@ class test_base_config(wttest.WiredTigerTestCase):
# Open up another database, configure without base configuration.
os.mkdir("A")
- conn = wiredtiger.wiredtiger_open("A", "create,config_base=false")
+ conn = self.wiredtiger_open("A", "create,config_base=false")
self.assertFalse(os.path.exists("A/WiredTiger.basecfg"))
+ conn.close()
if __name__ == '__main__':
diff --git a/test/suite/test_huffman01.py b/test/suite/test_huffman01.py
index 786841b29f7..d71198e3151 100644
--- a/test/suite/test_huffman01.py
+++ b/test/suite/test_huffman01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_huffman02.py b/test/suite/test_huffman02.py
index 2f75758e8ff..aa4329415a4 100644
--- a/test/suite/test_huffman02.py
+++ b/test/suite/test_huffman02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_index01.py b/test/suite/test_index01.py
index f2398fee5e8..bebeb191ef0 100644
--- a/test/suite/test_index01.py
+++ b/test/suite/test_index01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -39,11 +39,6 @@ class test_index01(wttest.WiredTigerTestCase):
NUM_INDICES = 6
index = ['%s:index%d' % (indexbase, i) for i in xrange(NUM_INDICES)]
- def reopen(self):
- self.conn.close()
- self.conn = wiredtiger.wiredtiger_open('.', None)
- self.session = self.conn.open_session()
-
def create_table(self):
self.pr('create table')
self.session.create(self.tablename, 'key_format=Si,value_format=SSii,columns=(name,ID,dept,job,salary,year)')
@@ -222,5 +217,20 @@ class test_index01(wttest.WiredTigerTestCase):
self.assertEqual(list(self.index_iter(i)), [])
self.drop_table()
+ def test_exclusive(self):
+ '''Create indices, then try to create another index exclusively'''
+ self.create_table()
+ # non-exclusive recreate is allowed
+ self.session.create(self.index[0], 'columns=(dept)')
+ # exclusive recreate
+ self.assertRaises(wiredtiger.WiredTigerError,
+ lambda: self.session.create(self.index[0],
+ 'columns=(dept),exclusive'))
+ # non-exclusive create with differing configuration
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.session.create(self.index[0],
+ 'columns=(salary)'), '/does not match existing configuration/')
+ self.drop_table()
+
if __name__ == '__main__':
wttest.run()
diff --git a/test/suite/test_inmem01.py b/test/suite/test_inmem01.py
index fa7ca787056..875ebb2bfa7 100644
--- a/test/suite/test_inmem01.py
+++ b/test/suite/test_inmem01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -54,12 +54,9 @@ class test_inmem01(wttest.WiredTigerTestCase):
('row', dict(tablekind='row'))
])
- # Override WiredTigerTestCase to create an in-memory database
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'cache_size=5MB,create,' +
- 'file_manager=(close_idle_time=0),in_memory=true,cache_size=5MB')
- return conn
+ # create an in-memory database
+ conn_config = 'cache_size=5MB,' + \
+ 'file_manager=(close_idle_time=0),in_memory=true'
def get_table_config(self):
kf = 'key_format='
diff --git a/test/suite/test_intpack.py b/test/suite/test_intpack.py
index efe4bfc0421..187b2d7f579 100644
--- a/test/suite/test_intpack.py
+++ b/test/suite/test_intpack.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_join01.py b/test/suite/test_join01.py
index ca6e5fbcabb..f03c7c6f06c 100644
--- a/test/suite/test_join01.py
+++ b/test/suite/test_join01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -40,12 +40,8 @@ class test_join01(wttest.WiredTigerTestCase):
('table', dict(ref='table')),
('index', dict(ref='index'))
]
-
- # Override WiredTigerTestCase, we have statistics tests.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' + 'error_prefix="%s: "' % self.shortid())
- return conn
+ # We need statistics for these tests.
+ conn_config = 'statistics=(all)'
def gen_key(self, i):
return [ i + 1 ]
@@ -245,10 +241,22 @@ class test_join01(wttest.WiredTigerTestCase):
# Joining a non positioned cursor
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: self.session.join(jc, ic0, 'compare=ge'),
- '/requires key be set/')
+ '/requires reference cursor be positioned/')
+ ic0.set_key('val1')
+ # Joining a non positioned cursor (no search or next has been done)
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.session.join(jc, ic0, 'compare=ge'),
+ '/requires reference cursor be positioned/')
+ ic0.set_key('valXX')
+ self.assertEqual(ic0.search(), wiredtiger.WT_NOTFOUND)
+ # Joining a non positioned cursor after failed search
+ self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
+ lambda: self.session.join(jc, ic0, 'compare=ge'),
+ '/requires reference cursor be positioned/')
- # minimally position the cursors now
- ic0.next()
+ # position the cursors now
+ ic0.set_key('val1')
+ ic0.search()
ic0again.next()
icB.next()
@@ -260,7 +268,7 @@ class test_join01(wttest.WiredTigerTestCase):
# The cursor must be positioned
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
lambda: self.session.join(jc, ic1, 'compare=ge'),
- '/requires key be set/')
+ '/requires reference cursor be positioned/')
ic1.next()
# The first cursor joined cannot be bloom
diff --git a/test/suite/test_join02.py b/test/suite/test_join02.py
index bf376575103..d122de8a0eb 100644
--- a/test/suite/test_join02.py
+++ b/test/suite/test_join02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_join03.py b/test/suite/test_join03.py
index 552e3b41748..613d2396b07 100644
--- a/test/suite/test_join03.py
+++ b/test/suite/test_join03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -61,7 +61,7 @@ class test_join03(wttest.WiredTigerTestCase):
extarg = self.extensionArg([('extractors', 'csv', 'csv_extractor')])
connarg = 'create,error_prefix="{0}: ",{1}'.format(
self.shortid(), extarg)
- conn = wiredtiger.wiredtiger_open(dir, connarg)
+ conn = self.wiredtiger_open(dir, connarg)
self.pr(`conn`)
return conn
diff --git a/test/suite/test_join04.py b/test/suite/test_join04.py
new file mode 100644
index 00000000000..7e2afb15285
--- /dev/null
+++ b/test/suite/test_join04.py
@@ -0,0 +1,169 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2016 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 os
+import wiredtiger, wttest, run
+from wtscenario import check_scenarios, multiply_scenarios, number_scenarios
+
+# test_join04.py
+# Join operations
+# Joins with a custom extractor, using equality joins
+class test_join04(wttest.WiredTigerTestCase):
+ table_name1 = 'test_join04'
+ nentries = 100
+
+ # Return the wiredtiger_open extension argument for a shared library.
+ def extensionArg(self, exts):
+ extfiles = []
+ for ext in exts:
+ (dirname, name, libname) = ext
+ if name != None and name != 'none':
+ testdir = os.path.dirname(__file__)
+ extdir = os.path.join(run.wt_builddir, 'ext', dirname)
+ extfile = os.path.join(
+ extdir, name, '.libs', 'libwiredtiger_' + libname + '.so')
+ if not os.path.exists(extfile):
+ self.skipTest('extension "' + extfile + '" not built')
+ if not extfile in extfiles:
+ extfiles.append(extfile)
+ if len(extfiles) == 0:
+ return ''
+ else:
+ return ',extensions=["' + '","'.join(extfiles) + '"]'
+
+ # Override WiredTigerTestCase, we have extensions.
+ def setUpConnectionOpen(self, dir):
+ extarg = self.extensionArg([('extractors', 'csv', 'csv_extractor')])
+ connarg = 'create,error_prefix="{0}: ",{1}'.format(
+ self.shortid(), extarg)
+ conn = self.wiredtiger_open(dir, connarg)
+ self.pr(`conn`)
+ return conn
+
+ # JIRA WT-2308:
+ # Test extractors with equality joins
+ def test_join_extractor(self):
+ self.session.create('table:join04',
+ 'key_format=i,value_format=S,columns=(k,v)')
+ self.session.create('index:join04:index1',
+ 'key_format=i,extractor=csv,' +
+ 'app_metadata={"format" : "i", "field" : "0"}')
+ self.session.create('index:join04:index2',
+ 'key_format=i,extractor=csv,' +
+ 'app_metadata={"format" : "i", "field" : "1"}')
+
+ cursor1 = self.session.open_cursor('table:join04', None, None)
+ cursor1[1] = '10,21'
+ cursor1[2] = '10,22'
+ cursor1.close()
+
+ cursor1 = self.session.open_cursor('index:join04:index1', None, None)
+ cursor1.set_key(10)
+ cursor1.search()
+ cursor2 = self.session.open_cursor('index:join04:index2', None, None)
+ cursor2.set_key(22)
+ cursor2.search()
+
+ jcursor = self.session.open_cursor('join:table:join04', None, None)
+ self.session.join(jcursor, cursor1, 'compare=eq')
+ self.session.join(jcursor, cursor2, 'compare=eq')
+
+ found = 0
+ while jcursor.next() == 0:
+ [k] = jcursor.get_keys()
+ [v] = jcursor.get_values()
+ self.assertEqual(k, 2)
+ self.assertEqual(v, '10,22')
+ found += 1
+ self.assertEqual(found, 1)
+ jcursor.close()
+ cursor1.close()
+ cursor2.close()
+
+ # More tests using extractors with equality joins
+ def test_join_extractor_more(self):
+ self.session.create('table:join04',
+ 'key_format=i,value_format=S,columns=(k,v)')
+ self.session.create('index:join04:index1',
+ 'key_format=i,extractor=csv,' +
+ 'app_metadata={"format" : "i", "field" : "0"}')
+ self.session.create('index:join04:index2',
+ 'key_format=i,extractor=csv,' +
+ 'app_metadata={"format" : "i", "field" : "1"}')
+ self.session.create('index:join04:index3',
+ 'key_format=i,extractor=csv,' +
+ 'app_metadata={"format" : "i", "field" : "2"}')
+
+ jcursor = self.session.open_cursor('join:table:join04', None, None)
+ cursor1 = self.session.open_cursor('table:join04', None, None)
+ k = 1
+ for v in ['10,21,30','10,22,30','10,23,30',
+ '11,21,30','11,22,30','11,23,30',
+ '10,21,31','10,22,31','10,23,31',
+ '10,21,30','11,22,31','12,23,32']:
+ cursor1[k] = v
+ k += 1
+ cursor1.close()
+
+ # A list of tests, one per line, each entry is:
+ # [[list of inputs], [list of outputs]]
+ tests = [
+ [[10,22,30], ['10,22,30']],
+ [[10,21,30], ['10,21,30','10,21,30']],
+ [[11], ['11,21,30','11,22,30','11,23,30','11,22,31']],
+ [[None,22], ['10,22,30','11,22,30','10,22,31','11,22,31']]]
+
+ for t in tests:
+ jcursor = self.session.open_cursor('join:table:join04', None, None)
+ ins = t[0]
+ outs = t[1]
+ cursors = []
+ n = 0
+ for k in ins:
+ n += 1
+ if k == None: continue
+ uri = 'index:join04:index' + str(n)
+ c = self.session.open_cursor(uri, None, None)
+ c.set_key(k)
+ self.assertEqual(c.search(), 0)
+ cursors.append(c)
+ self.session.join(jcursor, c, 'compare=eq')
+ while jcursor.next() == 0:
+ [k] = jcursor.get_keys()
+ [v] = jcursor.get_values()
+ #self.tty('got=' + str(v) + ' at key=' + str(k))
+ self.assertTrue(v in outs)
+ outs.remove(v)
+ self.assertEqual(len(outs), 0)
+ jcursor.close()
+ for c in cursors:
+ c.close()
+
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/test/suite/test_jsondump01.py b/test/suite/test_jsondump01.py
index b483b4db429..ddf871d9a24 100644
--- a/test/suite/test_jsondump01.py
+++ b/test/suite/test_jsondump01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_jsondump02.py b/test/suite/test_jsondump02.py
index 790f651fd2f..c6cd464e453 100644
--- a/test/suite/test_jsondump02.py
+++ b/test/suite/test_jsondump02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -209,7 +209,7 @@ class test_jsondump02(wttest.WiredTigerTestCase):
self.check_json(self.table_uri3, (
('"key0" : 1', '"value0" : "\\u0001\\u0002\\u0003"'),
('"key0" : 2',
- '"value0" : "\\u0077\\u0088\\u0099\\u0000\\u00FF\\u00FE"')))
+ '"value0" : "\\u0077\\u0088\\u0099\\u0000\\u00ff\\u00fe"')))
self.check_json(self.table_uri4, (
('"ikey" : 1,\n"Skey" : "key1"',
'"S1" : "val1",\n"i2" : 1,\n"S3" : "val1",\n"i4" : 1'),
diff --git a/test/suite/test_lsm01.py b/test/suite/test_lsm01.py
index f2561278edd..1f89cf38d77 100644
--- a/test/suite/test_lsm01.py
+++ b/test/suite/test_lsm01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_lsm02.py b/test/suite/test_lsm02.py
index afa5c47a77e..85067665017 100644
--- a/test/suite/test_lsm02.py
+++ b/test/suite/test_lsm02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_metadata_cursor01.py b/test/suite/test_metadata_cursor01.py
index 706b8a4132a..e759c14f846 100644
--- a/test/suite/test_metadata_cursor01.py
+++ b/test/suite/test_metadata_cursor01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_nsnap01.py b/test/suite/test_nsnap01.py
index 19253ec7631..5207b577ba4 100644
--- a/test/suite/test_nsnap01.py
+++ b/test/suite/test_nsnap01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_nsnap02.py b/test/suite/test_nsnap02.py
index fb0d798bedc..e4ed65ef72a 100644
--- a/test/suite/test_nsnap02.py
+++ b/test/suite/test_nsnap02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_nsnap03.py b/test/suite/test_nsnap03.py
index 969a217a868..0e853522940 100644
--- a/test/suite/test_nsnap03.py
+++ b/test/suite/test_nsnap03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_nsnap04.py b/test/suite/test_nsnap04.py
index 61b7bdd8bab..e8a5c9b6140 100644
--- a/test/suite/test_nsnap04.py
+++ b/test/suite/test_nsnap04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_overwrite.py b/test/suite/test_overwrite.py
index f710035c086..e22cdab4dea 100644
--- a/test/suite/test_overwrite.py
+++ b/test/suite/test_overwrite.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_pack.py b/test/suite/test_pack.py
index 451c6fbb9a9..9d833f49e16 100644
--- a/test/suite/test_pack.py
+++ b/test/suite/test_pack.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_perf001.py b/test/suite/test_perf001.py
index 4f99e552b79..1280639c9dd 100644
--- a/test/suite/test_perf001.py
+++ b/test/suite/test_perf001.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -44,12 +44,7 @@ class test_perf001(wttest.WiredTigerTestCase):
#('lsm-file', dict(tabletype='lsm',indextype='file')),
#('lsm-lsm', dict(tabletype='lsm',indextype='lsm')),
])
-
- def setUpConnectionOpen(self, dir):
- wtopen_args = 'create,cache_size=512M'
- conn = wiredtiger.wiredtiger_open(dir, wtopen_args)
- self.pr(`conn`)
- return conn
+ conn_config = 'cache_size=512M'
def test_performance_of_indices(self):
uri = 'table:' + self.table_name
diff --git a/test/suite/test_rebalance.py b/test/suite/test_rebalance.py
new file mode 100644
index 00000000000..80cce6ed514
--- /dev/null
+++ b/test/suite/test_rebalance.py
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2016 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 os, time
+import wiredtiger, wttest
+from helper import complex_populate, simple_populate
+from wtscenario import check_scenarios
+
+# test_rebalance.py
+# session level rebalance operation
+class test_rebalance(wttest.WiredTigerTestCase):
+ name = 'test_rebalance'
+
+ # Use small pages so we generate some internal layout
+ # Setup LSM so multiple chunks are present
+ config = 'key_format=S,allocation_size=512,internal_page_max=512' + \
+ ',leaf_page_max=1k,lsm=(chunk_size=512k,merge_min=10)'
+
+ scenarios = check_scenarios([
+ ('file', dict(uri='file:')),
+ ('table', dict(uri='table:')),
+ ('lsm', dict(uri='lsm:'))
+ ])
+
+ # Populate an object, then rebalance it.
+ def rebalance(self, populate, with_cursor):
+ uri = self.uri + self.name
+ populate(self, uri, self.config, 10000)
+
+ # Force to disk, we don't rebalance in-memory objects.
+ self.reopen_conn()
+
+ # Open cursors should cause failure.
+ if with_cursor:
+ cursor = self.session.open_cursor(uri, None, None)
+ self.assertRaises(wiredtiger.WiredTigerError,
+ lambda: self.session.drop(uri, None))
+ cursor.close()
+
+ self.session.rebalance(uri, None)
+ self.session.drop(uri)
+
+ # Test rebalance of an object.
+ def test_rebalance(self):
+ # Simple file or table object.
+ self.rebalance(simple_populate, False)
+ self.rebalance(simple_populate, True)
+
+ # A complex, multi-file table object.
+ if self.uri == "table:":
+ self.rebalance(complex_populate, False)
+ self.rebalance(complex_populate, True)
+
+
+if __name__ == '__main__':
+ wttest.run()
diff --git a/test/suite/test_reconfig01.py b/test/suite/test_reconfig01.py
index 2528f856a08..876de1fe5af 100644
--- a/test/suite/test_reconfig01.py
+++ b/test/suite/test_reconfig01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_reconfig02.py b/test/suite/test_reconfig02.py
index e0981a887fb..aee8ee4458b 100644
--- a/test/suite/test_reconfig02.py
+++ b/test/suite/test_reconfig02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_rename.py b/test/suite/test_rename.py
index 9ab4cb13da3..af968a4a38d 100644
--- a/test/suite/test_rename.py
+++ b/test/suite/test_rename.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_salvage.py b/test/suite/test_salvage.py
index 4bdffb262ab..3b648a7f170 100644
--- a/test/suite/test_salvage.py
+++ b/test/suite/test_salvage.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_schema01.py b/test/suite/test_schema01.py
index 44c4462cdc2..52bff7a13ff 100644
--- a/test/suite/test_schema01.py
+++ b/test/suite/test_schema01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -56,11 +56,6 @@ class test_schema01(wttest.WiredTigerTestCase):
wttest.WiredTigerTestCase.__init__(self, *args, **kwargs)
self.reconcile = False
- def reopen(self):
- self.conn.close()
- self.conn = wiredtiger.wiredtiger_open('.', None)
- self.session = self.conn.open_session()
-
def create_table(self):
self.pr('create table')
self.session.create(self.tablename, 'key_format=5s,value_format=HQ,' +
@@ -89,7 +84,7 @@ class test_schema01(wttest.WiredTigerTestCase):
c.close()
if reopen:
- self.reopen()
+ self.reopen_conn()
c = self.cursor()
expectpos = 0
diff --git a/test/suite/test_schema02.py b/test/suite/test_schema02.py
index 96347a2abf3..6895e947efe 100644
--- a/test/suite/test_schema02.py
+++ b/test/suite/test_schema02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -99,6 +99,14 @@ class test_schema02(wttest.WiredTigerTestCase):
# expect this to work
self.session.create("colgroup:main:c1", "columns=(S1,i2)")
+ # exclusive: no error message
+ self.expect_failure_colgroup("main:c1", "columns=(S1,i2),exclusive",
+ "")
+
+ # exists with different config
+ self.expect_failure_colgroup("main:c1", "columns=(S1,i4)",
+ "/does not match existing configuration/")
+
# colgroup not declared in initial create
self.expect_failure_colgroup("main:c3", "columns=(S3,i4)",
"/Column group 'c3' not found in"
diff --git a/test/suite/test_schema03.py b/test/suite/test_schema03.py
index 6e535b60850..f48bfdf3cf8 100644
--- a/test/suite/test_schema03.py
+++ b/test/suite/test_schema03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -219,6 +219,9 @@ class test_schema03(wttest.WiredTigerTestCase):
- between each step, whether to close/reopen the connection
"""
+ # Boost cache size and number of sessions for this test
+ conn_config = 'cache_size=100m,session_max=1000'
+
################################################################
# These three variables can be altered to help generate
# and pare down failing test cases.
@@ -297,12 +300,6 @@ class test_schema03(wttest.WiredTigerTestCase):
resource.setrlimit(resource.RLIMIT_NOFILE, newlimit)
super(test_schema03, self).setUp()
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,cache_size=100m,session_max=1000')
- self.pr(`conn`)
- return conn
-
def tearDown(self):
super(test_schema03, self).tearDown()
resource.setrlimit(resource.RLIMIT_NOFILE, self.origFileLimit)
diff --git a/test/suite/test_schema04.py b/test/suite/test_schema04.py
index a66e1ea2411..cd41138deb0 100644
--- a/test/suite/test_schema04.py
+++ b/test/suite/test_schema04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_schema05.py b/test/suite/test_schema05.py
index b0562f7983c..89722d5f89a 100644
--- a/test/suite/test_schema05.py
+++ b/test/suite/test_schema05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -81,7 +81,7 @@ class test_schema05(wttest.WiredTigerTestCase):
extarg = self.extensionArg([('extractors', 'csv', 'csv_extractor')])
connarg = 'create,error_prefix="{0}: ",{1}'.format(
self.shortid(), extarg)
- conn = wiredtiger.wiredtiger_open(dir, connarg)
+ conn = self.wiredtiger_open(dir, connarg)
self.pr(`conn`)
return conn
diff --git a/test/suite/test_schema06.py b/test/suite/test_schema06.py
index c1a39465db4..e72959edf2a 100644
--- a/test/suite/test_schema06.py
+++ b/test/suite/test_schema06.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_shared_cache01.py b/test/suite/test_shared_cache01.py
index b5abc047334..896a1e569ef 100644
--- a/test/suite/test_shared_cache01.py
+++ b/test/suite/test_shared_cache01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -72,7 +72,7 @@ class test_shared_cache01(wttest.WiredTigerTestCase):
for name in connections:
shutil.rmtree(name, True)
os.mkdir(name)
- next_conn = wiredtiger.wiredtiger_open(
+ next_conn = self.wiredtiger_open(
name,
'create,error_prefix="' + self.shortid() + ': "' +
pool_opts + extra_opts)
diff --git a/test/suite/test_shared_cache02.py b/test/suite/test_shared_cache02.py
index ffe27360399..4afccbe59f7 100644
--- a/test/suite/test_shared_cache02.py
+++ b/test/suite/test_shared_cache02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -72,7 +72,7 @@ class test_shared_cache02(wttest.WiredTigerTestCase):
for name in connections:
shutil.rmtree(name, True)
os.mkdir(name)
- next_conn = wiredtiger.wiredtiger_open(
+ next_conn = self.wiredtiger_open(
name,
'create,error_prefix="' + self.shortid() + ': "' +
pool_opts + extra_opts)
diff --git a/test/suite/test_split.py b/test/suite/test_split.py
index dbed0956c94..d09613e1c52 100644
--- a/test/suite/test_split.py
+++ b/test/suite/test_split.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_stat01.py b/test/suite/test_stat01.py
index 96f246e3c8a..5c3259696eb 100644
--- a/test/suite/test_stat01.py
+++ b/test/suite/test_stat01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -51,11 +51,7 @@ class test_stat01(wttest.WiredTigerTestCase):
]
scenarios = number_scenarios(multiply_scenarios('.', types, keyfmt))
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' + 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(all)'
def statstr_to_int(self, str):
"""
diff --git a/test/suite/test_stat02.py b/test/suite/test_stat02.py
index 8643d700793..88371947b5b 100644
--- a/test/suite/test_stat02.py
+++ b/test/suite/test_stat02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -60,13 +60,9 @@ class test_stat_cursor_config(wttest.WiredTigerTestCase):
scenarios = number_scenarios(
multiply_scenarios('.', uri, data_config, cursor_config))
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,' +
- 'statistics=(' + self.data_config + '),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ # Turn on statistics for this test.
+ def conn_config(self, dir):
+ return 'statistics=(%s)' % self.data_config
# For each database/cursor configuration, confirm the right combinations
# succeed or fail.
@@ -87,13 +83,7 @@ class test_stat_cursor_config(wttest.WiredTigerTestCase):
# Test the connection "clear" configuration.
class test_stat_cursor_conn_clear(wttest.WiredTigerTestCase):
pfx = 'test_stat_cursor_conn_clear'
-
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(all)'
def test_stat_cursor_conn_clear(self):
uri = 'table:' + self.pfx
@@ -123,13 +113,7 @@ class test_stat_cursor_dsrc_clear(wttest.WiredTigerTestCase):
]
scenarios = number_scenarios(multiply_scenarios('.', uri))
-
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(all)'
def test_stat_cursor_dsrc_clear(self):
self.pop(self, self.uri, 'key_format=S', 100)
@@ -159,13 +143,7 @@ class test_stat_cursor_fast(wttest.WiredTigerTestCase):
]
scenarios = number_scenarios(multiply_scenarios('.', uri))
-
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(all)'
def test_stat_cursor_fast(self):
self.pop(self, self.uri, 'key_format=S', 100)
@@ -194,7 +172,7 @@ class test_stat_cursor_conn_error(wttest.WiredTigerTestCase):
config = 'create,statistics=(' + i[0] + ',' + i[1] + ')'
msg = '/only one statistics configuration value/'
self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
- lambda: wiredtiger.wiredtiger_open('.', config), msg)
+ lambda: self.wiredtiger_open('.', config), msg)
# Test data-source error combinations.
@@ -209,13 +187,7 @@ class test_stat_cursor_dsrc_error(wttest.WiredTigerTestCase):
]
scenarios = number_scenarios(multiply_scenarios('.', uri))
-
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(all)'
def test_stat_cursor_dsrc_error(self):
self.pop(self, self.uri, 'key_format=S', 100)
diff --git a/test/suite/test_stat03.py b/test/suite/test_stat03.py
index 2e2af16f953..039ad1f7f8d 100644
--- a/test/suite/test_stat03.py
+++ b/test/suite/test_stat03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -52,13 +52,7 @@ class test_stat_cursor_reset(wttest.WiredTigerTestCase):
]
scenarios = number_scenarios(multiply_scenarios('.', uri))
-
- # Override WiredTigerTestCase, we have extensions.
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(all)'
def stat_cursor(self, uri):
return self.session.open_cursor(
diff --git a/test/suite/test_stat04.py b/test/suite/test_stat04.py
index 33e7a925c6a..e7c39371f80 100644
--- a/test/suite/test_stat04.py
+++ b/test/suite/test_stat04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -50,13 +50,7 @@ class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):
('jumboval', dict(nentries=100, valuesize=4200000)),
]
scenarios = number_scenarios(multiply_scenarios('.', keyfmt, nentries))
-
- # Override WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- return wiredtiger.wiredtiger_open(dir,
- 'create,' +
- 'statistics=(all),' +
- 'error_prefix="%s: "' % self.shortid())
+ conn_config = 'statistics=(all)'
def init_test(self):
self.valuepfx = self.valuesize * 'X'
diff --git a/test/suite/test_stat05.py b/test/suite/test_stat05.py
index f147b93ce81..6a93ec2c84d 100644
--- a/test/suite/test_stat05.py
+++ b/test/suite/test_stat05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -49,14 +49,7 @@ class test_stat_cursor_config(wttest.WiredTigerTestCase):
]
scenarios = number_scenarios(uri)
-
- # Override WiredTigerTestCase to enable statistics
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,' +
- 'statistics=(fast),' +
- 'error_prefix="%s: "' % self.shortid())
- return conn
+ conn_config = 'statistics=(fast)'
def openAndWalkStatCursor(self):
c = self.session.open_cursor(
diff --git a/test/suite/test_stat_log01.py b/test/suite/test_stat_log01.py
index 6b0ba52cae1..f6033d940c5 100644
--- a/test/suite/test_stat_log01.py
+++ b/test/suite/test_stat_log01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -47,21 +47,21 @@ class test_stat_log01(wttest.WiredTigerTestCase):
return None
def test_stats_log_default(self):
- self.conn = wiredtiger.wiredtiger_open(
+ self.conn = self.wiredtiger_open(
None, "create,statistics=(fast),statistics_log=(wait=1)")
# Wait for the default interval, to ensure stats have been written.
time.sleep(2)
self.check_stats_file("WiredTigerStat")
def test_stats_log_name(self):
- self.conn = wiredtiger.wiredtiger_open(
+ self.conn = self.wiredtiger_open(
None, "create,statistics=(fast),statistics_log=(wait=1,path=foo)")
# Wait for the default interval, to ensure stats have been written.
time.sleep(2)
self.check_stats_file("foo")
def test_stats_log_on_close_and_log(self):
- self.conn = wiredtiger.wiredtiger_open(None,
+ self.conn = self.wiredtiger_open(None,
"create,statistics=(fast),statistics_log=(on_close=true,wait=1)")
# Wait for the default interval, to ensure stats have been written.
time.sleep(2)
@@ -69,7 +69,7 @@ class test_stat_log01(wttest.WiredTigerTestCase):
self.check_stats_file("WiredTigerStat")
def test_stats_log_on_close(self):
- self.conn = wiredtiger.wiredtiger_open(None,
+ self.conn = self.wiredtiger_open(None,
"create,statistics=(fast),statistics_log=(on_close=true)")
# Close the connection to ensure the statistics get generated.
self.close_conn()
diff --git a/test/suite/test_sweep01.py b/test/suite/test_sweep01.py
index 13422a75a61..f996dbfa06d 100644
--- a/test/suite/test_sweep01.py
+++ b/test/suite/test_sweep01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -33,7 +33,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat
+from wiredtiger import stat
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -42,6 +42,9 @@ class test_sweep01(wttest.WiredTigerTestCase, suite_subprocess):
uri = 'table:' + tablebase
numfiles = 50
numkv = 1000
+ conn_config = 'file_manager=(close_handle_minimum=0,' + \
+ 'close_idle_time=6,close_scan_interval=2),' + \
+ 'statistics=(fast),'
types = [
('row', dict(tabletype='row',
@@ -54,26 +57,6 @@ class test_sweep01(wttest.WiredTigerTestCase, suite_subprocess):
scenarios = types
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
- self.backup_dir = os.path.join(self.home, "WT_BACKUP")
- # Configure sweep to run every 2 seconds with a 6 second timeout.
- # That matches the ratio of the default 10 and 30 seconds.
- conn_params = \
- ',create,error_prefix="%s: ",' % self.shortid() + \
- 'file_manager=(close_handle_minimum=0,' + \
- 'close_idle_time=6,close_scan_interval=2),' + \
- 'statistics=(fast),'
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- try:
- conn = wiredtiger_open(dir, conn_params)
- except wiredtiger.WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
- self.pr(`conn`)
- self.session2 = conn.open_session()
- return conn
-
def test_ops(self):
#
# Set up numfiles with numkv entries. We just want some data in there
diff --git a/test/suite/test_sweep02.py b/test/suite/test_sweep02.py
index ac389418b7e..cff45e0d2f9 100644
--- a/test/suite/test_sweep02.py
+++ b/test/suite/test_sweep02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -31,7 +31,6 @@
#
import wiredtiger, wttest
-from wiredtiger import wiredtiger_open
from wttest import unittest
class test_sweep02(wttest.WiredTigerTestCase):
@@ -49,23 +48,23 @@ class test_sweep02(wttest.WiredTigerTestCase):
return None
def test_config01(self):
- self.conn = wiredtiger_open(self.dir,
+ self.conn = self.wiredtiger_open(self.dir,
self.base_config + "file_manager=()")
def test_config02(self):
- self.conn = wiredtiger_open(self.dir,
+ self.conn = self.wiredtiger_open(self.dir,
self.base_config + "file_manager=(close_scan_interval=1)")
def test_config03(self):
- self.conn = wiredtiger_open(self.dir,
+ self.conn = self.wiredtiger_open(self.dir,
self.base_config + "file_manager=(close_idle_time=1)")
def test_config04(self):
- self.conn = wiredtiger_open(self.dir,
+ self.conn = self.wiredtiger_open(self.dir,
self.base_config + "file_manager=(close_handle_minimum=500)")
def test_config05(self):
- self.conn = wiredtiger_open(self.dir, self.base_config + \
+ self.conn = self.wiredtiger_open(self.dir, self.base_config + \
"file_manager=(close_scan_interval=1,close_idle_time=1)")
if __name__ == '__main__':
diff --git a/test/suite/test_sweep03.py b/test/suite/test_sweep03.py
index 684c87695c5..061c2f5b37b 100644
--- a/test/suite/test_sweep03.py
+++ b/test/suite/test_sweep03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat
+from wiredtiger import stat
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -41,6 +41,9 @@ class test_sweep03(wttest.WiredTigerTestCase, suite_subprocess):
uri = 'table:' + tablebase
numfiles = 400 # Make this more than the default close_handle_minimum
numkv = 100
+ conn_config = 'file_manager=(close_handle_minimum=10,' + \
+ 'close_idle_time=0,close_scan_interval=1),' + \
+ 'statistics=(fast),'
types = [
('row', dict(tabletype='row',
@@ -53,24 +56,6 @@ class test_sweep03(wttest.WiredTigerTestCase, suite_subprocess):
scenarios = types
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
-
- conn_params = \
- ',create,error_prefix="%s: ",' % self.shortid() + \
- 'file_manager=(close_handle_minimum=10,' + \
- 'close_idle_time=0,close_scan_interval=1),' + \
- 'statistics=(fast),'
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- try:
- conn = wiredtiger_open(dir, conn_params)
- except wiredtiger.WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
- self.pr(`conn`)
- self.session2 = conn.open_session()
- return conn
-
def test_disable_idle_timeout1(self):
#
# Set up numfiles with numkv entries. We just want some data in there
diff --git a/test/suite/test_truncate01.py b/test/suite/test_truncate01.py
index dd91a7868ec..77a476e40c1 100644
--- a/test/suite/test_truncate01.py
+++ b/test/suite/test_truncate01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_truncate02.py b/test/suite/test_truncate02.py
index a11de6cc5da..6c11302787c 100644
--- a/test/suite/test_truncate02.py
+++ b/test/suite/test_truncate02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_truncate03.py b/test/suite/test_truncate03.py
index 85826841814..e2db355f0ef 100644
--- a/test/suite/test_truncate03.py
+++ b/test/suite/test_truncate03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_txn01.py b/test/suite/test_txn01.py
index cbb771273a6..eb6963791fd 100644
--- a/test/suite/test_txn01.py
+++ b/test/suite/test_txn01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -42,13 +42,6 @@ class test_txn01(wttest.WiredTigerTestCase):
('row-t', dict(uri='table:text_txn01',key_format='S',value_format='S')),
])
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir, 'create,' +
- ('error_prefix="%s: ",' % self.shortid()))
- self.pr(`conn`)
- return conn
-
# Return the number of records visible to the cursor.
def cursor_count(self, cursor):
count = 0
diff --git a/test/suite/test_txn02.py b/test/suite/test_txn02.py
index 17d0b97b50f..fccf123d3bc 100644
--- a/test/suite/test_txn02.py
+++ b/test/suite/test_txn02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -119,7 +118,7 @@ class test_txn02(wttest.WiredTigerTestCase, suite_subprocess):
'create,error_prefix="%s: ",' % self.shortid() + \
'transaction_sync="%s",' % self.txn_sync
# print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- conn = wiredtiger_open(dir, conn_params)
+ conn = self.wiredtiger_open(dir, conn_params)
self.pr(`conn`)
self.session2 = conn.open_session()
return conn
@@ -154,7 +153,7 @@ class test_txn02(wttest.WiredTigerTestCase, suite_subprocess):
# recovery and see the committed results.
self.backup(self.backup_dir)
backup_conn_params = 'log=(enabled,file_max=%s)' % self.logmax
- backup_conn = wiredtiger_open(self.backup_dir, backup_conn_params)
+ backup_conn = self.wiredtiger_open(self.backup_dir, backup_conn_params)
try:
self.check(backup_conn.open_session(), None, committed)
finally:
@@ -178,7 +177,8 @@ class test_txn02(wttest.WiredTigerTestCase, suite_subprocess):
endcount = 2
count = 0
while count < endcount:
- backup_conn = wiredtiger_open(self.backup_dir, backup_conn_params)
+ backup_conn = self.wiredtiger_open(self.backup_dir,
+ backup_conn_params)
try:
self.check(backup_conn.open_session(), None, committed)
finally:
diff --git a/test/suite/test_txn03.py b/test/suite/test_txn03.py
index e2efef1742e..97180a75949 100644
--- a/test/suite/test_txn03.py
+++ b/test/suite/test_txn03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -46,13 +46,6 @@ class test_txn03(wttest.WiredTigerTestCase):
('var', dict(create_params = "key_format=S,value_format=S")),
])
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir, 'create,' +
- ('error_prefix="%s: ",' % self.shortid()))
- self.pr(`conn`)
- return conn
-
def test_ops(self):
self.session.create(self.uri1, self.create_params)
self.session.create(self.uri2, self.create_params)
diff --git a/test/suite/test_txn04.py b/test/suite/test_txn04.py
index f9f660223da..de49c5fe235 100644
--- a/test/suite/test_txn04.py
+++ b/test/suite/test_txn04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import shutil, os
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios
import wttest
@@ -78,7 +77,7 @@ class test_txn04(wttest.WiredTigerTestCase, suite_subprocess):
'create,error_prefix="%s: ",' % self.shortid() + \
'transaction_sync="%s",' % self.txn_sync
# print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- conn = wiredtiger_open(dir, conn_params)
+ conn = self.wiredtiger_open(dir, conn_params)
self.pr(`conn`)
self.session2 = conn.open_session()
return conn
@@ -124,7 +123,7 @@ class test_txn04(wttest.WiredTigerTestCase, suite_subprocess):
self.runWt(cmd.split())
self.exception='false'
backup_conn_params = 'log=(enabled,file_max=%s)' % self.logmax
- backup_conn = wiredtiger_open(self.backup_dir, backup_conn_params)
+ backup_conn = self.wiredtiger_open(self.backup_dir, backup_conn_params)
try:
self.check(backup_conn.open_session(), None, committed)
except:
diff --git a/test/suite/test_txn05.py b/test/suite/test_txn05.py
index d427b893b17..bb68034ca04 100644
--- a/test/suite/test_txn05.py
+++ b/test/suite/test_txn05.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios
import wttest
@@ -79,7 +78,7 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
'create,error_prefix="%s: ",' % self.shortid() + \
'transaction_sync="%s",' % self.txn_sync
# print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- conn = wiredtiger_open(dir, conn_params)
+ conn = self.wiredtiger_open(dir, conn_params)
self.pr(`conn`)
self.session2 = conn.open_session()
return conn
@@ -114,7 +113,7 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
# recovery and see the committed results.
self.backup(self.backup_dir)
backup_conn_params = 'log=(enabled,file_max=%s)' % self.logmax
- backup_conn = wiredtiger_open(self.backup_dir, backup_conn_params)
+ backup_conn = self.wiredtiger_open(self.backup_dir, backup_conn_params)
try:
self.check(backup_conn.open_session(), None, committed)
finally:
@@ -138,7 +137,8 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
endcount = 2
count = 0
while count < endcount:
- backup_conn = wiredtiger_open(self.backup_dir, backup_conn_params)
+ backup_conn = self.wiredtiger_open(self.backup_dir,
+ backup_conn_params)
try:
self.check(backup_conn.open_session(), None, committed)
finally:
diff --git a/test/suite/test_txn06.py b/test/suite/test_txn06.py
index 4e3416c2235..9c1d0335d47 100644
--- a/test/suite/test_txn06.py
+++ b/test/suite/test_txn06.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_txn07.py b/test/suite/test_txn07.py
index fa522582a8e..94c26990178 100644
--- a/test/suite/test_txn07.py
+++ b/test/suite/test_txn07.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat
+from wiredtiger import stat
from wtscenario import multiply_scenarios, number_scenarios
import wttest
@@ -90,7 +90,7 @@ class test_txn07(wttest.WiredTigerTestCase, suite_subprocess):
'transaction_sync="%s",' % self.txn_sync
# print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
try:
- conn = wiredtiger_open(dir, conn_params)
+ conn = self.wiredtiger_open(dir, conn_params)
except wiredtiger.WiredTigerError as e:
print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
self.pr(`conn`)
@@ -142,7 +142,7 @@ class test_txn07(wttest.WiredTigerTestCase, suite_subprocess):
backup_conn_params = 'log=(enabled,file_max=%s,' % self.logmax + \
'compressor=%s)' % self.compress + \
self.extensionArg(self.compress)
- backup_conn = wiredtiger_open(self.backup_dir, backup_conn_params)
+ backup_conn = self.wiredtiger_open(self.backup_dir, backup_conn_params)
try:
self.check(backup_conn.open_session(), None, committed)
finally:
diff --git a/test/suite/test_txn08.py b/test/suite/test_txn08.py
index d35a0c70b3b..36253856285 100644
--- a/test/suite/test_txn08.py
+++ b/test/suite/test_txn08.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,7 @@
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat
+from wiredtiger import stat
from wtscenario import multiply_scenarios, number_scenarios
import wttest
@@ -41,24 +41,10 @@ class test_txn08(wttest.WiredTigerTestCase, suite_subprocess):
tablename = 'test_txn08'
uri = 'table:' + tablename
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
- # Cycle through the different transaction_sync values in a
- # deterministic manner.
- self.txn_sync = '(method=dsync,enabled)'
- conn_params = \
- 'log=(archive=false,enabled,file_max=%s)' % self.logmax + \
- ',create,error_prefix="%s: ",' % self.shortid() + \
- 'transaction_sync="%s",' % self.txn_sync
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- try:
- conn = wiredtiger_open(dir, conn_params)
- except wiredtiger.WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
- self.pr(`conn`)
- self.session2 = conn.open_session()
- return conn
+ # Turn on logging for this test.
+ def conn_config(self, dir):
+ return 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
+ 'transaction_sync="(method=dsync,enabled)"'
def test_printlog_unicode(self):
# print "Creating %s with config '%s'" % (self.uri, self.create_params)
@@ -82,6 +68,11 @@ class test_txn08(wttest.WiredTigerTestCase, suite_subprocess):
self.runWt(['printlog'], outfilename='printlog.out')
self.check_file_contains('printlog.out',
'\\u0001\\u0002abcd\\u0003\\u0004')
+ self.runWt(['printlog', '-x'], outfilename='printlog-hex.out')
+ self.check_file_contains('printlog-hex.out',
+ '\\u0001\\u0002abcd\\u0003\\u0004')
+ self.check_file_contains('printlog-hex.out',
+ '0102616263640304')
if __name__ == '__main__':
wttest.run()
diff --git a/test/suite/test_txn09.py b/test/suite/test_txn09.py
index df085a75d67..f536d65205d 100644
--- a/test/suite/test_txn09.py
+++ b/test/suite/test_txn09.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -91,7 +90,7 @@ class test_txn09(wttest.WiredTigerTestCase, suite_subprocess):
'transaction_sync=(enabled=false),'
# print "Opening conn at '%s' with config '%s'" % (dir, conn_params)
- conn = wiredtiger_open(dir, conn_params)
+ conn = self.wiredtiger_open(dir, conn_params)
self.pr(`conn`)
self.session2 = conn.open_session()
return conn
diff --git a/test/suite/test_txn10.py b/test/suite/test_txn10.py
index 49ef2b10abe..cf9c11dd4ab 100644
--- a/test/suite/test_txn10.py
+++ b/test/suite/test_txn10.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -40,13 +39,8 @@ class test_txn10(wttest.WiredTigerTestCase, suite_subprocess):
t1 = 'table:test_txn10_1'
t2 = 'table:test_txn10_2'
create_params = 'key_format=i,value_format=i'
-
- # Overrides WiredTigerTestCase, add extra config params
- def setUpConnectionOpen(self, dir):
- self.conn_config = \
- 'log=(archive=false,enabled,file_max=100K),' + \
+ conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
'transaction_sync=(method=dsync,enabled)'
- return wttest.WiredTigerTestCase.setUpConnectionOpen(self, dir)
def simulate_crash_restart(self, olddir, newdir):
''' Simulate a crash from olddir and restart in newdir. '''
diff --git a/test/suite/test_txn11.py b/test/suite/test_txn11.py
index b97df689905..ab87283c014 100644
--- a/test/suite/test_txn11.py
+++ b/test/suite/test_txn11.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import fnmatch, os, time
from suite_subprocess import suite_subprocess
from helper import simple_populate
-from wiredtiger import wiredtiger_open
import wttest
class test_txn11(wttest.WiredTigerTestCase, suite_subprocess):
@@ -44,15 +43,11 @@ class test_txn11(wttest.WiredTigerTestCase, suite_subprocess):
source_uri = 'table:' + tablename + "_src"
uri = 'table:' + tablename
- def setUpConnectionOpen(self, dir):
- self.home = dir
- conn_params = \
- 'create,error_prefix="%s: ",' % self.shortid() + \
- 'log=(archive=%s,enabled,file_max=%s,prealloc=false),' % (self.archive, self.logmax) + \
+ # Turn on logging for this test.
+ def conn_config(self, dir):
+ return 'log=(archive=%s,' % self.archive + \
+ 'enabled,file_max=%s,prealloc=false),' % self.logmax + \
'transaction_sync=(enabled=false),'
- conn = wiredtiger_open(dir, conn_params)
- self.pr(`conn`)
- return conn
def run_checkpoints(self):
orig_logs = fnmatch.filter(os.listdir(self.home), "*Log*")
diff --git a/test/suite/test_txn12.py b/test/suite/test_txn12.py
index 71e57ea7432..8ae9df33990 100644
--- a/test/suite/test_txn12.py
+++ b/test/suite/test_txn12.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_txn13.py b/test/suite/test_txn13.py
index d60fee65bce..dd6a6dbcd6d 100644
--- a/test/suite/test_txn13.py
+++ b/test/suite/test_txn13.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -33,7 +33,6 @@
#import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import check_scenarios
import wiredtiger, wttest
@@ -50,19 +49,10 @@ class test_txn13(wttest.WiredTigerTestCase, suite_subprocess):
('4gb', dict(expect_err=True, valuesize=4194304))
])
- # Overrides WiredTigerTestCase
- def setUpConnectionOpen(self, dir):
- self.home = dir
- conn_params = \
- 'log=(archive=false,enabled,file_max=%s)' % self.logmax + \
- ',create,cache_size=8G,error_prefix="%s: ",' % self.shortid()
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- try:
- conn = wiredtiger_open(dir, conn_params)
- except wiredtiger.WiredTigerError as e:
- print "Failed conn at '%s' with config '%s'" % (dir, conn_params)
- self.pr(`conn`)
- return conn
+ # Turn on logging for this test.
+ def conn_config(self, dir):
+ return 'log=(archive=false,enabled,file_max=%s)' % self.logmax + \
+ ',cache_size=8G'
@wttest.longtest('txn tests with huge values')
def test_large_values(self):
diff --git a/test/suite/test_txn14.py b/test/suite/test_txn14.py
index a126f843768..371f4402567 100644
--- a/test/suite/test_txn14.py
+++ b/test/suite/test_txn14.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,6 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -41,6 +40,7 @@ class test_txn14(wttest.WiredTigerTestCase, suite_subprocess):
create_params = 'key_format=i,value_format=i'
entries = 10000
extra_entries = 5
+ conn_config = 'log=(archive=false,enabled,file_max=100K)'
sync_list = [
('write', dict(sync='off')),
@@ -49,11 +49,6 @@ class test_txn14(wttest.WiredTigerTestCase, suite_subprocess):
]
scenarios = multiply_scenarios('.', sync_list)
- # Overrides WiredTigerTestCase, add extra config params
- def setUpConnectionOpen(self, dir):
- self.conn_config = 'log=(archive=false,enabled,file_max=100K),'
- return wttest.WiredTigerTestCase.setUpConnectionOpen(self, dir)
-
def simulate_crash_restart(self, olddir, newdir):
''' Simulate a crash from olddir and restart in newdir. '''
# with the connection still open, copy files to new directory
diff --git a/test/suite/test_txn15.py b/test/suite/test_txn15.py
index e36e8556d1e..809dce4ebfa 100644
--- a/test/suite/test_txn15.py
+++ b/test/suite/test_txn15.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -32,7 +32,7 @@
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
-from wiredtiger import wiredtiger_open, stat
+from wiredtiger import stat
from wtscenario import multiply_scenarios, number_scenarios, prune_scenarios
import wttest
@@ -40,6 +40,13 @@ class test_txn15(wttest.WiredTigerTestCase, suite_subprocess):
uri = 'table:test_txn15_1'
create_params = 'key_format=i,value_format=i'
entries = 100
+ # Turn on logging for this test.
+ def conn_config(self, dir):
+ return 'statistics=(fast),' + \
+ 'log=(archive=false,enabled,file_max=100K),' + \
+ 'use_environment=false,' + \
+ 'transaction_sync=(enabled=%s),' % self.conn_enable + \
+ 'transaction_sync=(method=%s),' % self.conn_method
conn_sync_enabled = [
('en_off', dict(conn_enable='false')),
@@ -67,23 +74,6 @@ class test_txn15(wttest.WiredTigerTestCase, suite_subprocess):
scenarios = multiply_scenarios('.', conn_sync_enabled, conn_sync_method,
begin_sync, commit_sync)
- # Overrides WiredTigerTestCase, add extra config params
- def setUpConnectionOpen(self, dir):
- self.home = dir
- #
- # Turn off using any environment variables that may be set by the
- # testing infrastructure.
- #
- conn_params = \
- 'create,statistics=(fast),error_prefix="%s: ",' % self.shortid() + \
- 'log=(archive=false,enabled,file_max=100K),' + \
- 'use_environment=false,' + \
- 'transaction_sync=(enabled=%s),' % self.conn_enable + \
- 'transaction_sync=(method=%s),' % self.conn_method
- # print "Creating conn at '%s' with config '%s'" % (dir, conn_params)
- conn = wiredtiger_open(dir, conn_params)
- return conn
-
# Given the different configuration settings determine if this group
# of settings would result in either a wait for write or sync.
# Returns None, "write" or "sync". None means no waiting for either.
diff --git a/test/suite/test_unicode01.py b/test/suite/test_unicode01.py
index 76ebd886319..0796abf4607 100644
--- a/test/suite/test_unicode01.py
+++ b/test/suite/test_unicode01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_upgrade.py b/test/suite/test_upgrade.py
index df8024413cc..357e437f14d 100644
--- a/test/suite/test_upgrade.py
+++ b/test/suite/test_upgrade.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util01.py b/test/suite/test_util01.py
index 29033fb43ba..726a53eb5ca 100644
--- a/test/suite/test_util01.py
+++ b/test/suite/test_util01.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util02.py b/test/suite/test_util02.py
index 33672411671..51e03d8d105 100644
--- a/test/suite/test_util02.py
+++ b/test/suite/test_util02.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util03.py b/test/suite/test_util03.py
index 9e3c81334ec..c3ea48b8f5e 100644
--- a/test/suite/test_util03.py
+++ b/test/suite/test_util03.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util04.py b/test/suite/test_util04.py
index 09b4facb220..d165d350adb 100644
--- a/test/suite/test_util04.py
+++ b/test/suite/test_util04.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util07.py b/test/suite/test_util07.py
index 37de647cae1..2bbb40422bd 100644
--- a/test/suite/test_util07.py
+++ b/test/suite/test_util07.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util08.py b/test/suite/test_util08.py
index 7c4c5cfcf85..b2bb1e067e0 100644
--- a/test/suite/test_util08.py
+++ b/test/suite/test_util08.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util09.py b/test/suite/test_util09.py
index e5b0b57a23c..ddf01b980ea 100644
--- a/test/suite/test_util09.py
+++ b/test/suite/test_util09.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util11.py b/test/suite/test_util11.py
index d9b226b506a..6bf87525164 100644
--- a/test/suite/test_util11.py
+++ b/test/suite/test_util11.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_util12.py b/test/suite/test_util12.py
index 0faa8dbf8bd..e8226a3146c 100644
--- a/test/suite/test_util12.py
+++ b/test/suite/test_util12.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_verify.py b/test/suite/test_verify.py
index 5889054f269..5ce926027ef 100644
--- a/test/suite/test_verify.py
+++ b/test/suite/test_verify.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/test_version.py b/test/suite/test_version.py
index 4d59ea6d279..f8835e5bd05 100644
--- a/test/suite/test_version.py
+++ b/test/suite/test_version.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/wtscenario.py b/test/suite/wtscenario.py
index 0f8e8c30c1f..7fad7c228fb 100644
--- a/test/suite/wtscenario.py
+++ b/test/suite/wtscenario.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/test/suite/wttest.py b/test/suite/wttest.py
index 443fabb00b2..b5a58d1566f 100644
--- a/test/suite/wttest.py
+++ b/test/suite/wttest.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -135,9 +135,31 @@ class CapturedFd(object):
self.expectpos = os.path.getsize(self.filename)
+class TestSuiteConnection(object):
+ def __init__(self, conn, connlist):
+ connlist.append(conn)
+ self._conn = conn
+ self._connlist = connlist
+
+ def close(self):
+ self._connlist.remove(self._conn)
+ return self._conn.close()
+
+ # Proxy everything except what we explicitly define to the
+ # wrapped connection
+ def __getattr__(self, attr):
+ if attr in self.__dict__:
+ return getattr(self, attr)
+ else:
+ return getattr(self._conn, attr)
+
+
class WiredTigerTestCase(unittest.TestCase):
_globalSetup = False
_printOnceSeen = {}
+
+ # conn_config can be overridden to add to basic connection configuration.
+ # Can be a string or a callable function or lambda expression.
conn_config = ''
@staticmethod
@@ -198,13 +220,32 @@ class WiredTigerTestCase(unittest.TestCase):
return "%s.%s.%s" % (self.__module__,
self.className(), self._testMethodName)
- # Can be overridden
- def setUpConnectionOpen(self, dir):
- conn = wiredtiger.wiredtiger_open(dir,
- 'create,error_prefix="%s",%s' % (self.shortid(), self.conn_config))
+ # Can be overridden, but first consider setting self.conn_config .
+ def setUpConnectionOpen(self, home):
+ self.home = home
+ config = self.conn_config
+ if hasattr(config, '__call__'):
+ config = config(home)
+ # In case the open starts additional threads, flush first to
+ # avoid confusion.
+ sys.stdout.flush()
+ conn_param = 'create,error_prefix="%s: ",%s' % (self.shortid(), config)
+ try:
+ conn = self.wiredtiger_open(home, conn_param)
+ except wiredtiger.WiredTigerError as e:
+ print "Failed wiredtiger_open: dir '%s', config '%s'" % \
+ (home, conn_param)
+ raise e
self.pr(`conn`)
return conn
+ # Replacement for wiredtiger.wiredtiger_open that returns
+ # a proxied connection that knows to close it itself at the
+ # end of the run, unless it was already closed.
+ def wiredtiger_open(self, home=None, config=''):
+ conn = wiredtiger.wiredtiger_open(home, config)
+ return TestSuiteConnection(conn, self._connections)
+
# Can be overridden
def setUpSessionOpen(self, conn):
return conn.open_session(None)
@@ -244,6 +285,8 @@ class WiredTigerTestCase(unittest.TestCase):
self.__class__.wt_ntests += 1
if WiredTigerTestCase._verbose > 2:
self.prhead('started in ' + self.testdir, True)
+ # tearDown needs connections list, set it here in case the open fails.
+ self._connections = []
self.origcwd = os.getcwd()
shutil.rmtree(self.testdir, ignore_errors=True)
if os.path.exists(self.testdir):
@@ -269,10 +312,18 @@ class WiredTigerTestCase(unittest.TestCase):
skipped = (excinfo[0] == unittest.SkipTest)
self.pr('finishing')
- try:
- self.close_conn()
- except:
- pass
+ # Close all connections that weren't explicitly closed.
+ # Connections left open (as a result of a test failure)
+ # can result in cascading errors. We also make sure
+ # self.conn is on the list of active connections.
+ if not self.conn in self._connections:
+ self._connections.append(self.conn)
+ for conn in self._connections:
+ try:
+ conn.close()
+ except:
+ pass
+ self._connections = []
try:
self.fdTearDown()
diff --git a/test/suite/wtthread.py b/test/suite/wtthread.py
index 33c5c61e00f..046a915394d 100644
--- a/test/suite/wtthread.py
+++ b/test/suite/wtthread.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
@@ -70,30 +70,35 @@ class backup_thread(threading.Thread):
cursor.close()
- bkp_conn = wiredtiger.wiredtiger_open(self.backup_dir)
- bkp_session = bkp_conn.open_session()
- # Verify that the backup was OK.
- uris = list()
- for next_file in files:
- if next_file.startswith("WiredTiger"):
- continue
- uri = "file:" + next_file
- uris.append(uri)
+ bkp_conn = None
+ try:
+ bkp_conn = wiredtiger.wiredtiger_open(self.backup_dir)
+ bkp_session = bkp_conn.open_session()
+ # Verify that the backup was OK.
+ uris = list()
+ for next_file in files:
+ if next_file.startswith("WiredTiger"):
+ continue
+ uri = "file:" + next_file
+ uris.append(uri)
- # TODO: We want a self.assertTrue here - but need to be a wttest to
- # do that..
- if not compare_tables(
+ # TODO: We want a self.assertTrue here - be need to be a
+ # wttest to do that..
+ if not compare_tables(
self, sess, uris, "checkpoint=WiredTigerCheckpoint"):
- print "Error: checkpoint tables differ."
- else:
- wttest.WiredTigerTestCase.printVerbose(
- 3, "Checkpoint tables match")
+ print "Error: checkpoint tables differ."
+ else:
+ wttest.WiredTigerTestCase.printVerbose(
+ 3, "Checkpoint tables match")
- if not compare_tables(self, bkp_session, uris):
- print "Error: backup tables differ."
- else:
- wttest.WiredTigerTestCase.printVerbose(3, "Backup tables match")
- bkp_conn.close()
+ if not compare_tables(self, bkp_session, uris):
+ print "Error: backup tables differ."
+ else:
+ wttest.WiredTigerTestCase.printVerbose(
+ 3, "Backup tables match")
+ finally:
+ if bkp_conn != None:
+ bkp_conn.close()
sess.close()
diff --git a/test/thread/file.c b/test/thread/file.c
index d2cd7f157ab..81ec6ad44f8 100644
--- a/test/thread/file.c
+++ b/test/thread/file.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/rw.c b/test/thread/rw.c
index c9e2e78ec35..913fa6e6c25 100644
--- a/test/thread/rw.c
+++ b/test/thread/rw.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -205,10 +205,10 @@ reader(void *arg)
printf(" read thread %2d starting: tid: %s, file: %s\n",
id, tid, s->name);
- sched_yield(); /* Get all the threads created. */
+ __wt_yield(); /* Get all the threads created. */
if (session_per_op) {
- for (i = 0; i < s->nops; ++i, ++s->reads, sched_yield()) {
+ for (i = 0; i < s->nops; ++i, ++s->reads, __wt_yield()) {
if ((ret = conn->open_session(
conn, NULL, NULL, &session)) != 0)
testutil_die(ret, "conn.open_session");
@@ -226,7 +226,7 @@ reader(void *arg)
if ((ret = session->open_cursor(
session, s->name, NULL, NULL, &cursor)) != 0)
testutil_die(ret, "session.open_cursor");
- for (i = 0; i < s->nops; ++i, ++s->reads, sched_yield())
+ for (i = 0; i < s->nops; ++i, ++s->reads, __wt_yield())
reader_op(session, cursor, s);
if ((ret = session->close(session, NULL)) != 0)
testutil_die(ret, "session.close");
@@ -306,10 +306,10 @@ writer(void *arg)
printf("write thread %2d starting: tid: %s, file: %s\n",
id, tid, s->name);
- sched_yield(); /* Get all the threads created. */
+ __wt_yield(); /* Get all the threads created. */
if (session_per_op) {
- for (i = 0; i < s->nops; ++i, sched_yield()) {
+ for (i = 0; i < s->nops; ++i, __wt_yield()) {
if ((ret = conn->open_session(
conn, NULL, NULL, &session)) != 0)
testutil_die(ret, "conn.open_session");
@@ -327,7 +327,7 @@ writer(void *arg)
if ((ret = session->open_cursor(
session, s->name, NULL, NULL, &cursor)) != 0)
testutil_die(ret, "session.open_cursor");
- for (i = 0; i < s->nops; ++i, sched_yield())
+ for (i = 0; i < s->nops; ++i, __wt_yield())
writer_op(session, cursor, s);
if ((ret = session->close(session, NULL)) != 0)
testutil_die(ret, "session.close");
diff --git a/test/thread/stats.c b/test/thread/stats.c
index 9ea8e6482cb..67a2c02719b 100644
--- a/test/thread/stats.c
+++ b/test/thread/stats.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/t.c b/test/thread/t.c
index 71df65d8419..e72b54bf62a 100644
--- a/test/thread/t.c
+++ b/test/thread/t.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/thread/thread.h b/test/thread/thread.h
index bf2447573de..36cdbebd210 100644
--- a/test/thread/thread.h
+++ b/test/thread/thread.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/utility/test_util.i b/test/utility/test_util.i
index 00948e1f74a..73141bc9be7 100644
--- a/test/utility/test_util.i
+++ b/test/utility/test_util.i
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
diff --git a/test/windows/windows_shim.c b/test/windows/windows_shim.c
index a59060d56e8..6e8da8f86d4 100644
--- a/test/windows/windows_shim.c
+++ b/test/windows/windows_shim.c
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -29,13 +29,6 @@
#include "windows_shim.h"
int
-sched_yield(void)
-{
- (void)SwitchToThread();
- return (0);
-}
-
-int
sleep(int seconds)
{
Sleep(seconds * 1000);
diff --git a/test/windows/windows_shim.h b/test/windows/windows_shim.h
index c124cda6092..c35c27cb7b0 100644
--- a/test/windows/windows_shim.h
+++ b/test/windows/windows_shim.h
@@ -1,5 +1,5 @@
/*-
- * Public Domain 2014-2015 MongoDB, Inc.
+ * Public Domain 2014-2016 MongoDB, Inc.
* Public Domain 2008-2014 WiredTiger, Inc.
*
* This is free and unencumbered software released into the public domain.
@@ -70,11 +70,6 @@ struct timeval {
int gettimeofday(struct timeval* tp, void* tzp);
/*
- * Emulate <sched.h>
- */
-int sched_yield(void);
-
-/*
* Emulate <unistd.h>
*/
typedef uint32_t useconds_t;
diff --git a/tools/wt_ckpt_decode.py b/tools/wt_ckpt_decode.py
new file mode 100644
index 00000000000..f78bf8c34bf
--- /dev/null
+++ b/tools/wt_ckpt_decode.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2016 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.
+
+# Decode a checkpoint 'addr'
+
+import os, sys, getopt
+
+def usage():
+ print 'Usage:\n\
+ $ python .../tools/wt_ckpt_decode.py [ -a allocsize ] addr...\n\
+\n\
+addr is a hex string\n\
+'
+
+def err_usage(msg):
+ print 'wt_ckpt_decode.py: ERROR: ' + msg
+ usage()
+ sys.exit(False)
+
+# Set paths
+wt_disttop = sys.path[0]
+while not os.path.isdir(wt_disttop + '/build_posix'):
+ if wt_disttop == '/':
+ err_usage('current dir not in wiredtiger development directory')
+ wt_disttop = os.path.dirname(wt_disttop)
+sys.path.insert(1, os.path.join(wt_disttop, 'lang', 'python', 'wiredtiger'))
+
+from packing import pack, unpack
+
+def show_one(label, value):
+ l = 16 - len(label)
+ l = l if l > 1 else 1
+ print ' {0}{1}{2:10d} (0x{2:x})'.format(label, (' ' * l), value, value)
+
+def show_triple(triple, name, allocsize):
+ off = triple[0]
+ size = triple[1]
+ csum = triple[2]
+ if size == 0:
+ off = -1
+ csum = 0
+ show_one(name + ' offset', (off + 1) * allocsize)
+ show_one(name + ' size', (size) * allocsize)
+ show_one(name + ' cksum', csum)
+ print ''
+
+def decode_arg(arg, allocsize):
+ addr = arg.decode("hex")
+ version = ord(addr[0])
+ print arg + ': '
+ if version != 1:
+ print '**** ERROR: unknown version ' + str(version)
+ addr = addr[1:]
+ result = unpack('iiiiiiiiiiiiii',addr)
+ if len(result) != 14:
+ print '**** ERROR: result len unexpected: ' + str(len(result))
+ show_triple(result[0:3], 'root', allocsize)
+ show_triple(result[3:6], 'alloc', allocsize)
+ show_triple(result[6:9], 'avail', allocsize)
+ show_triple(result[9:12], 'discard', allocsize)
+ file_size = result[12]
+ ckpt_size = result[13]
+ show_one('file size', file_size)
+ show_one('checkpoint size', ckpt_size)
+
+#decode_arg('018281e420f2fa4a8381e40c5855ca808080808080e22fc0e20fc0', 4096)
+
+allocsize = 4096
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "a:", ["allocsize"])
+except getopt.GetoptError as err:
+ err_usage(str(err))
+for o, a in opts:
+ if o == '-a':
+ allocsize = int(a)
+
+for arg in args:
+ decode_arg(arg, allocsize)
diff --git a/tools/wtstats/test/test_wtstats.py b/tools/wtstats/test/test_wtstats.py
index dd6098fec49..ac730c2fd4d 100644
--- a/tools/wtstats/test/test_wtstats.py
+++ b/tools/wtstats/test/test_wtstats.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
diff --git a/tools/wtstats/wtstats.html.template b/tools/wtstats/wtstats.html.template
index 6d4376c1d82..ef0f60bb4f2 100644
--- a/tools/wtstats/wtstats.html.template
+++ b/tools/wtstats/wtstats.html.template
@@ -9834,7 +9834,7 @@ button.close {
#wrapper {
padding-left: 250px;
- transition: all .4s ease 0;
+ transition: all .4s ease 0s;
}
#sidebar-wrapper {
@@ -9846,7 +9846,7 @@ button.close {
height: 100%;
overflow-y: auto;
z-index: 1000;
- transition: all .4s ease 0;
+ transition: all .4s ease 0s;
border-right: 1px solid #ddd;
}
@@ -9875,7 +9875,7 @@ button.close {
#wrapper.active #sidebar-wrapper {
left: 250px;
width: 250px;
- transition: all .4s ease 0;
+ transition: all .4s ease 0s;
}
}
@@ -10011,17 +10011,19 @@ svg.multiline .line {
}
</style></head><body><div id="app"></div></body><script type="text/javascript">(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
-!function t(e,n,r){function i(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t){{var e=(window.$=window.jQuery=t("jquery"),t("../views/app")),n=t("../models/app");t("debug")("index")}t("bootstrap/js/dropdown"),t("bootstrap/js/collapse"),t("bootstrap/js/transition"),t("bootstrap/js/button");var data="### INSERT DATA HERE ###",r=window.app=new n(data,{parse:!0}),i=document.getElementById("app"),o=new e({model:r,el:i});o.render()},{"../models/app":2,"../views/app":63,"bootstrap/js/button":51,"bootstrap/js/collapse":52,"bootstrap/js/dropdown":53,"bootstrap/js/transition":54,debug:57,jquery:61}],2:[function(t,e){{var n=t("ampersand-state"),r=t("./chart"),i=t("./stat-collection"),o=t("./sidebar"),a=t("lodash"),u=t("debug")("model:app");e.exports=n.extend({children:{sidebar:o,chart:r},collections:{stats:i},props:{selectionState:{type:"array","default":function(){return[]}}},parse:function(t){var e=(new Date).getFullYear(),n={},r=a.map(t.series,function(t){if(-1!==t.key.indexOf(":"))var r=t.key.split(":"),i=r[0].trim(),o=r[1].trim();else var i="stats",o=t.key;var data=a.sortBy(a.map(t.values,function(t,n){var r=n.split(" ");r.splice(2,0,e.toString());var i=r.join(" ");return{x:new Date(i),y:t}}),"x"),u=Math.min.apply(null,data.map(function(t){return t.x}));return data.forEach(function(t){t.xrel=(t.x-u)/1e3}),n[i]=!0,{group:i,name:o,data:data}});n=a.keys(n).map(function(t){return{title:t}});var i={stats:r,sidebar:{panels:n}};return i},initialize:function(){var t=this.sidebar.panels;t.each(function(t){t.app=this}.bind(this)),this.stats.each(function(e){e.app=this,t.get(e.group).stats.add(e)}.bind(this))},clearSelectionState:function(){this.selectionState=[],u("clear")},toggleAllExcept:function(t){this.stats.filter(function(e){return e!==t}).some(function(t){return t.selected});0!==this.selectionState.length&&t.selected?(this.stats.each(function(t,e){t.selected=this.selectionState.length?this.selectionState[e]:!0}.bind(this)),this.clearSelectionState()):(this.selectionState=this.stats.map(function(t){return t.selected}),this.stats.each(function(e){e.selected=e===t}))}})}},{"./chart":3,"./sidebar":7,"./stat-collection":8,"ampersand-state":21,debug:57,lodash:62}],3:[function(t,e){{var n=t("ampersand-state"),r=t("lodash");t("debug")("model:chart"),e.exports=n.extend({props:{xSetting:{type:"string","default":"relative",values:["relative","absolute"]},ySetting:{type:"string","default":"linear",values:["linear","log-scale"]},allowSampling:{type:"boolean","default":!0},subSampled:{type:"boolean","default":!1},recalcXDomain:{type:"boolean","default":!0}},derived:{series:{deps:["parent"],cache:!1,fn:function(){var t=this.parent.stats.filter(function(t){return t.selected}).map(function(t){return r.pick(t,["color","data","name","cid","selected"])});return t}},empty:{deps:["parent","series"],cache:!1,fn:function(){return 0===this.series.length}}}})}},{"ampersand-state":21,debug:57,lodash:62}],4:[function(t,e){{var n=t("d3");e.exports=function(){function t(){var t=n.scale.category20();return t}var e;return{getInstance:function(){return e||(e=t()),e}}}()}},{d3:56}],5:[function(t,e){{var n=t("ampersand-state"),r=t("./stat-collection");t("debug")("model:panel"),e.exports=n.extend({collections:{stats:r},props:{title:{type:"string",required:!0},open:{type:"boolean","default":!1},app:{type:"object"}},derived:{selected:{deps:["stats"],cache:!1,fn:function(){var t=this.stats.filter(function(t){return t.selected});return t.length===this.stats.length?"all":0===t.length?"none":"some"}},suptitle:{deps:["title"],cache:!1,fn:function(){var t=this.title.split(" ");return t.length>1?t[0]:""}},subtitle:{deps:["title"],fn:function(){var t=this.title.split(" ");return t.length>1?t[1]:this.title}}}})}},{"./stat-collection":8,"ampersand-state":21,debug:57}],6:[function(t,e){{var n=t("ampersand-state");t("debug")("model:search"),e.exports=n.extend({props:{content:{type:"string","default":""}},derived:{empty:{deps:["content"],fn:function(){return""===this.content}}}})}},{"ampersand-state":21,debug:57}],7:[function(t,e){{var n=t("ampersand-state"),r=t("ampersand-collection"),i=t("./search"),o=t("./panel"),a=(t("lodash"),t("debug")("model:sidebar"),r.extend({mainIndex:"title",model:o}));e.exports=n.extend({children:{search:i},collections:{panels:a}})}},{"./panel":5,"./search":6,"ampersand-collection":12,"ampersand-state":21,debug:57,lodash:62}],8:[function(t,e){{var n=t("ampersand-collection"),r=t("ampersand-collection-underscore-mixin"),i=t("./stat");e.exports=n.extend(r,{comparator:"name",model:i})}},{"./stat":9,"ampersand-collection":12,"ampersand-collection-underscore-mixin":10}],9:[function(t,e){{var n=t("ampersand-state"),r=t("./colors").getInstance();t("debug")("model:stat"),e.exports=n.extend({props:{name:{type:"string","default":""},group:{type:"string","default":""},selected:{type:"boolean","default":!1},data:{type:"object"},app:{type:"object"}},derived:{color:{cache:!0,fn:function(){return r(this.cid)}}}})}},{"./colors":4,"ampersand-state":21,debug:57}],10:[function(t,e){"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-underscore-mixin"]=window.ampersand["ampersand-collection-underscore-mixin"]||[],window.ampersand["ampersand-collection-underscore-mixin"].push("1.0.3"));var n=t("underscore"),r=[].slice,i={},o=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample","partition"];n.each(o,function(t){n[t]&&(i[t]=function(){var e=r.call(arguments);return e.unshift(this.models),n[t].apply(n,e)})});var a=["groupBy","countBy","sortBy","indexBy"];n.each(a,function(t){n[t]&&(i[t]=function(e,r){var i=n.isFunction(e)?e:function(t){return t.get?t.get(e):t[e]};return n[t](this.models,i,r)})}),i.where=function(t,e){return n.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){var n;for(var r in t)if(n=e.get?e.get(r):e[r],t[r]!==n)return!1;return!0})},i.findWhere=function(t){return this.where(t,!0)},i.pluck=function(t){return n.invoke(this.models,"get",t)},e.exports=i},{underscore:11}],11:[function(t,e,n){(function(){function t(t){function e(e,n,r,i,o,a){for(;o>=0&&a>o;o+=t){var u=i?i[o]:o;r=n(r,e[u],u,e)}return r}return function(n,r,i,o){r=x(r,o,4);var a=!E(n)&&b.keys(n),u=(a||n).length,s=t>0?0:u-1;return arguments.length<3&&(i=n[a?a[s]:s],s+=t),e(n,r,i,a,s,u)}}function r(t){return function(e,n,r){n=w(n,r);for(var i=null!=e&&e.length,o=t>0?0:i-1;o>=0&&i>o;o+=t)if(n(e[o],o,e))return o;return-1}}function i(t,e){var n=A.length,r=t.constructor,i=b.isFunction(r)&&r.prototype||s,o="constructor";for(b.has(t,o)&&!b.contains(e,o)&&e.push(o);n--;)o=A[n],o in t&&t[o]!==i[o]&&!b.contains(e,o)&&e.push(o)}var o=this,a=o._,u=Array.prototype,s=Object.prototype,l=Function.prototype,c=u.push,f=u.slice,h=s.toString,p=s.hasOwnProperty,d=Array.isArray,g=Object.keys,v=l.bind,m=Object.create,y=function(){},b=function(t){return t instanceof b?t:this instanceof b?void(this._wrapped=t):new b(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=b),n._=b):o._=b,b.VERSION="1.8.2";var x=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,n){return null==t?b.identity:b.isFunction(t)?x(t,e,n):b.isObject(t)?b.matcher(t):b.property(t)};b.iteratee=function(t,e){return w(t,e,1/0)};var _=function(t,e){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var i=1;r>i;i++)for(var o=arguments[i],a=t(o),u=a.length,s=0;u>s;s++){var l=a[s];e&&void 0!==n[l]||(n[l]=o[l])}return n}},M=function(t){if(!b.isObject(t))return{};if(m)return m(t);y.prototype=t;var e=new y;return y.prototype=null,e},k=Math.pow(2,53)-1,E=function(t){var e=t&&t.length;return"number"==typeof e&&e>=0&&k>=e};b.each=b.forEach=function(t,e,n){e=x(e,n);var r,i;if(E(t))for(r=0,i=t.length;i>r;r++)e(t[r],r,t);else{var o=b.keys(t);for(r=0,i=o.length;i>r;r++)e(t[o[r]],o[r],t)}return t},b.map=b.collect=function(t,e,n){e=w(e,n);for(var r=!E(t)&&b.keys(t),i=(r||t).length,o=Array(i),a=0;i>a;a++){var u=r?r[a]:a;o[a]=e(t[u],u,t)}return o},b.reduce=b.foldl=b.inject=t(1),b.reduceRight=b.foldr=t(-1),b.find=b.detect=function(t,e,n){var r;return r=E(t)?b.findIndex(t,e,n):b.findKey(t,e,n),void 0!==r&&-1!==r?t[r]:void 0},b.filter=b.select=function(t,e,n){var r=[];return e=w(e,n),b.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},b.reject=function(t,e,n){return b.filter(t,b.negate(w(e)),n)},b.every=b.all=function(t,e,n){e=w(e,n);for(var r=!E(t)&&b.keys(t),i=(r||t).length,o=0;i>o;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},b.some=b.any=function(t,e,n){e=w(e,n);for(var r=!E(t)&&b.keys(t),i=(r||t).length,o=0;i>o;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},b.contains=b.includes=b.include=function(t,e,n){return E(t)||(t=b.values(t)),b.indexOf(t,e,"number"==typeof n&&n)>=0},b.invoke=function(t,e){var n=f.call(arguments,2),r=b.isFunction(e);return b.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},b.pluck=function(t,e){return b.map(t,b.property(e))},b.where=function(t,e){return b.filter(t,b.matcher(e))},b.findWhere=function(t,e){return b.find(t,b.matcher(e))},b.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e&&null!=t){t=E(t)?t:b.values(t);for(var u=0,s=t.length;s>u;u++)r=t[u],r>o&&(o=r)}else e=w(e,n),b.each(t,function(t,n,r){i=e(t,n,r),(i>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},b.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t){t=E(t)?t:b.values(t);for(var u=0,s=t.length;s>u;u++)r=t[u],o>r&&(o=r)}else e=w(e,n),b.each(t,function(t,n,r){i=e(t,n,r),(a>i||1/0===i&&1/0===o)&&(o=t,a=i)});return o},b.shuffle=function(t){for(var e,n=E(t)?t:b.values(t),r=n.length,i=Array(r),o=0;r>o;o++)e=b.random(0,o),e!==o&&(i[o]=i[e]),i[e]=n[o];return i},b.sample=function(t,e,n){return null==e||n?(E(t)||(t=b.values(t)),t[b.random(t.length-1)]):b.shuffle(t).slice(0,Math.max(0,e))},b.sortBy=function(t,e,n){return e=w(e,n),b.pluck(b.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var C=function(t){return function(e,n,r){var i={};return n=w(n,r),b.each(e,function(r,o){var a=n(r,o,e);t(i,r,a)}),i}};b.groupBy=C(function(t,e,n){b.has(t,n)?t[n].push(e):t[n]=[e]}),b.indexBy=C(function(t,e,n){t[n]=e}),b.countBy=C(function(t,e,n){b.has(t,n)?t[n]++:t[n]=1}),b.toArray=function(t){return t?b.isArray(t)?f.call(t):E(t)?b.map(t,b.identity):b.values(t):[]},b.size=function(t){return null==t?0:E(t)?t.length:b.keys(t).length},b.partition=function(t,e,n){e=w(e,n);var r=[],i=[];return b.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},b.first=b.head=b.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:b.initial(t,t.length-e)},b.initial=function(t,e,n){return f.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},b.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:b.rest(t,Math.max(0,t.length-e))},b.rest=b.tail=b.drop=function(t,e,n){return f.call(t,null==e||n?1:e)},b.compact=function(t){return b.filter(t,b.identity)};var S=function(t,e,n,r){for(var i=[],o=0,a=r||0,u=t&&t.length;u>a;a++){var s=t[a];if(E(s)&&(b.isArray(s)||b.isArguments(s))){e||(s=S(s,e,n));var l=0,c=s.length;for(i.length+=c;c>l;)i[o++]=s[l++]}else n||(i[o++]=s)}return i};b.flatten=function(t,e){return S(t,e,!1)},b.without=function(t){return b.difference(t,f.call(arguments,1))},b.uniq=b.unique=function(t,e,n,r){if(null==t)return[];b.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=w(n,r));for(var i=[],o=[],a=0,u=t.length;u>a;a++){var s=t[a],l=n?n(s,a,t):s;e?(a&&o===l||i.push(s),o=l):n?b.contains(o,l)||(o.push(l),i.push(s)):b.contains(i,s)||i.push(s)}return i},b.union=function(){return b.uniq(S(arguments,!0,!0))},b.intersection=function(t){if(null==t)return[];for(var e=[],n=arguments.length,r=0,i=t.length;i>r;r++){var o=t[r];if(!b.contains(e,o)){for(var a=1;n>a&&b.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},b.difference=function(t){var e=S(arguments,!0,!0,1);return b.filter(t,function(t){return!b.contains(e,t)})},b.zip=function(){return b.unzip(arguments)},b.unzip=function(t){for(var e=t&&b.max(t,"length").length||0,n=Array(e),r=0;e>r;r++)n[r]=b.pluck(t,r);return n},b.object=function(t,e){for(var n={},r=0,i=t&&t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},b.indexOf=function(t,e,n){var r=0,i=t&&t.length;if("number"==typeof n)r=0>n?Math.max(0,i+n):n;else if(n&&i)return r=b.sortedIndex(t,e),t[r]===e?r:-1;if(e!==e)return b.findIndex(f.call(t,r),b.isNaN);for(;i>r;r++)if(t[r]===e)return r;return-1},b.lastIndexOf=function(t,e,n){var r=t?t.length:0;if("number"==typeof n&&(r=0>n?r+n+1:Math.min(r,n+1)),e!==e)return b.findLastIndex(f.call(t,0,r),b.isNaN);for(;--r>=0;)if(t[r]===e)return r;return-1},b.findIndex=r(1),b.findLastIndex=r(-1),b.sortedIndex=function(t,e,n,r){n=w(n,r,1);for(var i=n(e),o=0,a=t.length;a>o;){var u=Math.floor((o+a)/2);n(t[u])<i?o=u+1:a=u}return o},b.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;r>o;o++,t+=n)i[o]=t;return i};var T=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=M(t.prototype),a=t.apply(o,i);return b.isObject(a)?a:o};b.bind=function(t,e){if(v&&t.bind===v)return v.apply(t,f.call(arguments,1));if(!b.isFunction(t))throw new TypeError("Bind must be called on a function");var n=f.call(arguments,2),r=function(){return T(t,r,e,this,n.concat(f.call(arguments)))};return r},b.partial=function(t){var e=f.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;i>a;a++)o[a]=e[a]===b?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return T(t,n,this,this,o)};return n},b.bindAll=function(t){var e,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(e=1;r>e;e++)n=arguments[e],t[n]=b.bind(t[n],t);return t},b.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return b.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},b.delay=function(t,e){var n=f.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},b.defer=b.partial(b.delay,b,1),b.throttle=function(t,e,n){var r,i,o,a=null,u=0;n||(n={});var s=function(){u=n.leading===!1?0:b.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var l=b.now();u||n.leading!==!1||(u=l);var c=e-(l-u);return r=this,i=arguments,0>=c||c>e?(a&&(clearTimeout(a),a=null),u=l,o=t.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(s,c)),o}},b.debounce=function(t,e,n){var r,i,o,a,u,s=function(){var l=b.now()-a;e>l&&l>=0?r=setTimeout(s,e-l):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=b.now();var l=n&&!r;return r||(r=setTimeout(s,e)),l&&(u=t.apply(o,i),o=i=null),u}},b.wrap=function(t,e){return b.partial(e,t)},b.negate=function(t){return function(){return!t.apply(this,arguments)}},b.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},b.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},b.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),1>=t&&(e=null),n}},b.once=b.partial(b.before,2);var j=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];b.keys=function(t){if(!b.isObject(t))return[];if(g)return g(t);var e=[];for(var n in t)b.has(t,n)&&e.push(n);return j&&i(t,e),e},b.allKeys=function(t){if(!b.isObject(t))return[];var e=[];for(var n in t)e.push(n);return j&&i(t,e),e},b.values=function(t){for(var e=b.keys(t),n=e.length,r=Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},b.mapObject=function(t,e,n){e=w(e,n);for(var r,i=b.keys(t),o=i.length,a={},u=0;o>u;u++)r=i[u],a[r]=e(t[r],r,t);return a},b.pairs=function(t){for(var e=b.keys(t),n=e.length,r=Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},b.invert=function(t){for(var e={},n=b.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},b.functions=b.methods=function(t){var e=[];for(var n in t)b.isFunction(t[n])&&e.push(n);return e.sort()},b.extend=_(b.allKeys),b.extendOwn=b.assign=_(b.keys),b.findKey=function(t,e,n){e=w(e,n);for(var r,i=b.keys(t),o=0,a=i.length;a>o;o++)if(r=i[o],e(t[r],r,t))return r},b.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;b.isFunction(e)?(i=b.allKeys(a),r=x(e,n)):(i=S(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var u=0,s=i.length;s>u;u++){var l=i[u],c=a[l];r(c,l,a)&&(o[l]=c)}return o},b.omit=function(t,e,n){if(b.isFunction(e))e=b.negate(e);else{var r=b.map(S(arguments,!1,!1,1),String);e=function(t,e){return!b.contains(r,e)}}return b.pick(t,e,n)},b.defaults=_(b.allKeys,!0),b.clone=function(t){return b.isObject(t)?b.isArray(t)?t.slice():b.extend({},t):t},b.tap=function(t,e){return e(t),t},b.isMatch=function(t,e){var n=b.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;r>o;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var N=function(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof b&&(t=t._wrapped),e instanceof b&&(e=e._wrapped);var i=h.call(t);if(i!==h.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,u=e.constructor;if(a!==u&&!(b.isFunction(a)&&a instanceof a&&b.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var s=n.length;s--;)if(n[s]===t)return r[s]===e;if(n.push(t),r.push(e),o){if(s=t.length,s!==e.length)return!1;for(;s--;)if(!N(t[s],e[s],n,r))return!1}else{var l,c=b.keys(t);if(s=c.length,b.keys(e).length!==s)return!1;for(;s--;)if(l=c[s],!b.has(e,l)||!N(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0};b.isEqual=function(t,e){return N(t,e)},b.isEmpty=function(t){return null==t?!0:E(t)&&(b.isArray(t)||b.isString(t)||b.isArguments(t))?0===t.length:0===b.keys(t).length},b.isElement=function(t){return!(!t||1!==t.nodeType)},b.isArray=d||function(t){return"[object Array]"===h.call(t)},b.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},b.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){b["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}}),b.isArguments(arguments)||(b.isArguments=function(t){return b.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(b.isFunction=function(t){return"function"==typeof t||!1}),b.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},b.isNaN=function(t){return b.isNumber(t)&&t!==+t},b.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===h.call(t)},b.isNull=function(t){return null===t},b.isUndefined=function(t){return void 0===t},b.has=function(t,e){return null!=t&&p.call(t,e)},b.noConflict=function(){return o._=a,this},b.identity=function(t){return t},b.constant=function(t){return function(){return t}},b.noop=function(){},b.property=function(t){return function(e){return null==e?void 0:e[t]}},b.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},b.matcher=b.matches=function(t){return t=b.extendOwn({},t),function(e){return b.isMatch(e,t)}},b.times=function(t,e,n){var r=Array(Math.max(0,t));e=x(e,n,1);for(var i=0;t>i;i++)r[i]=e(i);return r},b.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},b.now=Date.now||function(){return(new Date).getTime()};var O={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},q=b.invert(O),D=function(t){var e=function(e){return t[e]},n="(?:"+b.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};b.escape=D(O),b.unescape=D(q),b.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),b.isFunction(r)?r.call(t):r};var L=0;b.uniqueId=function(t){var e=++L+"";return t?t+e:e},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R=/\\|'|\r|\n|\u2028|\u2029/g,I=function(t){return"\\"+z[t]};b.template=function(t,e,n){!e&&n&&(e=n),e=b.defaults({},e,b.templateSettings);var r=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,u){return o+=t.slice(i,u).replace(R,I),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var s=function(data){return a.call(this,data,b)},l=e.variable||"obj";return s.source="function("+l+"){\n"+o+"}",s},b.chain=function(t){var e=b(t);return e._chain=!0,e};var P=function(t,e){return t._chain?b(e).chain():e};b.mixin=function(t){b.each(b.functions(t),function(e){var n=b[e]=t[e];b.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),P(this,n.apply(b,t))}})},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];b.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],P(this,n)}}),b.each(["concat","join","slice"],function(t){var e=u[t];b.prototype[t]=function(){return P(this,e.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return b})}).call(this)},{}],12:[function(t,e){function n(t,e){if(e||(e={}),e.model&&(this.model=e.model),e.comparator&&(this.comparator=e.comparator),e.parent&&(this.parent=e.parent),!this.mainIndex){var n=this.model&&this.model.prototype&&this.model.prototype.idAttribute;this.mainIndex=n||"id"}this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,u({silent:!0},e))}var r=t("backbone-events-standalone"),i=t("ampersand-class-extend"),o=t("is-array"),a=t("amp-bind"),u=t("extend-object"),s=[].slice;u(n.prototype,r,{initialize:function(){},indexes:[],isModel:function(t){return this.model&&t instanceof this.model},add:function(t,e){return this.set(t,u({merge:!1,add:!0,remove:!1},e))},parse:function(t){return t},serialize:function(){return this.map(function(t){if(t.serialize)return t.serialize();var e={};return u(e,t),delete e.collection,e})},toJSON:function(){return this.serialize()},set:function(t,e){e=u({add:!0,remove:!0,merge:!0},e),e.parse&&(t=this.parse(t,e));var n=!o(t);t=n?t?[t]:[]:t.slice();var r,i,a,s,l,c,f,h=e.at,p=this.comparator&&null==h&&e.sort!==!1,d="string"==typeof this.comparator?this.comparator:null,g=[],v=[],m={},y=e.add,b=e.merge,x=e.remove,w=!p&&y&&x?[]:!1,_=this.model&&this.model.prototype||Object.prototype;for(c=0,f=t.length;f>c;c++){if(a=t[c]||{},r=this.isModel(a)?i=a:_.generateId?_.generateId(a):a[_.idAttribute||this.mainIndex],s=this.get(r))x&&(m[s.cid||s[this.mainIndex]]=!0),b&&(a=a===i?i.attributes:a,e.parse&&(a=s.parse(a,e)),s.set?(s.set(a,e),p&&!l&&s.hasChanged(d)&&(l=!0)):u(s,a)),t[c]=s;else if(y){if(i=t[c]=this._prepareModel(a,e),!i)continue;g.push(i),this._addReference(i,e)}i=s||i,i&&(w&&(i.isNew&&i.isNew()||!i[this.mainIndex]||!m[i.cid||i[this.mainIndex]])&&w.push(i),m[i[this.mainIndex]]=!0)}if(x){for(c=0,f=this.length;f>c;c++)i=this.models[c],m[i.cid||i[this.mainIndex]]||v.push(i);v.length&&this.remove(v,e)}if(g.length||w&&w.length)if(p&&(l=!0),null!=h)for(c=0,f=g.length;f>c;c++)this.models.splice(h+c,0,g[c]);else{var M=w||g;for(c=0,f=M.length;f>c;c++)this.models.push(M[c])}if(l&&this.sort({silent:!0}),!e.silent){for(c=0,f=g.length;f>c;c++)i=g[c],i.trigger?i.trigger("add",i,this,e):this.trigger("add",i,this,e);(l||w&&w.length)&&this.trigger("sort",this,e)}return n?t[0]:t},get:function(t,e){if(t){var n=this._indexes[e||this.mainIndex];return n[t]||n[t[this.mainIndex]]||this._indexes.cid[t]||this._indexes.cid[t.cid]}},at:function(t){return this.models[t]},remove:function(t,e){var n,r,i,a,u=!o(t);for(t=u?[t]:s.call(t),e||(e={}),n=0,r=t.length;r>n;n++)i=t[n]=this.get(t[n]),i&&(this._deIndex(i),a=this.models.indexOf(i),this.models.splice(a,1),e.silent||(e.index=a,i.trigger?i.trigger("remove",i,this,e):this.trigger("remove",i,this,e)),this._removeReference(i,e));return u?t[0]:t},reset:function(t,e){e||(e={});for(var n=0,r=this.models.length;r>n;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,u({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},sort:function(t){var e=this;if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),this.models.sort("string"==typeof this.comparator?function(t,n){return t.get?(t=t.get(e.comparator),n=n.get(e.comparator)):(t=t[e.comparator],n=n[e.comparator]),t>n||void 0===t?1:n>t||void 0===n?-1:0}:1===this.comparator.length?function(t,n){return t=e.comparator(t),n=e.comparator(n),t>n||void 0===t?1:n>t||void 0===n?-1:0}:a(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},_reset:function(){var t=this.indexes||[],e=0;t.push(this.mainIndex),t.push("cid");var n=t.length;for(this.models=[],this._indexes={};n>e;e++)this._indexes[t[e]]={}},_prepareModel:function(t,e){if(!this.model)return t;if(this.isModel(t))return t.collection||(t.collection=this),t;e=e?u({},e):{},e.collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_deIndex:function(t){for(var e in this._indexes)delete this._indexes[e][t[e]||t.get&&t.get(e)]},_index:function(t){for(var e in this._indexes){var n=t[e]||t.get&&t.get(e);n&&(this._indexes[e][n]=t)}},_addReference:function(t){this._index(t),t.collection||(t.collection=this),t.on&&t.on("all",this._onModelEvent,this)},_removeReference:function(t){this===t.collection&&delete t.collection,this._deIndex(t),t.off&&t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){("add"!==t&&"remove"!==t||n===this)&&("destroy"===t&&this.remove(e,r),e&&t==="change:"+this.mainIndex&&(this._deIndex(e),this._index(e)),this.trigger.apply(this,arguments))}}),Object.defineProperties(n.prototype,{length:{get:function(){return this.models.length}},isCollection:{value:!0}});var l=["indexOf","lastIndexOf","every","some","forEach","map","filter","reduce","reduceRight"];l.forEach(function(t){n.prototype[t]=function(){return this.models[t].apply(this.models,arguments)}}),n.prototype.each=n.prototype.forEach,n.extend=i,e.exports=n},{"amp-bind":13,"ampersand-class-extend":16,"backbone-events-standalone":18,"extend-object":19,"is-array":20}],13:[function(t,e){var n=t("amp-is-function"),r=t("amp-is-object"),i=Function.prototype.bind,o=Array.prototype.slice,a=function(){};e.exports=function(t,e){var u,s;if(i&&t.bind===i)return i.apply(t,o.call(arguments,1));if(!n(t))throw new TypeError("Bind must be called on a function");return u=o.call(arguments,2),s=function(){if(!(this instanceof s))return t.apply(e,u.concat(o.call(arguments)));a.prototype=t.prototype;var n=new a;a.prototype=null;var i=t.apply(n,u.concat(o.call(arguments)));return r(i)?i:n}}},{"amp-is-function":14,"amp-is-object":15}],14:[function(t,e){var n=Object.prototype.toString,r=function(t){return"[object Function]"===n.call(t)};"function"!=typeof/./&&(r=function(t){return"function"==typeof t||!1}),e.exports=r},{}],15:[function(t,e){e.exports=function(t){var e=typeof t;return!!t&&("function"===e||"object"===e)}},{}],16:[function(t,e){var n=t("extend-object"),r=function(t){var e,r=this,i=[].slice.call(arguments);e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return r.apply(this,arguments)},n(e,r);var o=function(){this.constructor=e};return o.prototype=r.prototype,e.prototype=new o,t&&(i.unshift(e.prototype),n.apply(null,i)),e.__super__=r.prototype,e};e.exports=r},{"extend-object":19}],17:[function(t,e,n){!function(){function t(){return{keys:Object.keys,uniqueId:function(t){var e=++l+"";return t?t+e:e},has:function(t,e){return u.call(t,e)},each:function(t,e,n){if(null!=t)if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;i>r;r++)if(e.call(n,t[r],r,t)===o)return}else for(var u in t)if(this.has(t,u)&&e.call(n,t[u],u,t)===o)return},once:function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}}}var r,i=this,o={},a=Array.prototype.forEach,u=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l=0,c=t();r={on:function(t,e,n){if(!h(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!h(this,"once",t,[e,n])||!e)return this;var r=this,i=c.once(function(){r.off(t,i),e.apply(this,arguments)});return i._callback=e,this.on(t,i,n)},off:function(t,e,n){var r,i,o,a,u,s,l,f;if(!this._events||!h(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:c.keys(this._events),u=0,s=a.length;s>u;u++)if(t=a[u],o=this._events[t]){if(this._events[t]=r=[],e||n)for(l=0,f=o.length;f>l;l++)i=o[l],(e&&e!==i.callback&&e!==i.callback._callback||n&&n!==i.context)&&r.push(i);r.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!h(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&p(n,e),r&&p(r,arguments),this},stopListening:function(t,e,n){var r=this._listeners;if(!r)return this;var i=!e&&!n;"object"==typeof e&&(n=this),t&&((r={})[t._listenerId]=t);for(var o in r)r[o].off(e,n,this),i&&delete this._listeners[o];return this}};var f=/\s+/,h=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var i in n)t[e].apply(t,[i,n[i]].concat(r));return!1}if(f.test(n)){for(var o=n.split(f),a=0,u=o.length;u>a;a++)t[e].apply(t,[o[a]].concat(r));return!1}return!0},p=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],u=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,u);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e)}},d={listenTo:"on",listenToOnce:"once"};c.each(d,function(t,e){r[e]=function(e,n,r){var i=this._listeners||(this._listeners={}),o=e._listenerId||(e._listenerId=c.uniqueId("l"));return i[o]=e,"object"==typeof n&&(r=this),e[t](n,r,this),this}}),r.bind=r.on,r.unbind=r.off,r.mixin=function(t){var e=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return c.each(e,function(e){t[e]=this[e]
-},this),t},"function"==typeof define?define(function(){return r}):"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=r),n.BackboneEvents=r):i.BackboneEvents=r}(this)},{}],18:[function(t,e){e.exports=t("./backbone-events-standalone")},{"./backbone-events-standalone":17}],19:[function(t,e){var n=[],r=n.forEach,i=n.slice;e.exports=function(t){return r.call(i.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t}},{}],20:[function(t,e){var n=Array.isArray,r=Object.prototype.toString;e.exports=n||function(t){return!!t&&"[object Array]"==r.call(t)}},{}],21:[function(t,e){function n(t,e){e||(e={}),this.cid||(this.cid=a.uniqueId("state")),this._events={},this._values={},this._definition=Object.create(this._definition),e.parse&&(t=this.parse(t,e)),this.parent=e.parent,this.collection=e.collection,this._keyTree=new s,this._initCollections(),this._initChildren(),this._cache={},this._previousAttributes={},t&&this.set(t,a.extend({silent:!0,initial:!0},e)),this._changed={},this._derived&&this._initDerived(),e.init!==!1&&this.initialize.apply(this,arguments)}function r(t,e,n,r){var i,o,u=t._definition[e]={};if(a.isString(n))i=t._ensureValidType(n),i&&(u.type=i);else{if(a.isArray(n)&&(o=n,n={type:o[0],required:o[1],"default":o[2]}),i=t._ensureValidType(n.type),i&&(u.type=i),n.required&&(u.required=!0),n["default"]&&"object"==typeof n["default"])throw new TypeError("The default value for "+e+" cannot be an object/array, must be a value or a function which returns a value/object/array");u["default"]=n["default"],u.allowNull=n.allowNull?n.allowNull:!1,n.setOnce&&(u.setOnce=!0),u.required&&a.isUndefined(u["default"])&&!u.setOnce&&(u["default"]=t._getDefaultForType(i)),u.test=n.test,u.values=n.values}return r&&(u.session=!0),Object.defineProperty(t,e,{set:function(t){this.set(e,t)},get:function(){var t=this._values[e],n=this._dataTypes[u.type];return"undefined"!=typeof t?(n&&n.get&&(t=n.get(t)),t):(t=a.result(u,"default"),this._values[e]=t,t)}}),u}function i(t,e,n){var r=t._derived[e]={fn:a.isFunction(n)?n:n.fn,cache:n.cache!==!1,depList:n.deps||[]};a.each(r.depList,function(n){t._deps[n]=a(t._deps[n]||[]).union([e])}),Object.defineProperty(t,e,{get:function(){return this._getDerivedProperty(e)},set:function(){throw new TypeError('"'+e+"\" is a derived property, it can't be set directly.")}})}function o(t){var e,n=this,o=[].slice.call(arguments);e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return n.apply(this,arguments)},a.extend(e,n);var u=function(){this.constructor=e};u.prototype=n.prototype,e.prototype=new u,e.prototype._derived=a.extend({},n.prototype._derived),e.prototype._deps=a.extend({},n.prototype._deps),e.prototype._definition=a.extend({},n.prototype._definition),e.prototype._collections=a.extend({},n.prototype._collections),e.prototype._children=a.extend({},n.prototype._children),e.prototype._dataTypes=a.extend({},n.prototype._dataTypes||f),t&&o.forEach(function(t){var n=["dataTypes","props","session","derived","collections","children"];t.dataTypes&&a.each(t.dataTypes,function(t,n){e.prototype._dataTypes[n]=t}),t.props&&a.each(t.props,function(t,n){r(e.prototype,n,t)}),t.session&&a.each(t.session,function(t,n){r(e.prototype,n,t,!0)}),t.derived&&a.each(t.derived,function(t,n){i(e.prototype,n,t)}),t.collections&&a.each(t.collections,function(t,n){e.prototype._collections[n]=t}),t.children&&a.each(t.children,function(t,n){e.prototype._children[n]=t}),a.extend(e.prototype,a.omit(t,n))});Object.prototype.toString;return e.__super__=n.prototype,e}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[],window.ampersand["ampersand-state"].push("4.4.5"));var a=t("underscore"),u=t("backbone-events-standalone"),s=t("key-tree-store"),l=t("array-next"),c=/^change:/;a.extend(n.prototype,u,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return null==this.getId()},escape:function(t){return a.escape(this.get(t))},isValid:function(t){return this._validate({},a.extend(t||{},{validate:!0}))},parse:function(t){return t},serialize:function(){var t=this.getAttributes({props:!0},!0);return a.each(this._children,function(e,n){t[n]=this[n].serialize()},this),a.each(this._collections,function(e,n){t[n]=this[n].serialize()},this),t},set:function(t,e,n){var r,i,o,u,s,l,c,f,h,p,d,g,v,m,y,b,x=this,w=this.extraProperties;if(a.isObject(t)||null===t?(h=t,n=e):(h={},h[t]=e),n=n||{},!this._validate(h,n))return!1;g=n.unset,d=n.silent,m=n.initial,i=[],r=this._changing,this._changing=!0,r||(this._previousAttributes=this.attributes,this._changed={});for(f in h){if(u=h[f],o=typeof u,v=this._values[f],s=this._definition[f],!s){if(this._children[f]||this._collections[f]){this[f].set(u,n);continue}if("ignore"===w)continue;if("reject"===w)throw new TypeError('No "'+f+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"');if("allow"===w)s=this._createPropertyDefinition(f,"any");else if(w)throw new TypeError('Invalid value for extraProperties: "'+w+'"')}if(b=this._getCompareForType(s.type),p=this._dataTypes[s.type],p&&p.set&&(l=p.set(u),u=l.val,o=l.type),s.test&&(c=s.test.call(this,u,o)))throw new TypeError("Property '"+f+"' failed validation with error: "+c);if(a.isUndefined(u)&&s.required)throw new TypeError("Required property '"+f+"' must be of type "+s.type+". Tried to set "+u);if(a.isNull(u)&&s.required&&!s.allowNull)throw new TypeError("Property '"+f+"' must be of type "+s.type+" (cannot be null). Tried to set "+u);if(s.type&&"any"!==s.type&&s.type!==o&&!a.isNull(u)&&!a.isUndefined(u))throw new TypeError("Property '"+f+"' must be of type "+s.type+". Tried to set "+u);if(s.values&&!a.contains(s.values,u))throw new TypeError("Property '"+f+"' must be one of values: "+s.values.join(", ")+". Tried to set "+u);if(y=!b(v,u,f),s.setOnce&&void 0!==v&&y&&!m)throw new TypeError("Property '"+f+"' can only be set once.");y?(i.push({prev:v,val:u,key:f}),x._changed[f]=u):delete x._changed[f]}if(a.each(i,function(t){x._previousAttributes[t.key]=t.prev,g?delete x._values[t.key]:x._values[t.key]=t.val}),!d&&i.length&&(x._pending=!0),d||a.each(i,function(t){x.trigger("change:"+t.key,x,t.val,n)}),r)return this;if(!d)for(;this._pending;)this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},get:function(t){return this[t]},toggle:function(t){var e=this._definition[t];if("boolean"===e.type)this[t]=!this[t];else{if(!e||!e.values)throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.");this[t]=l(e.values,this[t])}return this},previousAttributes:function(){return a.clone(this._previousAttributes)},hasChanged:function(t){return null==t?!a.isEmpty(this._changed):a.has(this._changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?a.clone(this._changed):!1;var e,n,r,i=!1,o=this._changing?this._previousAttributes:this.attributes;for(var u in t)n=this._definition[u],n&&(r=this._getCompareForType(n.type),r(o[u],e=t[u])||((i||(i={}))[u]=e));return i},toJSON:function(){return this.serialize()},unset:function(t,e){{var n,r=this._definition[t];r.type}return r.required?(n=a.result(r,"default"),this.set(t,n,e)):this.set(t,n,a.extend({},e,{unset:!0}))},clear:function(t){var e=this;return a.each(a.keys(this.attributes),function(n){e.unset(n,t)}),this},previous:function(t){return null!=t&&Object.keys(this._previousAttributes).length?this._previousAttributes[t]:null},_getDefaultForType:function(t){var e=this._dataTypes[t];return e&&e["default"]},_getCompareForType:function(t){var e=this._dataTypes[t];return e&&e.compare?a.bind(e.compare,this):a.isEqual},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=a.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return n?(this.trigger("invalid",this,n,a.extend(e||{},{validationError:n})),!1):!0},_createPropertyDefinition:function(t,e,n){return r(this,t,e,n)},_ensureValidType:function(t){return a.contains(["string","number","boolean","array","object","date","any"].concat(a.keys(this._dataTypes)),t)?t:void 0},getAttributes:function(t,e){t||(t={}),a.defaults(t,{session:!1,props:!1,derived:!1});var n,r,i,o={};for(r in this._definition)i=this._definition[r],(t.session&&i.session||t.props&&!i.session)&&(n=e?this._values[r]:this[r],"undefined"==typeof n&&(n=a.result(i,"default")),"undefined"!=typeof n&&(o[r]=n));if(t.derived)for(r in this._derived)o[r]=this[r];return o},_initDerived:function(){var t=this;a.each(this._derived,function(e,n){var r=t._derived[n];r.deps=r.depList;var i=function(e){e=e||{};var i=r.fn.call(t);t._cache[n]===i&&r.cache||(r.cache&&(t._previousAttributes[n]=t._cache[n]),t._cache[n]=i,t.trigger("change:"+n,t,t._cache[n]))};r.deps.forEach(function(e){t._keyTree.add(e,i)})}),this.on("all",function(e){c.test(e)&&t._keyTree.get(e.split(":")[1]).forEach(function(t){t()})},this)},_getDerivedProperty:function(t,e){return this._derived[t].cache?((e||!this._cache.hasOwnProperty(t))&&(this._cache[t]=this._derived[t].fn.apply(this)),this._cache[t]):this._derived[t].fn.apply(this)},_initCollections:function(){var t;if(this._collections)for(t in this._collections)this[t]=new this._collections[t](null,{parent:this})},_initChildren:function(){var t;if(this._children)for(t in this._children)this[t]=new this._children[t]({},{parent:this}),this.listenTo(this[t],"all",this._getEventBubblingHandler(t))},_getEventBubblingHandler:function(t){return a.bind(function(e,n,r){c.test(e)?this.trigger("change:"+t+"."+e.split(":")[1],n,r):"change"===e&&this.trigger("change",this)},this)},_verifyRequired:function(){var t=this.attributes;for(var e in this._definition)if(this._definition[e].required&&"undefined"==typeof t[e])return!1;return!0}}),Object.defineProperties(n.prototype,{attributes:{get:function(){return this.getAttributes({props:!0,session:!0})}},all:{get:function(){return this.getAttributes({session:!0,props:!0,derived:!0})}},isState:{get:function(){return!0},set:function(){}}});var f={string:{"default":function(){return""}},date:{set:function(t){var e;if(null==t)e="object";else if(a.isDate(t))e="date",t=t.valueOf();else try{var n=new Date(t).valueOf();if(isNaN(n)&&(n=new Date(parseInt(t,10)).valueOf(),isNaN(n)))throw TypeError;t=n,e="date"}catch(r){e=typeof t}return{val:t,type:e}},get:function(t){return null==t?t:new Date(t)},"default":function(){return new Date}},array:{set:function(t){return{val:t,type:a.isArray(t)?"array":typeof t}},"default":function(){return[]}},object:{set:function(t){var e=typeof t;return"object"!==e&&a.isUndefined(t)&&(t=null,e="object"),{val:t,type:e}},"default":function(){return{}}},state:{set:function(t){var e=t instanceof n||t&&t.isState;return e?{val:t,type:"state"}:{val:t,type:typeof t}},compare:function(t,e,n){var r=t===e;return r||(t&&this.stopListening(t),null!=e&&this.listenTo(e,"all",this._getEventBubblingHandler(n))),r}}};n.extend=o,e.exports=n},{"array-next":22,"backbone-events-standalone":24,"key-tree-store":25,underscore:26}],22:[function(t,e){e.exports=function(t,e){var n=t.length,r=t.indexOf(e)+1;return r>n-1&&(r=0),t[r]}},{}],23:[function(t,e){e.exports=t(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/backbone-events-standalone.js":17}],24:[function(t,e){e.exports=t(18)},{"./backbone-events-standalone":23,"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/index.js":18}],25:[function(t,e){function n(){this.storage={}}n.prototype.add=function(t,e){var n=this.storage[t]||(this.storage[t]=[]);n.push(e)},n.prototype.remove=function(t){var e,n;for(e in this.storage)n=this.storage[e],n.some(function(e,r){return e===t?(n.splice(r,1),!0):void 0})},n.prototype.get=function(t){var e,n=[];for(e in this.storage)(t===e||0===e.indexOf(t+"."))&&(n=n.concat(this.storage[e]));return n},e.exports=n},{}],26:[function(t,e){e.exports=t(11)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection-underscore-mixin/node_modules/underscore/underscore.js":11}],27:[function(t,e){function n(t,e){e||(e={}),this.collection=t,this._reset(),this._watched=e.watched||[],this._parseFilters(e),this._runFilters(),this.listenTo(this.collection,"all",this._onCollectionEvent)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-subcollection"]=window.ampersand["ampersand-subcollection"]||[],window.ampersand["ampersand-subcollection"].push("1.5.0"));var r=t("underscore"),i=t("backbone-events-standalone"),o=t("ampersand-class-extend"),a=t("ampersand-collection-underscore-mixin"),u=Array.prototype.slice;r.extend(n.prototype,i,a,{addFilter:function(t){this.swapFilters([t],[])},removeFilter:function(t){this.swapFilters([],[t])},clearFilters:function(){this._reset(),this._runFilters()},swapFilters:function(t,e){var n=this;e?r.isArray(e)||(e=[e]):e=this._filters,t?r.isArray(t)||(t=[t]):t=[],e.forEach(function(t){n._removeFilter(t)}),t.forEach(function(t){n._addFilter(t)}),this._runFilters()},configure:function(t,e){e&&this._resetFilters(),this._parseFilters(t),this._runFilters()},at:function(t){return this.models[t]},get:function(t,e){var n=this.collection.get(t,e);return n&&this.contains(n)?n:void 0},_removeFilter:function(t){var e=this._filters.indexOf(t);-1!==e&&this._filters.splice(e,1)},_reset:function(){this.models=[],this._resetFilters()},_resetFilters:function(){this._filters=[],this._watched=[],this.limit=void 0,this.offset=void 0},_addFilter:function(t){this._filters.push(t)},_watch:function(t){this._watched=r.union(this._watched,r.isArray(t)?t:[t])},_unwatch:function(t){this._watched=r.without(this._watched,t)},_parseFilters:function(t){t.where&&(r.each(t.where,function(t,e){this._addFilter(function(n){return(n.get?n.get(e):n[e])===t})},this),this._watch(r.keys(t.where))),t.hasOwnProperty("limit")&&(this.limit=t.limit),t.hasOwnProperty("offset")&&(this.offset=t.offset),t.filter&&this._addFilter(t.filter,!1),t.filters&&t.filters.forEach(this._addFilter,this),t.comparator&&(this.comparator=t.comparator)},_runFilters:function(){var t,e,n,i=u.call(this.models),o=u.call(this.collection.models),a=this.offset||0;t=this._filters.length?r.reduce(this._filters,function(t,e){return t.filter(e)},o):u.call(o),this.comparator&&(t=r.sortBy(t,this.comparator)),(this.limit||this.offset)&&(t=t.slice(a,this.limit+a)),e=r.difference(t,i),n=r.difference(i,t),this.models=t,r.each(n,function(t){this.trigger("remove",t,this)},this),r.each(e,function(t){this.trigger("add",t,this)},this),r.isEqual(i,t)||this.trigger("sort",this)},_onCollectionEvent:function(t,e){(r.contains(this._watched,t.split(":")[1])||r.contains(["add","remove","reset","sync"],t))&&this._runFilters(),(r.contains(["sync","invalid","destroy"])||-1!==t.indexOf("change"))&&this.contains(e)&&this.trigger.apply(this,arguments)}}),Object.defineProperty(n.prototype,"length",{get:function(){return this.models.length}}),Object.defineProperty(n.prototype,"isCollection",{get:function(){return!0}}),n.extend=o,e.exports=n},{"ampersand-class-extend":28,"ampersand-collection-underscore-mixin":10,"backbone-events-standalone":31,underscore:32}],28:[function(t,e){e.exports=t(16)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":16,"extend-object":29}],29:[function(t,e){e.exports=t(19)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/extend-object/extend-object.js":19}],30:[function(t,e){e.exports=t(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/backbone-events-standalone.js":17}],31:[function(t,e){e.exports=t(18)},{"./backbone-events-standalone":30,"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/index.js":18}],32:[function(t,e){e.exports=t(11)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection-underscore-mixin/node_modules/underscore/underscore.js":11}],33:[function(t,e){function n(t){this.cid=a.uniqueId("view"),t||(t={});var e=t.parent;delete t.parent,f.call(this,t,{init:!1,parent:e}),this.on("change:el",this._handleElementChange,this),this._parsedBindings=l(this.bindings,this),this._initializeBindings(),t.el&&!this.autoRender&&this._handleElementChange(),this._initializeSubviews(),this.template=t.template||this.template,this.initialize.apply(this,arguments),this.set(a.pick(t,h)),this.autoRender&&this.template&&this.render()}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-view"]=window.ampersand["ampersand-view"]||[],window.ampersand["ampersand-view"].push("7.2.0"));var r=t("ampersand-state"),i=t("ampersand-collection-view"),o=t("domify"),a=t("underscore"),u=t("events-mixin"),s=t("matches-selector"),l=t("ampersand-dom-bindings"),c=t("get-object-path"),f=r.extend({dataTypes:{element:{set:function(t){return{val:t,type:t instanceof Element?"element":typeof t}},compare:function(t,e){return t===e}},collection:{set:function(t){return{val:t,type:t&&t.isCollection?"collection":typeof t}},compare:function(t,e){return t===e}}},props:{model:"state",el:"element",collection:"collection"},derived:{rendered:{deps:["el"],fn:function(){return!!this.el}},hasData:{deps:["model"],fn:function(){return!!this.model}}}}),h=["model","collection","el"];n.prototype=Object.create(f.prototype),a.extend(n.prototype,{query:function(t){return t?"string"==typeof t?s(this.el,t)?this.el:this.el.querySelector(t)||void 0:t:this.el},queryAll:function(t){var e=[];return this.el?""===t?[this.el]:(s(this.el,t)&&e.push(this.el),e.concat(Array.prototype.slice.call(this.el.querySelectorAll(t)))):e},queryByHook:function(t){return this.query('[data-hook~="'+t+'"]')},initialize:function(){},render:function(){return this.renderWithTemplate(this),this},remove:function(){var t=this._parsedBindings;return this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this._subviews&&a.chain(this._subviews).flatten().invoke("remove"),this.stopListening(),a.each(t,function(e,n){a.each(e,function(e,r){delete t[n][r]}),delete t[n]}),this.trigger("remove",this),this},_handleElementChange:function(){return this.eventManager&&this.eventManager.unbind(),this.eventManager=u(this.el,this),this.delegateEvents(),this._applyBindingsForKey(),this},delegateEvents:function(t){if(!t&&!(t=a.result(this,"events")))return this;this.undelegateEvents();for(var e in t)this.eventManager.bind(e,t[e]);return this},undelegateEvents:function(){return this.eventManager.unbind(),this},registerSubview:function(t){return this._subviews||(this._subviews=[]),this._subviews.push(t),t.el&&(t.parent=this),t},renderSubview:function(t,e){return"string"==typeof e&&(e=this.query(e)),this.registerSubview(t),t.render(),(e||this.el).appendChild(t.el),t},_applyBindingsForKey:function(t){if(this.el){var e,n=this._parsedBindings.getGrouped(t);for(e in n)n[e].forEach(function(t){t(this.el,c(this,e),a.last(e.split(".")))},this)}},_initializeBindings:function(){this.bindings&&this.on("all",function(t){"change:"===t.slice(0,7)&&this._applyBindingsForKey(t.split(":")[1])},this)},_initializeSubviews:function(){if(this.subviews)for(var t in this.subviews)this._parseSubview(this.subviews[t],t)},_parseSubview:function(t,e){function n(){var t,r;this.el&&(t=this.query(i.selector))&&(!i.waitFor||c(this,i.waitFor))&&(r=this[e]=i.prepareView.call(this,t),r.render(),this.registerSubview(r),this.off("change",n))}var r=this,i={selector:t.container||'[data-hook="'+t.hook+'"]',waitFor:t.waitFor||"",prepareView:t.prepareView||function(e){return new t.constructor({el:e,parent:r})}};this.on("change",n,this)},renderWithTemplate:function(t,e){var n=e||this.template;if(!n)throw new Error("Template string or function needed.");var r=a.isString(n)?n:n.call(this,t||this);a.isString(r)&&(r=o(r));var i=this.el&&this.el.parentNode;if(i&&i.replaceChild(r,this.el),"#document-fragment"===r.nodeName)throw new Error("Views can only have one root element.");return this.el=r,this},cacheElements:function(t){for(var e in t)this[e]=this.query(t[e])},listenToAndRun:function(t,e,n){var r=a.bind(n,this);this.listenTo(t,e,r),r()},animateRemove:function(){this.remove()},renderCollection:function(t,e,n,r){var o="string"==typeof n?this.query(n):n,u=a.extend({collection:t,el:o||this.el,view:e,parent:this,viewOptions:{parent:this}},r),s=new i(u);return s.render(),this.registerSubview(s)}}),n.extend=f.extend,e.exports=n},{"ampersand-collection-view":34,"ampersand-dom-bindings":39,"ampersand-state":21,domify:42,"events-mixin":43,"get-object-path":48,"matches-selector":49,underscore:50}],34:[function(t,e){function n(t){if(!t)throw new ReferenceError("Collection view missing required parameters: collection, el");if(!t.collection)throw new ReferenceError("Collection view requires a collection");if(!t.el&&!this.insertSelf)throw new ReferenceError("Collection view requires an el");r.extend(this,r.pick(t,a)),this.views=[],this.listenTo(this.collection,"add",this._addViewForModel),this.listenTo(this.collection,"remove",this._removeViewForModel),this.listenTo(this.collection,"sort",this._rerenderAll),this.listenTo(this.collection,"refresh reset",this._reset)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-view"]=window.ampersand["ampersand-collection-view"]||[],window.ampersand["ampersand-collection-view"].push("1.2.1"));var r=t("underscore"),i=t("backbone-events-standalone"),o=t("ampersand-class-extend"),a=["collection","el","viewOptions","view","emptyView","filter","reverse","parent"];r.extend(n.prototype,i,{render:function(){return this._renderAll(),this},remove:function(){r.invoke(this.views,"remove"),this.stopListening()},_getViewByModel:function(t){return r.find(this.views,function(e){return t===e.model})},_createViewForModel:function(t,e){var n=new this.view(r({model:t,collection:this.collection}).extend(this.viewOptions));return this.views.push(n),n.parent=this,n.renderedByParentView=!0,n.render(e),n},_getOrCreateByModel:function(t,e){return this._getViewByModel(t)||this._createViewForModel(t,e)},_addViewForModel:function(t,e,n){var r=this.filter?this.filter(t):!0;if(r){this.renderedEmptyView&&(this.renderedEmptyView.remove(),delete this.renderedEmptyView);var i=this._getOrCreateByModel(t,{containerEl:this.el});n&&n.rerender?this._insertView(i):this._insertViewAtIndex(i)}},_insertViewAtIndex:function(t){if(!t.insertSelf){var e,n,r=this.collection.indexOf(t.model);e=this.collection.at(this.reverse?r-1:r+1),n=this._getViewByModel(e),n?this.el.insertBefore(t.el,n&&n.el):this.el.appendChild(t.el)}},_insertView:function(t){t.insertSelf||(this.reverse&&this.el.firstChild?this.el.insertBefore(t.el,this.el.firstChild):this.el.appendChild(t.el))},_removeViewForModel:function(t){var e=this._getViewByModel(t);if(e){var n=this.views.indexOf(e);-1!==n&&(e=this.views.splice(n,1)[0],this._removeView(e),0===this.views.length&&this._renderEmptyView())}},_removeView:function(t){t.animateRemove?t.animateRemove():t.remove()},_renderAll:function(){this.collection.each(this._addViewForModel,this),0===this.views.length&&this._renderEmptyView()},_rerenderAll:function(t,e){e=e||{},this.collection.each(function(t){this._addViewForModel(t,this,r.extend(e,{rerender:!0}))},this)},_renderEmptyView:function(){if(this.emptyView&&!this.renderedEmptyView){var t=this.renderedEmptyView=new this.emptyView;this.el.appendChild(t.render().el)}},_reset:function(){var t=this.collection.map(this._getOrCreateByModel,this),e=r.difference(this.views,t);e.forEach(this._removeView,this),this.views=t,this._rerenderAll(),0===this.views.length&&this._renderEmptyView()}}),n.extend=o,e.exports=n},{"ampersand-class-extend":35,"backbone-events-standalone":38,underscore:50}],35:[function(t,e){e.exports=t(16)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":16,"extend-object":36}],36:[function(t,e){e.exports=t(19)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/extend-object/extend-object.js":19}],37:[function(t,e,n){!function(){function t(){return{keys:Object.keys||function(t){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError("keys() called on a non-object");var e,n=[];for(e in t)t.hasOwnProperty(e)&&(n[n.length]=e);return n},uniqueId:function(t){var e=++l+"";return t?t+e:e},has:function(t,e){return u.call(t,e)},each:function(t,e,n){if(null!=t)if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;i>r;r++)if(e.call(n,t[r],r,t)===o)return}else for(var u in t)if(this.has(t,u)&&e.call(n,t[u],u,t)===o)return},once:function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}}}var r,i=this,o={},a=Array.prototype.forEach,u=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l=0,c=t();r={on:function(t,e,n){if(!h(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!h(this,"once",t,[e,n])||!e)return this;var r=this,i=c.once(function(){r.off(t,i),e.apply(this,arguments)});return i._callback=e,this.on(t,i,n)},off:function(t,e,n){var r,i,o,a,u,s,l,f;if(!this._events||!h(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:c.keys(this._events),u=0,s=a.length;s>u;u++)if(t=a[u],o=this._events[t]){if(this._events[t]=r=[],e||n)for(l=0,f=o.length;f>l;l++)i=o[l],(e&&e!==i.callback&&e!==i.callback._callback||n&&n!==i.context)&&r.push(i);r.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!h(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&p(n,e),r&&p(r,arguments),this},stopListening:function(t,e,n){var r=this._listeners;if(!r)return this;var i=!e&&!n;"object"==typeof e&&(n=this),t&&((r={})[t._listenerId]=t);for(var o in r)r[o].off(e,n,this),i&&delete this._listeners[o];return this}};var f=/\s+/,h=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var i in n)t[e].apply(t,[i,n[i]].concat(r));return!1}if(f.test(n)){for(var o=n.split(f),a=0,u=o.length;u>a;a++)t[e].apply(t,[o[a]].concat(r));return!1}return!0},p=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],u=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,u);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e)}},d={listenTo:"on",listenToOnce:"once"};c.each(d,function(t,e){r[e]=function(e,n,r){var i=this._listeners||(this._listeners={}),o=e._listenerId||(e._listenerId=c.uniqueId("l"));return i[o]=e,"object"==typeof n&&(r=this),e[t](n,r,this),this}}),r.bind=r.on,r.unbind=r.off,r.mixin=function(t){var e=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return c.each(e,function(e){t[e]=this[e]},this),t},"function"==typeof define?define(function(){return r}):"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=r),n.BackboneEvents=r):i.BackboneEvents=r}(this)},{}],38:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{"./backbone-events-standalone":37,"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/index.js":18}],39:[function(t,e){function n(t,e){if(""===e)return[t];var n=[];return u(t,e)&&n.push(t),n.concat(s.call(t.querySelectorAll(e)))}function r(t){return Array.isArray(t)?t:[t]}function i(t,e){var i,o=t.type||"text",u="function"==typeof o,s=function(){return"string"==typeof t.selector?t.selector:t.hook?'[data-hook~="'+t.hook+'"]':""}(),l=t.yes,c=t.no,f=!(!l&&!c);if(u)return function(t,r){n(t,s).forEach(function(t){o.call(e,t,r,i)}),i=r};if("text"===o)return function(t,e){n(t,s).forEach(function(t){a.text(t,e)})};if("class"===o)return function(t,e){n(t,s).forEach(function(t){a.switchClass(t,i,e)}),i=e};if("attribute"===o){if(!t.name)throw Error('attribute bindings must have a "name"');return function(e,o){var u=r(t.name);n(e,s).forEach(function(t){u.forEach(function(e){a.setAttribute(t,e,o)})}),i=o}}if("value"===o)return function(t,e){n(t,s).forEach(function(t){e||0===e||(e=""),document.activeElement!==t&&(t.value=e)}),i=e};if("booleanClass"===o)return f?(l=r(l||""),c=r(c||""),function(t,e){var r=e?c:l,i=e?l:c;n(t,s).forEach(function(t){r.forEach(function(e){a.removeClass(t,e)}),i.forEach(function(e){a.addClass(t,e)})})}):function(e,i,o){var u=r(t.name||o);n(e,s).forEach(function(t){u.forEach(function(e){a[i?"addClass":"removeClass"](t,e)})})};if("booleanAttribute"===o)return function(e,i,o){var u=r(t.name||o);n(e,s).forEach(function(t){u.forEach(function(e){a[i?"addAttribute":"removeAttribute"](t,e)})})};if("toggle"===o)return f?function(t,e){n(t,l).forEach(function(t){a[e?"show":"hide"](t)}),n(t,c).forEach(function(t){a[e?"hide":"show"](t)})}:function(t,e){n(t,s).forEach(function(t){a[e?"show":"hide"](t)})};if("switch"===o){if(!t.cases)throw Error('switch bindings must have "cases"');return function(e,r){for(var i in t.cases)n(e,t.cases[i]).forEach(function(t){a[r===i?"show":"hide"](t)})}}if("innerHTML"===o)return function(t,e){n(t,s).forEach(function(t){a.html(t,e)})};if("switchClass"===o){if(!t.cases)throw Error('switchClass bindings must have "cases"');return function(e,i,o){var u=r(t.name||o);for(var s in t.cases)n(e,t.cases[s]).forEach(function(t){u.forEach(function(e){a[i===s?"addClass":"removeClass"](t,e)})})}}throw new Error("no such binding type: "+o)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom-bindings"]=window.ampersand["ampersand-dom-bindings"]||[],window.ampersand["ampersand-dom-bindings"].push("3.3.3"));var o=t("key-tree-store"),a=t("ampersand-dom"),u=t("matches-selector");e.exports=function(t,e){var n,r,a=new o;for(n in t)r=t[n],"string"==typeof r?a.add(n,i({type:"text",selector:r})):r.forEach?r.forEach(function(t){a.add(n,i(t,e))}):a.add(n,i(r,e));return a};var s=Array.prototype.slice},{"ampersand-dom":40,"key-tree-store":41,"matches-selector":49}],40:[function(t,e){function n(t){return t||0===t?t:""}function r(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function i(t,e){var n=t[e];return e in t&&(n===!0||n===!1)}function o(t){return"true"===l.getAttribute(t,"data-anddom-hidden")}function a(t){l.setAttribute(t,"data-anddom-display",t.style.display)}function u(t){t.style.display=l.getAttribute(t,"data-anddom-display")||"",l.removeAttribute(t,"data-anddom-hidden")}function s(t){l.setAttribute(t,"data-anddom-hidden","true"),t.style.display="none"}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom"]=window.ampersand["ampersand-dom"]||[],window.ampersand["ampersand-dom"].push("1.2.7"));var l=e.exports={text:function(t,e){t.textContent=n(e)},addClass:function(t,e){e=n(e),e&&(Array.isArray(e)?e.forEach(function(e){l.addClass(t,e)}):t.classList?t.classList.add(e):r(t,e)||(t.classList?t.classList.add(e):t.className+=" "+e))},removeClass:function(t,e){Array.isArray(e)?e.forEach(function(e){l.removeClass(t,e)}):t.classList?(e=n(e),e&&t.classList.remove(e)):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")
-},hasClass:r,switchClass:function(t,e,n){e&&this.removeClass(t,e),this.addClass(t,n)},addAttribute:function(t,e){t.setAttribute(e,""),i(t,e)&&(t[e]=!0)},removeAttribute:function(t,e){t.removeAttribute(e),i(t,e)&&(t[e]=!1)},setAttribute:function(t,e,r){t.setAttribute(e,n(r))},getAttribute:function(t,e){return t.getAttribute(e)},hide:function(t){o(t)||(a(t),s(t))},show:function(t){u(t)},html:function(t,e){t.innerHTML=e}}},{}],41:[function(t,e){function n(){this.storage={}}var r=Array.prototype.slice;n.prototype.add=function(t,e){var n=this.storage[t]||(this.storage[t]=[]);n.push(e)},n.prototype.remove=function(t){var e,n;for(e in this.storage)n=this.storage[e],n.some(function(e,r){return e===t?(n.splice(r,1),!0):void 0})},n.prototype.get=function(t){var e,n=[];for(e in this.storage)t&&t!==e&&0!==e.indexOf(t+".")||(n=n.concat(this.storage[e]));return n},n.prototype.getGrouped=function(t){var e,n={};for(e in this.storage)t&&t!==e&&0!==e.indexOf(t+".")||(n[e]=r.call(this.storage[e]));return n},n.prototype.getAll=function(t){var e,n={};for(e in this.storage)(t===e||0===e.indexOf(t+"."))&&(n[e]=r.call(this.storage[e]));return n},n.prototype.run=function(t,e){var n=r.call(arguments,2);this.get(t).forEach(function(t){t.apply(e||this,n)})},e.exports=n},{}],42:[function(t,e){function n(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var i=e.createElement("html");return i.innerHTML=t,i.removeChild(i.lastChild)}var a=o[r]||o._default,u=a[0],s=a[1],l=a[2],i=e.createElement("div");for(i.innerHTML=s+t+l;u--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);for(var c=e.createDocumentFragment();i.firstChild;)c.appendChild(i.removeChild(i.firstChild));return c}e.exports=n;var r=document.createElement("div");r.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var i=!r.getElementsByTagName("link").length;r=void 0;var o={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:i?[1,"X<div>","</div>"]:[0,"",""]};o.td=o.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],o.option=o.optgroup=[1,'<select multiple="multiple">',"</select>"],o.thead=o.tbody=o.colgroup=o.caption=o.tfoot=[1,"<table>","</table>"],o.text=o.circle=o.ellipse=o.line=o.path=o.polygon=o.polyline=o.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],43:[function(t,e){function n(t,e){if(!(this instanceof n))return new n(t,e);if(!t)throw new Error("element required");if(!e)throw new Error("object required");this.el=t,this.obj=e,this._events={}}function r(t){var e=t.split(/ +/);return{name:e.shift(),selector:e.join(" ")}}var i=t("component-event"),o=t("delegate-events"),a=["focus","blur"];e.exports=n,n.prototype.sub=function(t,e,n){this._events[t]=this._events[t]||{},this._events[t][e]=n},n.prototype.bind=function(t,e){function n(){var t=[].slice.call(arguments).concat(c);if("function"==typeof e)return void e.apply(s,t);if(!s[e])throw new Error(e+" method is not defined");s[e].apply(s,t)}var a=r(t),u=this.el,s=this.obj,l=a.name,e=e||"on"+l,c=[].slice.call(arguments,2);return a.selector?n=o.bind(u,a.selector,l,n):i.bind(u,l,n),this.sub(l,e,n),n},n.prototype.unbind=function(t,e){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(t);var n=this._events[t],r=-1!==a.indexOf(t);if(n){var o=n[e];o&&i.unbind(this.el,t,o,r)}},n.prototype.unbindAll=function(){for(var t in this._events)this.unbindAllOf(t)},n.prototype.unbindAllOf=function(t){var e=this._events[t];if(e)for(var n in e)this.unbind(t,n)}},{"component-event":44,"delegate-events":45}],44:[function(t,e,n){var r=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==r?"on":"";n.bind=function(t,e,n,i){return t[r](o+e,n,i||!1),n},n.unbind=function(t,e,n,r){return t[i](o+e,n,r||!1),n}},{}],45:[function(t,e,n){var r=t("closest"),i=t("event"),o=["focus","blur"];n.bind=function(t,e,n,a,u){return-1!==o.indexOf(n)&&(u=!0),i.bind(t,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=r(i,e,!0,t),n.delegateTarget&&a.call(t,n)},u)},n.unbind=function(t,e,n,r){-1!==o.indexOf(e)&&(r=!0),i.unbind(t,e,n,r)}},{closest:46,event:44}],46:[function(t,e){var n=t("matches-selector");e.exports=function(t,e,r){for(var i=r?t:t.parentNode;i&&i!==document;){if(n(i,e))return i;i=i.parentNode}}},{"matches-selector":47}],47:[function(t,e){function n(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;++r)if(n[r]==t)return!0;return!1}var r=Element.prototype,i=r.matchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector;e.exports=n},{}],48:[function(t,e){function n(t,e){if(-1==e.indexOf(".")&&-1==e.indexOf("["))return t[e];for(var n,r=e.split(/\.|\[|\]/g),i=-1,o=r.length;++i<o;)if(0==i&&(n=t),r[i]){if(void 0==n)break;n=n[r[i]]}return n}e.exports=n},{}],49:[function(t,e){"use strict";function n(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;r++)if(n[r]==t)return!0;return!1}var r=Element.prototype,i=r.matches||r.matchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector;e.exports=n},{}],50:[function(t,e,n){(function(){var t=this,r=t._,i={},o=Array.prototype,a=Object.prototype,u=Function.prototype,s=o.push,l=o.slice,c=o.concat,f=a.toString,h=a.hasOwnProperty,p=o.forEach,d=o.map,g=o.reduce,v=o.reduceRight,m=o.filter,y=o.every,b=o.some,x=o.indexOf,w=o.lastIndexOf,_=Array.isArray,M=Object.keys,k=u.bind,E=function(t){return t instanceof E?t:this instanceof E?void(this._wrapped=t):new E(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=E),n._=E):t._=E,E.VERSION="1.6.0";var C=E.each=E.forEach=function(t,e,n){if(null==t)return t;if(p&&t.forEach===p)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var a=E.keys(t),r=0,o=a.length;o>r;r++)if(e.call(n,t[a[r]],a[r],t)===i)return;return t};E.map=E.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(C(t,function(t,i,o){r.push(e.call(n,t,i,o))}),r)};var S="Reduce of empty array with no initial value";E.reduce=E.foldl=E.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduce===g)return r&&(e=E.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(C(t,function(t,o,a){i?n=e.call(r,n,t,o,a):(n=t,i=!0)}),!i)throw new TypeError(S);return n},E.reduceRight=E.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),v&&t.reduceRight===v)return r&&(e=E.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var a=E.keys(t);o=a.length}if(C(t,function(u,s,l){s=a?a[--o]:--o,i?n=e.call(r,n,t[s],s,l):(n=t[s],i=!0)}),!i)throw new TypeError(S);return n},E.find=E.detect=function(t,e,n){var r;return T(t,function(t,i,o){return e.call(n,t,i,o)?(r=t,!0):void 0}),r},E.filter=E.select=function(t,e,n){var r=[];return null==t?r:m&&t.filter===m?t.filter(e,n):(C(t,function(t,i,o){e.call(n,t,i,o)&&r.push(t)}),r)},E.reject=function(t,e,n){return E.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},E.every=E.all=function(t,e,n){e||(e=E.identity);var r=!0;return null==t?r:y&&t.every===y?t.every(e,n):(C(t,function(t,o,a){return(r=r&&e.call(n,t,o,a))?void 0:i}),!!r)};var T=E.some=E.any=function(t,e,n){e||(e=E.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(C(t,function(t,o,a){return r||(r=e.call(n,t,o,a))?i:void 0}),!!r)};E.contains=E.include=function(t,e){return null==t?!1:x&&t.indexOf===x?-1!=t.indexOf(e):T(t,function(t){return t===e})},E.invoke=function(t,e){var n=l.call(arguments,2),r=E.isFunction(e);return E.map(t,function(t){return(r?e:t[e]).apply(t,n)})},E.pluck=function(t,e){return E.map(t,E.property(e))},E.where=function(t,e){return E.filter(t,E.matches(e))},E.findWhere=function(t,e){return E.find(t,E.matches(e))},E.max=function(t,e,n){if(!e&&E.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);var r=-1/0,i=-1/0;return C(t,function(t,o,a){var u=e?e.call(n,t,o,a):t;u>i&&(r=t,i=u)}),r},E.min=function(t,e,n){if(!e&&E.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);var r=1/0,i=1/0;return C(t,function(t,o,a){var u=e?e.call(n,t,o,a):t;i>u&&(r=t,i=u)}),r},E.shuffle=function(t){var e,n=0,r=[];return C(t,function(t){e=E.random(n++),r[n-1]=r[e],r[e]=t}),r},E.sample=function(t,e,n){return null==e||n?(t.length!==+t.length&&(t=E.values(t)),t[E.random(t.length-1)]):E.shuffle(t).slice(0,Math.max(0,e))};var j=function(t){return null==t?E.identity:E.isFunction(t)?t:E.property(t)};E.sortBy=function(t,e,n){return e=j(e),E.pluck(E.map(t,function(t,r,i){return{value:t,index:r,criteria:e.call(n,t,r,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var A=function(t){return function(e,n,r){var i={};return n=j(n),C(e,function(o,a){var u=n.call(r,o,a,e);t(i,u,o)}),i}};E.groupBy=A(function(t,e,n){E.has(t,e)?t[e].push(n):t[e]=[n]}),E.indexBy=A(function(t,e,n){t[e]=n}),E.countBy=A(function(t,e){E.has(t,e)?t[e]++:t[e]=1}),E.sortedIndex=function(t,e,n,r){n=j(n);for(var i=n.call(r,e),o=0,a=t.length;a>o;){var u=o+a>>>1;n.call(r,t[u])<i?o=u+1:a=u}return o},E.toArray=function(t){return t?E.isArray(t)?l.call(t):t.length===+t.length?E.map(t,E.identity):E.values(t):[]},E.size=function(t){return null==t?0:t.length===+t.length?t.length:E.keys(t).length},E.first=E.head=E.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:0>e?[]:l.call(t,0,e)},E.initial=function(t,e,n){return l.call(t,0,t.length-(null==e||n?1:e))},E.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:l.call(t,Math.max(t.length-e,0))},E.rest=E.tail=E.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},E.compact=function(t){return E.filter(t,E.identity)};var N=function(t,e,n){return e&&E.every(t,E.isArray)?c.apply(n,t):(C(t,function(t){E.isArray(t)||E.isArguments(t)?e?s.apply(n,t):N(t,e,n):n.push(t)}),n)};E.flatten=function(t,e){return N(t,e,[])},E.without=function(t){return E.difference(t,l.call(arguments,1))},E.partition=function(t,e){var n=[],r=[];return C(t,function(t){(e(t)?n:r).push(t)}),[n,r]},E.uniq=E.unique=function(t,e,n,r){E.isFunction(e)&&(r=n,n=e,e=!1);var i=n?E.map(t,n,r):t,o=[],a=[];return C(i,function(n,r){(e?r&&a[a.length-1]===n:E.contains(a,n))||(a.push(n),o.push(t[r]))}),o},E.union=function(){return E.uniq(E.flatten(arguments,!0))},E.intersection=function(t){var e=l.call(arguments,1);return E.filter(E.uniq(t),function(t){return E.every(e,function(e){return E.contains(e,t)})})},E.difference=function(t){var e=c.apply(o,l.call(arguments,1));return E.filter(t,function(t){return!E.contains(e,t)})},E.zip=function(){for(var t=E.max(E.pluck(arguments,"length").concat(0)),e=new Array(t),n=0;t>n;n++)e[n]=E.pluck(arguments,""+n);return e},E.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},E.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=E.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(x&&t.indexOf===x)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},E.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(w&&t.lastIndexOf===w)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},E.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);r>i;)o[i++]=t,t+=n;return o};var O=function(){};E.bind=function(t,e){var n,r;if(k&&t.bind===k)return k.apply(t,l.call(arguments,1));if(!E.isFunction(t))throw new TypeError;return n=l.call(arguments,2),r=function(){if(!(this instanceof r))return t.apply(e,n.concat(l.call(arguments)));O.prototype=t.prototype;var i=new O;O.prototype=null;var o=t.apply(i,n.concat(l.call(arguments)));return Object(o)===o?o:i}},E.partial=function(t){var e=l.call(arguments,1);return function(){for(var n=0,r=e.slice(),i=0,o=r.length;o>i;i++)r[i]===E&&(r[i]=arguments[n++]);for(;n<arguments.length;)r.push(arguments[n++]);return t.apply(this,r)}},E.bindAll=function(t){var e=l.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return C(e,function(e){t[e]=E.bind(t[e],t)}),t},E.memoize=function(t,e){var n={};return e||(e=E.identity),function(){var r=e.apply(this,arguments);return E.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},E.delay=function(t,e){var n=l.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},E.defer=function(t){return E.delay.apply(E,[t,1].concat(l.call(arguments,1)))},E.throttle=function(t,e,n){var r,i,o,a=null,u=0;n||(n={});var s=function(){u=n.leading===!1?0:E.now(),a=null,o=t.apply(r,i),r=i=null};return function(){var l=E.now();u||n.leading!==!1||(u=l);var c=e-(l-u);return r=this,i=arguments,0>=c?(clearTimeout(a),a=null,u=l,o=t.apply(r,i),r=i=null):a||n.trailing===!1||(a=setTimeout(s,c)),o}},E.debounce=function(t,e,n){var r,i,o,a,u,s=function(){var l=E.now()-a;e>l?r=setTimeout(s,e-l):(r=null,n||(u=t.apply(o,i),o=i=null))};return function(){o=this,i=arguments,a=E.now();var l=n&&!r;return r||(r=setTimeout(s,e)),l&&(u=t.apply(o,i),o=i=null),u}},E.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},E.wrap=function(t,e){return E.partial(e,t)},E.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},E.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},E.keys=function(t){if(!E.isObject(t))return[];if(M)return M(t);var e=[];for(var n in t)E.has(t,n)&&e.push(n);return e},E.values=function(t){for(var e=E.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},E.pairs=function(t){for(var e=E.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},E.invert=function(t){for(var e={},n=E.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},E.functions=E.methods=function(t){var e=[];for(var n in t)E.isFunction(t[n])&&e.push(n);return e.sort()},E.extend=function(t){return C(l.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},E.pick=function(t){var e={},n=c.apply(o,l.call(arguments,1));return C(n,function(n){n in t&&(e[n]=t[n])}),e},E.omit=function(t){var e={},n=c.apply(o,l.call(arguments,1));for(var r in t)E.contains(n,r)||(e[r]=t[r]);return e},E.defaults=function(t){return C(l.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t},E.clone=function(t){return E.isObject(t)?E.isArray(t)?t.slice():E.extend({},t):t},E.tap=function(t,e){return e(t),t};var q=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof E&&(t=t._wrapped),e instanceof E&&(e=e._wrapped);var i=f.call(t);if(i!=f.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;var a=t.constructor,u=e.constructor;if(a!==u&&!(E.isFunction(a)&&a instanceof a&&E.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1;n.push(t),r.push(e);var s=0,l=!0;if("[object Array]"==i){if(s=t.length,l=s==e.length)for(;s--&&(l=q(t[s],e[s],n,r)););}else{for(var c in t)if(E.has(t,c)&&(s++,!(l=E.has(e,c)&&q(t[c],e[c],n,r))))break;if(l){for(c in e)if(E.has(e,c)&&!s--)break;l=!s}}return n.pop(),r.pop(),l};E.isEqual=function(t,e){return q(t,e,[],[])},E.isEmpty=function(t){if(null==t)return!0;if(E.isArray(t)||E.isString(t))return 0===t.length;for(var e in t)if(E.has(t,e))return!1;return!0},E.isElement=function(t){return!(!t||1!==t.nodeType)},E.isArray=_||function(t){return"[object Array]"==f.call(t)},E.isObject=function(t){return t===Object(t)},C(["Arguments","Function","String","Number","Date","RegExp"],function(t){E["is"+t]=function(e){return f.call(e)=="[object "+t+"]"}}),E.isArguments(arguments)||(E.isArguments=function(t){return!(!t||!E.has(t,"callee"))}),"function"!=typeof/./&&(E.isFunction=function(t){return"function"==typeof t}),E.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},E.isNaN=function(t){return E.isNumber(t)&&t!=+t},E.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==f.call(t)},E.isNull=function(t){return null===t},E.isUndefined=function(t){return void 0===t},E.has=function(t,e){return h.call(t,e)},E.noConflict=function(){return t._=r,this},E.identity=function(t){return t},E.constant=function(t){return function(){return t}},E.property=function(t){return function(e){return e[t]}},E.matches=function(t){return function(e){if(e===t)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0}},E.times=function(t,e,n){for(var r=Array(Math.max(0,t)),i=0;t>i;i++)r[i]=e.call(n,i);return r},E.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},E.now=Date.now||function(){return(new Date).getTime()};var D={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};D.unescape=E.invert(D.escape);var L={escape:new RegExp("["+E.keys(D.escape).join("")+"]","g"),unescape:new RegExp("("+E.keys(D.unescape).join("|")+")","g")};E.each(["escape","unescape"],function(t){E[t]=function(e){return null==e?"":(""+e).replace(L[t],function(e){return D[t][e]})}}),E.result=function(t,e){if(null==t)return void 0;var n=t[e];return E.isFunction(n)?n.call(t):n},E.mixin=function(t){C(E.functions(t),function(e){var n=E[e]=t[e];E.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),P.call(this,n.apply(E,t))}})};var F=0;E.uniqueId=function(t){var e=++F+"";return t?t+e:e},E.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},I=/\\|'|\r|\n|\t|\u2028|\u2029/g;E.template=function(t,data,e){var n;e=E.defaults({},e,E.templateSettings);var r=new RegExp([(e.escape||z).source,(e.interpolate||z).source,(e.evaluate||z).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,u){return o+=t.slice(i,u).replace(I,function(t){return"\\"+R[t]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),a&&(o+="';\n"+a+"\n__p+='"),i=u+e.length,e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(e.variable||"obj","_",o)}catch(a){throw a.source=o,a}if(data)return n(data,E);var u=function(data){return n.call(this,data,E)};return u.source="function("+(e.variable||"obj")+"){\n"+o+"}",u},E.chain=function(t){return E(t).chain()};var P=function(t){return this._chain?E(t).chain():t};E.mixin(E),C(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];E.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],P.call(this,n)}}),C(["concat","join","slice"],function(t){var e=o[t];E.prototype[t]=function(){return P.call(this,e.apply(this._wrapped,arguments))}}),E.extend(E.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return E})}).call(this)},{}],51:[function(){+function(t){"use strict";function e(e){return this.each(function(){var r=t(this),data=r.data("bs.button"),i="object"==typeof e&&e;data||r.data("bs.button",data=new n(this,i)),"toggle"==e?data.toggle():e&&data.setState(e)})}var n=function(e,r){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.2.0",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(e){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",data=r.data();e+="Text",null==data.resetText&&r.data("resetText",r[i]()),r[i](null==data[e]?this.options[e]:data[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,r.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var r=t.fn.button;t.fn.button=e,t.fn.button.Constructor=n,t.fn.button.noConflict=function(){return t.fn.button=r,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=t(n.target);r.hasClass("btn")||(r=r.closest(".btn")),e.call(r,"toggle"),n.preventDefault()})}(jQuery)},{}],52:[function(){+function(t){"use strict";function e(e){return this.each(function(){var r=t(this),data=r.data("bs.collapse"),i=t.extend({},n.DEFAULTS,r.data(),"object"==typeof e&&e);!data&&i.toggle&&"show"==e&&(e=!e),data||r.data("bs.collapse",data=new n(this,i)),"string"==typeof e&&data[e]()})}var n=function(e,r){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};n.VERSION="3.2.0",n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n=t.Event("show.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var r=this.$parent&&this.$parent.find("> .panel > .in");if(r&&r.length){var i=r.data("bs.collapse");if(i&&i.transitioning)return;e.call(r,"hide"),i||r.data("bs.collapse",null)}var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var u=t.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(350)[o](this.$element[0][u])}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(350):r.call(this)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var r=t.fn.collapse;t.fn.collapse=e,t.fn.collapse.Constructor=n,t.fn.collapse.noConflict=function(){return t.fn.collapse=r,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(n){var r,i=t(this),o=i.attr("data-target")||n.preventDefault()||(r=i.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),a=t(o),data=a.data("bs.collapse"),u=data?"toggle":i.data(),s=i.attr("data-parent"),l=s&&t(s);data&&data.transitioning||(l&&l.find('[data-toggle="collapse"][data-parent="'+s+'"]').not(i).addClass("collapsed"),i[a.hasClass("in")?"addClass":"removeClass"]("collapsed")),e.call(a,u)})}(jQuery)},{}],53:[function(){+function(t){"use strict";function e(e){e&&3===e.which||(t(i).remove(),t(o).each(function(){var r=n(t(this)),i={relatedTarget:this};r.hasClass("open")&&(r.trigger(e=t.Event("hide.bs.dropdown",i)),e.isDefaultPrevented()||r.removeClass("open").trigger("hidden.bs.dropdown",i))}))}function n(e){var n=e.attr("data-target");n||(n=e.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&t(n);return r&&r.length?r:e.parent()}function r(e){return this.each(function(){var n=t(this),data=n.data("bs.dropdown");data||n.data("bs.dropdown",data=new a(this)),"string"==typeof e&&data[e].call(n)})}var i=".dropdown-backdrop",o='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.2.0",a.prototype.toggle=function(r){var i=t(this);if(!i.is(".disabled, :disabled")){var o=n(i),a=o.hasClass("open");if(e(),!a){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var u={relatedTarget:this};if(o.trigger(r=t.Event("show.bs.dropdown",u)),r.isDefaultPrevented())return;i.trigger("focus"),o.toggleClass("open").trigger("shown.bs.dropdown",u)}return!1}},a.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var r=t(this);if(e.preventDefault(),e.stopPropagation(),!r.is(".disabled, :disabled")){var i=n(r),a=i.hasClass("open");if(!a||a&&27==e.keyCode)return 27==e.which&&i.find(o).trigger("focus"),r.trigger("click");var u=" li:not(.divider):visible a",s=i.find('[role="menu"]'+u+', [role="listbox"]'+u);if(s.length){var l=s.index(s.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<s.length-1&&l++,~l||(l=0),s.eq(l).trigger("focus")}}}};var u=t.fn.dropdown;t.fn.dropdown=r,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=u,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",o,a.prototype.toggle).on("keydown.bs.dropdown.data-api",o+', [role="menu"], [role="listbox"]',a.prototype.keydown)}(jQuery)},{}],54:[function(){+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;t(this).one("bsTransitionEnd",function(){n=!0});var i=function(){n||t(r).trigger(t.support.transition.end)};return setTimeout(i,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery)},{}],55:[function(){},{}],56:[function(t,e){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function r(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function i(t){return null===t?0/0:+t}function o(t){return!isNaN(t)}function a(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function u(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function l(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function c(){this._=Object.create(null)}function f(t){return(t+="")===vu||t[0]===mu?mu+t:t}function h(t){return(t+="")[0]===mu?t.slice(1):t}function p(t){return f(t)in this._}function d(t){return(t=f(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(h(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function m(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function b(t){return t}function x(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=yu.length;r>n;++n){var i=yu[n]+e;if(i in t)return i}}function _(){}function M(){}function k(t){function e(){for(var e,r=n,i=-1,o=r.length;++i<o;)(e=r[i].on)&&e.apply(this,arguments);return t}var n=[],r=new c;return e.on=function(e,i){var o,a=r.get(e);return arguments.length<2?a&&a.on:(a&&(a.on=null,n=n.slice(0,o=n.indexOf(a)).concat(n.slice(o+1)),r.remove(e)),i&&n.push(r.set(e,{on:i})),t)},e}function E(){ru.event.preventDefault()}function C(){for(var t,e=ru.event;t=e.sourceEvent;)e=t;return e}function S(t){for(var e=new M,n=0,r=arguments.length;++n<r;)e[arguments[n]]=k(e);return e.of=function(n,r){return function(i){try{var o=i.sourceEvent=ru.event;i.target=t,ru.event=i,e[i.type].apply(n,r)}finally{ru.event=o}}},e}function T(t){return xu(t,ku),t}function j(t){return"function"==typeof t?t:function(){return wu(t,this)}}function A(t){return"function"==typeof t?t:function(){return _u(t,this)}}function N(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function u(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=ru.ns.qualify(t),null==e?t.local?r:n:"function"==typeof e?t.local?u:a:t.local?o:i}function O(t){return t.trim().replace(/\s+/g," ")}function q(t){return new RegExp("(?:^|\\s+)"+ru.requote(t)+"(?:\\s+|$)","g")}function D(t){return(t+"").trim().split(/^|\s+/)}function L(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=D(t).map(F);var i=t.length;return"function"==typeof e?r:n}function F(t){var e=q(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.getAttribute("class")||"";r?(e.lastIndex=0,e.test(i)||n.setAttribute("class",O(i+" "+t))):n.setAttribute("class",O(i.replace(e," ")))}}function z(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?o:i}function R(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?i:r}function I(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ru.ns.qualify(t)).local?n:e}function P(){var t=this.parentNode;t&&t.removeChild(this)}function H(data){return{__data__:data}}function B(t){return function(){return Mu(this,t)}}function $(t){return arguments.length||(t=r),function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function V(t,e){for(var n=0,r=t.length;r>n;n++)for(var i,o=t[n],a=0,u=o.length;u>a;a++)(i=o[a])&&e(i,a,n);return t}function U(t){return xu(t,Cu),t}function W(t){var e,n;return function(r,i,o){var a,u=t[o].update,s=u.length;for(o!=n&&(n=o,e=0),i>=e&&(e=i+1);!(a=u[e])&&++e<s;);return a}}function Y(t,e,n){function r(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}function i(){var i=s(e,ou(arguments));r.call(this),this.addEventListener(t,this[a]=i,i.$=n),i._=e}function o(){var e,n=new RegExp("^__on([^.]+)"+ru.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];
-this.removeEventListener(e[1],i,i.$),delete this[r]}}var a="__on"+t,u=t.indexOf("."),s=X;u>0&&(t=t.slice(0,u));var l=Su.get(t);return l&&(t=l,s=J),u?e?i:r:e?_:o}function X(t,e){return function(n){var r=ru.event;ru.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{ru.event=r}}}function J(t,e){var n=X(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Z(e){var r=".dragsuppress-"+ ++ju,i="click"+r,o=ru.select(n(e)).on("touchmove"+r,E).on("dragstart"+r,E).on("selectstart"+r,E);if(null==Tu&&(Tu="onselectstart"in e?!1:w(e.style,"userSelect")),Tu){var a=t(e).style,u=a[Tu];a[Tu]="none"}return function(t){if(o.on(r,null),Tu&&(a[Tu]=u),t){var e=function(){o.on(i,null)};o.on(i,function(){E(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Au){var o=n(t);if(o.scrollX||o.scrollY){r=ru.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Au=!(a.f||a.e),r.remove()}}return Au?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var u=t.getBoundingClientRect();return[e.clientX-u.left-t.clientLeft,e.clientY-u.top-t.clientTop]}function G(){return ru.event.changedTouches[0].identifier}function Q(t){return t>0?1:0>t?-1:0}function te(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function ee(t){return t>1?0:-1>t?qu:Math.acos(t)}function ne(t){return t>1?Fu:-1>t?-Fu:Math.asin(t)}function re(t){return((t=Math.exp(t))-1/t)/2}function ie(t){return((t=Math.exp(t))+1/t)/2}function oe(t){return((t=Math.exp(2*t))-1)/(t+1)}function ae(t){return(t=Math.sin(t/2))*t}function ue(){}function se(t,e,n){return this instanceof se?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof se?new se(t.h,t.s,t.l):_e(""+t,Me,se):new se(t,e,n)}function le(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+e):n+e-n*e,o=2*n-a,new ye(i(t+120),i(t),i(t-120))}function ce(t,e,n){return this instanceof ce?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ce?new ce(t.h,t.c,t.l):t instanceof he?de(t.l,t.a,t.b):de((t=ke((t=ru.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ce(t,e,n)}function fe(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new he(n,Math.cos(t*=zu)*e,Math.sin(t)*e)}function he(t,e,n){return this instanceof he?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof he?new he(t.l,t.a,t.b):t instanceof ce?fe(t.h,t.c,t.l):ke((t=ye(t)).r,t.g,t.b):new he(t,e,n)}function pe(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;return i=ge(i)*Xu,r=ge(r)*Ju,o=ge(o)*Zu,new ye(me(3.2404542*i-1.5371385*r-.4985314*o),me(-.969266*i+1.8760108*r+.041556*o),me(.0556434*i-.2040259*r+1.0572252*o))}function de(t,e,n){return t>0?new ce(Math.atan2(n,e)*Ru,Math.sqrt(e*e+n*n),t):new ce(0/0,0/0,t)}function ge(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ve(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function me(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ye(t,e,n){return this instanceof ye?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof ye?new ye(t.r,t.g,t.b):_e(""+t,ye,le):new ye(t,e,n)}function be(t){return new ye(t>>16,t>>8&255,255&t)}function xe(t){return be(t)+""}function we(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function _e(t,e,n){var r,i,o,a=0,u=0,s=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Ce(i[0]),Ce(i[1]),Ce(i[2]))}return(o=Qu.get(t.toLowerCase()))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a=a>>4|a,u=240&o,u=u>>4|u,s=15&o,s=s<<4|s):7===t.length&&(a=(16711680&o)>>16,u=(65280&o)>>8,s=255&o)),e(a,u,s))}function Me(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),u=a-o,s=(a+o)/2;return u?(i=.5>s?u/(a+o):u/(2-a-o),r=t==a?(e-n)/u+(n>e?6:0):e==a?(n-t)/u+2:(t-e)/u+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new se(r,i,s)}function ke(t,e,n){t=Ee(t),e=Ee(e),n=Ee(n);var r=ve((.4124564*t+.3575761*e+.1804375*n)/Xu),i=ve((.2126729*t+.7151522*e+.072175*n)/Ju),o=ve((.0193339*t+.119192*e+.9503041*n)/Zu);return he(116*i-16,500*(r-i),200*(i-o))}function Ee(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ce(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Se(t){return"function"==typeof t?t:function(){return t}}function Te(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),je(e,n,t,r)}}function je(t,e,n,r){function i(){var t,e=s.status;if(!e&&Ne(s)||e>=200&&300>e||304===e){try{t=n.call(o,s)}catch(r){return void a.error.call(o,r)}a.load.call(o,t)}else a.error.call(o,s)}var o={},a=ru.dispatch("beforesend","progress","load","error"),u={},s=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=ru.event;ru.event=t;try{a.progress.call(o,s)}finally{ru.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?u[t]:(null==e?delete u[t]:u[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(l=t,o):l},o.response=function(t){return n=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(ou(arguments)))}}),o.send=function(n,data,r){if(2===arguments.length&&"function"==typeof data&&(r=data,data=null),s.open(n,t,!0),null==e||"accept"in u||(u.accept=e+",*/*"),s.setRequestHeader)for(var i in u)s.setRequestHeader(i,u[i]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=l&&(s.responseType=l),null!=r&&o.on("error",r).on("load",function(t){r(null,t)}),a.beforesend.call(o,s),s.send(null==data?null:data),o},o.abort=function(){return s.abort(),o},ru.rebind(o,a,"on"),null==r?o:o.get(Ae(r))}function Ae(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ne(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Oe(){var t=qe(),e=De()-t;e>24?(isFinite(e)&&(clearTimeout(rs),rs=setTimeout(Oe,e)),ns=0):(ns=1,os(Oe))}function qe(){var t=Date.now();for(is=ts;is;)t>=is.t&&(is.f=is.c(t-is.t)),is=is.n;return t}function De(){for(var t,e=ts,n=1/0;e;)e.f?e=t?t.n=e.n:ts=e.n:(e.t<n&&(n=e.t),e=(t=e).n);return es=t,n}function Le(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Fe(t,e){var n=Math.pow(10,3*gu(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function ze(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,o=r&&n?function(t,e){for(var i=t.length,o=[],a=0,u=r[0],s=0;i>0&&u>0&&(s+u+1>e&&(u=Math.max(1,e-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>e));)u=r[a=(a+1)%r.length];return o.reverse().join(n)}:b;return function(t){var n=us.exec(t),r=n[1]||" ",a=n[2]||">",u=n[3]||"-",s=n[4]||"",l=n[5],c=+n[6],f=n[7],h=n[8],p=n[9],d=1,g="",v="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===a)&&(l=r="0",a="="),p){case"n":f=!0,p="g";break;case"%":d=100,v="%",p="f";break;case"p":d=100,v="%",p="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+p.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":d=-1,p="r"}"$"===s&&(g=i[0],v=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):("e"==p||"f"==p)&&(h=Math.max(0,Math.min(20,h)))),p=ss.get(p)||Re;var b=l&&f;return function(t){var n=v;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===u?"":u;if(0>d){var s=ru.formatPrefix(t,h);t=s.scale(t),n=s.symbol+v}else t*=d;t=p(t,h);var x,w,_=t.lastIndexOf(".");if(0>_){var M=y?t.lastIndexOf("e"):-1;0>M?(x=t,w=""):(x=t.substring(0,M),w=t.substring(M))}else x=t.substring(0,_),w=e+t.substring(_+1);!l&&f&&(x=o(x,1/0));var k=g.length+x.length+w.length+(b?0:i.length),E=c>k?new Array(k=c-k+1).join(r):"";return b&&(x=o(E+x,E.length?c-w.length:1/0)),i+=g,t=x+w,("<"===a?i+t+E:">"===a?E+i+t:"^"===a?E.substring(0,k>>=1)+i+t+E.substring(k):i+(b?t:E+t))+n}}}function Re(t){return t+""}function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Pe(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new cs(n-1)),1),n}function o(t,n){return e(t=new cs(+t),n),t}function a(t,r,o){var a=i(t),u=[];if(o>1)for(;r>a;)n(a)%o||u.push(new Date(+a)),e(a,1);else for(;r>a;)u.push(new Date(+a)),e(a,1);return u}function u(t,e,n){try{cs=Ie;var r=new Ie;return r._=t,a(r,e,n)}finally{cs=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=o,t.range=a;var s=t.utc=He(t);return s.floor=s,s.round=He(r),s.ceil=He(i),s.offset=He(o),s.range=u,t}function He(t){return function(e,n){try{cs=Ie;var r=new Ie;return r._=e,t(r,n)._}finally{cs=Date}}}function Be(t){function e(t){function e(e){for(var n,i,o,a=[],u=-1,s=0;++u<r;)37===t.charCodeAt(u)&&(a.push(t.slice(s,u)),null!=(i=hs[n=t.charAt(++u)])&&(n=t.charAt(++u)),(o=T[n])&&(n=o(e,null==i?"e"===n?" ":"0":i)),a.push(n),s=u+1);return a.push(t.slice(s,u)),a.join("")}var r=t.length;return e.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=n(r,t,e,0);if(i!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var o=null!=r.Z&&cs!==Ie,a=new(o?Ie:cs);return"j"in r?a.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),o?a._:a},e.toString=function(){return t},e}function n(t,e,n,r){for(var i,o,a,u=0,s=e.length,l=n.length;s>u;){if(r>=l)return-1;if(i=e.charCodeAt(u++),37===i){if(a=e.charAt(u++),o=j[a in hs?e.charAt(u++):a],!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.w=M.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.w=w.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){C.lastIndex=0;var r=C.exec(e.slice(n));return r?(t.m=S.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){k.lastIndex=0;var r=k.exec(e.slice(n));return r?(t.m=E.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,r){return n(t,T.c.toString(),e,r)}function s(t,e,r){return n(t,T.x.toString(),e,r)}function l(t,e,r){return n(t,T.X.toString(),e,r)}function c(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,p=t.time,d=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{cs=Ie;var e=new cs;return e._=t,r(e)}finally{cs=Date}}var r=e(t);return n.parse=function(t){try{cs=Ie;var e=r.parse(t);return e&&e._}finally{cs=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=ln;var b=ru.map(),x=Ve(g),w=Ue(g),_=Ve(v),M=Ue(v),k=Ve(m),E=Ue(m),C=Ve(y),S=Ue(y);d.forEach(function(t,e){b.set(t.toLowerCase(),e)});var T={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return $e(t.getDate(),e,2)},e:function(t,e){return $e(t.getDate(),e,2)},H:function(t,e){return $e(t.getHours(),e,2)},I:function(t,e){return $e(t.getHours()%12||12,e,2)},j:function(t,e){return $e(1+ls.dayOfYear(t),e,3)},L:function(t,e){return $e(t.getMilliseconds(),e,3)},m:function(t,e){return $e(t.getMonth()+1,e,2)},M:function(t,e){return $e(t.getMinutes(),e,2)},p:function(t){return d[+(t.getHours()>=12)]},S:function(t,e){return $e(t.getSeconds(),e,2)},U:function(t,e){return $e(ls.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return $e(ls.mondayOfYear(t),e,2)},x:e(h),X:e(p),y:function(t,e){return $e(t.getFullYear()%100,e,2)},Y:function(t,e){return $e(t.getFullYear()%1e4,e,4)},Z:un,"%":function(){return"%"}},j={a:r,A:i,b:o,B:a,c:u,d:tn,e:tn,H:nn,I:nn,j:en,L:an,m:Qe,M:rn,p:c,S:on,U:Ye,w:We,W:Xe,x:s,X:l,y:Ze,Y:Je,Z:Ke,"%":sn};return e}function $e(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(e)+i:i)}function Ve(t){return new RegExp("^(?:"+t.map(ru.requote).join("|")+")","i")}function Ue(t){for(var e=new c,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function We(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ye(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function Xe(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function Je(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Ze(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.y=Ge(+r[0]),n+r[0].length):-1}function Ke(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Ge(t){return t+(t>68?1900:2e3)}function Qe(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tn(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function en(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function nn(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rn(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function on(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function an(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function un(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=gu(e)/60|0,i=gu(e)%60;return n+$e(r,"0",2)+$e(i,"0",2)}function sn(t,e,n){ds.lastIndex=0;var r=ds.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ln(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}function cn(){}function fn(t,e,n){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function hn(t,e){t&&ys.hasOwnProperty(t.type)&&ys[t.type](t,e)}function pn(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function dn(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)pn(t[n],e,1);e.polygonEnd()}function gn(){function t(t,e){t*=zu,e=e*zu/2+qu/4;var n=t-r,a=n>=0?1:-1,u=a*n,s=Math.cos(e),l=Math.sin(e),c=o*l,f=i*s+c*Math.cos(u),h=c*a*Math.sin(u);xs.add(Math.atan2(h,f)),r=t,i=s,o=l}var e,n,r,i,o;ws.point=function(a,u){ws.point=t,r=(e=a)*zu,i=Math.cos(u=(n=u)*zu/2+qu/4),o=Math.sin(u)},ws.lineEnd=function(){t(e,n)}}function vn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function mn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function bn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function wn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function _n(t){return[Math.atan2(t[1],t[0]),ne(t[2])]}function Mn(t,e){return gu(t[0]-e[0])<Nu&&gu(t[1]-e[1])<Nu}function kn(t,e){t*=zu;var n=Math.cos(e*=zu);En(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function En(t,e,n){++_s,ks+=(t-ks)/_s,Es+=(e-Es)/_s,Cs+=(n-Cs)/_s}function Cn(){function t(t,i){t*=zu;var o=Math.cos(i*=zu),a=o*Math.cos(t),u=o*Math.sin(t),s=Math.sin(i),l=Math.atan2(Math.sqrt((l=n*s-r*u)*l+(l=r*a-e*s)*l+(l=e*u-n*a)*l),e*a+n*u+r*s);Ms+=l,Ss+=l*(e+(e=a)),Ts+=l*(n+(n=u)),js+=l*(r+(r=s)),En(e,n,r)}var e,n,r;qs.point=function(i,o){i*=zu;var a=Math.cos(o*=zu);e=a*Math.cos(i),n=a*Math.sin(i),r=Math.sin(o),qs.point=t,En(e,n,r)}}function Sn(){qs.point=kn}function Tn(){function t(t,e){t*=zu;var n=Math.cos(e*=zu),a=n*Math.cos(t),u=n*Math.sin(t),s=Math.sin(e),l=i*s-o*u,c=o*a-r*s,f=r*u-i*a,h=Math.sqrt(l*l+c*c+f*f),p=r*a+i*u+o*s,d=h&&-ee(p)/h,g=Math.atan2(h,p);As+=d*l,Ns+=d*c,Os+=d*f,Ms+=g,Ss+=g*(r+(r=a)),Ts+=g*(i+(i=u)),js+=g*(o+(o=s)),En(r,i,o)}var e,n,r,i,o;qs.point=function(a,u){e=a,n=u,qs.point=t,a*=zu;var s=Math.cos(u*=zu);r=s*Math.cos(a),i=s*Math.sin(a),o=Math.sin(u),En(r,i,o)},qs.lineEnd=function(){t(e,n),qs.lineEnd=Sn,qs.point=kn}}function jn(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])}),n}function An(){return!0}function Nn(t,e,n,r,i){var o=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(Mn(n,r)){i.lineStart();for(var u=0;e>u;++u)i.point((n=t[u])[0],n[1]);return void i.lineEnd()}var s=new qn(n,t,null,!0),l=new qn(n,null,s,!1);s.o=l,o.push(s),a.push(l),s=new qn(r,t,null,!1),l=new qn(r,null,s,!0),s.o=l,o.push(s),a.push(l)}}),a.sort(e),On(o),On(a),o.length){for(var u=0,s=n,l=a.length;l>u;++u)a[u].e=s=!s;for(var c,f,h=o[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(var u=0,l=c.length;l>u;++u)i.point((f=c[u])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d){c=p.p.z;for(var u=c.length-1;u>=0;--u)i.point((f=c[u])[0],f[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,d=!d}while(!p.v);i.lineEnd()}}}function On(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function qn(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Dn(t,e,n,r){return function(i,o){function a(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function u(t,e){var n=i(t,e);v.point(n[0],n[1])}function s(){y.point=u,v.lineStart()}function l(){y.point=a,v.lineEnd()}function c(t,e){g.push([t,e]);var n=i(t,e);x.point(n[0],n[1])}function f(){x.lineStart(),g=[]}function h(){c(g[0][0],g[0][1]),x.lineEnd();var t,e=x.clean(),n=b.buffer(),r=n.length;if(g.pop(),d.push(g),g=null,r)if(1&e){t=n[0];var i,r=t.length-1,a=-1;if(r>0){for(w||(o.polygonStart(),w=!0),o.lineStart();++a<r;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else r>1&&2&e&&n.push(n.pop().concat(n.shift())),p.push(n.filter(Ln))}var p,d,g,v=e(o),m=i.invert(r[0],r[1]),y={point:a,lineStart:s,lineEnd:l,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=h,p=[],d=[]},polygonEnd:function(){y.point=a,y.lineStart=s,y.lineEnd=l,p=ru.merge(p);var t=Hn(m,d);p.length?(w||(o.polygonStart(),w=!0),Nn(p,zn,t,n,o)):t&&(w||(o.polygonStart(),w=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),w&&(o.polygonEnd(),w=!1),p=d=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}},b=Fn(),x=e(b),w=!1;return y}}function Ln(t){return t.length>1}function Fn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:_,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function zn(t,e){return((t=t.x)[0]<0?t[1]-Fu-Nu:Fu-t[1])-((e=e.x)[0]<0?e[1]-Fu-Nu:Fu-e[1])}function Rn(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?qu:-qu,s=gu(o-n);gu(s-qu)<Nu?(t.point(n,r=(r+a)/2>0?Fu:-Fu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&s>=qu&&(gu(n-i)<Nu&&(n-=i*Nu),gu(o-u)<Nu&&(o-=u*Nu),r=In(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=0/0},clean:function(){return 2-e}}}function In(t,e,n,r){var i,o,a=Math.sin(t-n);return gu(a)>Nu?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function Pn(t,e,n,r){var i;if(null==t)i=n*Fu,r.point(-qu,i),r.point(0,i),r.point(qu,i),r.point(qu,0),r.point(qu,-i),r.point(0,-i),r.point(-qu,-i),r.point(-qu,0),r.point(-qu,i);else if(gu(t[0]-e[0])>Nu){var o=t[0]<e[0]?qu:-qu;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function Hn(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;xs.reset();for(var u=0,s=e.length;s>u;++u){var l=e[u],c=l.length;if(c)for(var f=l[0],h=f[0],p=f[1]/2+qu/4,d=Math.sin(p),g=Math.cos(p),v=1;;){v===c&&(v=0),t=l[v];var m=t[0],y=t[1]/2+qu/4,b=Math.sin(y),x=Math.cos(y),w=m-h,_=w>=0?1:-1,M=_*w,k=M>qu,E=d*b;if(xs.add(Math.atan2(E*_*Math.sin(M),g*x+E*Math.cos(M))),o+=k?w+_*Du:w,k^h>=n^m>=n){var C=yn(vn(f),vn(t));wn(C);var S=yn(i,C);wn(S);var T=(k^w>=0?-1:1)*ne(S[2]);(r>T||r===T&&(C[0]||C[1]))&&(a+=k^w>=0?1:-1)}if(!v++)break;h=m,d=b,g=x,f=t}}return(-Nu>o||Nu>o&&0>xs)^1&a}function Bn(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,o,s,l,c;return{lineStart:function(){l=s=!1,c=1},point:function(f,h){var p,d=[f,h],g=e(f,h),v=a?g?0:i(f,h):g?i(f+(0>f?qu:-qu),h):0;if(!n&&(l=s=g)&&t.lineStart(),g!==s&&(p=r(n,d),(Mn(n,p)||Mn(d,p))&&(d[0]+=Nu,d[1]+=Nu,g=e(d[0],d[1]))),g!==s)c=0,g?(t.lineStart(),p=r(d,n),t.point(p[0],p[1])):(p=r(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(u&&n&&a^g){var m;v&o||!(m=r(d,n,!0))||(c=0,a?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||n&&Mn(n,d)||t.point(d[0],d[1]),n=d,s=g,o=v},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return c|(l&&s)<<1}}}function r(t,e,n){var r=vn(t),i=vn(e),a=[1,0,0],u=yn(r,i),s=mn(u,u),l=u[0],c=s-l*l;if(!c)return!n&&t;var f=o*s/c,h=-o*l/c,p=yn(a,u),d=xn(a,f),g=xn(u,h);bn(d,g);var v=p,m=mn(d,v),y=mn(v,v),b=m*m-y*(mn(d,d)-1);if(!(0>b)){var x=Math.sqrt(b),w=xn(v,(-m-x)/y);if(bn(w,d),w=_n(w),!n)return w;var _,M=t[0],k=e[0],E=t[1],C=e[1];M>k&&(_=M,M=k,k=_);var S=k-M,T=gu(S-qu)<Nu,j=T||Nu>S;if(!T&&E>C&&(_=E,E=C,C=_),j?T?E+C>0^w[1]<(gu(w[0]-M)<Nu?E:C):E<=w[1]&&w[1]<=C:S>qu^(M<=w[0]&&w[0]<=k)){var A=xn(v,(-m+x)/y);return bn(A,d),[w,_n(A)]}}}function i(e,n){var r=a?t:qu-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var o=Math.cos(t),a=o>0,u=gu(o)>Nu,s=gr(t,6*zu);return Dn(e,n,s,a?[0,-t]:[-qu,t-qu])}function $n(t,e,n,r){return function(i){var o,a=i.a,u=i.b,s=a.x,l=a.y,c=u.x,f=u.y,h=0,p=1,d=c-s,g=f-l;if(o=t-s,d||!(o>0)){if(o/=d,0>d){if(h>o)return;p>o&&(p=o)}else if(d>0){if(o>p)return;o>h&&(h=o)}if(o=n-s,d||!(0>o)){if(o/=d,0>d){if(o>p)return;o>h&&(h=o)}else if(d>0){if(h>o)return;p>o&&(p=o)}if(o=e-l,g||!(o>0)){if(o/=g,0>g){if(h>o)return;p>o&&(p=o)}else if(g>0){if(o>p)return;o>h&&(h=o)}if(o=r-l,g||!(0>o)){if(o/=g,0>g){if(o>p)return;o>h&&(h=o)}else if(g>0){if(h>o)return;p>o&&(p=o)}return h>0&&(i.a={x:s+h*d,y:l+h*g}),1>p&&(i.b={x:s+p*d,y:l+p*g}),i}}}}}}function Vn(t,e,n,r){function i(r,i){return gu(r[0]-t)<Nu?i>0?0:3:gu(r[0]-n)<Nu?i>0?2:1:gu(r[1]-e)<Nu?i>0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(u){function s(t){for(var e=0,n=v.length,r=t[1],i=0;n>i;++i)for(var o,a=1,u=v[i],s=u.length,l=u[0];s>a;++a)o=u[a],l[1]<=r?o[1]>r&&te(l,o,t)>0&&++e:o[1]<=r&&te(l,o,t)<0&&--e,l=o;return 0!==e}function l(o,u,s,l){var c=0,f=0;if(null==o||(c=i(o,s))!==(f=i(u,s))||a(o,u)<0^s>0){do l.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+s+4)%4)!==f)}else l.point(u[0],u[1])}function c(i,o){return i>=t&&n>=i&&o>=e&&r>=o}function f(t,e){c(t,e)&&u.point(t,e)}function h(){j.point=d,v&&v.push(m=[]),k=!0,M=!1,w=_=0/0}function p(){g&&(d(y,b),x&&M&&S.rejoin(),g.push(S.buffer())),j.point=f,M&&u.lineEnd()}function d(t,e){t=Math.max(-Ls,Math.min(Ls,t)),e=Math.max(-Ls,Math.min(Ls,e));var n=c(t,e);if(v&&m.push([t,e]),k)y=t,b=e,x=n,k=!1,n&&(u.lineStart(),u.point(t,e));else if(n&&M)u.point(t,e);else{var r={a:{x:w,y:_},b:{x:t,y:e}};T(r)?(M||(u.lineStart(),u.point(r.a.x,r.a.y)),u.point(r.b.x,r.b.y),n||u.lineEnd(),E=!1):n&&(u.lineStart(),u.point(t,e),E=!1)}w=t,_=e,M=n}var g,v,m,y,b,x,w,_,M,k,E,C=u,S=Fn(),T=$n(t,e,n,r),j={point:f,lineStart:h,lineEnd:p,polygonStart:function(){u=S,g=[],v=[],E=!0},polygonEnd:function(){u=C,g=ru.merge(g);var e=s([t,r]),n=E&&e,i=g.length;(n||i)&&(u.polygonStart(),n&&(u.lineStart(),l(null,null,1,u),u.lineEnd()),i&&Nn(g,o,e,l,u),u.polygonEnd()),g=v=m=null}};return j}}function Un(t){var e=0,n=qu/3,r=ur(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*qu/180,n=t[1]*qu/180):[e/qu*180,n/qu*180]},i}function Wn(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,ne((o-(t*t+n*n)*i*i)/(2*i))]},n}function Yn(){function t(t,e){zs+=i*t-r*e,r=t,i=e}var e,n,r,i;Bs.point=function(o,a){Bs.point=t,e=r=o,n=i=a},Bs.lineEnd=function(){t(e,n)}}function Xn(t,e){Rs>t&&(Rs=t),t>Ps&&(Ps=t),Is>e&&(Is=e),e>Hs&&(Hs=e)}function Jn(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e),u.point=n}function n(t,e){a.push("L",t,",",e)}function r(){u.point=t}function i(){a.push("Z")}var o=Zn(4.5),a=[],u={point:t,lineStart:function(){u.point=e},lineEnd:r,polygonStart:function(){u.lineEnd=i},polygonEnd:function(){u.lineEnd=r,u.point=t},pointRadius:function(t){return o=Zn(t),u},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return u}function Zn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Kn(t,e){ks+=t,Es+=e,++Cs}function Gn(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);Ss+=a*(e+t)/2,Ts+=a*(n+r)/2,js+=a,Kn(e=t,n=r)}var e,n;Vs.point=function(r,i){Vs.point=t,Kn(e=r,n=i)}}function Qn(){Vs.point=Kn}function tr(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);Ss+=a*(r+t)/2,Ts+=a*(i+e)/2,js+=a,a=i*t-r*e,As+=a*(r+t),Ns+=a*(i+e),Os+=3*a,Kn(r=t,i=e)}var e,n,r,i;Vs.point=function(o,a){Vs.point=t,Kn(e=r=o,n=i=a)},Vs.lineEnd=function(){t(e,n)}}function er(t){function e(e,n){t.moveTo(e+a,n),t.arc(e,n,a,0,Du)}function n(e,n){t.moveTo(e,n),u.point=r}function r(e,n){t.lineTo(e,n)}function i(){u.point=e}function o(){t.closePath()}var a=4.5,u={point:e,lineStart:function(){u.point=n},lineEnd:i,polygonStart:function(){u.lineEnd=o},polygonEnd:function(){u.lineEnd=i,u.point=e},pointRadius:function(t){return a=t,u},result:_};return u}function nr(t){function e(t){return(u?r:n)(t)}function n(e){return or(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){b=0/0,k.point=o,e.lineStart()}function o(n,r){var o=vn([n,r]),a=t(n,r);i(b,x,y,w,_,M,b=a[0],x=a[1],y=n,w=o[0],_=o[1],M=o[2],u,e),e.point(b,x)}function a(){k.point=n,e.lineEnd()}function s(){r(),k.point=l,k.lineEnd=c}function l(t,e){o(f=t,h=e),p=b,d=x,g=w,v=_,m=M,k.point=o}function c(){i(b,x,y,w,_,M,p,d,f,g,v,m,u,e),k.lineEnd=a,a()}var f,h,p,d,g,v,m,y,b,x,w,_,M,k={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart(),k.lineStart=s},polygonEnd:function(){e.polygonEnd(),k.lineStart=r}};return k}function i(e,n,r,u,s,l,c,f,h,p,d,g,v,m){var y=c-e,b=f-n,x=y*y+b*b;if(x>4*o&&v--){var w=u+p,_=s+d,M=l+g,k=Math.sqrt(w*w+_*_+M*M),E=Math.asin(M/=k),C=gu(gu(M)-1)<Nu||gu(r-h)<Nu?(r+h)/2:Math.atan2(_,w),S=t(C,E),T=S[0],j=S[1],A=T-e,N=j-n,O=b*A-y*N;(O*O/x>o||gu((y*A+b*N)/x-.5)>.3||a>u*p+s*d+l*g)&&(i(e,n,r,u,s,l,T,j,C,w/=k,_/=k,M,v,m),m.point(T,j),i(T,j,C,w,_,M,c,f,h,p,d,g,v,m))}}var o=.5,a=Math.cos(30*zu),u=16;return e.precision=function(t){return arguments.length?(u=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function rr(t){var e=nr(function(e,n){return t([e*Ru,n*Ru])});return function(t){return sr(e(t))}}function ir(t){this.stream=t}function or(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function ar(t){return ur(function(){return t})()}function ur(t){function e(t){return t=u(t[0]*zu,t[1]*zu),[t[0]*h+s,l-t[1]*h]}function n(t){return t=u.invert((t[0]-s)/h,(l-t[1])/h),t&&[t[0]*Ru,t[1]*Ru]}function r(){u=jn(a=fr(m,y,x),o);var t=o(g,v);return s=p-t[0]*h,l=d+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),e}var o,a,u,s,l,c,f=nr(function(t,e){return t=o(t,e),[t[0]*h+s,l-t[1]*h]}),h=150,p=480,d=250,g=0,v=0,m=0,y=0,x=0,w=Ds,_=b,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=sr(w(a,f(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(w=null==t?(M=t,Ds):Bn((M=+t)*zu),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,_=t?Vn(t[0][0],t[0][1],t[1][0],t[1][1]):b,i()):k},e.scale=function(t){return arguments.length?(h=+t,r()):h},e.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],r()):[p,d]},e.center=function(t){return arguments.length?(g=t[0]%360*zu,v=t[1]%360*zu,r()):[g*Ru,v*Ru]},e.rotate=function(t){return arguments.length?(m=t[0]%360*zu,y=t[1]%360*zu,x=t.length>2?t[2]%360*zu:0,r()):[m*Ru,y*Ru,x*Ru]},ru.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&n,r()}}function sr(t){return or(t,function(e,n){t.point(e*zu,n*zu)})}function lr(t,e){return[t,e]}function cr(t,e){return[t>qu?t-Du:-qu>t?t+Du:t,e]}function fr(t,e,n){return t?e||n?jn(pr(t),dr(e,n)):pr(t):e||n?dr(e,n):cr}function hr(t){return function(e,n){return e+=t,[e>qu?e-Du:-qu>e?e+Du:e,n]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function dr(t,e){function n(t,e){var n=Math.cos(e),u=Math.cos(t)*n,s=Math.sin(t)*n,l=Math.sin(e),c=l*r+u*i;return[Math.atan2(s*o-c*a,u*r-l*i),ne(c*o+s*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),u=Math.cos(t)*n,s=Math.sin(t)*n,l=Math.sin(e),c=l*o-s*a;return[Math.atan2(s*o+l*a,u*r+c*i),ne(c*r-u*i)]},n}function gr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,u){var s=a*e;null!=i?(i=vr(n,i),o=vr(n,o),(a>0?o>i:i>o)&&(i+=a*Du)):(i=t+a*Du,o=t-.5*s);for(var l,c=i;a>0?c>o:o>c;c-=s)u.point((l=_n([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],l[1])}}function vr(t,e){var n=vn(e);n[0]-=t,wn(n);var r=ee(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Nu)%(2*Math.PI)}function mr(t,e,n){var r=ru.range(t,e-Nu,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function yr(t,e,n){var r=ru.range(t,e-Nu,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function wr(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),u=Math.sin(r),s=i*Math.cos(t),l=i*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(ae(r-e)+i*a*ae(n-t))),p=1/Math.sin(h),d=h?function(t){var e=Math.sin(t*=h)*p,n=Math.sin(h-t)*p,r=n*s+e*c,i=n*l+e*f,a=n*o+e*u;return[Math.atan2(i,r)*Ru,Math.atan2(a,Math.sqrt(r*r+i*i))*Ru]}:function(){return[t*Ru,e*Ru]};return d.distance=h,d}function _r(){function t(t,i){var o=Math.sin(i*=zu),a=Math.cos(i),u=gu((t*=zu)-e),s=Math.cos(u);Us+=Math.atan2(Math.sqrt((u=a*Math.sin(u))*u+(u=r*o-n*a*s)*u),n*o+r*a*s),e=t,n=o,r=a}var e,n,r;Ws.point=function(i,o){e=i*zu,n=Math.sin(o*=zu),r=Math.cos(o),Ws.point=t},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=_}}function Mr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]},n}function kr(t,e){function n(t,e){a>0?-Fu+Nu>e&&(e=-Fu+Nu):e>Fu-Nu&&(e=Fu-Nu);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(qu/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;return o?(n.invert=function(t,e){var n=a-e,r=Q(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-Fu]},n):Cr}function Er(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]
-}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;return gu(i)<Nu?lr:(n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,o-Q(i)*Math.sqrt(t*t+n*n)]},n)}function Cr(t,e){return[t,Math.log(Math.tan(qu/4+e/2))]}function Sr(t){var e,n=ar(t),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var a=o.apply(n,arguments);if(a===n){if(e=null==t){var u=qu*r(),s=i();o([[s[0]-u,s[1]-u],[s[0]+u,s[1]+u]])}}else e&&(a=null);return a},n.clipExtent(null)}function Tr(t,e){return[Math.log(Math.tan(qu/4+e/2)),-t]}function jr(t){return t[0]}function Ar(t){return t[1]}function Nr(t){for(var e=t.length,n=[0,1],r=2,i=2;e>i;i++){for(;r>1&&te(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Or(t,e){return t[0]-e[0]||t[1]-e[1]}function qr(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Dr(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,u=r[0]-o,s=t[1],l=n[1],c=e[1]-s,f=r[1]-l,h=(u*(s-l)-f*(i-o))/(f*a-u*c);return[i+h*a,s+h*c]}function Lr(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Fr(){ri(this),this.edge=this.site=this.circle=null}function zr(t){var e=il.pop()||new Fr;return e.site=t,e}function Rr(t){Xr(t),el.remove(t),il.push(t),ri(t)}function Ir(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,u=[t];Rr(t);for(var s=o;s.circle&&gu(n-s.circle.x)<Nu&&gu(r-s.circle.cy)<Nu;)o=s.P,u.unshift(s),Rr(s),s=o;u.unshift(s),Xr(s);for(var l=a;l.circle&&gu(n-l.circle.x)<Nu&&gu(r-l.circle.cy)<Nu;)a=l.N,u.push(l),Rr(l),l=a;u.push(l),Xr(l);var c,f=u.length;for(c=1;f>c;++c)l=u[c],s=u[c-1],ti(l.edge,s.site,l.site,i);s=u[0],l=u[f-1],l.edge=Gr(s.site,l.site,null,i),Yr(s),Yr(l)}function Pr(t){for(var e,n,r,i,o=t.x,a=t.y,u=el._;u;)if(r=Hr(u,a)-o,r>Nu)u=u.L;else{if(i=o-Br(u,a),!(i>Nu)){r>-Nu?(e=u.P,n=u):i>-Nu?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}var s=zr(t);if(el.insert(e,s),e||n){if(e===n)return Xr(e),n=zr(e.site),el.insert(s,n),s.edge=n.edge=Gr(e.site,s.site),Yr(e),void Yr(n);if(!n)return void(s.edge=Gr(e.site,s.site));Xr(e),Xr(n);var l=e.site,c=l.x,f=l.y,h=t.x-c,p=t.y-f,d=n.site,g=d.x-c,v=d.y-f,m=2*(h*v-p*g),y=h*h+p*p,b=g*g+v*v,x={x:(v*y-p*b)/m+c,y:(h*b-g*y)/m+f};ti(n.edge,l,d,x),s.edge=Gr(l,t,null,x),n.edge=Gr(t,d,null,x),Yr(e),Yr(n)}}function Hr(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;n=a.site;var u=n.x,s=n.y,l=s-e;if(!l)return u;var c=u-r,f=1/o-1/l,h=c/l;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*l)-s+l/2+i-o/2)))/f+r:(r+u)/2}function Br(t,e){var n=t.N;if(n)return Hr(n,e);var r=t.site;return r.y===e?r.x:1/0}function $r(t){this.site=t,this.edges=[]}function Vr(t){for(var e,n,r,i,o,a,u,s,l,c,f=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],g=tl,v=g.length;v--;)if(o=g[v],o&&o.prepare())for(u=o.edges,s=u.length,a=0;s>a;)c=u[a].end(),r=c.x,i=c.y,l=u[++a%s].start(),e=l.x,n=l.y,(gu(r-e)>Nu||gu(i-n)>Nu)&&(u.splice(a,0,new ei(Qr(o.site,c,gu(r-f)<Nu&&d-i>Nu?{x:f,y:gu(e-f)<Nu?n:d}:gu(i-d)<Nu&&h-r>Nu?{x:gu(n-d)<Nu?e:h,y:d}:gu(r-h)<Nu&&i-p>Nu?{x:h,y:gu(e-h)<Nu?n:p}:gu(i-p)<Nu&&r-f>Nu?{x:gu(n-p)<Nu?e:f,y:p}:null),o.site,null)),++s)}function Ur(t,e){return e.angle-t.angle}function Wr(){ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Yr(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,u=i.y,s=r.x-a,l=r.y-u,c=o.x-a,f=o.y-u,h=2*(s*f-l*c);if(!(h>=-Ou)){var p=s*s+l*l,d=c*c+f*f,g=(f*p-l*d)/h,v=(s*d-c*p)/h,f=v+u,m=ol.pop()||new Wr;m.arc=t,m.site=i,m.x=g+a,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,b=rl._;b;)if(m.y<b.y||m.y===b.y&&m.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}rl.insert(y,m),y||(nl=m)}}}}function Xr(t){var e=t.circle;e&&(e.P||(nl=e.N),rl.remove(e),ol.push(e),ri(e),t.circle=null)}function Jr(t){for(var e,n=Qs,r=$n(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;)e=n[i],(!Zr(e,t)||!r(e)||gu(e.a.x-e.b.x)<Nu&&gu(e.a.y-e.b.y)<Nu)&&(e.a=e.b=null,n.splice(i,1))}function Zr(t,e){var n=t.b;if(n)return!0;var r,i,o=t.a,a=e[0][0],u=e[1][0],s=e[0][1],l=e[1][1],c=t.l,f=t.r,h=c.x,p=c.y,d=f.x,g=f.y,v=(h+d)/2,m=(p+g)/2;if(g===p){if(a>v||v>=u)return;if(h>d){if(o){if(o.y>=l)return}else o={x:v,y:s};n={x:v,y:l}}else{if(o){if(o.y<s)return}else o={x:v,y:l};n={x:v,y:s}}}else if(r=(h-d)/(g-p),i=m-r*v,-1>r||r>1)if(h>d){if(o){if(o.y>=l)return}else o={x:(s-i)/r,y:s};n={x:(l-i)/r,y:l}}else{if(o){if(o.y<s)return}else o={x:(l-i)/r,y:l};n={x:(s-i)/r,y:s}}else if(g>p){if(o){if(o.x>=u)return}else o={x:a,y:r*a+i};n={x:u,y:r*u+i}}else{if(o){if(o.x<a)return}else o={x:u,y:r*u+i};n={x:a,y:r*a+i}}return t.a=o,t.b=n,!0}function Kr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Gr(t,e,n,r){var i=new Kr(t,e);return Qs.push(i),n&&ti(i,t,e,n),r&&ti(i,e,t,r),tl[t.i].edges.push(new ei(i,t,e)),tl[e.i].edges.push(new ei(i,e,t)),i}function Qr(t,e,n){var r=new Kr(t,null);return r.a=e,r.b=n,Qs.push(r),r}function ti(t,e,n,r){t.a||t.b?t.l===n?t.b=r:t.a=r:(t.a=r,t.l=e,t.r=n)}function ei(t,e,n){var r=t.a,i=t.b;this.edge=t,this.site=e,this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function ni(){this._=null}function ri(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ii(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function oi(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function ai(t){for(;t.L;)t=t.L;return t}function ui(t,e){var n,r,i,o=t.sort(si).pop();for(Qs=[],tl=new Array(t.length),el=new ni,rl=new ni;;)if(i=nl,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))(o.x!==n||o.y!==r)&&(tl[o.i]=new $r(o),Pr(o),n=o.x,r=o.y),o=t.pop();else{if(!i)break;Ir(i.arc)}e&&(Jr(e),Vr(e));var a={cells:tl,edges:Qs};return el=rl=Qs=tl=null,a}function si(t,e){return e.y-t.y||e.x-t.x}function li(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function ci(t){return t.x}function fi(t){return t.y}function hi(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pi(t,e,n,r,i,o){if(!t(e,n,r,i,o)){var a=.5*(n+i),u=.5*(r+o),s=e.nodes;s[0]&&pi(t,s[0],n,r,a,u),s[1]&&pi(t,s[1],a,r,i,u),s[2]&&pi(t,s[2],n,u,a,o),s[3]&&pi(t,s[3],a,u,i,o)}}function di(t,e,n,r,i,o,a){var u,s=1/0;return function l(t,c,f,h,p){if(!(c>o||f>a||r>h||i>p)){if(d=t.point){var d,g=e-t.x,v=n-t.y,m=g*g+v*v;if(s>m){var y=Math.sqrt(s=m);r=e-y,i=n-y,o=e+y,a=n+y,u=d}}for(var b=t.nodes,x=.5*(c+h),w=.5*(f+p),_=e>=x,M=n>=w,k=M<<1|_,E=k+4;E>k;++k)if(t=b[3&k])switch(3&k){case 0:l(t,c,f,x,w);break;case 1:l(t,x,f,h,w);break;case 2:l(t,c,w,x,p);break;case 3:l(t,x,w,h,p)}}}(t,r,i,o,a),u}function gi(t,e){t=ru.rgb(t),e=ru.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,u=e.b-i;return function(t){return"#"+we(Math.round(n+o*t))+we(Math.round(r+a*t))+we(Math.round(i+u*t))}}function vi(t,e){var n,r={},i={};for(n in t)n in e?r[n]=bi(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function mi(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function yi(t,e){var n,r,i,o=ul.lastIndex=sl.lastIndex=0,a=-1,u=[],s=[];for(t+="",e+="";(n=ul.exec(t))&&(r=sl.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:mi(n,r)})),o=sl.lastIndex;return o<e.length&&(i=e.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var n,r=0;e>r;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}function bi(t,e){for(var n,r=ru.interpolators.length;--r>=0&&!(n=ru.interpolators[r](t,e)););return n}function xi(t,e){var n,r=[],i=[],o=t.length,a=e.length,u=Math.min(t.length,e.length);for(n=0;u>n;++n)r.push(bi(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;u>n;++n)i[n]=r[n](t);return i}}function wi(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function _i(t){return function(e){return 1-t(1-e)}}function Mi(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function ki(t){return t*t}function Ei(t){return t*t*t}function Ci(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Si(t){return function(e){return Math.pow(e,t)}}function Ti(t){return 1-Math.cos(t*Fu)}function ji(t){return Math.pow(2,10*(t-1))}function Ai(t){return 1-Math.sqrt(1-t*t)}function Ni(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Du*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Du/e)}}function Oi(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function qi(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Di(t,e){t=ru.hcl(t),e=ru.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,u=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.c:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360),function(t){return fe(n+o*t,r+a*t,i+u*t)+""}}function Li(t,e){t=ru.hsl(t),e=ru.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,u=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.s:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360),function(t){return le(n+o*t,r+a*t,i+u*t)+""}}function Fi(t,e){t=ru.lab(t),e=ru.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,u=e.b-i;return function(t){return pe(n+o*t,r+a*t,i+u*t)+""}}function zi(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Ri(t){var e=[t.a,t.b],n=[t.c,t.d],r=Pi(e),i=Ii(e,n),o=Pi(Hi(n,e,-i))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Ru,this.translate=[t.e,t.f],this.scale=[r,o],this.skew=o?Math.atan2(i,o)*Ru:0}function Ii(t,e){return t[0]*e[0]+t[1]*e[1]}function Pi(t){var e=Math.sqrt(Ii(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Hi(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}function Bi(t,e){var n,r=[],i=[],o=ru.transform(t),a=ru.transform(e),u=o.translate,s=a.translate,l=o.rotate,c=a.rotate,f=o.skew,h=a.skew,p=o.scale,d=a.scale;return u[0]!=s[0]||u[1]!=s[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:mi(u[0],s[0])},{i:3,x:mi(u[1],s[1])})):r.push(s[0]||s[1]?"translate("+s+")":""),l!=c?(l-c>180?c+=360:c-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:mi(l,c)})):c&&r.push(r.pop()+"rotate("+c+")"),f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:mi(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:mi(p[0],d[0])},{i:n-2,x:mi(p[1],d[1])})):(1!=d[0]||1!=d[1])&&r.push(r.pop()+"scale("+d+")"),n=i.length,function(t){for(var e,o=-1;++o<n;)r[(e=i[o]).i]=e.x(t);return r.join("")}}function $i(t,e){return e=(e-=t=+t)||1/e,function(n){return(n-t)/e}}function Vi(t,e){return e=(e-=t=+t)||1/e,function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function Ui(t){for(var e=t.source,n=t.target,r=Yi(e,n),i=[e];e!==r;)e=e.parent,i.push(e);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function Wi(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Yi(t,e){if(t===e)return t;for(var n=Wi(t),r=Wi(e),i=n.pop(),o=r.pop(),a=null;i===o;)a=i,i=n.pop(),o=r.pop();return a}function Xi(t){t.fixed|=2}function Ji(t){t.fixed&=-7}function Zi(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ki(t){t.fixed&=-5}function Gi(t,e,n){var r=0,i=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,u=a.length,s=-1;++s<u;)o=a[s],null!=o&&(Gi(o,e,n),t.charge+=o.charge,r+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var l=e*n[t.point.index];t.charge+=t.pointCharge=l,r+=l*t.point.x,i+=l*t.point.y}t.cx=r/t.charge,t.cy=i/t.charge}function Qi(t,e){return ru.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=oo,t}function to(t,e){for(var n=[t];null!=(t=n.pop());)if(e(t),(i=t.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function eo(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a]);for(;null!=(t=r.pop());)e(t)}function no(t){return t.children}function ro(t){return t.value}function io(t,e){return e.value-t.value}function oo(t){return ru.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function ao(t){return t.x}function uo(t){return t.y}function so(t,e,n){t.y0=e,t.y=n}function lo(data){return ru.range(data.length)}function co(data){for(var t=-1,e=data[0].length,n=[];++t<e;)n[t]=0;return n}function fo(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;o>n;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function ho(t){return t.reduce(po,0)}function po(t,e){return t+e[1]}function go(t,e){return vo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vo(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function mo(t){return[ru.min(t),ru.max(t)]}function yo(t,e){return t.value-e.value}function bo(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function xo(t,e){t._pack_next=e,e._pack_prev=t}function wo(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function _o(t){function e(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),p=Math.max(t.y+t.r,p)}if((n=t.children)&&(l=n.length)){var n,r,i,o,a,u,s,l,c=1/0,f=-1/0,h=1/0,p=-1/0;if(n.forEach(Mo),r=n[0],r.x=-r.r,r.y=0,e(r),l>1&&(i=n[1],i.x=i.r,i.y=0,e(i),l>2))for(o=n[2],Co(r,i,o),e(o),bo(r,o),r._pack_prev=o,bo(o,i),i=r._pack_next,a=3;l>a;a++){Co(r,i,o=n[a]);var d=0,g=1,v=1;for(u=i._pack_next;u!==i;u=u._pack_next,g++)if(wo(u,o)){d=1;break}if(1==d)for(s=r._pack_prev;s!==u._pack_prev&&!wo(s,o);s=s._pack_prev,v++);d?(v>g||g==v&&i.r<r.r?xo(r,i=u):xo(r=s,i),a--):(bo(r,o),i=o,e(o))}var m=(c+f)/2,y=(h+p)/2,b=0;for(a=0;l>a;a++)o=n[a],o.x-=m,o.y-=y,b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=b,n.forEach(ko)}}function Mo(t){t._pack_next=t._pack_prev=t}function ko(t){delete t._pack_next,delete t._pack_prev}function Eo(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var o=-1,a=i.length;++o<a;)Eo(i[o],e,n,r)}function Co(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,u=i*i+o*o;a*=a,r*=r;var s=.5+(r-a)/(2*u),l=Math.sqrt(Math.max(0,2*a*(r+u)-(r-=u)*r-a*a))/(2*u);n.x=t.x+s*i+l*o,n.y=t.y+s*o-l*i}else n.x=t.x+r,n.y=t.y}function So(t,e){return t.parent==e.parent?1:2}function To(t){var e=t.children;return e.length?e[0]:t.t}function jo(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function Ao(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function No(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)e=i[o],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Oo(t,e,n){return t.a.parent===e.parent?t.a:n}function qo(t){return 1+ru.max(t,function(t){return t.y})}function Do(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Lo(t){var e=t.children;return e&&e.length?Lo(e[0]):t}function Fo(t){var e,n=t.children;return n&&(e=n.length)?Fo(n[e-1]):t}function zo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ro(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>o&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function Io(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Po(t){return t.rangeExtent?t.rangeExtent():Io(t.range())}function Ho(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function Bo(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];return o>a&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function $o(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bl}function Vo(t,e,n,r){var i=[],o=[],a=0,u=Math.min(t.length,e.length)-1;for(t[u]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=u;)i.push(n(t[a-1],t[a])),o.push(r(e[a-1],e[a]));return function(e){var n=ru.bisect(t,e,1,u)-1;return o[n](i[n](e))}}function Uo(t,e,n,r){function i(){var i=Math.min(t.length,e.length)>2?Vo:Ho,s=r?Vi:$i;return a=i(t,e,s,n),u=i(e,t,s,bi),o}function o(t){return a(t)}var a,u;return o.invert=function(t){return u(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},o.range=function(t){return arguments.length?(e=t,i()):e},o.rangeRound=function(t){return o.range(t).interpolate(zi)},o.clamp=function(t){return arguments.length?(r=t,i()):r},o.interpolate=function(t){return arguments.length?(n=t,i()):n},o.ticks=function(e){return Jo(t,e)},o.tickFormat=function(e,n){return Zo(t,e,n)},o.nice=function(e){return Yo(t,e),i()},o.copy=function(){return Uo(t,e,n,r)},i()}function Wo(t,e){return ru.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Yo(t,e){return Bo(t,$o(Xo(t,e)[2]))}function Xo(t,e){null==e&&(e=10);var n=Io(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;return.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Jo(t,e){return ru.range.apply(ru,Xo(t,e))}function Zo(t,e,n){var r=Xo(t,e);if(n){var i=us.exec(n);if(i.shift(),"s"===i[8]){var o=ru.formatPrefix(Math.max(gu(r[0]),gu(r[1])));return i[7]||(i[7]="."+Ko(o.scale(r[2]))),i[8]="f",n=ru.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Go(i[8],r)),n=i.join("")}else n=",."+Ko(r[2])+"f";return ru.format(n)}function Ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Go(t,e){var n=Ko(e[2]);return t in xl?Math.abs(n-Ko(Math.max(gu(e[0]),gu(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qo(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return o(t.invert(e))},a.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),a):r},a.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),a):e},a.nice=function(){var e=Bo(r.map(i),n?Math:_l);return t.domain(e),r=e.map(o),a},a.ticks=function(){var t=Io(r),a=[],u=t[0],s=t[1],l=Math.floor(i(u)),c=Math.ceil(i(s)),f=e%1?2:e;if(isFinite(c-l)){if(n){for(;c>l;l++)for(var h=1;f>h;h++)a.push(o(l)*h);a.push(o(l))}else for(a.push(o(l));l++<c;)for(var h=f-1;h>0;h--)a.push(o(l)*h);for(l=0;a[l]<u;l++);for(c=a.length;a[c-1]>s;c--);a=a.slice(l,c)}return a},a.tickFormat=function(t,e){if(!arguments.length)return wl;arguments.length<2?e=wl:"function"!=typeof e&&(e=ru.format(e));var r,u=Math.max(.1,t/a.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/o(s(i(t)+r))<=u?e(t):""}},a.copy=function(){return Qo(t.copy(),e,n,r)},Wo(a,t)}function ta(t,e,n){function r(e){return t(i(e))}var i=ea(e),o=ea(1/e);return r.invert=function(e){return o(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Jo(n,t)},r.tickFormat=function(t,e){return Zo(n,t,e)},r.nice=function(t){return r.domain(Yo(n,t))},r.exponent=function(a){return arguments.length?(i=ea(e=a),o=ea(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return ta(t.copy(),e,n)},Wo(r,t)}function ea(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function na(t,e){function n(n){return o[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%o.length]}function r(e,n){return ru.range(t.length).map(function(t){return e+n*t})}var i,o,a;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new c;for(var o,a=-1,u=r.length;++a<u;)i.has(o=r[a])||i.set(o,t.push(o));return n[e.t].apply(n,e.a)},n.range=function(t){return arguments.length?(o=t,a=0,e={t:"range",a:arguments},n):o},n.rangePoints=function(i,u){arguments.length<2&&(u=0);var s=i[0],l=i[1],c=t.length<2?(s=(s+l)/2,0):(l-s)/(t.length-1+u);return o=r(s+c*u/2,c),a=0,e={t:"rangePoints",a:arguments},n},n.rangeRoundPoints=function(i,u){arguments.length<2&&(u=0);var s=i[0],l=i[1],c=t.length<2?(s=l=Math.round((s+l)/2),0):(l-s)/(t.length-1+u)|0;return o=r(s+Math.round(c*u/2+(l-s-(t.length-1+u)*c)/2),c),a=0,e={t:"rangeRoundPoints",a:arguments},n},n.rangeBands=function(i,u,s){arguments.length<2&&(u=0),arguments.length<3&&(s=u);var l=i[1]<i[0],c=i[l-0],f=i[1-l],h=(f-c)/(t.length-u+2*s);return o=r(c+h*s,h),l&&o.reverse(),a=h*(1-u),e={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(i,u,s){arguments.length<2&&(u=0),arguments.length<3&&(s=u);var l=i[1]<i[0],c=i[l-0],f=i[1-l],h=Math.floor((f-c)/(t.length-u+2*s));return o=r(c+Math.round((f-c-(t.length-u)*h)/2),h),l&&o.reverse(),a=Math.round(h*(1-u)),e={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return a},n.rangeExtent=function(){return Io(e.a[0])},n.copy=function(){return na(t,e)},n.domain(t)}function ra(t,e){function n(){var n=0,r=e.length;for(u=[];++n<r;)u[n-1]=ru.quantile(t,n/r);return a}function a(t){return isNaN(t=+t)?void 0:e[ru.bisect(u,t)]}var u;return a.domain=function(e){return arguments.length?(t=e.map(i).filter(o).sort(r),n()):t},a.range=function(t){return arguments.length?(e=t,n()):e},a.quantiles=function(){return u},a.invertExtent=function(n){return n=e.indexOf(n),0>n?[0/0,0/0]:[n>0?u[n-1]:t[0],n<u.length?u[n]:t[t.length-1]]},a.copy=function(){return ra(t,e)},n()}function ia(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){return o=n.length/(e-t),a=n.length-1,r}var o,a;return r.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],i()):[t,e]},r.range=function(t){return arguments.length?(n=t,i()):n},r.invertExtent=function(e){return e=n.indexOf(e),e=0>e?0/0:e/o+t,[e,e+1/o]},r.copy=function(){return ia(t,e,n)},i()}function oa(t,e){function n(n){return n>=n?e[ru.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return oa(t,e)},n}function aa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Jo(t,e)},e.tickFormat=function(e,n){return Zo(t,e,n)},e.copy=function(){return aa(t)},e}function ua(){return 0}function sa(t){return t.innerRadius}function la(t){return t.outerRadius}function ca(t){return t.startAngle}function fa(t){return t.endAngle}function ha(t){return t&&t.padAngle}function pa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function da(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],u=(i?r:-r)/Math.sqrt(o*o+a*a),s=u*a,l=-u*o,c=t[0]+s,f=t[1]+l,h=e[0]+s,p=e[1]+l,d=(c+h)/2,g=(f+p)/2,v=h-c,m=p-f,y=v*v+m*m,b=n-r,x=c*p-h*f,w=(0>m?-1:1)*Math.sqrt(b*b*y-x*x),_=(x*m-v*w)/y,M=(-x*v-m*w)/y,k=(x*m+v*w)/y,E=(-x*v+m*w)/y,C=_-d,S=M-g,T=k-d,j=E-g;return C*C+S*S>T*T+j*j&&(_=k,M=E),[[_-s,M-l],[_*n/b,M*n/b]]}function ga(t){function e(data){function e(){s.push("M",o(t(l),u))}for(var a,s=[],l=[],c=-1,f=data.length,h=Se(n),p=Se(r);++c<f;)i.call(this,a=data[c],c)?l.push([+h.call(this,a,c),+p.call(this,a,c)]):l.length&&(e(),l=[]);return l.length&&e(),s.length?s.join(""):null}var n=jr,r=Ar,i=An,o=va,a=o.key,u=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(a="function"==typeof t?o=t:(o=Tl.get(t)||va).key,e):a},e.tension=function(t){return arguments.length?(u=t,e):u},e}function va(t){return t.join("L")}function ma(t){return va(t)+"Z"}function ya(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")}function ba(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function xa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function wa(t,e){return t.length<4?va(t):t[1]+ka(t.slice(1,-1),Ea(t,e))}function _a(t,e){return t.length<3?va(t):t[0]+ka((t.push(t[0]),t),Ea([t[t.length-2]].concat(t,[t[1]]),e))}function Ma(t,e){return t.length<3?va(t):t[0]+ka(t,Ea(t,e))}function ka(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return va(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],u=a,s=1;if(n&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=t[1],s=2),e.length>1){u=e[1],o=t[s],s++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1];for(var l=2;l<e.length;l++,s++)o=t[s],u=e[l],r+="S"+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1]}if(n){var c=t[s];r+="Q"+(o[0]+2*u[0]/3)+","+(o[1]+2*u[1]/3)+","+c[0]+","+c[1]}return r}function Ea(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],u=1,s=t.length;++u<s;)n=o,o=a,a=t[u],r.push([i*(a[0]-n[0]),i*(a[1]-n[1])]);return r}function Ca(t){if(t.length<3)return va(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],u=[o,o,o,r[1]],s=[i,",",o,"L",Aa(Nl,a),",",Aa(Nl,u)];for(t.push(t[n-1]);++e<=n;)r=t[e],a.shift(),a.push(r[0]),u.shift(),u.push(r[1]),Na(s,a,u);return t.pop(),s.push("L",r),s.join("")}function Sa(t){if(t.length<4)return va(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;)e=t[r],o.push(e[0]),a.push(e[1]);for(n.push(Aa(Nl,o)+","+Aa(Nl,a)),--r;++r<i;)e=t[r],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Na(n,o,a);return n.join("")}function Ta(t){for(var e,n,r=-1,i=t.length,o=i+4,a=[],u=[];++r<4;)n=t[r%i],a.push(n[0]),u.push(n[1]);for(e=[Aa(Nl,a),",",Aa(Nl,u)],--r;++r<o;)n=t[r%i],a.shift(),a.push(n[0]),u.shift(),u.push(n[1]),Na(e,a,u);return e.join("")}function ja(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],u=t[n][0]-o,s=t[n][1]-a,l=-1;++l<=n;)r=t[l],i=l/n,r[0]=e*r[0]+(1-e)*(o+i*u),r[1]=e*r[1]+(1-e)*(a+i*s);return Ca(t)}function Aa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Na(t,e,n){t.push("C",Aa(jl,e),",",Aa(jl,n),",",Aa(Al,e),",",Aa(Al,n),",",Aa(Nl,e),",",Aa(Nl,n))}function Oa(t,e){return(e[1]-t[1])/(e[0]-t[0])}function qa(t){for(var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=Oa(i,o);++e<n;)r[e]=(a+(a=Oa(i=o,o=t[e+1])))/2;return r[e]=a,r}function Da(t){for(var e,n,r,i,o=[],a=qa(t),u=-1,s=t.length-1;++u<s;)e=Oa(t[u],t[u+1]),gu(e)<Nu?a[u]=a[u+1]=0:(n=a[u]/e,r=a[u+1]/e,i=n*n+r*r,i>9&&(i=3*e/Math.sqrt(i),a[u]=i*n,a[u+1]=i*r));for(u=-1;++u<=s;)i=(t[Math.min(s,u+1)][0]-t[Math.max(0,u-1)][0])/(6*(1+a[u]*a[u])),o.push([i||0,a[u]*i||0]);return o}function La(t){return t.length<3?va(t):t[0]+ka(t,Da(t))}function Fa(t){for(var e,n,r,i=-1,o=t.length;++i<o;)e=t[i],n=e[0],r=e[1]-Fu,e[0]=n*Math.cos(r),e[1]=n*Math.sin(r);return t}function za(t){function e(data){function e(){d.push("M",u(t(v),f),c,l(t(g.reverse()),f),"Z")}for(var s,h,p,d=[],g=[],v=[],m=-1,y=data.length,b=Se(n),x=Se(i),w=n===r?function(){return h}:Se(r),_=i===o?function(){return p}:Se(o);++m<y;)a.call(this,s=data[m],m)?(g.push([h=+b.call(this,s,m),p=+x.call(this,s,m)]),v.push([+w.call(this,s,m),+_.call(this,s,m)])):g.length&&(e(),g=[],v=[]);return g.length&&e(),d.length?d.join(""):null}var n=jr,r=jr,i=0,o=Ar,a=An,u=va,s=u.key,l=u,c="L",f=.7;return e.x=function(t){return arguments.length?(n=r=t,e):r},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(i=o=t,e):o},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?u=t:(u=Tl.get(t)||va).key,l=u.reverse||u,c=u.closed?"M":"L",e):s},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Ra(t){return t.radius}function Ia(t){return[t.x,t.y]}function Pa(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Fu;return[n*Math.cos(r),n*Math.sin(r)]}}function Ha(){return 64}function Ba(){return"circle"}function $a(t){var e=Math.sqrt(t/qu);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Va(t){return function(){var e,n;(e=this[t])&&(n=e[e.active])&&(--e.count?delete e[e.active]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Ua(t,e,n){return xu(t,Rl),t.namespace=e,t.id=n,t}function Wa(t,e,n,r){var i=t.id,o=t.namespace;return V(t,"function"==typeof n?function(t,a,u){t[o][i].tween.set(e,r(n.call(t,t.__data__,a,u)))}:(n=r(n),function(t){t[o][i].tween.set(e,n)}))}function Ya(t){return null==t&&(t=""),function(){this.textContent=t}}function Xa(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ja(t,e,n,r,i){var o=t[n]||(t[n]={active:0,count:0}),a=o[r];if(!a){var u=i.time;a=o[r]={tween:new c,time:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++o.count,ru.timer(function(i){function s(n){if(o.active>r)return c();var i=o[o.active];i&&(--o.count,delete o[o.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),o.active=r,a.event&&a.event.start.call(t,t.__data__,e),a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)}),h=a.ease,f=a.duration,ru.timer(function(){return d.c=l(n||1)?An:l,1},0,u)}function l(n){if(o.active!==r)return 1;for(var i=n/f,u=h(i),s=g.length;s>0;)g[--s].call(t,u);return i>=1?(a.event&&a.event.end.call(t,t.__data__,e),c()):void 0}function c(){return--o.count?delete o[r]:delete t[n],1}var f,h,p=a.delay,d=is,g=[];return d.t=p+u,i>=p?s(i-p):void(d.c=s)},0,u)}}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Ka(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ga(t){return t.toISOString()}function Qa(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,o=ru.bisect(Yl,i);return o==Yl.length?[e.year,Xo(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/Yl[o-1]<Yl[o]/i?o-1:o]:[Zl,Xo(t,n)[2]]}return r.invert=function(e){return tu(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(tu)},r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,tu(+n+1),e).length}var o=r.domain(),a=Io(o),u=null==t?i(a,10):"number"==typeof t&&i(a,t);return u&&(t=u[0],e=u[1]),r.domain(Bo(o,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=tu(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=tu(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Io(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(n[0],tu(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Qa(t.copy(),e,n)},Wo(r,t)}function tu(t){return new Date(t)}function eu(t){return JSON.parse(t.responseText)}function nu(t){var e=au.createRange();return e.selectNode(au.body),e.createContextualFragment(t.responseText)}var ru={version:"3.5.5"},iu=[].slice,ou=function(t){return iu.call(t)},au=this.document;if(au)try{ou(au.documentElement.childNodes)[0].nodeType}catch(uu){ou=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),au)try{au.createElement("DIV").style.setProperty("opacity",0,"")}catch(su){var lu=this.Element.prototype,cu=lu.setAttribute,fu=lu.setAttributeNS,hu=this.CSSStyleDeclaration.prototype,pu=hu.setProperty;lu.setAttribute=function(t,e){cu.call(this,t,e+"")},lu.setAttributeNS=function(t,e,n){fu.call(this,t,e,n+"")},hu.setProperty=function(t,e,n){pu.call(this,t,e+"",n)}}ru.ascending=r,ru.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},ru.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n},ru.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n},ru.extent=function(t,e){var n,r,i,o=-1,a=t.length;
-if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),r>i&&(i=r))}else{for(;++o<a;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=e.call(t,t[o],o))&&(n>r&&(n=r),r>i&&(i=r))}return[n,i]},ru.sum=function(t,e){var n,r=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)o(n=+t[a])&&(r+=n);else for(;++a<i;)o(n=+e.call(t,t[a],a))&&(r+=n);return r},ru.mean=function(t,e){var n,r=0,a=t.length,u=-1,s=a;if(1===arguments.length)for(;++u<a;)o(n=i(t[u]))?r+=n:--s;else for(;++u<a;)o(n=i(e.call(t,t[u],u)))?r+=n:--s;return s?r/s:void 0},ru.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i},ru.median=function(t,e){var n,a=[],u=t.length,s=-1;if(1===arguments.length)for(;++s<u;)o(n=i(t[s]))&&a.push(n);else for(;++s<u;)o(n=i(e.call(t,t[s],s)))&&a.push(n);return a.length?ru.quantile(a.sort(r),.5):void 0},ru.variance=function(t,e){var n,r,a=t.length,u=0,s=0,l=-1,c=0;if(1===arguments.length)for(;++l<a;)o(n=i(t[l]))&&(r=n-u,u+=r/++c,s+=r*(n-u));else for(;++l<a;)o(n=i(e.call(t,t[l],l)))&&(r=n-u,u+=r/++c,s+=r*(n-u));return c>1?s/(c-1):void 0},ru.deviation=function(){var t=ru.variance.apply(this,arguments);return t?Math.sqrt(t):t};var du=a(r);ru.bisectLeft=du.left,ru.bisect=ru.bisectRight=du.right,ru.bisector=function(t){return a(1===t.length?function(e,n){return r(t(e),n)}:t)},ru.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,2>o&&(e=0));for(var r,i,o=n-e;o;)i=Math.random()*o--|0,r=t[o+e],t[o+e]=t[i+e],t[i+e]=r;return t},ru.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},ru.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>n;)o[n]=[e=i,i=t[++n]];return o},ru.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=ru.min(arguments,u),n=new Array(e);++t<e;)for(var r,i=-1,o=n[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return n},ru.transpose=function(t){return ru.zip.apply(ru,t)},ru.keys=function(t){var e=[];for(var n in t)e.push(n);return e},ru.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},ru.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},ru.merge=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(r=t[i],e=r.length;--e>=0;)n[--a]=r[e];return n};var gu=Math.abs;ru.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=s(gu(n)),a=-1;if(t*=o,e*=o,n*=o,0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i},ru.map=function(t,e){var n=new c;if(t instanceof c)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e.call(t,r=t[i],i),r)}else for(var a in t)n.set(a,t[a]);return n};var vu="__proto__",mu="\x00";l(c,{has:p,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:d,keys:g,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:h(e),value:this._[e]});return t},size:v,empty:m,forEach:function(t){for(var e in this._)t.call(this,h(e),this._[e])}}),ru.nest=function(){function t(e,a,u){if(u>=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var s,l,f,h,p=-1,d=a.length,g=o[u++],v=new c;++p<d;)(h=v.get(s=g(l=a[p])))?h.push(l):v.set(s,[l]);return e?(l=e(),f=function(n,r){l.set(n,t(e,r,u))}):(l={},f=function(n,r){l[n]=t(e,r,u)}),v.forEach(f),l}function e(t,n){if(n>=o.length)return t;var r=[],i=a[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(ru.map,n,0),0)},i.key=function(t){return o.push(t),i},i.sortKeys=function(t){return a[o.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},ru.set=function(t){var e=new y;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},l(y,{has:p,add:function(t){return this._[f(t+="")]=!0,t},remove:d,values:g,size:v,empty:m,forEach:function(t){for(var e in this._)t.call(this,h(e))}}),ru.behavior={},ru.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=x(t,e,e[n]);return t};var yu=["webkit","ms","moz","Moz","o","O"];ru.dispatch=function(){for(var t=new M,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=k(t);return t},M.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},ru.event=null,ru.requote=function(t){return t.replace(bu,"\\$&")};var bu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xu={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},wu=function(t,e){return e.querySelector(t)},_u=function(t,e){return e.querySelectorAll(t)},Mu=function(t,e){var n=t.matches||t[w(t,"matchesSelector")];return(Mu=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(wu=function(t,e){return Sizzle(t,e)[0]||null},_u=Sizzle,Mu=Sizzle.matchesSelector),ru.selection=function(){return ru.select(au.documentElement)};var ku=ru.selection.prototype=[];ku.select=function(t){var e,n,r,i,o=[];t=j(t);for(var a=-1,u=this.length;++a<u;){o.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=-1,l=r.length;++s<l;)(i=r[s])?(e.push(n=t.call(i,i.__data__,s,a)),n&&"__data__"in i&&(n.__data__=i.__data__)):e.push(null)}return T(o)},ku.selectAll=function(t){var e,n,r=[];t=A(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],u=-1,s=a.length;++u<s;)(n=a[u])&&(r.push(e=ou(t.call(n,n.__data__,u,i))),e.parentNode=n);return T(r)};var Eu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ru.ns={prefix:Eu,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.slice(0,e),t=t.slice(e+1)),Eu.hasOwnProperty(n)?{space:Eu[n],local:t}:t}},ku.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=ru.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},ku.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=D(t)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else for(e=n.getAttribute("class");++i<r;)if(!q(t[i]).test(e))return!1;return!0}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ku.style=function(t,e,r){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(z(r,t[r],e));return this}if(2>i){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(z(t,e,r))},ku.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},ku.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},ku.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},ku.append=function(t){return t=I(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},ku.insert=function(t,e){return t=I(t),e=j(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},ku.remove=function(){return this.each(P)},ku.data=function(t,e){function n(t,n){var r,i,o,a=t.length,f=n.length,h=Math.min(a,f),p=new Array(f),d=new Array(f),g=new Array(a);if(e){var v,m=new c,y=new Array(a);for(r=-1;++r<a;)m.has(v=e.call(i=t[r],i.__data__,r))?g[r]=i:m.set(v,i),y[r]=v;for(r=-1;++r<f;)(i=m.get(v=e.call(n,o=n[r],r)))?i!==!0&&(p[r]=i,i.__data__=o):d[r]=H(o),m.set(v,!0);for(r=-1;++r<a;)m.get(y[r])!==!0&&(g[r]=t[r])}else{for(r=-1;++r<h;)i=t[r],o=n[r],i?(i.__data__=o,p[r]=i):d[r]=H(o);for(;f>r;++r)d[r]=H(n[r]);for(;a>r;++r)g[r]=t[r]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,u.push(d),s.push(p),l.push(g)}var r,i,o=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++o<a;)(i=r[o])&&(t[o]=i.__data__);return t}var u=U([]),s=T([]),l=T([]);if("function"==typeof t)for(;++o<a;)n(r=this[o],t.call(r,r.parentNode.__data__,o));else for(;++o<a;)n(r=this[o],t);return s.enter=function(){return u},s.exit=function(){return l},s},ku.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},ku.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=B(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var u=0,s=n.length;s>u;u++)(r=n[u])&&t.call(r,r.__data__,u,o)&&e.push(r)}return T(i)},ku.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},ku.sort=function(t){t=$.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},ku.each=function(t){return V(this,function(e,n,r){t.call(e,e.__data__,n,r)})},ku.call=function(t){var e=ou(arguments);return t.apply(e[0]=this,e),this},ku.empty=function(){return!this.node()},ku.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null},ku.size=function(){var t=0;return V(this,function(){++t}),t};var Cu=[];ru.selection.enter=U,ru.selection.enter.prototype=Cu,Cu.append=ku.append,Cu.empty=ku.empty,Cu.node=ku.node,Cu.call=ku.call,Cu.size=ku.size,Cu.select=function(t){for(var e,n,r,i,o,a=[],u=-1,s=this.length;++u<s;){r=(i=this[u]).update,a.push(e=[]),e.parentNode=i.parentNode;for(var l=-1,c=i.length;++l<c;)(o=i[l])?(e.push(r[l]=n=t.call(i.parentNode,o.__data__,l,u)),n.__data__=o.__data__):e.push(null)}return T(a)},Cu.insert=function(t,e){return arguments.length<2&&(e=W(this)),ku.insert.call(this,t,e)},ru.select=function(e){var n;return"string"==typeof e?(n=[wu(e,au)],n.parentNode=au.documentElement):(n=[e],n.parentNode=t(e)),T([n])},ru.selectAll=function(t){var e;return"string"==typeof t?(e=ou(_u(t,au)),e.parentNode=au.documentElement):(e=t,e.parentNode=null),T([e])},ku.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(Y(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(Y(t,e,n))};var Su=ru.map({mouseenter:"mouseover",mouseleave:"mouseout"});au&&Su.forEach(function(t){"on"+t in au&&Su.remove(t)});var Tu,ju=0;ru.mouse=function(t){return K(t,C())};var Au=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ru.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=C().changedTouches),e)for(var r,i=0,o=e.length;o>i;++i)if((r=e[i]).identifier===n)return K(t,r)},ru.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,n,o,a){return function(){function u(){var t,n,r=e(h,g);r&&(t=r[0]-b[0],n=r[1]-b[1],d|=t|n,b=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:n}))}function s(){e(h,g)&&(m.on(o+v,null).on(a+v,null),y(d&&ru.event.target===f),p({type:"dragend"}))}var l,c=this,f=ru.event.target,h=c.parentNode,p=r.of(c,arguments),d=0,g=t(),v=".drag"+(null==g?"":"-"+g),m=ru.select(n(f)).on(o+v,u).on(a+v,s),y=Z(f),b=e(h,g);i?(l=i.apply(c,arguments),l=[l.x-b[0],l.y-b[1]]):l=[0,0],p({type:"dragstart"})}}var r=S(t,"drag","dragstart","dragend"),i=null,o=e(_,ru.mouse,n,"mousemove","mouseup"),a=e(G,ru.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},ru.rebind(t,r,"on")},ru.touches=function(t,e){return arguments.length<2&&(e=C().touches),e?ou(e).map(function(e){var n=K(t,e);return n.identifier=e.identifier,n}):[]};var Nu=1e-6,Ou=Nu*Nu,qu=Math.PI,Du=2*qu,Lu=Du-Nu,Fu=qu/2,zu=qu/180,Ru=180/qu,Iu=Math.SQRT2,Pu=2,Hu=4;ru.interpolateZoom=function(t,e){function n(t){var e=t*y;if(m){var n=ie(g),a=o/(Pu*h)*(n*oe(Iu*e+g)-re(g));return[r+a*l,i+a*c,o*n/ie(Iu*e+g)]}return[r+t*l,i+t*c,o*Math.exp(Iu*e)]}var r=t[0],i=t[1],o=t[2],a=e[0],u=e[1],s=e[2],l=a-r,c=u-i,f=l*l+c*c,h=Math.sqrt(f),p=(s*s-o*o+Hu*f)/(2*o*Pu*h),d=(s*s-o*o-Hu*f)/(2*s*Pu*h),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(d*d+1)-d),m=v-g,y=(m||Math.log(s/o))/Iu;return n.duration=1e3*y,n},ru.behavior.zoom=function(){function t(t){t.on(N,f).on($u+".zoom",p).on("dblclick.zoom",d).on(D,h)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(T[0],Math.min(T[1],t))}function o(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,a)),o(v=n,r),e=ru.select(e),j>0&&(e=e.transition().duration(j)),e.call(t.event)}function u(){w&&w.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),M&&M.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){A++||t({type:"zoomstart"})}function l(t){u(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--A||t({type:"zoomend"}),v=null}function f(){function t(){f=1,o(ru.mouse(i),p),l(u)}function r(){h.on(O,null).on(q,null),d(f&&ru.event.target===a),c(u)}var i=this,a=ru.event.target,u=L.of(i,arguments),f=0,h=ru.select(n(i)).on(O,t).on(q,r),p=e(ru.mouse(i)),d=Z(i);zl.call(i),s(u)}function h(){function t(){var t=ru.touches(d);return p=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function n(){var e=ru.event.target;ru.select(e).on(x,r).on(w,u),_.push(e);for(var n=ru.event.changedTouches,i=0,o=n.length;o>i;++i)v[n[i].identifier]=null;var s=t(),l=Date.now();if(1===s.length){if(500>l-b){var c=s[0];a(d,c,v[c.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),E()}b=l}else if(s.length>1){var c=s[0],f=s[1],h=c[0]-f[0],p=c[1]-f[1];m=h*h+p*p}}function r(){var t,e,n,r,a=ru.touches(d);zl.call(d);for(var u=0,s=a.length;s>u;++u,r=null)if(n=a[u],r=v[n.identifier]){if(e)break;t=n,e=r}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=m&&Math.sqrt(c/m);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],i(f*p)}b=null,o(t,e),l(g)}function u(){if(ru.event.touches.length){for(var e=ru.event.changedTouches,n=0,r=e.length;r>n;++n)delete v[e[n].identifier];for(var i in v)return void t()}ru.selectAll(_).on(y,null),M.on(N,f).on(D,h),C(),c(g)}var p,d=this,g=L.of(d,arguments),v={},m=0,y=".zoom-"+ru.event.changedTouches[0].identifier,x="touchmove"+y,w="touchend"+y,_=[],M=ru.select(d),C=Z(d);n(),s(g),M.on(N,null).on(D,n)}function p(){var t=L.of(this,arguments);y?clearTimeout(y):(g=e(v=m||ru.mouse(this)),zl.call(this),s(t)),y=setTimeout(function(){y=null,c(t)},50),E(),i(Math.pow(2,.002*Bu())*k.k),o(v,g),l(t)}function d(){var t=ru.mouse(this),n=Math.log(k.k)/Math.LN2;a(this,t,e(t),ru.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,v,m,y,b,x,w,_,M,k={x:0,y:0,k:1},C=[960,500],T=Vu,j=250,A=0,N="mousedown.zoom",O="mousemove.zoom",q="mouseup.zoom",D="touchstart.zoom",L=S(t,"zoomstart","zoom","zoomend");return $u||($u="onwheel"in au?(Bu=function(){return-ru.event.deltaY*(ru.event.deltaMode?120:1)},"wheel"):"onmousewheel"in au?(Bu=function(){return ru.event.wheelDelta},"mousewheel"):(Bu=function(){return-ru.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=L.of(this,arguments),e=k;Ll?ru.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=C[0],r=C[1],i=v?v[0]:n/2,o=v?v[1]:r/2,a=ru.interpolateZoom([(i-k.x)/k.k,(o-k.y)/k.k,n/k.k],[(i-e.x)/e.k,(o-e.y)/e.k,n/e.k]);return function(e){var r=a(e),u=n/r[2];this.__chart__=k={x:i-r[0]*u,y:o-r[1]*u,k:u},l(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=k,s(t),l(t),c(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},u(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:+e},u(),t):k.k},t.scaleExtent=function(e){return arguments.length?(T=null==e?Vu:[+e[0],+e[1]],t):T},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(C=e&&[+e[0],+e[1]],t):C},t.duration=function(e){return arguments.length?(j=+e,t):j},t.x=function(e){return arguments.length?(w=e,x=e.copy(),k={x:0,y:0,k:1},t):w},t.y=function(e){return arguments.length?(M=e,_=e.copy(),k={x:0,y:0,k:1},t):M},ru.rebind(t,L,"on")};var Bu,$u,Vu=[0,1/0];ru.color=ue,ue.prototype.toString=function(){return this.rgb()+""},ru.hsl=se;var Uu=se.prototype=new ue;Uu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new se(this.h,this.s,this.l/t)},Uu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new se(this.h,this.s,t*this.l)},Uu.rgb=function(){return le(this.h,this.s,this.l)},ru.hcl=ce;var Wu=ce.prototype=new ue;Wu.brighter=function(t){return new ce(this.h,this.c,Math.min(100,this.l+Yu*(arguments.length?t:1)))},Wu.darker=function(t){return new ce(this.h,this.c,Math.max(0,this.l-Yu*(arguments.length?t:1)))},Wu.rgb=function(){return fe(this.h,this.c,this.l).rgb()},ru.lab=he;var Yu=18,Xu=.95047,Ju=1,Zu=1.08883,Ku=he.prototype=new ue;Ku.brighter=function(t){return new he(Math.min(100,this.l+Yu*(arguments.length?t:1)),this.a,this.b)},Ku.darker=function(t){return new he(Math.max(0,this.l-Yu*(arguments.length?t:1)),this.a,this.b)},Ku.rgb=function(){return pe(this.l,this.a,this.b)},ru.rgb=ye;var Gu=ye.prototype=new ue;Gu.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new ye(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new ye(i,i,i)},Gu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ye(t*this.r,t*this.g,t*this.b)},Gu.hsl=function(){return Me(this.r,this.g,this.b)},Gu.toString=function(){return"#"+we(this.r)+we(this.g)+we(this.b)};var Qu=ru.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Qu.forEach(function(t,e){Qu.set(t,be(e))}),ru.functor=Se,ru.xhr=Te(b),ru.dsv=function(t,e){function n(t,n,o){arguments.length<3&&(o=n,n=null);var a=je(t,e,null==n?r:i(n),o);return a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n},a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return u.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var u=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(c>=l)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++<l;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}c=n+2;var r=t.charCodeAt(n+1);return 13===r?(i=!0,10===t.charCodeAt(n+2)&&++c):10===r&&(i=!0),t.slice(e+1,n).replace(/""/g,'"')}for(;l>c;){var r=t.charCodeAt(c++),u=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(r!==s)continue;return t.slice(e,c-u)}return t.slice(e)}for(var r,i,o={},a={},u=[],l=t.length,c=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;)h.push(r),r=n();e&&null==(h=e(h,f++))||u.push(h)}return u},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new y,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(o).join("\n")},n},ru.csv=ru.dsv(",","text/csv"),ru.tsv=ru.dsv(" ","text/tab-separated-values");var ts,es,ns,rs,is,os=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ru.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,o={c:t,t:i,f:!1,n:null};es?es.n=o:ts=o,es=o,ns||(rs=clearTimeout(rs),ns=1,os(Oe))},ru.timer.flush=function(){qe(),De()},ru.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var as=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Fe);ru.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=ru.round(t,Le(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),as[8+n/3]};var us=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ss=ru.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ru.round(t,Le(t,e))).toFixed(Math.max(0,Math.min(20,Le(t*(1+1e-15),e))))}}),ls=ru.time={},cs=Date;Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){fs.setUTCDate.apply(this._,arguments)},setDay:function(){fs.setUTCDay.apply(this._,arguments)},setFullYear:function(){fs.setUTCFullYear.apply(this._,arguments)},setHours:function(){fs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fs.setUTCSeconds.apply(this._,arguments)},setTime:function(){fs.setTime.apply(this._,arguments)}};var fs=Date.prototype;ls.year=Pe(function(t){return t=ls.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ls.years=ls.year.range,ls.years.utc=ls.year.utc.range,ls.day=Pe(function(t){var e=new cs(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),ls.days=ls.day.range,ls.days.utc=ls.day.utc.range,ls.dayOfYear=function(t){var e=ls.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=ls[t]=Pe(function(t){return(t=ls.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=ls.year(t).getDay();return Math.floor((ls.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});ls[t+"s"]=n.range,ls[t+"s"].utc=n.utc.range,ls[t+"OfYear"]=function(t){var n=ls.year(t).getDay();return Math.floor((ls.dayOfYear(t)+(n+e)%7)/7)}}),ls.week=ls.sunday,ls.weeks=ls.sunday.range,ls.weeks.utc=ls.sunday.utc.range,ls.weekOfYear=ls.sundayOfYear;var hs={"-":"",_:" ",0:"0"},ps=/^\s*\d+/,ds=/^%/;ru.locale=function(t){return{numberFormat:ze(t),timeFormat:Be(t)}};var gs=ru.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ru.format=gs.numberFormat,ru.geo={},cn.prototype={s:0,t:0,add:function(t){fn(t,this.t,vs),fn(vs.s,this.s,this),this.s?this.t+=vs.t:this.s=vs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vs=new cn;ru.geo.stream=function(t,e){t&&ms.hasOwnProperty(t.type)?ms[t.type](t,e):hn(t,e)};var ms={Feature:function(t,e){hn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)hn(n[r].geometry,e)}},ys={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){pn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)pn(n[r],e,0)},Polygon:function(t,e){dn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)dn(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)hn(n[r],e)}};ru.geo.area=function(t){return bs=0,ru.geo.stream(t,ws),bs};var bs,xs=new cn,ws={sphere:function(){bs+=4*qu},point:_,lineStart:_,lineEnd:_,polygonStart:function(){xs.reset(),ws.lineStart=gn},polygonEnd:function(){var t=2*xs;bs+=0>t?4*qu+t:t,ws.lineStart=ws.lineEnd=ws.point=_}};ru.geo.bounds=function(){function t(t,e){b.push(x=[c=t,h=t]),f>e&&(f=e),e>p&&(p=e)}function e(e,n){var r=vn([e*zu,n*zu]);if(m){var i=yn(m,r),o=[i[1],-i[0],0],a=yn(o,i);wn(a),a=_n(a);var s=e-d,l=s>0?1:-1,g=a[0]*Ru*l,v=gu(s)>180;if(v^(g>l*d&&l*e>g)){var y=a[1]*Ru;y>p&&(p=y)}else if(g=(g+360)%360-180,v^(g>l*d&&l*e>g)){var y=-a[1]*Ru;f>y&&(f=y)}else f>n&&(f=n),n>p&&(p=n);v?d>e?u(c,e)>u(c,h)&&(h=e):u(e,h)>u(c,h)&&(c=e):h>=c?(c>e&&(c=e),e>h&&(h=e)):e>d?u(c,e)>u(c,h)&&(h=e):u(e,h)>u(c,h)&&(c=e)}else t(e,n);m=r,d=e}function n(){w.point=e}function r(){x[0]=c,x[1]=h,w.point=t,m=null}function i(t,n){if(m){var r=t-d;y+=gu(r)>180?r+(r>0?360:-360):r}else g=t,v=n;ws.point(t,n),e(t,n)}function o(){ws.lineStart()}function a(){i(g,v),ws.lineEnd(),gu(y)>Nu&&(c=-(h=180)),x[0]=c,x[1]=h,m=null}function u(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function l(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,h,p,d,g,v,m,y,b,x,w={point:t,lineStart:n,lineEnd:r,polygonStart:function(){w.point=i,w.lineStart=o,w.lineEnd=a,y=0,ws.polygonStart()},polygonEnd:function(){ws.polygonEnd(),w.point=t,w.lineStart=n,w.lineEnd=r,0>xs?(c=-(h=180),f=-(p=90)):y>Nu?p=90:-Nu>y&&(f=-90),x[0]=c,x[1]=h}};return function(t){p=h=-(c=f=1/0),b=[],ru.geo.stream(t,w);var e=b.length;if(e){b.sort(s);for(var n,r=1,i=b[0],o=[i];e>r;++r)n=b[r],l(n[0],i)||l(n[1],i)?(u(i[0],n[1])>u(i[0],i[1])&&(i[1]=n[1]),u(n[0],i[1])>u(i[0],i[1])&&(i[0]=n[0])):o.push(i=n);for(var a,n,d=-1/0,e=o.length-1,r=0,i=o[e];e>=r;i=n,++r)n=o[r],(a=u(i[1],n[0]))>d&&(d=a,c=n[0],h=i[1])}return b=x=null,1/0===c||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[c,f],[h,p]]}}(),ru.geo.centroid=function(t){_s=Ms=ks=Es=Cs=Ss=Ts=js=As=Ns=Os=0,ru.geo.stream(t,qs);var e=As,n=Ns,r=Os,i=e*e+n*n+r*r;return Ou>i&&(e=Ss,n=Ts,r=js,Nu>Ms&&(e=ks,n=Es,r=Cs),i=e*e+n*n+r*r,Ou>i)?[0/0,0/0]:[Math.atan2(n,e)*Ru,ne(r/Math.sqrt(i))*Ru]};var _s,Ms,ks,Es,Cs,Ss,Ts,js,As,Ns,Os,qs={sphere:_,point:kn,lineStart:Cn,lineEnd:Sn,polygonStart:function(){qs.lineStart=Tn},polygonEnd:function(){qs.lineStart=Cn}},Ds=Dn(An,Rn,Pn,[-qu,-qu/2]),Ls=1e9;ru.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){return i&&(i.valid=!1),i=o(t),i.valid=!0,i},extent:function(u){return arguments.length?(o=Vn(t=+u[0][0],e=+u[0][1],n=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(ru.geo.conicEqualArea=function(){return Un(Wn)}).raw=Wn,ru.geo.albers=function(){return ru.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ru.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return e=null,n(o,a),e||(r(o,a),e)||i(o,a),e}var e,n,r,i,o=ru.geo.albers(),a=ru.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=ru.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?u:o).invert(t)},t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=u.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(o.precision(e),a.precision(e),u.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),a.scale(.35*e),u.scale(e),t.translate(o.translate())):o.scale()
-},t.translate=function(e){if(!arguments.length)return o.translate();var l=o.scale(),c=+e[0],f=+e[1];return n=o.translate(e).clipExtent([[c-.455*l,f-.238*l],[c+.455*l,f+.238*l]]).stream(s).point,r=a.translate([c-.307*l,f+.201*l]).clipExtent([[c-.425*l+Nu,f+.12*l+Nu],[c-.214*l-Nu,f+.234*l-Nu]]).stream(s).point,i=u.translate([c-.205*l,f+.212*l]).clipExtent([[c-.214*l+Nu,f+.166*l+Nu],[c-.115*l-Nu,f+.234*l-Nu]]).stream(s).point,t},t.scale(1070)};var Fs,zs,Rs,Is,Ps,Hs,Bs={point:_,lineStart:_,lineEnd:_,polygonStart:function(){zs=0,Bs.lineStart=Yn},polygonEnd:function(){Bs.lineStart=Bs.lineEnd=Bs.point=_,Fs+=gu(zs/2)}},$s={point:Xn,lineStart:_,lineEnd:_,polygonStart:_,polygonEnd:_},Vs={point:Kn,lineStart:Gn,lineEnd:Qn,polygonStart:function(){Vs.lineStart=tr},polygonEnd:function(){Vs.point=Kn,Vs.lineStart=Gn,Vs.lineEnd=Qn}};ru.geo.path=function(){function t(t){return t&&("function"==typeof u&&o.pointRadius(+u.apply(this,arguments)),a&&a.valid||(a=i(o)),ru.geo.stream(t,a)),o.result()}function e(){return a=null,t}var n,r,i,o,a,u=4.5;return t.area=function(t){return Fs=0,ru.geo.stream(t,i(Bs)),Fs},t.centroid=function(t){return ks=Es=Cs=Ss=Ts=js=As=Ns=Os=0,ru.geo.stream(t,i(Vs)),Os?[As/Os,Ns/Os]:js?[Ss/js,Ts/js]:Cs?[ks/Cs,Es/Cs]:[0/0,0/0]},t.bounds=function(t){return Ps=Hs=-(Rs=Is=1/0),ru.geo.stream(t,i($s)),[[Rs,Is],[Ps,Hs]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||rr(t):b,e()):n},t.context=function(t){return arguments.length?(o=null==(r=t)?new Jn:new er(t),"function"!=typeof u&&o.pointRadius(u),e()):r},t.pointRadius=function(e){return arguments.length?(u="function"==typeof e?e:(o.pointRadius(+e),+e),t):u},t.projection(ru.geo.albersUsa()).context(null)},ru.geo.transform=function(t){return{stream:function(e){var n=new ir(e);for(var r in t)n[r]=t[r];return n}}},ir.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ru.geo.projection=ar,ru.geo.projectionMutator=ur,(ru.geo.equirectangular=function(){return ar(lr)}).raw=lr.invert=lr,ru.geo.rotation=function(t){function e(e){return e=t(e[0]*zu,e[1]*zu),e[0]*=Ru,e[1]*=Ru,e}return t=fr(t[0]%360*zu,t[1]*zu,t.length>2?t[2]*zu:0),e.invert=function(e){return e=t.invert(e[0]*zu,e[1]*zu),e[0]*=Ru,e[1]*=Ru,e},e},cr.invert=lr,ru.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=fr(-t[0]*zu,-t[1]*zu,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Ru,t[1]*=Ru}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gr((e=+r)*zu,i*zu),t):e},t.precision=function(r){return arguments.length?(n=gr(e*zu,(i=+r)*zu),t):i},t.angle(90)},ru.geo.distance=function(t,e){var n,r=(e[0]-t[0])*zu,i=t[1]*zu,o=e[1]*zu,a=Math.sin(r),u=Math.cos(r),s=Math.sin(i),l=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=l*c-s*f*u)*n),s*c+l*f*u)},ru.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ru.range(Math.ceil(o/v)*v,i,v).map(h).concat(ru.range(Math.ceil(l/m)*m,s,m).map(p)).concat(ru.range(Math.ceil(r/d)*d,n,d).filter(function(t){return gu(t%v)>Nu}).map(c)).concat(ru.range(Math.ceil(u/g)*g,a,g).filter(function(t){return gu(t%m)>Nu}).map(f))}var n,r,i,o,a,u,s,l,c,f,h,p,d=10,g=d,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(p(s).slice(1),h(i).reverse().slice(1),p(l).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],i=+e[1][0],l=+e[0][1],s=+e[1][1],o>i&&(e=o,o=i,i=e),l>s&&(e=l,l=s,s=e),t.precision(y)):[[o,l],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],u=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),u>a&&(e=u,u=a,a=e),t.precision(y)):[[r,u],[n,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(d=+e[0],g=+e[1],t):[d,g]},t.precision=function(e){return arguments.length?(y=+e,c=mr(u,a,90),f=yr(r,n,y),h=mr(l,s,90),p=yr(o,i,y),t):y},t.majorExtent([[-180,-90+Nu],[180,90-Nu]]).minorExtent([[-180,-80-Nu],[180,80+Nu]])},ru.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=br,i=xr;return t.distance=function(){return ru.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},ru.geo.interpolate=function(t,e){return wr(t[0]*zu,t[1]*zu,e[0]*zu,e[1]*zu)},ru.geo.length=function(t){return Us=0,ru.geo.stream(t,Ws),Us};var Us,Ws={sphere:_,point:_,lineStart:_r,lineEnd:_,polygonStart:_,polygonEnd:_},Ys=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ru.geo.azimuthalEqualArea=function(){return ar(Ys)}).raw=Ys;var Xs=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(ru.geo.azimuthalEquidistant=function(){return ar(Xs)}).raw=Xs,(ru.geo.conicConformal=function(){return Un(kr)}).raw=kr,(ru.geo.conicEquidistant=function(){return Un(Er)}).raw=Er;var Js=Mr(function(t){return 1/t},Math.atan);(ru.geo.gnomonic=function(){return ar(Js)}).raw=Js,Cr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Fu]},(ru.geo.mercator=function(){return Sr(Cr)}).raw=Cr;var Zs=Mr(function(){return 1},Math.asin);(ru.geo.orthographic=function(){return ar(Zs)}).raw=Zs;var Ks=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ru.geo.stereographic=function(){return ar(Ks)}).raw=Ks,Tr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Fu]},(ru.geo.transverseMercator=function(){var t=Sr(Tr),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Tr,ru.geom={},ru.geom.hull=function(t){function e(data){if(data.length<3)return[];var t,e=Se(n),i=Se(r),o=data.length,a=[],u=[];for(t=0;o>t;t++)a.push([+e.call(this,data[t],t),+i.call(this,data[t],t),t]);for(a.sort(Or),t=0;o>t;t++)u.push([a[t][0],-a[t][1]]);var s=Nr(a),l=Nr(u),c=l[0]===s[0],f=l[l.length-1]===s[s.length-1],h=[];for(t=s.length-1;t>=0;--t)h.push(data[a[s[t]][2]]);for(t=+c;t<l.length-f;++t)h.push(data[a[l[t]][2]]);return h}var n=jr,r=Ar;return arguments.length?e(t):(e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e)},ru.geom.polygon=function(t){return xu(t,Gs),t};var Gs=ru.geom.polygon.prototype=[];Gs.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],i=0;++e<n;)t=r,r=this[e],i+=t[1]*r[0]-t[0]*r[1];return.5*i},Gs.centroid=function(t){var e,n,r=-1,i=this.length,o=0,a=0,u=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++r<i;)e=u,u=this[r],n=e[0]*u[1]-u[0]*e[1],o+=(e[0]+u[0])*n,a+=(e[1]+u[1])*n;return[o*t,a*t]},Gs.clip=function(t){for(var e,n,r,i,o,a,u=Lr(t),s=-1,l=this.length-Lr(this),c=this[l-1];++s<l;){for(e=t.slice(),t.length=0,i=this[s],o=e[(r=e.length-u)-1],n=-1;++n<r;)a=e[n],qr(a,c,i)?(qr(o,c,i)||t.push(Dr(o,a,c,i)),t.push(a)):qr(o,c,i)&&t.push(Dr(o,a,c,i)),o=a;u&&t.push(t[0]),c=i}return t};var Qs,tl,el,nl,rl,il=[],ol=[];$r.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;)t=e[n].edge,t.b&&t.a||e.splice(n,1);return e.sort(Ur),e.length},ei.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},ni.prototype={insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=ai(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)r=n.U,n===r.L?(i=r.R,i&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(ii(this,n),t=n,n=t.U),n.C=!1,r.C=!0,oi(this,r))):(i=r.L,i&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(oi(this,n),t=n,n=t.U),n.C=!1,r.C=!0,ii(this,r))),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,a=t.R;if(n=o?a?ai(a):o:a,i?i.L===t?i.L=n:i.R=n:this._=n,o&&a?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==a?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=a,a.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,ii(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,oi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,ii(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,oi(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,ii(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,oi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},ru.geom.voronoi=function(t){function e(data){var t=new Array(data.length),e=u[0][0],r=u[0][1],i=u[1][0],o=u[1][1];return ui(n(data),u).cells.forEach(function(n,a){var u=n.edges,s=n.site,l=t[a]=u.length?u.map(function(t){var e=t.start();return[e.x,e.y]}):s.x>=e&&s.x<=i&&s.y>=r&&s.y<=o?[[e,o],[i,o],[i,r],[e,r]]:[];l.point=data[a]}),t}function n(data){return data.map(function(t,e){return{x:Math.round(o(t,e)/Nu)*Nu,y:Math.round(a(t,e)/Nu)*Nu,i:e}})}var r=jr,i=Ar,o=r,a=i,u=al;return t?e(t):(e.links=function(data){return ui(n(data)).edges.filter(function(t){return t.l&&t.r}).map(function(t){return{source:data[t.l.i],target:data[t.r.i]}})},e.triangles=function(data){var t=[];return ui(n(data)).cells.forEach(function(e,n){for(var r,i,o=e.site,a=e.edges.sort(Ur),u=-1,s=a.length,l=a[s-1].edge,c=l.l===o?l.r:l.l;++u<s;)r=l,i=c,l=a[u].edge,c=l.l===o?l.r:l.l,n<i.i&&n<c.i&&li(o,i,c)<0&&t.push([data[n],data[i.i],data[c.i]])}),t},e.x=function(t){return arguments.length?(o=Se(r=t),e):r},e.y=function(t){return arguments.length?(a=Se(i=t),e):i},e.clipExtent=function(t){return arguments.length?(u=null==t?al:t,e):u===al?null:u},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):u===al?null:u&&u[1]},e)};var al=[[-1e6,-1e6],[1e6,1e6]];ru.geom.delaunay=function(t){return ru.geom.voronoi().triangles(t)},ru.geom.quadtree=function(t,e,n,r,i){function o(data){function t(t,e,n,r,i,a,u,s){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(gu(l-n)+gu(c-r)<.01)o(t,e,n,r,i,a,u,s);else{var f=t.point;t.x=t.y=t.point=null,o(t,f,l,c,i,a,u,s),o(t,e,n,r,i,a,u,s)}else t.x=n,t.y=r,t.point=e}else o(t,e,n,r,i,a,u,s)}function o(e,n,r,i,o,a,u,s){var l=.5*(o+u),c=.5*(a+s),f=r>=l,h=i>=c,p=h<<1|f;e.leaf=!1,e=e.nodes[p]||(e.nodes[p]=hi()),f?o=l:u=l,h?a=c:s=c,t(e,n,r,i,o,a,u,s)}var l,c,f,h,p,d,g,v,m,y=Se(u),b=Se(s);if(null!=e)d=e,g=n,v=r,m=i;else if(v=m=-(d=g=1/0),c=[],f=[],p=data.length,a)for(h=0;p>h;++h)l=data[h],l.x<d&&(d=l.x),l.y<g&&(g=l.y),l.x>v&&(v=l.x),l.y>m&&(m=l.y),c.push(l.x),f.push(l.y);else for(h=0;p>h;++h){var x=+y(l=data[h],h),w=+b(l,h);d>x&&(d=x),g>w&&(g=w),x>v&&(v=x),w>m&&(m=w),c.push(x),f.push(w)}var _=v-d,M=m-g;_>M?m=g+_:v=d+M;var k=hi();if(k.add=function(e){t(k,e,+y(e,++h),+b(e,h),d,g,v,m)},k.visit=function(t){pi(t,k,d,g,v,m)},k.find=function(t){return di(k,t[0],t[1],d,g,v,m)},h=-1,null==e){for(;++h<p;)t(k,data[h],c[h],f[h],d,g,v,m);--h}else data.forEach(k.add);return c=f=data=l=null,k}var a,u=jr,s=Ar;return(a=arguments.length)?(u=ci,s=fi,3===a&&(i=n,r=e,n=e=0),o(t)):(o.x=function(t){return arguments.length?(u=t,o):u},o.y=function(t){return arguments.length?(s=t,o):s},o.extent=function(t){return arguments.length?(null==t?e=n=r=i=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),o):null==e?null:[[e,n],[r,i]]},o.size=function(t){return arguments.length?(null==t?e=n=r=i=null:(e=n=0,r=+t[0],i=+t[1]),o):null==e?null:[r-e,i-n]},o)},ru.interpolateRgb=gi,ru.interpolateObject=vi,ru.interpolateNumber=mi,ru.interpolateString=yi;var ul=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sl=new RegExp(ul.source,"g");ru.interpolate=bi,ru.interpolators=[function(t,e){var n=typeof e;return("string"===n?Qu.has(e)||/^(#|rgb\(|hsl\()/.test(e)?gi:yi:e instanceof ue?gi:Array.isArray(e)?xi:"object"===n&&isNaN(e)?vi:mi)(t,e)}],ru.interpolateArray=xi;var ll=function(){return b},cl=ru.map({linear:ll,poly:Si,quad:function(){return ki},cubic:function(){return Ei},sin:function(){return Ti},exp:function(){return ji},circle:function(){return Ai},elastic:Ni,back:Oi,bounce:function(){return qi}}),fl=ru.map({"in":b,out:_i,"in-out":Mi,"out-in":function(t){return Mi(_i(t))}});ru.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=cl.get(n)||ll,r=fl.get(r)||b,wi(r(n.apply(null,iu.call(arguments,1))))},ru.interpolateHcl=Di,ru.interpolateHsl=Li,ru.interpolateLab=Fi,ru.interpolateRound=zi,ru.transform=function(t){var e=au.createElementNS(ru.ns.prefix.svg,"g");return(ru.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Ri(n?n.matrix:hl)})(t)},Ri.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var hl={a:1,b:0,c:0,d:1,e:0,f:0};ru.interpolateTransform=Bi,ru.layout={},ru.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Ui(t[n]));return e}},ru.layout.chord=function(){function t(){var t,l,f,h,p,d={},g=[],v=ru.range(o),m=[];for(n=[],r=[],t=0,h=-1;++h<o;){for(l=0,p=-1;++p<o;)l+=i[h][p];g.push(l),m.push(ru.range(o)),t+=l}for(a&&v.sort(function(t,e){return a(g[t],g[e])}),u&&m.forEach(function(t,e){t.sort(function(t,n){return u(i[e][t],i[e][n])})}),t=(Du-c*o)/t,l=0,h=-1;++h<o;){for(f=l,p=-1;++p<o;){var y=v[h],b=m[y][p],x=i[y][b],w=l,_=l+=x*t;d[y+"-"+b]={index:y,subindex:b,startAngle:w,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/t},l+=c}for(h=-1;++h<o;)for(p=h-1;++p<o;){var M=d[h+"-"+p],k=d[p+"-"+h];(M.value||k.value)&&n.push(M.value<k.value?{source:k,target:M}:{source:M,target:k})}s&&e()}function e(){n.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,i,o,a,u,s,l={},c=0;return l.matrix=function(t){return arguments.length?(o=(i=t)&&i.length,n=r=null,l):i},l.padding=function(t){return arguments.length?(c=t,n=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,n=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(u=t,n=null,l):u},l.sortChords=function(t){return arguments.length?(s=t,n&&e(),l):s},l.chords=function(){return n||t(),n},l.groups=function(){return r||t(),r},l},ru.layout.force=function(){function t(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,u=i-n,s=o*o+a*a;if(s>u*u/v){if(d>s){var l=e.charge/s;t.px-=o*l,t.py-=a*l}return!0}if(e.point&&s&&d>s){var l=e.pointCharge/s;t.px-=o*l,t.py-=a*l}}return!e.charge}}function e(t){t.px=ru.event.x,t.py=ru.event.y,u.resume()}var n,r,i,o,a,u={},s=ru.dispatch("start","tick","end"),l=[1,1],c=.9,f=pl,h=dl,p=-30,d=gl,g=.1,v=.64,m=[],y=[];return u.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,u,f,h,d,v,b,x,w=m.length,_=y.length;for(n=0;_>n;++n)u=y[n],f=u.source,h=u.target,b=h.x-f.x,x=h.y-f.y,(d=b*b+x*x)&&(d=r*o[n]*((d=Math.sqrt(d))-i[n])/d,b*=d,x*=d,h.x-=b*(v=f.weight/(h.weight+f.weight)),h.y-=x*v,f.x+=b*(v=1-v),f.y+=x*v);if((v=r*g)&&(b=l[0]/2,x=l[1]/2,n=-1,v))for(;++n<w;)u=m[n],u.x+=(b-u.x)*v,u.y+=(x-u.y)*v;if(p)for(Gi(e=ru.geom.quadtree(m),r,a),n=-1;++n<w;)(u=m[n]).fixed||e.visit(t(u));for(n=-1;++n<w;)u=m[n],u.fixed?(u.x=u.px,u.y=u.py):(u.x-=(u.px-(u.px=u.x))*c,u.y-=(u.py-(u.py=u.y))*c);s.tick({type:"tick",alpha:r})},u.nodes=function(t){return arguments.length?(m=t,u):m},u.links=function(t){return arguments.length?(y=t,u):y},u.size=function(t){return arguments.length?(l=t,u):l},u.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,u):f},u.distance=u.linkDistance,u.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,u):h},u.friction=function(t){return arguments.length?(c=+t,u):c},u.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,u):p},u.chargeDistance=function(t){return arguments.length?(d=t*t,u):Math.sqrt(d)},u.gravity=function(t){return arguments.length?(g=+t,u):g},u.theta=function(t){return arguments.length?(v=t*t,u):Math.sqrt(v)},u.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),ru.timer(u.tick)),u):r},u.start=function(){function t(t,r){if(!n){for(n=new Array(s),u=0;s>u;++u)n[u]=[];for(u=0;c>u;++u){var i=y[u];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var o,a=n[e],u=-1,l=a.length;++u<l;)if(!isNaN(o=a[u][t]))return o;return Math.random()*r}var e,n,r,s=m.length,c=y.length,d=l[0],g=l[1];for(e=0;s>e;++e)(r=m[e]).index=e,r.weight=0;for(e=0;c>e;++e)r=y[e],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=m[e],isNaN(r.x)&&(r.x=t("x",d)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;if(o=[],"function"==typeof h)for(e=0;c>e;++e)o[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=h;if(a=[],"function"==typeof p)for(e=0;s>e;++e)a[e]=+p.call(this,m[e],e);else for(e=0;s>e;++e)a[e]=p;return u.resume()},u.resume=function(){return u.alpha(.1)},u.stop=function(){return u.alpha(0)},u.drag=function(){return n||(n=ru.behavior.drag().origin(b).on("dragstart.force",Xi).on("drag.force",e).on("dragend.force",Ji)),arguments.length?void this.on("mouseover.force",Zi).on("mouseout.force",Ki).call(n):n},ru.rebind(u,s,"on")};var pl=20,dl=1,gl=1/0;ru.layout.hierarchy=function(){function t(i){var o,a=[i],u=[];for(i.depth=0;null!=(o=a.pop());)if(u.push(o),(l=n.call(t,o,o.depth))&&(s=l.length)){for(var s,l,c;--s>=0;)a.push(c=l[s]),c.parent=o,c.depth=o.depth+1;r&&(o.value=0),o.children=l}else r&&(o.value=+r.call(t,o,o.depth)||0),delete o.children;return eo(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),u}var e=io,n=no,r=ro;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(to(e,function(t){t.children&&(t.value=0)}),eo(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},ru.layout.partition=function(){function t(e,n,r,i){var o=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,u,s,l=-1;for(r=e.value?r/e.value:0;++l<a;)t(u=o[l],n,s=u.value*r,i),n+=s}}function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}function n(n,o){var a=r.call(this,n,o);return t(a[0],0,i[0],i[1]/e(a[0])),a}var r=ru.layout.hierarchy(),i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},Qi(n,r)},ru.layout.pie=function(){function t(data){var a,u=data.length,s=data.map(function(n,r){return+e.call(t,n,r)}),l=+("function"==typeof r?r.apply(this,arguments):r),c=("function"==typeof i?i.apply(this,arguments):i)-l,f=Math.min(Math.abs(c)/u,+("function"==typeof o?o.apply(this,arguments):o)),h=f*(0>c?-1:1),p=(c-u*h)/ru.sum(s),d=ru.range(u),g=[];return null!=n&&d.sort(n===vl?function(t,e){return s[e]-s[t]}:function(t,e){return n(data[t],data[e])}),d.forEach(function(t){g[t]={data:data[t],value:a=s[t],startAngle:l,endAngle:l+=a*p+h,padAngle:f}}),g}var e=Number,n=vl,r=0,i=Du,o=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var vl={};ru.layout.stack=function(){function t(data,u){if(!(f=data.length))return data;var s=data.map(function(n,r){return e.call(t,n,r)}),l=s.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),a.call(t,e,n)]})}),c=n.call(t,l,u);s=ru.permute(s,c),l=ru.permute(l,c);var f,h,p,d,g=r.call(t,l,u),v=s[0].length;for(p=0;v>p;++p)for(i.call(t,s[0][p],d=g[p],l[0][p][1]),h=1;f>h;++h)i.call(t,s[h][p],d+=l[h-1][p][1],l[h][p][1]);return data}var e=b,n=lo,r=co,i=so,o=ao,a=uo;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:ml.get(e)||lo,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:yl.get(e)||co,t):r},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(i=e,t):i},t};var ml=ru.map({"inside-out":function(data){var t,e,n=data.length,r=data.map(fo),i=data.map(ho),o=ru.range(n).sort(function(t,e){return r[t]-r[e]}),a=0,u=0,s=[],l=[];for(t=0;n>t;++t)e=o[t],u>a?(a+=i[e],s.push(e)):(u+=i[e],l.push(e));return l.reverse().concat(s)},reverse:function(data){return ru.range(data.length).reverse()},"default":lo}),yl=ru.map({silhouette:function(data){var t,e,n,r=data.length,i=data[0].length,o=[],a=0,u=[];for(e=0;i>e;++e){for(t=0,n=0;r>t;t++)n+=data[t][e][1];n>a&&(a=n),o.push(n)}for(e=0;i>e;++e)u[e]=(a-o[e])/2;return u},wiggle:function(data){var t,e,n,r,i,o,a,u,s,l=data.length,c=data[0],f=c.length,h=[];for(h[0]=u=s=0,e=1;f>e;++e){for(t=0,r=0;l>t;++t)r+=data[t][e][1];for(t=0,i=0,a=c[e][0]-c[e-1][0];l>t;++t){for(n=0,o=(data[t][e][1]-data[t][e-1][1])/(2*a);t>n;++n)o+=(data[n][e][1]-data[n][e-1][1])/a;i+=o*data[t][e][1]}h[e]=u-=r?i/r*a:0,s>u&&(s=u)}for(e=0;f>e;++e)h[e]-=s;return h},expand:function(data){var t,e,n,r=data.length,i=data[0].length,o=1/r,a=[];for(e=0;i>e;++e){for(t=0,n=0;r>t;t++)n+=data[t][e][1];if(n)for(t=0;r>t;t++)data[t][e][1]/=n;else for(t=0;r>t;t++)data[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:co});ru.layout.histogram=function(){function t(data,t){for(var o,a,u=[],s=data.map(n,this),l=r.call(this,s,t),c=i.call(this,l,s,t),t=-1,f=s.length,h=c.length-1,p=e?1:1/f;++t<h;)o=u[t]=[],o.dx=c[t+1]-(o.x=c[t]),o.y=0;if(h>0)for(t=-1;++t<f;)a=s[t],a>=l[0]&&a<=l[1]&&(o=u[ru.bisect(c,a,1,h)-1],o.y+=p,o.push(data[t]));return u}var e=!0,n=Number,r=mo,i=go;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Se(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return vo(t,e)}:Se(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},ru.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),u=a[0],s=i[0],l=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(u.x=u.y=0,eo(u,function(t){t.r=+c(t.value)}),eo(u,_o),r){var f=r*(e?1:Math.max(2*u.r/s,2*u.r/l))/2;eo(u,function(t){t.r+=f}),eo(u,_o),eo(u,function(t){t.r-=f})}return Eo(u,s/2,l/2,e?1:1/Math.max(2*u.r/s,2*u.r/l)),a}var e,n=ru.layout.hierarchy().sort(yo),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Qi(t,n)},ru.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);if(eo(h,n),h.parent.m=-h.z,to(h,r),l)to(f,o);else{var p=f,d=f,g=f;to(f,function(t){t.x<p.x&&(p=t),t.x>d.x&&(d=t),t.depth>g.depth&&(g=t)});var v=u(p,d)/2-p.x,m=s[0]/(d.x+u(d,p)/2+v),y=s[1]/(g.depth||1);to(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,u=o.length;u>a;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){No(t);var o=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+u(t._,r._),t.m=t.z-o):t.z=o}else r&&(t.z=r.z+u(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,o=t,a=e,s=i.parent.children[0],l=i.m,c=o.m,f=a.m,h=s.m;a=jo(a),i=To(i),a&&i;)s=To(s),o=jo(o),o.a=t,r=a.z+f-i.z-l+u(a._,i._),r>0&&(Ao(Oo(a,t,n),t,r),l+=r,c+=r),f+=a.m,l+=i.m,h+=s.m,c+=o.m;a&&!jo(o)&&(o.t=a,o.m+=f-c),i&&!To(s)&&(s.t=i,s.m+=l-h,n=t)}return n}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var a=ru.layout.hierarchy().sort(null).value(null),u=So,s=[1,1],l=null;return t.separation=function(e){return arguments.length?(u=e,t):u},t.size=function(e){return arguments.length?(l=null==(s=e)?o:null,t):l?null:s},t.nodeSize=function(e){return arguments.length?(l=null==(s=e)?null:o,t):l?s:null},Qi(t,a)},ru.layout.cluster=function(){function t(t,o){var a,u=e.call(this,t,o),s=u[0],l=0;eo(s,function(t){var e=t.children;e&&e.length?(t.x=Do(e),t.y=qo(e)):(t.x=a?l+=n(t,a):0,t.y=0,a=t)});var c=Lo(s),f=Fo(s),h=c.x-n(c,f)/2,p=f.x+n(f,c)/2;return eo(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(p-h)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),u}var e=ru.layout.hierarchy().sort(null).value(null),n=So,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Qi(t,e)},ru.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i<o;)r=(n=t[i]).value*(0>e?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var o=n.children;if(o&&o.length){var a,u,s,l=f(n),c=[],h=o.slice(),d=1/0,g="slice"===p?l.dx:"dice"===p?l.dy:"slice-dice"===p?1&n.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(t(h,l.dx*l.dy/n.value),c.area=0;(s=h.length)>0;)c.push(a=h[s-1]),c.area+=a.area,"squarify"!==p||(u=r(c,g))<=d?(h.pop(),d=u):(c.area-=c.pop().area,i(c,g,l,!1),g=Math.min(l.dx,l.dy),c.length=c.area=0,d=1/0);c.length&&(i(c,g,l,!0),c.length=c.area=0),o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),u=r.slice(),s=[];for(t(u,a.dx*a.dy/e.value),s.area=0;o=u.pop();)s.push(o),s.area+=o.area,null!=o.z&&(i(s,o.z?a.dx:a.dy,a,!u.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,u=t.length;++a<u;)(n=t[a].area)&&(o>n&&(o=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*d/r,r/(e*o*d)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,u=n.x,l=n.y,c=e?s(t.area/e):0;if(e==n.dx){for((r||c>n.dy)&&(c=n.dy);++o<a;)i=t[o],i.x=u,i.y=l,i.dy=c,u+=i.dx=Math.min(n.x+n.dx-u,c?s(i.area/c):0);i.z=!0,i.dx+=n.x+n.dx-u,n.y+=c,n.dy-=c}else{for((r||c>n.dx)&&(c=n.dx);++o<a;)i=t[o],i.x=u,i.y=l,i.dx=c,l+=i.dy=Math.min(n.y+n.dy-l,c?s(i.area/c):0);i.z=!1,i.dy+=n.y+n.dy-l,n.x+=c,n.dx-=c}}function o(r){var i=a||u(r),o=i[0];return o.x=0,o.y=0,o.dx=l[0],o.dy=l[1],a&&u.revalue(o),t([o],o.dx*o.dy/o.value),(a?n:e)(o),h&&(a=i),i}var a,u=ru.layout.hierarchy(),s=Math.round,l=[1,1],c=null,f=zo,h=!1,p="squarify",d=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(l=t,o):l},o.padding=function(t){function e(e){var n=t.call(o,e,e.depth);return null==n?zo(e):Ro(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Ro(e,t)}if(!arguments.length)return c;var r;return f=null==(c=t)?zo:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n,o},o.round=function(t){return arguments.length?(s=t?Math.round:Number,o):s!=Number},o.sticky=function(t){return arguments.length?(h=t,a=null,o):h},o.ratio=function(t){return arguments.length?(d=t,o):d},o.mode=function(t){return arguments.length?(p=t+"",o):p},Qi(o,u)},ru.random={normal:function(t,e){var n=arguments.length;return 2>n&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ru.random.normal.apply(ru,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ru.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},ru.scale={};var bl={floor:b,ceil:b};ru.scale.linear=function(){return Uo([0,1],[0,1],bi,!1)};var xl={s:1,g:1,p:1,r:1,e:1};ru.scale.log=function(){return Qo(ru.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=ru.format(".0e"),_l={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ru.scale.pow=function(){return ta(ru.scale.linear(),1,[0,1])},ru.scale.sqrt=function(){return ru.scale.pow().exponent(.5)},ru.scale.ordinal=function(){return na([],{t:"range",a:[[]]})},ru.scale.category10=function(){return ru.scale.ordinal().range(Ml)},ru.scale.category20=function(){return ru.scale.ordinal().range(kl)},ru.scale.category20b=function(){return ru.scale.ordinal().range(El)},ru.scale.category20c=function(){return ru.scale.ordinal().range(Cl)};var Ml=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xe),kl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xe),El=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xe),Cl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xe);ru.scale.quantile=function(){return ra([],[])},ru.scale.quantize=function(){return ia(0,1,[0,1])},ru.scale.threshold=function(){return oa([.5],[0,1])},ru.scale.identity=function(){return aa([0,1])},ru.svg={},ru.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Fu,f=u.apply(this,arguments)-Fu,h=Math.abs(f-c),p=c>f?0:1;if(t>l&&(d=l,l=t,t=d),h>=Lu)return e(l,p)+(t?e(t,1-p):"")+"Z";var d,g,v,m,y,b,x,w,_,M,k,E,C=0,S=0,T=[];if((m=(+s.apply(this,arguments)||0)/2)&&(v=o===Sl?Math.sqrt(t*t+l*l):+o.apply(this,arguments),p||(S*=-1),l&&(S=ne(v/l*Math.sin(m))),t&&(C=ne(v/t*Math.sin(m)))),l){y=l*Math.cos(c+S),b=l*Math.sin(c+S),x=l*Math.cos(f-S),w=l*Math.sin(f-S);var j=Math.abs(f-c-2*S)<=qu?0:1;if(S&&pa(y,b,x,w)===p^j){var A=(c+f)/2;y=l*Math.cos(A),b=l*Math.sin(A),x=w=null}}else y=b=0;if(t){_=t*Math.cos(f-C),M=t*Math.sin(f-C),k=t*Math.cos(c+C),E=t*Math.sin(c+C);var N=Math.abs(c-f+2*C)<=qu?0:1;if(C&&pa(_,M,k,E)===1-p^N){var O=(c+f)/2;_=t*Math.cos(O),M=t*Math.sin(O),k=E=null}}else _=M=0;if((d=Math.min(Math.abs(l-t)/2,+i.apply(this,arguments)))>.001){g=l>t^p?0:1;var q=null==k?[_,M]:null==x?[y,b]:Dr([y,b],[k,E],[x,w],[_,M]),D=y-q[0],L=b-q[1],F=x-q[0],z=w-q[1],R=1/Math.sin(Math.acos((D*F+L*z)/(Math.sqrt(D*D+L*L)*Math.sqrt(F*F+z*z)))/2),I=Math.sqrt(q[0]*q[0]+q[1]*q[1]);if(null!=x){var P=Math.min(d,(l-I)/(R+1)),H=da(null==k?[_,M]:[k,E],[y,b],l,P,p),B=da([x,w],[_,M],l,P,p);d===P?T.push("M",H[0],"A",P,",",P," 0 0,",g," ",H[1],"A",l,",",l," 0 ",1-p^pa(H[1][0],H[1][1],B[1][0],B[1][1]),",",p," ",B[1],"A",P,",",P," 0 0,",g," ",B[0]):T.push("M",H[0],"A",P,",",P," 0 1,",g," ",B[0])}else T.push("M",y,",",b);if(null!=k){var $=Math.min(d,(t-I)/(R-1)),V=da([y,b],[k,E],t,-$,p),U=da([_,M],null==x?[y,b]:[x,w],t,-$,p);d===$?T.push("L",U[0],"A",$,",",$," 0 0,",g," ",U[1],"A",t,",",t," 0 ",p^pa(U[1][0],U[1][1],V[1][0],V[1][1]),",",1-p," ",V[1],"A",$,",",$," 0 0,",g," ",V[0]):T.push("L",U[0],"A",$,",",$," 0 0,",g," ",V[0])}else T.push("L",_,",",M)}else T.push("M",y,",",b),null!=x&&T.push("A",l,",",l," 0 ",j,",",p," ",x,",",w),T.push("L",_,",",M),null!=k&&T.push("A",t,",",t," 0 ",N,",",1-p," ",k,",",E);
-return T.push("Z"),T.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=sa,r=la,i=ua,o=Sl,a=ca,u=fa,s=ha;return t.innerRadius=function(e){return arguments.length?(n=Se(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Se(e),t):r},t.cornerRadius=function(e){return arguments.length?(i=Se(e),t):i},t.padRadius=function(e){return arguments.length?(o=e==Sl?Sl:Se(e),t):o},t.startAngle=function(e){return arguments.length?(a=Se(e),t):a},t.endAngle=function(e){return arguments.length?(u=Se(e),t):u},t.padAngle=function(e){return arguments.length?(s=Se(e),t):s},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +u.apply(this,arguments))/2-Fu;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Sl="auto";ru.svg.line=function(){return ga(b)};var Tl=ru.map({linear:va,"linear-closed":ma,step:ya,"step-before":ba,"step-after":xa,basis:Ca,"basis-open":Sa,"basis-closed":Ta,bundle:ja,cardinal:Ma,"cardinal-open":wa,"cardinal-closed":_a,monotone:La});Tl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var jl=[0,2/3,1/3,0],Al=[0,1/3,2/3,0],Nl=[0,1/6,2/3,1/6];ru.svg.line.radial=function(){var t=ga(Fa);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ba.reverse=xa,xa.reverse=ba,ru.svg.area=function(){return za(b)},ru.svg.area.radial=function(){var t=za(Fa);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ru.svg.chord=function(){function t(t,u){var s=e(this,o,t,u),l=e(this,a,t,u);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,l)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),o=u.call(t,i,r),a=s.call(t,i,r)-Fu,c=l.call(t,i,r)-Fu;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>qu)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=br,a=xr,u=Ra,s=ca,l=fa;return t.radius=function(e){return arguments.length?(u=Se(e),t):u},t.source=function(e){return arguments.length?(o=Se(e),t):o},t.target=function(e){return arguments.length?(a=Se(e),t):a},t.startAngle=function(e){return arguments.length?(s=Se(e),t):s},t.endAngle=function(e){return arguments.length?(l=Se(e),t):l},t},ru.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),u=(o.y+a.y)/2,s=[o,{x:o.x,y:u},{x:a.x,y:u},a];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,n=xr,r=Ia;return t.source=function(n){return arguments.length?(e=Se(n),t):e},t.target=function(e){return arguments.length?(n=Se(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},ru.svg.diagonal.radial=function(){var t=ru.svg.diagonal(),e=Ia,n=t.projection;return t.projection=function(t){return arguments.length?n(Pa(e=t)):e},t},ru.svg.symbol=function(){function t(t,r){return(Ol.get(e.call(this,t,r))||$a)(n.call(this,t,r))}var e=Ba,n=Ha;return t.type=function(n){return arguments.length?(e=Se(n),t):e},t.size=function(e){return arguments.length?(n=Se(e),t):n},t};var Ol=ru.map({circle:$a,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Dl)),n=e*Dl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ql),n=e*ql/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ql),n=e*ql/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});ru.svg.symbolTypes=Ol.keys();var ql=Math.sqrt(3),Dl=Math.tan(30*zu);ku.transition=function(t){for(var e,n,r=Ll||++Il,i=Xa(t),o=[],a=Fl||{time:Date.now(),ease:Ci,delay:0,duration:250},u=-1,s=this.length;++u<s;){o.push(e=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(n=l[c])&&Ja(n,c,i,r,a),e.push(n)}return Ua(o,i,r)},ku.interrupt=function(t){return this.each(null==t?zl:Va(Xa(t)))};var Ll,Fl,zl=Va(Xa()),Rl=[],Il=0;Rl.call=ku.call,Rl.empty=ku.empty,Rl.node=ku.node,Rl.size=ku.size,ru.transition=function(t,e){return t&&t.transition?Ll?t.transition(e):t:ru.selection().transition(t)},ru.transition.prototype=Rl,Rl.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=j(t);for(var u=-1,s=this.length;++u<s;){a.push(e=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(r=l[c])&&(n=t.call(r,r.__data__,c,u))?("__data__"in r&&(n.__data__=r.__data__),Ja(n,c,o,i,r[o][i]),e.push(n)):e.push(null)}return Ua(a,o,i)},Rl.selectAll=function(t){var e,n,r,i,o,a=this.id,u=this.namespace,s=[];t=A(t);for(var l=-1,c=this.length;++l<c;)for(var f=this[l],h=-1,p=f.length;++h<p;)if(r=f[h]){o=r[u][a],n=t.call(r,r.__data__,h,l),s.push(e=[]);for(var d=-1,g=n.length;++d<g;)(i=n[d])&&Ja(i,d,u,a,o),e.push(i)}return Ua(s,u,a)},Rl.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=B(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var n=this[o],u=0,s=n.length;s>u;u++)(r=n[u])&&t.call(r,r.__data__,u,o)&&e.push(r)}return Ua(i,this.namespace,this.id)},Rl.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},Rl.attr=function(t,e){function n(){this.removeAttribute(u)}function r(){this.removeAttributeNS(u.space,u.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(u);return n!==t&&(e=a(n,t),function(t){this.setAttribute(u,e(t))})})}function o(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(u.space,u.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(u.space,u.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Bi:bi,u=ru.ns.qualify(t);return Wa(this,"attr."+t,e,u.local?o:i)},Rl.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=ru.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Rl.style=function(t,e,r){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=bi(o,e),function(e){this.style.setProperty(t,i(e),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Wa(this,"style."+t,e,o)},Rl.styleTween=function(t,e,r){function i(i,o){var a=e.call(this,i,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Rl.text=function(t){return Wa(this,"text",t,Ya)},Rl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Rl.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=ru.ease.apply(ru,arguments)),V(this,function(r){r[n][e].ease=t}))},Rl.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))},Rl.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Rl.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Fl,o=Ll;try{Ll=n,V(this,function(e,i,o){Fl=e[r][n],t.call(e,e.__data__,i,o)})}finally{Fl=i,Ll=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=ru.dispatch("start","end","interrupt"))).on(t,e)});return this},Rl.transition=function(){for(var t,e,n,r,i=this.id,o=++Il,a=this.namespace,u=[],s=0,l=this.length;l>s;s++){u.push(t=[]);for(var e=this[s],c=0,f=e.length;f>c;c++)(n=e[c])&&(r=n[a][i],Ja(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return Ua(u,a,o)},ru.svg.axis=function(){function t(t){t.each(function(){var t,l=ru.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),h=null==s?f.ticks?f.ticks.apply(f,u):f.domain():s,p=null==e?f.tickFormat?f.tickFormat.apply(f,u):b:e,d=l.selectAll(".tick").data(h,f),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Nu),v=ru.transition(d.exit()).style("opacity",Nu).remove(),m=ru.transition(d.order()).style("opacity",1),y=Math.max(i,0)+a,x=Po(f),w=l.selectAll(".domain").data([0]),_=(w.enter().append("path").attr("class","domain"),ru.transition(w));g.append("line"),g.append("text");var M,k,E,C,S=g.select("line"),T=m.select("line"),j=d.select("text").text(p),A=g.select("text"),N=m.select("text"),O="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Za,M="x",E="y",k="x2",C="y2",j.attr("dy",0>O?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+O*o+"V0H"+x[1]+"V"+O*o)):(t=Ka,M="y",E="x",k="y2",C="x2",j.attr("dy",".32em").style("text-anchor",0>O?"end":"start"),_.attr("d","M"+O*o+","+x[0]+"H0V"+x[1]+"H"+O*o)),S.attr(C,O*i),A.attr(E,O*y),T.attr(k,0).attr(C,O*i),N.attr(M,0).attr(E,O*y),f.rangeBand){var q=f,D=q.rangeBand()/2;c=f=function(t){return q(t)+D}}else c.rangeBand?c=f:v.call(t,f,c);g.call(t,c,f),m.call(t,f,f)})}var e,n=ru.scale.linear(),r=Pl,i=6,o=6,a=3,u=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Hl?e+"":Pl,t):r},t.ticks=function(){return arguments.length?(u=arguments,t):u},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,o=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Pl="bottom",Hl={top:1,right:1,bottom:1,left:1};ru.svg.brush=function(){function t(n){n.each(function(){var n=ru.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var u=n.selectAll(".resize").data(g,b);u.exit().remove(),u.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Bl[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),u.style("display",t.empty()?"none":null);var s,f=ru.transition(n),h=ru.transition(a);l&&(s=Po(l),h.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),c&&(s=Po(c),h.attr("y",s[0]).attr("height",s[1]-s[0]),i(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){32==ru.event.keyCode&&(j||(b=null,N[0]-=f[1],N[1]-=h[1],j=2),E())}function g(){32==ru.event.keyCode&&2==j&&(N[0]+=f[1],N[1]+=h[1],j=0,E())}function v(){var t=ru.mouse(w),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),j||(ru.event.altKey?(b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]),N[0]=f[+(t[0]<b[0])],N[1]=h[+(t[1]<b[1])]):b=null),S&&m(t,l,0)&&(r(k),n=!0),T&&m(t,c,1)&&(i(k),n=!0),n&&(e(k),M({type:"brush",mode:j?"move":"resize"}))}function m(t,e,n){var r,i,o=Po(e),s=o[0],l=o[1],c=N[n],g=n?h:f,v=g[1]-g[0];return j&&(s-=c,l-=v+c),r=(n?d:p)?Math.max(s,Math.min(l,t[n])):t[n],j?i=(r+=c)+v:(b&&(c=Math.max(s,Math.min(l,2*b[n]-r))),r>c?(i=r,r=c):i=c),g[0]!=r||g[1]!=i?(n?u=null:a=null,g[0]=r,g[1]=i,!0):void 0}function y(){v(),k.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ru.select("body").style("cursor",null),O.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),M({type:"brushend"})}var b,x,w=this,_=ru.select(ru.event.target),M=s.of(w,arguments),k=ru.select(w),C=_.datum(),S=!/^(n|s)$/.test(C)&&l,T=!/^(e|w)$/.test(C)&&c,j=_.classed("extent"),A=Z(w),N=ru.mouse(w),O=ru.select(n(w)).on("keydown.brush",o).on("keyup.brush",g);if(ru.event.changedTouches?O.on("touchmove.brush",v).on("touchend.brush",y):O.on("mousemove.brush",v).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),j)N[0]=f[0]-N[0],N[1]=h[0]-N[1];else if(C){var q=+/w$/.test(C),D=+/^n/.test(C);x=[f[1-q]-N[0],h[1-D]-N[1]],N[0]=f[q],N[1]=h[D]}else ru.event.altKey&&(b=N.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ru.select("body").style("cursor",_.style("cursor")),M({type:"brushstart"}),v()}var a,u,s=S(t,"brushstart","brush","brushend"),l=null,c=null,f=[0,0],h=[0,0],p=!0,d=!0,g=$l[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:f,y:h,i:a,j:u},n=this.__chart__||e;this.__chart__=e,Ll?ru.select(this).transition().each("start.brush",function(){a=n.i,u=n.j,f=n.x,h=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=xi(f,e.x),r=xi(h,e.y);return a=u=null,function(i){f=e.x=n(i),h=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i,u=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(l=e,g=$l[!l<<1|!c],t):l},t.y=function(e){return arguments.length?(c=e,g=$l[!l<<1|!c],t):c},t.clamp=function(e){return arguments.length?(l&&c?(p=!!e[0],d=!!e[1]):l?p=!!e:c&&(d=!!e),t):l&&c?[p,d]:l?p:c?d:null},t.extent=function(e){var n,r,i,o,s;return arguments.length?(l&&(n=e[0],r=e[1],c&&(n=n[0],r=r[0]),a=[n,r],l.invert&&(n=l(n),r=l(r)),n>r&&(s=n,n=r,r=s),(n!=f[0]||r!=f[1])&&(f=[n,r])),c&&(i=e[0],o=e[1],l&&(i=i[1],o=o[1]),u=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(s=i,i=o,o=s),(i!=h[0]||o!=h[1])&&(h=[i,o])),t):(l&&(a?(n=a[0],r=a[1]):(n=f[0],r=f[1],l.invert&&(n=l.invert(n),r=l.invert(r)),n>r&&(s=n,n=r,r=s))),c&&(u?(i=u[0],o=u[1]):(i=h[0],o=h[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(s=i,i=o,o=s))),l&&c?[[n,i],[r,o]]:l?[n,r]:c&&[i,o])},t.clear=function(){return t.empty()||(f=[0,0],h=[0,0],a=u=null),t},t.empty=function(){return!!l&&f[0]==f[1]||!!c&&h[0]==h[1]},ru.rebind(t,s,"on")};var Bl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$l=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vl=ls.format=gs.timeFormat,Ul=Vl.utc,Wl=Ul("%Y-%m-%dT%H:%M:%S.%LZ");Vl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ga:Wl,Ga.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ga.toString=Wl.toString,ls.second=Pe(function(t){return new cs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ls.seconds=ls.second.range,ls.seconds.utc=ls.second.utc.range,ls.minute=Pe(function(t){return new cs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ls.minutes=ls.minute.range,ls.minutes.utc=ls.minute.utc.range,ls.hour=Pe(function(t){var e=t.getTimezoneOffset()/60;return new cs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ls.hours=ls.hour.range,ls.hours.utc=ls.hour.utc.range,ls.month=Pe(function(t){return t=ls.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ls.months=ls.month.range,ls.months.utc=ls.month.utc.range;var Yl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ls.second,1],[ls.second,5],[ls.second,15],[ls.second,30],[ls.minute,1],[ls.minute,5],[ls.minute,15],[ls.minute,30],[ls.hour,1],[ls.hour,3],[ls.hour,6],[ls.hour,12],[ls.day,1],[ls.day,2],[ls.week,1],[ls.month,1],[ls.month,3],[ls.year,1]],Jl=Vl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",An]]),Zl={range:function(t,e,n){return ru.range(Math.ceil(t/n)*n,+e,n).map(tu)},floor:b,ceil:b};Xl.year=ls.year,ls.scale=function(){return Qa(ru.scale.linear(),Xl,Jl)};var Kl=Xl.map(function(t){return[t[0].utc,t[1]]}),Gl=Ul.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",An]]);Kl.year=ls.year.utc,ls.scale.utc=function(){return Qa(ru.scale.linear(),Kl,Gl)},ru.text=Te(function(t){return t.responseText}),ru.json=function(t,e){return je(t,"application/json",eu,e)},ru.html=function(t,e){return je(t,"text/html",nu,e)},ru.xml=Te(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(ru):"object"==typeof e&&e.exports&&(e.exports=ru),this.d3=ru}()},{}],57:[function(t,e,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),!e)return t;var r="color: "+this.color;t=[t[0],r,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,o=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r),t}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?l.removeItem("debug"):l.debug=t}catch(e){}}function u(){var t;try{t=l.debug}catch(e){}return t}function s(){try{return window.localStorage}catch(t){}}n=e.exports=t("./debug"),n.log=o,n.formatArgs=i,n.save=a,n.load=u,n.useColors=r;var l;l="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:s(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){return JSON.stringify(t)},n.enable(u())},{"./debug":58}],58:[function(t,e,n){function r(){return n.colors[c++%n.colors.length]}function i(t){function e(){}function i(){var t=i,e=+new Date,o=e-(l||e);t.diff=o,t.prev=l,t.curr=e,l=e,null==t.useColors&&(t.useColors=n.useColors()),null==t.color&&t.useColors&&(t.color=r());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var u=0;a[0]=a[0].replace(/%([a-z%])/g,function(e,r){if("%%"===e)return e;u++;var i=n.formatters[r];if("function"==typeof i){var o=a[u];e=i.call(t,o),a.splice(u,1),u--}return e}),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(t,a));var s=i.log||n.log||console.log.bind(console);s.apply(t,a)}e.enabled=!1,i.enabled=!0;var o=n.enabled(t)?i:e;return o.namespace=t,o}function o(t){n.save(t);for(var e=(t||"").split(/[\s,]+/),r=e.length,i=0;r>i;i++)e[i]&&(t=e[i].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function a(){n.enable("")}function u(t){var e,r;for(e=0,r=n.skips.length;r>e;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;r>e;e++)if(n.names[e].test(t))return!0;return!1}function s(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=i,n.coerce=s,n.disable=a,n.enable=o,n.enabled=u,n.humanize=t("ms"),n.names=[],n.skips=[],n.formatters={};var l,c=0},{ms:59}],59:[function(t,e){function n(t){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}function r(t){return t>=l?Math.round(t/l)+"d":t>=s?Math.round(t/s)+"h":t>=u?Math.round(t/u)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function i(t){return o(t,l,"day")||o(t,s,"hour")||o(t,u,"minute")||o(t,a,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var a=1e3,u=60*a,s=60*u,l=24*s,c=365.25*l;e.exports=function(t,e){return e=e||{},"string"==typeof t?n(t):e["long"]?i(t):r(t)}},{}],60:[function(t,e,n){(function(r){!function(t){if("object"==typeof n&&"undefined"!=typeof e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:"undefined"!=typeof r?i=r:"undefined"!=typeof self&&(i=self),i.jade=t()}}(function(){return function e(n,r,i){function o(u,s){if(!r[u]){if(!n[u]){var l="function"==typeof t&&t;if(!s&&l)return l(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[u]={exports:{}};n[u][0].call(f.exports,function(t){var e=n[u][1][t];return o(e?e:t)},f,f.exports,e,n,r,i)}return r[u].exports}for(var a="function"==typeof t&&t,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(t,e,n){"use strict";function r(t){return null!=t&&""!==t}function i(t){return(Array.isArray(t)?t.map(i):t&&"object"==typeof t?Object.keys(t).filter(function(e){return t[e]}):[t]).filter(r).join(" ")}n.merge=function o(t,e){if(1===arguments.length){for(var n=t[0],i=1;i<t.length;i++)n=o(n,t[i]);return n}var a=t["class"],u=e["class"];(a||u)&&(a=a||[],u=u||[],Array.isArray(a)||(a=[a]),Array.isArray(u)||(u=[u]),t["class"]=a.concat(u).filter(r));for(var s in e)"class"!=s&&(t[s]=e[s]);return t},n.joinClasses=i,n.cls=function(t,e){for(var r=[],o=0;o<t.length;o++)r.push(e&&e[o]?n.escape(i([t[o]])):i(t[o]));var a=i(r);return a.length?' class="'+a+'"':""},n.style=function(t){return t&&"object"==typeof t?Object.keys(t).map(function(e){return e+":"+t[e]}).join(";"):t},n.attr=function(t,e,r,i){return"style"===t&&(e=n.style(e)),"boolean"==typeof e||null==e?e?" "+(i?t:t+'="'+t+'"'):"":0==t.indexOf("data")&&"string"!=typeof e?(-1!==JSON.stringify(e).indexOf("&")&&console.warn("Since Jade 2.0.0, ampersands (`&`) in data attributes will be escaped to `&amp;`"),e&&"function"==typeof e.toISOString&&console.warn("Jade will eliminate the double quotes around dates in ISO form after 2.0.0")," "+t+"='"+JSON.stringify(e).replace(/'/g,"&apos;")+"'"):r?(e&&"function"==typeof e.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+t+'="'+n.escape(e)+'"'):(e&&"function"==typeof e.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+t+'="'+e+'"')},n.attrs=function(t,e){var r=[],o=Object.keys(t);if(o.length)for(var a=0;a<o.length;++a){var u=o[a],s=t[u];"class"==u?(s=i(s))&&r.push(" "+u+'="'+s+'"'):r.push(n.attr(u,s,!1,e))}return r.join("")},n.escape=function(t){var e=String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return e===""+t?t:e},n.rethrow=function a(e,n,r,i){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||i))throw e.message+=" on line "+r,e;try{i=i||t("fs").readFileSync(n,"utf8")}catch(o){a(e,null,r)}var u=3,s=i.split("\n"),l=Math.max(r-u,0),c=Math.min(s.length,r+u),u=s.slice(l,c).map(function(t,e){var n=e+l+1;return(n==r?" > ":" ")+n+"| "+t}).join("\n");throw e.path=n,e.message=(n||"Jade")+":"+r+"\n"+u+"\n\n"+e.message,e}},{fs:2}],2:[function(){},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{fs:55}],61:[function(t,e){!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=t.length,n=Q.type(t);return"function"===n||Q.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function r(t,e,n){if(Q.isFunction(e))return Q.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return Q.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(ue.test(e))return Q.filter(e,t,n);e=Q.filter(e,t)}return Q.grep(t,function(t){return W.call(e,t)>=0!==n})}function i(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function o(t){var e=de[t]={};return Q.each(t.match(pe)||[],function(t,n){e[n]=!0}),e}function a(){K.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1),Q.ready()}function u(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Q.expando+u.uid++}function s(t,e,data){var n;if(void 0===data&&1===t.nodeType)if(n="data-"+e.replace(xe,"-$1").toLowerCase(),data=t.getAttribute(n),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:be.test(data)?Q.parseJSON(data):data}catch(r){}ye.set(t,e,data)}else data=void 0;return data}function l(){return!0}function c(){return!1}function f(){try{return K.activeElement}catch(t){}}function h(t,e){return Q.nodeName(t,"table")&&Q.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function p(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=Fe.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function g(t,e){for(var n=0,r=t.length;r>n;n++)me.set(t[n],"globalEval",!e||me.get(e[n],"globalEval"))}function v(t,e){var n,r,i,o,a,u,s,l;if(1===e.nodeType){if(me.hasData(t)&&(o=me.access(t),a=me.set(e,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)Q.event.add(e,i,l[i][n])}ye.hasData(t)&&(u=ye.access(t),s=Q.extend({},u),ye.set(e,s))}}function m(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&Q.nodeName(t,e)?Q.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&ke.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function b(e,n){var r,i=Q(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(i[0]))?r.display:Q.css(i[0],"display");return i.detach(),o}function x(t){var e=K,n=Pe[t];return n||(n=b(t,e),"none"!==n&&n||(Ie=(Ie||Q("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement),e=Ie[0].contentDocument,e.write(),e.close(),n=b(t,e),Ie.detach()),Pe[t]=n),n}function w(t,e,n){var r,i,o,a,u=t.style;return n=n||$e(t),n&&(a=n.getPropertyValue(e)||n[e]),n&&(""!==a||Q.contains(t.ownerDocument,t)||(a=Q.style(t,e)),Be.test(a)&&He.test(e)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function M(t,e){if(e in t)return e;for(var n=e[0].toUpperCase()+e.slice(1),r=e,i=Je.length;i--;)if(e=Je[i]+n,e in t)return e;return r}function k(t,e,n){var r=Ue.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function E(t,e,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=Q.css(t,n+_e[o],!0,i)),r?("content"===n&&(a-=Q.css(t,"padding"+_e[o],!0,i)),"margin"!==n&&(a-=Q.css(t,"border"+_e[o]+"Width",!0,i))):(a+=Q.css(t,"padding"+_e[o],!0,i),"padding"!==n&&(a+=Q.css(t,"border"+_e[o]+"Width",!0,i)));return a}function C(t,e,n){var r=!0,i="width"===e?t.offsetWidth:t.offsetHeight,o=$e(t),a="border-box"===Q.css(t,"boxSizing",!1,o);if(0>=i||null==i){if(i=w(t,e,o),(0>i||null==i)&&(i=t.style[e]),Be.test(i))return i;r=a&&(Z.boxSizingReliable()||i===t.style[e]),i=parseFloat(i)||0}return i+E(t,e,n||(a?"border":"content"),r,o)+"px"}function S(t,e){for(var n,r,i,o=[],a=0,u=t.length;u>a;a++)r=t[a],r.style&&(o[a]=me.get(r,"olddisplay"),n=r.style.display,e?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&Me(r)&&(o[a]=me.access(r,"olddisplay",x(r.nodeName)))):(i=Me(r),"none"===n&&i||me.set(r,"olddisplay",i?n:Q.css(r,"display"))));for(a=0;u>a;a++)r=t[a],r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?o[a]||"":"none"));return t}function T(t,e,n,r,i){return new T.prototype.init(t,e,n,r,i)}function j(){return setTimeout(function(){Ze=void 0}),Ze=Q.now()}function A(t,e){var n,r=0,i={height:t};for(e=e?1:0;4>r;r+=2-e)n=_e[r],i["margin"+n]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function N(t,e,n){for(var r,i=(nn[e]||[]).concat(nn["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,e,t))return r}function O(t,e,n){var r,i,o,a,u,s,l,c,f=this,h={},p=t.style,d=t.nodeType&&Me(t),g=me.get(t,"fxshow");n.queue||(u=Q._queueHooks(t,"fx"),null==u.unqueued&&(u.unqueued=0,s=u.empty.fire,u.empty.fire=function(){u.unqueued||s()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Q.queue(t,"fx").length||u.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],l=Q.css(t,"display"),c="none"===l?me.get(t,"olddisplay")||x(t.nodeName):l,"inline"===c&&"none"===Q.css(t,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in e)if(i=e[r],Ge.exec(i)){if(delete e[r],o=o||"toggle"===i,i===(d?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;d=!0}h[r]=g&&g[r]||Q.style(t,r)}else l=void 0;if(Q.isEmptyObject(h))"inline"===("none"===l?x(t.nodeName):l)&&(p.display=l);else{g?"hidden"in g&&(d=g.hidden):g=me.access(t,"fxshow",{}),o&&(g.hidden=!d),d?Q(t).show():f.done(function(){Q(t).hide()}),f.done(function(){var e;me.remove(t,"fxshow");for(e in h)Q.style(t,e,h[e])});for(r in h)a=N(d?g[r]:0,r,f),r in g||(g[r]=a.start,d&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function q(t,e){var n,r,i,o,a;for(n in t)if(r=Q.camelCase(n),i=e[r],o=t[n],Q.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),a=Q.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete t[r];for(n in o)n in t||(t[n]=o[n],e[n]=i)}else e[r]=i}function D(t,e,n){var r,i,o=0,a=en.length,u=Q.Deferred().always(function(){delete s.elem}),s=function(){if(i)return!1;for(var e=Ze||j(),n=Math.max(0,l.startTime+l.duration-e),r=n/l.duration||0,o=1-r,a=0,s=l.tweens.length;s>a;a++)l.tweens[a].run(o);return u.notifyWith(t,[l,o,n]),1>o&&s?n:(u.resolveWith(t,[l]),!1)},l=u.promise({elem:t,props:Q.extend({},e),opts:Q.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Ze||j(),duration:n.duration,tweens:[],createTween:function(e,n){var r=Q.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);
-return l.tweens.push(r),r},stop:function(e){var n=0,r=e?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return e?u.resolveWith(t,[l,e]):u.rejectWith(t,[l,e]),this}}),c=l.props;for(q(c,l.opts.specialEasing);a>o;o++)if(r=en[o].call(l,t,c,l.opts))return r;return Q.map(c,N,l),Q.isFunction(l.opts.start)&&l.opts.start.call(t,l),Q.fx.timer(Q.extend(s,{elem:t,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function L(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(pe)||[];if(Q.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function F(t,e,n,r){function i(u){var s;return o[u]=!0,Q.each(t[u]||[],function(t,u){var l=u(e,n,r);return"string"!=typeof l||a||o[l]?a?!(s=l):void 0:(e.dataTypes.unshift(l),i(l),!1)}),s}var o={},a=t===xn;return i(e.dataTypes[0])||!o["*"]&&i("*")}function z(t,e){var n,r,i=Q.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&Q.extend(!0,t,r),t}function R(t,e,n){for(var r,i,o,a,u=t.contents,s=t.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){s.unshift(i);break}if(s[0]in n)o=s[0];else{for(i in n){if(!s[0]||t.converters[i+" "+s[0]]){o=i;break}a||(a=i)}o=o||a}return o?(o!==s[0]&&s.unshift(o),n[o]):void 0}function I(t,e,n,r){var i,o,a,u,s,l={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!s&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s=o,o=c.shift())if("*"===o)o=s;else if("*"!==s&&s!==o){if(a=l[s+" "+o]||l["* "+o],!a)for(i in l)if(u=i.split(" "),u[1]===o&&(a=l[s+" "+u[0]]||l["* "+u[0]])){a===!0?a=l[i]:l[i]!==!0&&(o=u[0],c.unshift(u[1]));break}if(a!==!0)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+s+" to "+o}}}return{state:"success",data:e}}function P(t,e,n,r){var i;if(Q.isArray(e))Q.each(e,function(e,i){n||En.test(t)?r(t,i):P(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==Q.type(e))r(t,e);else for(i in e)P(t+"["+i+"]",e[i],n,r)}function H(t){return Q.isWindow(t)?t:9===t.nodeType&&t.defaultView}var B=[],$=B.slice,V=B.concat,U=B.push,W=B.indexOf,Y={},X=Y.toString,J=Y.hasOwnProperty,Z={},K=t.document,G="2.1.3",Q=function(t,e){return new Q.fn.init(t,e)},te=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ee=/^-ms-/,ne=/-([\da-z])/gi,re=function(t,e){return e.toUpperCase()};Q.fn=Q.prototype={jquery:G,constructor:Q,selector:"",length:0,toArray:function(){return $.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:$.call(this)},pushStack:function(t){var e=Q.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return Q.each(this,t,e)},map:function(t){return this.pushStack(Q.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack($.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:B.sort,splice:B.splice},Q.extend=Q.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},u=1,s=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[u]||{},u++),"object"==typeof a||Q.isFunction(a)||(a={}),u===s&&(a=this,u--);s>u;u++)if(null!=(t=arguments[u]))for(e in t)n=a[e],r=t[e],a!==r&&(l&&r&&(Q.isPlainObject(r)||(i=Q.isArray(r)))?(i?(i=!1,o=n&&Q.isArray(n)?n:[]):o=n&&Q.isPlainObject(n)?n:{},a[e]=Q.extend(l,o,r)):void 0!==r&&(a[e]=r));return a},Q.extend({expando:"jQuery"+(G+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===Q.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!Q.isArray(t)&&t-parseFloat(t)+1>=0},isPlainObject:function(t){return"object"!==Q.type(t)||t.nodeType||Q.isWindow(t)?!1:t.constructor&&!J.call(t.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?Y[X.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;t=Q.trim(t),t&&(1===t.indexOf("use strict")?(e=K.createElement("script"),e.text=t,K.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(ee,"ms-").replace(ne,re)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,r){var i,o=0,a=t.length,u=n(t);if(r){if(u)for(;a>o&&(i=e.apply(t[o],r),i!==!1);o++);else for(o in t)if(i=e.apply(t[o],r),i===!1)break}else if(u)for(;a>o&&(i=e.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=e.call(t[o],o,t[o]),i===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(te,"")},makeArray:function(t,e){var r=e||[];return null!=t&&(n(Object(t))?Q.merge(r,"string"==typeof t?[t]:t):U.call(r,t)),r},inArray:function(t,e,n){return null==e?-1:W.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;n>r;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r,i=[],o=0,a=t.length,u=!n;a>o;o++)r=!e(t[o],o),r!==u&&i.push(t[o]);return i},map:function(t,e,r){var i,o=0,a=t.length,u=n(t),s=[];if(u)for(;a>o;o++)i=e(t[o],o,r),null!=i&&s.push(i);else for(o in t)i=e(t[o],o,r),null!=i&&s.push(i);return V.apply([],s)},guid:1,proxy:function(t,e){var n,r,i;return"string"==typeof e&&(n=t[e],e=t,t=n),Q.isFunction(t)?(r=$.call(arguments,2),i=function(){return t.apply(e||this,r.concat($.call(arguments)))},i.guid=t.guid=t.guid||Q.guid++,i):void 0},now:Date.now,support:Z}),Q.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){Y["[object "+e+"]"]=e.toLowerCase()});var ie=function(t){function e(t,e,n,r){var i,o,a,u,s,l,f,p,d,g;if((e?e.ownerDocument||e:P)!==O&&N(e),e=e||O,n=n||[],u=e.nodeType,"string"!=typeof t||!t||1!==u&&9!==u&&11!==u)return n;if(!r&&D){if(11!==u&&(i=ye.exec(t)))if(a=i[1]){if(9===u){if(o=e.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&R(e,o)&&o.id===a)return n.push(o),n}else{if(i[2])return G.apply(n,e.getElementsByTagName(t)),n;if((a=i[3])&&w.getElementsByClassName)return G.apply(n,e.getElementsByClassName(a)),n}if(w.qsa&&(!L||!L.test(t))){if(p=f=I,d=e,g=1!==u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(l=E(t),(f=e.getAttribute("id"))?p=f.replace(xe,"\\$&"):e.setAttribute("id",p),p="[id='"+p+"'] ",s=l.length;s--;)l[s]=p+h(l[s]);d=be.test(t)&&c(e.parentNode)||e,g=l.join(",")}if(g)try{return G.apply(n,d.querySelectorAll(g)),n}catch(v){}finally{f||e.removeAttribute("id")}}}return S(t.replace(se,"$1"),e,n,r)}function n(){function t(n,r){return e.push(n+" ")>_.cacheLength&&delete t[e.shift()],t[n+" "]=r}var e=[];return t}function r(t){return t[I]=!0,t}function i(t){var e=O.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),r=t.length;r--;)_.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Y)-(~t.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function u(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function s(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return r(function(e){return e=+e,r(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function f(){}function h(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function p(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=B++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,a){var u,s,l=[H,o];if(a){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||i){if(s=e[I]||(e[I]={}),(u=s[r])&&u[0]===H&&u[1]===o)return l[2]=u[2];if(s[r]=l,l[2]=t(e,n,a))return!0}}}function d(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function g(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function v(t,e,n,r,i){for(var o,a=[],u=0,s=t.length,l=null!=e;s>u;u++)(o=t[u])&&(!n||n(o,r,i))&&(a.push(o),l&&e.push(u));return a}function m(t,e,n,i,o,a){return i&&!i[I]&&(i=m(i)),o&&!o[I]&&(o=m(o,a)),r(function(r,a,u,s){var l,c,f,h=[],p=[],d=a.length,m=r||g(e||"*",u.nodeType?[u]:u,[]),y=!t||!r&&e?m:v(m,h,t,u,s),b=n?o||(r?t:d||i)?[]:a:y;if(n&&n(y,b,u,s),i)for(l=v(b,p),i(l,[],u,s),c=l.length;c--;)(f=l[c])&&(b[p[c]]=!(y[p[c]]=f));if(r){if(o||t){if(o){for(l=[],c=b.length;c--;)(f=b[c])&&l.push(y[c]=f);o(null,b=[],l,s)}for(c=b.length;c--;)(f=b[c])&&(l=o?te(r,f):h[c])>-1&&(r[l]=!(a[l]=f))}}else b=v(b===a?b.splice(d,b.length):b),o?o(null,a,b,s):G.apply(a,b)})}function y(t){for(var e,n,r,i=t.length,o=_.relative[t[0].type],a=o||_.relative[" "],u=o?1:0,s=p(function(t){return t===e},a,!0),l=p(function(t){return te(e,t)>-1},a,!0),c=[function(t,n,r){var i=!o&&(r||n!==T)||((e=n).nodeType?s(t,n,r):l(t,n,r));return e=null,i}];i>u;u++)if(n=_.relative[t[u].type])c=[p(d(c),n)];else{if(n=_.filter[t[u].type].apply(null,t[u].matches),n[I]){for(r=++u;i>r&&!_.relative[t[r].type];r++);return m(u>1&&d(c),u>1&&h(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(se,"$1"),n,r>u&&y(t.slice(u,r)),i>r&&y(t=t.slice(r)),i>r&&h(t))}c.push(n)}return d(c)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,u,s,l){var c,f,h,p=0,d="0",g=r&&[],m=[],y=T,b=r||o&&_.find.TAG("*",l),x=H+=null==y?1:Math.random()||.1,w=b.length;for(l&&(T=a!==O&&a);d!==w&&null!=(c=b[d]);d++){if(o&&c){for(f=0;h=t[f++];)if(h(c,a,u)){s.push(c);break}l&&(H=x)}i&&((c=!h&&c)&&p--,r&&g.push(c))}if(p+=d,i&&d!==p){for(f=0;h=n[f++];)h(g,m,a,u);if(r){if(p>0)for(;d--;)g[d]||m[d]||(m[d]=Z.call(s));m=v(m)}G.apply(s,m),l&&!r&&m.length>0&&p+n.length>1&&e.uniqueSort(s)}return l&&(H=x,T=y),g};return i?r(a):a}var x,w,_,M,k,E,C,S,T,j,A,N,O,q,D,L,F,z,R,I="sizzle"+1*new Date,P=t.document,H=0,B=0,$=n(),V=n(),U=n(),W=function(t,e){return t===e&&(A=!0),0},Y=1<<31,X={}.hasOwnProperty,J=[],Z=J.pop,K=J.push,G=J.push,Q=J.slice,te=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},ee="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",ue=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),he=new RegExp(ae),pe=new RegExp("^"+ie+"$"),de={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+ee+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},ge=/^(?:input|select|textarea|button)$/i,ve=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,xe=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),_e=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Me=function(){N()};try{G.apply(J=Q.call(P.childNodes),P.childNodes),J[P.childNodes.length].nodeType}catch(ke){G={apply:J.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}w=e.support={},k=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},N=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:P;return r!==O&&9===r.nodeType&&r.documentElement?(O=r,q=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Me,!1):n.attachEvent&&n.attachEvent("onunload",Me)),D=!k(r),w.attributes=i(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=i(function(t){return t.appendChild(r.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(r.getElementsByClassName),w.getById=i(function(t){return q.appendChild(t).id=I,!r.getElementsByName||!r.getElementsByName(I).length}),w.getById?(_.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&D){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(t){var e=t.replace(we,_e);return function(t){return t.getAttribute("id")===e}}):(delete _.find.ID,_.filter.ID=function(t){var e=t.replace(we,_e);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),_.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.CLASS=w.getElementsByClassName&&function(t,e){return D?e.getElementsByClassName(t):void 0},F=[],L=[],(w.qsa=me.test(r.querySelectorAll))&&(i(function(t){q.appendChild(t).innerHTML="<a id='"+I+"'></a><select id='"+I+"-\f]' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&L.push("[*^$]="+ne+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||L.push("\\["+ne+"*(?:value|"+ee+")"),t.querySelectorAll("[id~="+I+"-]").length||L.push("~="),t.querySelectorAll(":checked").length||L.push(":checked"),t.querySelectorAll("a#"+I+"+*").length||L.push(".#.+[+~]")}),i(function(t){var e=r.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&L.push("name"+ne+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),L.push(",.*:")})),(w.matchesSelector=me.test(z=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(t){w.disconnectedMatch=z.call(t,"div"),z.call(t,"[s!='']:x"),F.push("!=",ae)}),L=L.length&&new RegExp(L.join("|")),F=F.length&&new RegExp(F.join("|")),e=me.test(q.compareDocumentPosition),R=e||me.test(q.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},W=e?function(t,e){if(t===e)return A=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===P&&R(P,t)?-1:e===r||e.ownerDocument===P&&R(P,e)?1:j?te(j,t)-te(j,e):0:4&n?-1:1)}:function(t,e){if(t===e)return A=!0,0;var n,i=0,o=t.parentNode,u=e.parentNode,s=[t],l=[e];if(!o||!u)return t===r?-1:e===r?1:o?-1:u?1:j?te(j,t)-te(j,e):0;if(o===u)return a(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;s[i]===l[i];)i++;return i?a(s[i],l[i]):s[i]===P?-1:l[i]===P?1:0},r):O},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==O&&N(t),n=n.replace(fe,"='$1']"),!(!w.matchesSelector||!D||F&&F.test(n)||L&&L.test(n)))try{var r=z.call(t,n);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,O,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==O&&N(t),R(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==O&&N(t);var n=_.attrHandle[e.toLowerCase()],r=n&&X.call(_.attrHandle,e.toLowerCase())?n(t,e,!D):void 0;return void 0!==r?r:w.attributes||!D?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],r=0,i=0;if(A=!w.detectDuplicates,j=!w.sortStable&&t.slice(0),t.sort(W),A){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}return j=null,t},M=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=M(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=M(e);return n},_=e.selectors={cacheLength:50,createPseudo:r,match:de,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(we,_e),t[3]=(t[3]||t[4]||t[5]||"").replace(we,_e),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return de.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&he.test(n)&&(e=E(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(we,_e).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=$[t+" "];return e||(e=new RegExp("(^|"+ne+")"+t+"("+ne+"|$)"))&&$(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ue," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,s){var l,c,f,h,p,d,g=o!==a?"nextSibling":"previousSibling",v=e.parentNode,m=u&&e.nodeName.toLowerCase(),y=!s&&!u;if(v){if(o){for(;g;){for(f=e;f=f[g];)if(u?f.nodeName.toLowerCase()===m:1===f.nodeType)return!1;d=g="only"===t&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&y){for(c=v[I]||(v[I]={}),l=c[t]||[],p=l[0]===H&&l[1],h=l[0]===H&&l[2],f=p&&v.childNodes[p];f=++p&&f&&f[g]||(h=p=0)||d.pop();)if(1===f.nodeType&&++h&&f===e){c[t]=[H,p,h];break}}else if(y&&(l=(e[I]||(e[I]={}))[t])&&l[0]===H)h=l[1];else for(;(f=++p&&f&&f[g]||(h=p=0)||d.pop())&&((u?f.nodeName.toLowerCase()!==m:1!==f.nodeType)||!++h||(y&&((f[I]||(f[I]={}))[t]=[H,h]),f!==e)););return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(t,n){var i,o=_.pseudos[t]||_.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[I]?o(n):o.length>1?(i=[t,t,"",n],_.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),a=i.length;a--;)r=te(t,i[a]),t[r]=!(e[r]=i[a])}):function(t){return o(t,0,i)}):o}},pseudos:{not:r(function(t){var e=[],n=[],i=C(t.replace(se,"$1"));return i[I]?r(function(t,e,n,r){for(var o,a=i(t,null,r,[]),u=t.length;u--;)(o=a[u])&&(t[u]=!(e[u]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){return t=t.replace(we,_e),function(e){return(e.textContent||e.innerText||M(e)).indexOf(t)>-1}}),lang:r(function(t){return pe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(we,_e).toLowerCase(),function(e){var n;do if(n=D?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===q},focus:function(t){return t===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!_.pseudos.empty(t)},header:function(t){return ve.test(t.nodeName)},input:function(t){return ge.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[0>n?n+e:n]}),even:l(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:l(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:l(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:l(function(t,e,n){for(var r=0>n?n+e:n;++r<e;)t.push(r);return t})}},_.pseudos.nth=_.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[x]=u(x);for(x in{submit:!0,reset:!0})_.pseudos[x]=s(x);return f.prototype=_.filters=_.pseudos,_.setFilters=new f,E=e.tokenize=function(t,n){var r,i,o,a,u,s,l,c=V[t+" "];if(c)return n?0:c.slice(0);for(u=t,s=[],l=_.preFilter;u;){(!r||(i=le.exec(u)))&&(i&&(u=u.slice(i[0].length)||u),s.push(o=[])),r=!1,(i=ce.exec(u))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),u=u.slice(r.length));for(a in _.filter)!(i=de[a].exec(u))||l[a]&&!(i=l[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),u=u.slice(r.length));if(!r)break}return n?u.length:u?e.error(t):V(t,s).slice(0)},C=e.compile=function(t,e){var n,r=[],i=[],o=U[t+" "];if(!o){for(e||(e=E(t)),n=e.length;n--;)o=y(e[n]),o[I]?r.push(o):i.push(o);o=U(t,b(i,r)),o.selector=t}return o},S=e.select=function(t,e,n,r){var i,o,a,u,s,l="function"==typeof t&&t,f=!r&&E(t=l.selector||t);if(n=n||[],1===f.length){if(o=f[0]=f[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===e.nodeType&&D&&_.relative[o[1].type]){if(e=(_.find.ID(a.matches[0].replace(we,_e),e)||[])[0],!e)return n;l&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(i=de.needsContext.test(t)?0:o.length;i--&&(a=o[i],!_.relative[u=a.type]);)if((s=_.find[u])&&(r=s(a.matches[0].replace(we,_e),be.test(o[0].type)&&c(e.parentNode)||e))){if(o.splice(i,1),t=r.length&&h(o),!t)return G.apply(n,r),n;break}}return(l||C(t,f))(r,e,!D,n,be.test(t)&&c(e.parentNode)||e),n},w.sortStable=I.split("").sort(W).join("")===I,w.detectDuplicates=!!A,N(),w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(O.createElement("div"))}),i(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&i(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),i(function(t){return null==t.getAttribute("disabled")})||o(ee,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),e}(t);Q.find=ie,Q.expr=ie.selectors,Q.expr[":"]=Q.expr.pseudos,Q.unique=ie.uniqueSort,Q.text=ie.getText,Q.isXMLDoc=ie.isXML,Q.contains=ie.contains;var oe=Q.expr.match.needsContext,ae=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ue=/^.[^:#\[\.,]*$/;Q.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?Q.find.matchesSelector(r,t)?[r]:[]:Q.find.matches(t,Q.grep(e,function(t){return 1===t.nodeType}))},Q.fn.extend({find:function(t){var e,n=this.length,r=[],i=this;if("string"!=typeof t)return this.pushStack(Q(t).filter(function(){for(e=0;n>e;e++)if(Q.contains(i[e],this))return!0}));for(e=0;n>e;e++)Q.find(t,i[e],r);return r=this.pushStack(n>1?Q.unique(r):r),r.selector=this.selector?this.selector+" "+t:t,r},filter:function(t){return this.pushStack(r(this,t||[],!1))},not:function(t){return this.pushStack(r(this,t||[],!0))},is:function(t){return!!r(this,"string"==typeof t&&oe.test(t)?Q(t):t||[],!1).length}});var se,le=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ce=Q.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){if(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:le.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||se).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof Q?e[0]:e,Q.merge(this,Q.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:K,!0)),ae.test(n[1])&&Q.isPlainObject(e))for(n in e)Q.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=K.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=K,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):Q.isFunction(t)?"undefined"!=typeof se.ready?se.ready(t):t(Q):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),Q.makeArray(t,this))};ce.prototype=Q.fn,se=Q(K);var fe=/^(?:parents|prev(?:Until|All))/,he={children:!0,contents:!0,next:!0,prev:!0};Q.extend({dir:function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&Q(t).is(n))break;r.push(t)}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}}),Q.fn.extend({has:function(t){var e=Q(t,this),n=e.length;return this.filter(function(){for(var t=0;n>t;t++)if(Q.contains(this,e[t]))return!0})},closest:function(t,e){for(var n,r=0,i=this.length,o=[],a=oe.test(t)||"string"!=typeof t?Q(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&Q.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?Q.unique(o):o)},index:function(t){return t?"string"==typeof t?W.call(Q(t),this[0]):W.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(Q.unique(Q.merge(this.get(),Q(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),Q.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Q.dir(t,"parentNode")},parentsUntil:function(t,e,n){return Q.dir(t,"parentNode",n)},next:function(t){return i(t,"nextSibling")},prev:function(t){return i(t,"previousSibling")},nextAll:function(t){return Q.dir(t,"nextSibling")},prevAll:function(t){return Q.dir(t,"previousSibling")},nextUntil:function(t,e,n){return Q.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return Q.dir(t,"previousSibling",n)},siblings:function(t){return Q.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return Q.sibling(t.firstChild)},contents:function(t){return t.contentDocument||Q.merge([],t.childNodes)}},function(t,e){Q.fn[t]=function(n,r){var i=Q.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=Q.filter(r,i)),this.length>1&&(he[t]||Q.unique(i),fe.test(t)&&i.reverse()),this.pushStack(i)}});var pe=/\S+/g,de={};Q.Callbacks=function(t){t="string"==typeof t?de[t]||o(t):Q.extend({},t);var e,n,r,i,a,u,s=[],l=!t.once&&[],c=function(data){for(e=t.memory&&data,n=!0,u=i||0,i=0,a=s.length,r=!0;s&&a>u;u++)if(s[u].apply(data[0],data[1])===!1&&t.stopOnFalse){e=!1;break}r=!1,s&&(l?l.length&&c(l.shift()):e?s=[]:f.disable())},f={add:function(){if(s){var n=s.length;!function o(e){Q.each(e,function(e,n){var r=Q.type(n);"function"===r?t.unique&&f.has(n)||s.push(n):n&&n.length&&"string"!==r&&o(n)})}(arguments),r?a=s.length:e&&(i=n,c(e))}return this},remove:function(){return s&&Q.each(arguments,function(t,e){for(var n;(n=Q.inArray(e,s,n))>-1;)s.splice(n,1),r&&(a>=n&&a--,u>=n&&u--)}),this},has:function(t){return t?Q.inArray(t,s)>-1:!(!s||!s.length)},empty:function(){return s=[],a=0,this},disable:function(){return s=l=e=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,e||f.disable(),this},locked:function(){return!l},fireWith:function(t,e){return!s||n&&!l||(e=e||[],e=[t,e.slice?e.slice():e],r?l.push(e):c(e)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!n}};return f},Q.extend({Deferred:function(t){var e=[["resolve","done",Q.Callbacks("once memory"),"resolved"],["reject","fail",Q.Callbacks("once memory"),"rejected"],["notify","progress",Q.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return Q.Deferred(function(n){Q.each(e,function(e,o){var a=Q.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&Q.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?Q.extend(t,r):r}},i={};return r.pipe=r.then,Q.each(e,function(t,o){var a=o[2],u=o[3];r[o[1]]=a.add,u&&a.add(function(){n=u},e[1^t][2].disable,e[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=$.call(arguments),a=o.length,u=1!==a||t&&Q.isFunction(t.promise)?a:0,s=1===u?t:Q.Deferred(),l=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?$.call(arguments):i,r===e?s.notifyWith(n,r):--u||s.resolveWith(n,r)}};if(a>1)for(e=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&Q.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(s.reject).progress(l(i,n,e)):--u;return u||s.resolveWith(r,o),s.promise()}});var ge;Q.fn.ready=function(t){return Q.ready.promise().done(t),this},Q.extend({isReady:!1,readyWait:1,holdReady:function(t){t?Q.readyWait++:Q.ready(!0)},ready:function(t){(t===!0?--Q.readyWait:Q.isReady)||(Q.isReady=!0,t!==!0&&--Q.readyWait>0||(ge.resolveWith(K,[Q]),Q.fn.triggerHandler&&(Q(K).triggerHandler("ready"),Q(K).off("ready"))))}}),Q.ready.promise=function(e){return ge||(ge=Q.Deferred(),"complete"===K.readyState?setTimeout(Q.ready):(K.addEventListener("DOMContentLoaded",a,!1),t.addEventListener("load",a,!1))),ge.promise(e)},Q.ready.promise();var ve=Q.access=function(t,e,n,r,i,o,a){var u=0,s=t.length,l=null==n;if("object"===Q.type(n)){i=!0;for(u in n)Q.access(t,e,u,n[u],!0,o,a)}else if(void 0!==r&&(i=!0,Q.isFunction(r)||(a=!0),l&&(a?(e.call(t,r),e=null):(l=e,e=function(t,e,n){return l.call(Q(t),n)})),e))for(;s>u;u++)e(t[u],n,a?r:r.call(t[u],u,e(t[u],n)));return i?t:l?e.call(t):s?e(t[0],n):o};Q.acceptData=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType},u.uid=1,u.accepts=Q.acceptData,u.prototype={key:function(t){if(!u.accepts(t))return 0;var e={},n=t[this.expando];if(!n){n=u.uid++;try{e[this.expando]={value:n},Object.defineProperties(t,e)}catch(r){e[this.expando]=n,Q.extend(t,e)}}return this.cache[n]||(this.cache[n]={}),n
-},set:function(t,data,e){var n,r=this.key(t),i=this.cache[r];if("string"==typeof data)i[data]=e;else if(Q.isEmptyObject(i))Q.extend(this.cache[r],data);else for(n in data)i[n]=data[n];return i},get:function(t,e){var n=this.cache[this.key(t)];return void 0===e?n:n[e]},access:function(t,e,n){var r;return void 0===e||e&&"string"==typeof e&&void 0===n?(r=this.get(t,e),void 0!==r?r:this.get(t,Q.camelCase(e))):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r,i,o=this.key(t),a=this.cache[o];if(void 0===e)this.cache[o]={};else{Q.isArray(e)?r=e.concat(e.map(Q.camelCase)):(i=Q.camelCase(e),e in a?r=[e,i]:(r=i,r=r in a?[r]:r.match(pe)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(t){return!Q.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}};var me=new u,ye=new u,be=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,xe=/([A-Z])/g;Q.extend({hasData:function(t){return ye.hasData(t)||me.hasData(t)},data:function(t,e,data){return ye.access(t,e,data)},removeData:function(t,e){ye.remove(t,e)},_data:function(t,e,data){return me.access(t,e,data)},_removeData:function(t,e){me.remove(t,e)}}),Q.fn.extend({data:function(t,e){var n,r,data,i=this[0],o=i&&i.attributes;if(void 0===t){if(this.length&&(data=ye.get(i),1===i.nodeType&&!me.get(i,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&(r=o[n].name,0===r.indexOf("data-")&&(r=Q.camelCase(r.slice(5)),s(i,r,data[r])));me.set(i,"hasDataAttrs",!0)}return data}return"object"==typeof t?this.each(function(){ye.set(this,t)}):ve(this,function(e){var data,n=Q.camelCase(t);if(i&&void 0===e){if(data=ye.get(i,t),void 0!==data)return data;if(data=ye.get(i,n),void 0!==data)return data;if(data=s(i,n,void 0),void 0!==data)return data}else this.each(function(){var data=ye.get(this,n);ye.set(this,n,e),-1!==t.indexOf("-")&&void 0!==data&&ye.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){ye.remove(this,t)})}}),Q.extend({queue:function(t,e,data){var n;return t?(e=(e||"fx")+"queue",n=me.get(t,e),data&&(!n||Q.isArray(data)?n=me.access(t,e,Q.makeArray(data)):n.push(data)),n||[]):void 0},dequeue:function(t,e){e=e||"fx";var n=Q.queue(t,e),r=n.length,i=n.shift(),o=Q._queueHooks(t,e),a=function(){Q.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return me.get(t,n)||me.access(t,n,{empty:Q.Callbacks("once memory").add(function(){me.remove(t,[e+"queue",n])})})}}),Q.fn.extend({queue:function(t,data){var e=2;return"string"!=typeof t&&(data=t,t="fx",e--),arguments.length<e?Q.queue(this[0],t):void 0===data?this:this.each(function(){var e=Q.queue(this,t,data);Q._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&Q.dequeue(this,t)})},dequeue:function(t){return this.each(function(){Q.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=Q.Deferred(),o=this,a=this.length,u=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)n=me.get(o[a],t+"queueHooks"),n&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(e)}});var we=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_e=["Top","Right","Bottom","Left"],Me=function(t,e){return t=e||t,"none"===Q.css(t,"display")||!Q.contains(t.ownerDocument,t)},ke=/^(?:checkbox|radio)$/i;!function(){var t=K.createDocumentFragment(),e=t.appendChild(K.createElement("div")),n=K.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),Z.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",Z.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ee="undefined";Z.focusinBubbles="onfocusin"in t;var Ce=/^key/,Se=/^(?:mouse|pointer|contextmenu)|click/,Te=/^(?:focusinfocus|focusoutblur)$/,je=/^([^.]*)(?:\.(.+)|)$/;Q.event={global:{},add:function(t,e,n,data,r){var i,o,a,u,s,l,c,f,h,p,d,g=me.get(t);if(g)for(n.handler&&(i=n,n=i.handler,r=i.selector),n.guid||(n.guid=Q.guid++),(u=g.events)||(u=g.events={}),(o=g.handle)||(o=g.handle=function(e){return typeof Q!==Ee&&Q.event.triggered!==e.type?Q.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(pe)||[""],s=e.length;s--;)a=je.exec(e[s])||[],h=d=a[1],p=(a[2]||"").split(".").sort(),h&&(c=Q.event.special[h]||{},h=(r?c.delegateType:c.bindType)||h,c=Q.event.special[h]||{},l=Q.extend({type:h,origType:d,data:data,handler:n,guid:n.guid,selector:r,needsContext:r&&Q.expr.match.needsContext.test(r),namespace:p.join(".")},i),(f=u[h])||(f=u[h]=[],f.delegateCount=0,c.setup&&c.setup.call(t,data,p,o)!==!1||t.addEventListener&&t.addEventListener(h,o,!1)),c.add&&(c.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,l):f.push(l),Q.event.global[h]=!0)},remove:function(t,e,n,r,i){var o,a,u,s,l,c,f,h,p,d,g,v=me.hasData(t)&&me.get(t);if(v&&(s=v.events)){for(e=(e||"").match(pe)||[""],l=e.length;l--;)if(u=je.exec(e[l])||[],p=g=u[1],d=(u[2]||"").split(".").sort(),p){for(f=Q.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,h=s[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&g!==c.origType||n&&n.guid!==c.guid||u&&!u.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(t,c));a&&!h.length&&(f.teardown&&f.teardown.call(t,d,v.handle)!==!1||Q.removeEvent(t,p,v.handle),delete s[p])}else for(p in s)Q.event.remove(t,p+e[l],n,r,!0);Q.isEmptyObject(s)&&(delete v.handle,me.remove(t,"events"))}},trigger:function(e,data,n,r){var i,o,a,u,s,l,c,f=[n||K],h=J.call(e,"type")?e.type:e,p=J.call(e,"namespace")?e.namespace.split("."):[];if(o=a=n=n||K,3!==n.nodeType&&8!==n.nodeType&&!Te.test(h+Q.event.triggered)&&(h.indexOf(".")>=0&&(p=h.split("."),h=p.shift(),p.sort()),s=h.indexOf(":")<0&&"on"+h,e=e[Q.expando]?e:new Q.Event(h,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),data=null==data?[e]:Q.makeArray(data,[e]),c=Q.event.special[h]||{},r||!c.trigger||c.trigger.apply(n,data)!==!1)){if(!r&&!c.noBubble&&!Q.isWindow(n)){for(u=c.delegateType||h,Te.test(u+h)||(o=o.parentNode);o;o=o.parentNode)f.push(o),a=o;a===(n.ownerDocument||K)&&f.push(a.defaultView||a.parentWindow||t)}for(i=0;(o=f[i++])&&!e.isPropagationStopped();)e.type=i>1?u:c.bindType||h,l=(me.get(o,"events")||{})[e.type]&&me.get(o,"handle"),l&&l.apply(o,data),l=s&&o[s],l&&l.apply&&Q.acceptData(o)&&(e.result=l.apply(o,data),e.result===!1&&e.preventDefault());return e.type=h,r||e.isDefaultPrevented()||c._default&&c._default.apply(f.pop(),data)!==!1||!Q.acceptData(n)||s&&Q.isFunction(n[h])&&!Q.isWindow(n)&&(a=n[s],a&&(n[s]=null),Q.event.triggered=h,n[h](),Q.event.triggered=void 0,a&&(n[s]=a)),e.result}},dispatch:function(t){t=Q.event.fix(t);var e,n,r,i,o,a=[],u=$.call(arguments),s=(me.get(this,"events")||{})[t.type]||[],l=Q.event.special[t.type]||{};if(u[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(a=Q.event.handlers.call(this,t,s),e=0;(i=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(o.namespace))&&(t.handleObj=o,t.data=o.data,r=((Q.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u),void 0!==r&&(t.result=r)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,r,i,o,a=[],u=e.delegateCount,s=t.target;if(u&&s.nodeType&&(!t.button||"click"!==t.type))for(;s!==this;s=s.parentNode||this)if(s.disabled!==!0||"click"!==t.type){for(r=[],n=0;u>n;n++)o=e[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?Q(i,this).index(s)>=0:Q.find(i,this,null,[s]).length),r[i]&&r.push(o);r.length&&a.push({elem:s,handlers:r})}return u<e.length&&a.push({elem:this,handlers:e.slice(u)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,r,i,o=e.button;return null==t.pageX&&null!=e.clientX&&(n=t.target.ownerDocument||K,r=n.documentElement,i=n.body,t.pageX=e.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),t.pageY=e.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0),t}},fix:function(t){if(t[Q.expando])return t;var e,n,r,i=t.type,o=t,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Se.test(i)?this.mouseHooks:Ce.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,t=new Q.Event(o),e=r.length;e--;)n=r[e],t[n]=o[n];return t.target||(t.target=K),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,o):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==f()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&Q.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(t){return Q.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var i=Q.extend(new Q.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?Q.event.trigger(i,null,e):Q.event.dispatch.call(e,i),i.isDefaultPrevented()&&n.preventDefault()}},Q.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)},Q.Event=function(t,e){return this instanceof Q.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?l:c):this.type=t,e&&Q.extend(this,e),this.timeStamp=t&&t.timeStamp||Q.now(),void(this[Q.expando]=!0)):new Q.Event(t,e)},Q.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=l,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=l,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=l,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},Q.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){Q.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return(!i||i!==r&&!Q.contains(r,i))&&(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),Z.focusinBubbles||Q.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){Q.event.simulate(e,t.target,Q.event.fix(t),!0)};Q.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=me.access(r,e);i||r.addEventListener(t,n,!0),me.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=me.access(r,e)-1;i?me.access(r,e,i):(r.removeEventListener(t,n,!0),me.remove(r,e))}}}),Q.fn.extend({on:function(t,e,data,n,r){var i,o;if("object"==typeof t){"string"!=typeof e&&(data=data||e,e=void 0);for(o in t)this.on(o,e,data,t[o],r);return this}if(null==data&&null==n?(n=e,data=e=void 0):null==n&&("string"==typeof e?(n=data,data=void 0):(n=data,data=e,e=void 0)),n===!1)n=c;else if(!n)return this;return 1===r&&(i=n,n=function(t){return Q().off(t),i.apply(this,arguments)},n.guid=i.guid||(i.guid=Q.guid++)),this.each(function(){Q.event.add(this,t,n,data,e)})},one:function(t,e,data,n){return this.on(t,e,data,n,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,Q(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return(e===!1||"function"==typeof e)&&(n=e,e=void 0),n===!1&&(n=c),this.each(function(){Q.event.remove(this,t,n,e)})},trigger:function(t,data){return this.each(function(){Q.event.trigger(t,data,this)})},triggerHandler:function(t,data){var e=this[0];return e?Q.event.trigger(t,data,e,!0):void 0}});var Ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ne=/<([\w:]+)/,Oe=/<|&#?\w+;/,qe=/<(?:script|style|link)/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,Le=/^$|\/(?:java|ecma)script/i,Fe=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Re={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Re.optgroup=Re.option,Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.thead,Re.th=Re.td,Q.extend({clone:function(t,e,n){var r,i,o,a,u=t.cloneNode(!0),s=Q.contains(t.ownerDocument,t);if(!(Z.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||Q.isXMLDoc(t)))for(a=m(u),o=m(t),r=0,i=o.length;i>r;r++)y(o[r],a[r]);if(e)if(n)for(o=o||m(t),a=a||m(u),r=0,i=o.length;i>r;r++)v(o[r],a[r]);else v(t,u);return a=m(u,"script"),a.length>0&&g(a,!s&&m(t,"script")),u},buildFragment:function(t,e,n,r){for(var i,o,a,u,s,l,c=e.createDocumentFragment(),f=[],h=0,p=t.length;p>h;h++)if(i=t[h],i||0===i)if("object"===Q.type(i))Q.merge(f,i.nodeType?[i]:i);else if(Oe.test(i)){for(o=o||c.appendChild(e.createElement("div")),a=(Ne.exec(i)||["",""])[1].toLowerCase(),u=Re[a]||Re._default,o.innerHTML=u[1]+i.replace(Ae,"<$1></$2>")+u[2],l=u[0];l--;)o=o.lastChild;Q.merge(f,o.childNodes),o=c.firstChild,o.textContent=""}else f.push(e.createTextNode(i));for(c.textContent="",h=0;i=f[h++];)if((!r||-1===Q.inArray(i,r))&&(s=Q.contains(i.ownerDocument,i),o=m(c.appendChild(i),"script"),s&&g(o),n))for(l=0;i=o[l++];)Le.test(i.type||"")&&n.push(i);return c},cleanData:function(t){for(var data,e,n,r,i=Q.event.special,o=0;void 0!==(e=t[o]);o++){if(Q.acceptData(e)&&(r=e[me.expando],r&&(data=me.cache[r]))){if(data.events)for(n in data.events)i[n]?Q.event.remove(e,n):Q.removeEvent(e,n,data.handle);me.cache[r]&&delete me.cache[r]}delete ye.cache[e[ye.expando]]}}}),Q.fn.extend({text:function(t){return ve(this,function(t){return void 0===t?Q.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=t)})},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=h(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=h(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?Q.filter(t,this):this,i=0;null!=(n=r[i]);i++)e||1!==n.nodeType||Q.cleanData(m(n)),n.parentNode&&(e&&Q.contains(n.ownerDocument,n)&&g(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(Q.cleanData(m(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return Q.clone(this,t,e)})},html:function(t){return ve(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!qe.test(t)&&!Re[(Ne.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Ae,"<$1></$2>");try{for(;r>n;n++)e=this[n]||{},1===e.nodeType&&(Q.cleanData(m(e,!1)),e.innerHTML=t);e=0}catch(i){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,Q.cleanData(m(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=V.apply([],t);var n,r,i,o,a,u,s=0,l=this.length,c=this,f=l-1,h=t[0],g=Q.isFunction(h);if(g||l>1&&"string"==typeof h&&!Z.checkClone&&De.test(h))return this.each(function(n){var r=c.eq(n);g&&(t[0]=h.call(this,n,r.html())),r.domManip(t,e)});if(l&&(n=Q.buildFragment(t,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=Q.map(m(n,"script"),p),o=i.length;l>s;s++)a=n,s!==f&&(a=Q.clone(a,!0,!0),o&&Q.merge(i,m(a,"script"))),e.call(this[s],a,s);if(o)for(u=i[i.length-1].ownerDocument,Q.map(i,d),s=0;o>s;s++)a=i[s],Le.test(a.type||"")&&!me.access(a,"globalEval")&&Q.contains(u,a)&&(a.src?Q._evalUrl&&Q._evalUrl(a.src):Q.globalEval(a.textContent.replace(ze,"")))}return this}}),Q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){Q.fn[t]=function(t){for(var n,r=[],i=Q(t),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),Q(i[a])[e](n),U.apply(r,n.get());return this.pushStack(r)}});var Ie,Pe={},He=/^margin/,Be=new RegExp("^("+we+")(?!px)[a-z%]+$","i"),$e=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",i.appendChild(o);var e=t.getComputedStyle(a,null);n="1%"!==e.top,r="4px"===e.width,i.removeChild(o)}var n,r,i=K.documentElement,o=K.createElement("div"),a=K.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",Z.clearCloneStyle="content-box"===a.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(a),t.getComputedStyle&&Q.extend(Z,{pixelPosition:function(){return e(),n},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,n=a.appendChild(K.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",i.appendChild(o),e=!parseFloat(t.getComputedStyle(n,null).marginRight),i.removeChild(o),a.removeChild(n),e}}))}(),Q.swap=function(t,e,n,r){var i,o,a={};for(o in e)a[o]=t.style[o],t.style[o]=e[o];i=n.apply(t,r||[]);for(o in e)t.style[o]=a[o];return i};var Ve=/^(none|table(?!-c[ea]).+)/,Ue=new RegExp("^("+we+")(.*)$","i"),We=new RegExp("^([+-])=("+we+")","i"),Ye={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"},Je=["Webkit","O","Moz","ms"];Q.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=w(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,u=Q.camelCase(e),s=t.style;return e=Q.cssProps[u]||(Q.cssProps[u]=M(s,u)),a=Q.cssHooks[e]||Q.cssHooks[u],void 0===n?a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:s[e]:(o=typeof n,"string"===o&&(i=We.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(Q.css(t,e)),o="number"),null!=n&&n===n&&("number"!==o||Q.cssNumber[u]||(n+="px"),Z.clearCloneStyle||""!==n||0!==e.indexOf("background")||(s[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(s[e]=n)),void 0)}},css:function(t,e,n,r){var i,o,a,u=Q.camelCase(e);return e=Q.cssProps[u]||(Q.cssProps[u]=M(t.style,u)),a=Q.cssHooks[e]||Q.cssHooks[u],a&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=w(t,e,r)),"normal"===i&&e in Xe&&(i=Xe[e]),""===n||n?(o=parseFloat(i),n===!0||Q.isNumeric(o)?o||0:i):i}}),Q.each(["height","width"],function(t,e){Q.cssHooks[e]={get:function(t,n,r){return n?Ve.test(Q.css(t,"display"))&&0===t.offsetWidth?Q.swap(t,Ye,function(){return C(t,e,r)}):C(t,e,r):void 0},set:function(t,n,r){var i=r&&$e(t);return k(t,n,r?E(t,e,r,"border-box"===Q.css(t,"boxSizing",!1,i),i):0)}}}),Q.cssHooks.marginRight=_(Z.reliableMarginRight,function(t,e){return e?Q.swap(t,{display:"inline-block"},w,[t,"marginRight"]):void 0}),Q.each({margin:"",padding:"",border:"Width"},function(t,e){Q.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[t+_e[r]+e]=o[r]||o[r-2]||o[0];return i}},He.test(t)||(Q.cssHooks[t+e].set=k)}),Q.fn.extend({css:function(t,e){return ve(this,function(t,e,n){var r,i,o={},a=0;if(Q.isArray(e)){for(r=$e(t),i=e.length;i>a;a++)o[e[a]]=Q.css(t,e[a],!1,r);return o}return void 0!==n?Q.style(t,e,n):Q.css(t,e)},t,e,arguments.length>1)},show:function(){return S(this,!0)},hide:function(){return S(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Me(this)?Q(this).show():Q(this).hide()})}}),Q.Tween=T,T.prototype={constructor:T,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||"swing",this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Q.cssNumber[n]?"":"px")},cur:function(){var t=T.propHooks[this.prop];return t&&t.get?t.get(this):T.propHooks._default.get(this)},run:function(t){var e,n=T.propHooks[this.prop];return this.pos=e=this.options.duration?Q.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):T.propHooks._default.set(this),this}},T.prototype.init.prototype=T.prototype,T.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=Q.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){Q.fx.step[t.prop]?Q.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[Q.cssProps[t.prop]]||Q.cssHooks[t.prop])?Q.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},T.propHooks.scrollTop=T.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},Q.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},Q.fx=T.prototype.init,Q.fx.step={};var Ze,Ke,Ge=/^(?:toggle|show|hide)$/,Qe=new RegExp("^(?:([+-])=|)("+we+")([a-z%]*)$","i"),tn=/queueHooks$/,en=[O],nn={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),i=Qe.exec(e),o=i&&i[3]||(Q.cssNumber[t]?"":"px"),a=(Q.cssNumber[t]||"px"!==o&&+r)&&Qe.exec(Q.css(n.elem,t)),u=1,s=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do u=u||".5",a/=u,Q.style(n.elem,t,a+o);while(u!==(u=n.cur()/r)&&1!==u&&--s)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};Q.Animation=Q.extend(D,{tweener:function(t,e){Q.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++)n=t[r],nn[n]=nn[n]||[],nn[n].unshift(e)},prefilter:function(t,e){e?en.unshift(t):en.push(t)}}),Q.speed=function(t,e,n){var r=t&&"object"==typeof t?Q.extend({},t):{complete:n||!n&&e||Q.isFunction(t)&&t,duration:t,easing:n&&e||e&&!Q.isFunction(e)&&e};return r.duration=Q.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Q.fx.speeds?Q.fx.speeds[r.duration]:Q.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Q.isFunction(r.old)&&r.old.call(this),r.queue&&Q.dequeue(this,r.queue)},r},Q.fn.extend({fadeTo:function(t,e,n,r){return this.filter(Me).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=Q.isEmptyObject(t),o=Q.speed(e,n,r),a=function(){var e=D(this,Q.extend({},t),o);(i||me.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=Q.timers,data=me.get(this);if(i)data[i]&&data[i].stop&&r(data[i]);else for(i in data)data[i]&&data[i].stop&&tn.test(i)&&r(data[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));(e||!n)&&Q.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,data=me.get(this),n=data[t+"queue"],r=data[t+"queueHooks"],i=Q.timers,o=n?n.length:0;for(data.finish=!0,Q.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;o>e;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete data.finish})}}),Q.each(["toggle","show","hide"],function(t,e){var n=Q.fn[e];Q.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(A(e,!0),t,r,i)}}),Q.each({slideDown:A("show"),slideUp:A("hide"),slideToggle:A("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){Q.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),Q.timers=[],Q.fx.tick=function(){var t,e=0,n=Q.timers;for(Ze=Q.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||Q.fx.stop(),Ze=void 0},Q.fx.timer=function(t){Q.timers.push(t),t()?Q.fx.start():Q.timers.pop()},Q.fx.interval=13,Q.fx.start=function(){Ke||(Ke=setInterval(Q.fx.tick,Q.fx.interval))},Q.fx.stop=function(){clearInterval(Ke),Ke=null},Q.fx.speeds={slow:600,fast:200,_default:400},Q.fn.delay=function(t,e){return t=Q.fx?Q.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})},function(){var t=K.createElement("input"),e=K.createElement("select"),n=e.appendChild(K.createElement("option"));t.type="checkbox",Z.checkOn=""!==t.value,Z.optSelected=n.selected,e.disabled=!0,Z.optDisabled=!n.disabled,t=K.createElement("input"),t.value="t",t.type="radio",Z.radioValue="t"===t.value}();var rn,on,an=Q.expr.attrHandle;Q.fn.extend({attr:function(t,e){return ve(this,Q.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){Q.removeAttr(this,t)})}}),Q.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return typeof t.getAttribute===Ee?Q.prop(t,e,n):(1===o&&Q.isXMLDoc(t)||(e=e.toLowerCase(),r=Q.attrHooks[e]||(Q.expr.match.bool.test(e)?on:rn)),void 0===n?r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=Q.find.attr(t,e),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):void Q.removeAttr(t,e))},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(pe);if(o&&1===t.nodeType)for(;n=o[i++];)r=Q.propFix[n]||n,Q.expr.match.bool.test(n)&&(t[r]=!1),t.removeAttribute(n)},attrHooks:{type:{set:function(t,e){if(!Z.radioValue&&"radio"===e&&Q.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}}}),on={set:function(t,e,n){return e===!1?Q.removeAttr(t,n):t.setAttribute(n,n),n}},Q.each(Q.expr.match.bool.source.match(/\w+/g),function(t,e){var n=an[e]||Q.find.attr;an[e]=function(t,e,r){var i,o;return r||(o=an[e],an[e]=i,i=null!=n(t,e,r)?e.toLowerCase():null,an[e]=o),i}});var un=/^(?:input|select|textarea|button)$/i;Q.fn.extend({prop:function(t,e){return ve(this,Q.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[Q.propFix[t]||t]})}}),Q.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return o=1!==a||!Q.isXMLDoc(t),o&&(e=Q.propFix[e]||e,i=Q.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||un.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),Z.optSelected||(Q.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),Q.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Q.propFix[this.toLowerCase()]=this});var sn=/[\t\r\n\f]/g;Q.fn.extend({addClass:function(t){var e,n,r,i,o,a,u="string"==typeof t&&t,s=0,l=this.length;if(Q.isFunction(t))return this.each(function(e){Q(this).addClass(t.call(this,e,this.className))});if(u)for(e=(t||"").match(pe)||[];l>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(sn," "):" ")){for(o=0;i=e[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=Q.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(t){var e,n,r,i,o,a,u=0===arguments.length||"string"==typeof t&&t,s=0,l=this.length;if(Q.isFunction(t))return this.each(function(e){Q(this).removeClass(t.call(this,e,this.className))});if(u)for(e=(t||"").match(pe)||[];l>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(sn," "):"")){for(o=0;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=t?Q.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):this.each(Q.isFunction(t)?function(n){Q(this).toggleClass(t.call(this,n,this.className,e),e)}:function(){if("string"===n)for(var e,r=0,i=Q(this),o=t.match(pe)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else(n===Ee||"boolean"===n)&&(this.className&&me.set(this,"__className__",this.className),this.className=this.className||t===!1?"":me.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(sn," ").indexOf(e)>=0)return!0;return!1}});var ln=/\r/g;Q.fn.extend({val:function(t){var e,n,r,i=this[0];{if(arguments.length)return r=Q.isFunction(t),this.each(function(n){var i;1===this.nodeType&&(i=r?t.call(this,n,Q(this).val()):t,null==i?i="":"number"==typeof i?i+="":Q.isArray(i)&&(i=Q.map(i,function(t){return null==t?"":t+""})),e=Q.valHooks[this.type]||Q.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))});if(i)return e=Q.valHooks[i.type]||Q.valHooks[i.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(ln,""):null==n?"":n)}}}),Q.extend({valHooks:{option:{get:function(t){var e=Q.find.attr(t,"value");return null!=e?e:Q.trim(Q.text(t))}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,a=o?null:[],u=o?i+1:r.length,s=0>i?u:o?i:0;u>s;s++)if(n=r[s],!(!n.selected&&s!==i||(Z.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Q.nodeName(n.parentNode,"optgroup"))){if(e=Q(n).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var n,r,i=t.options,o=Q.makeArray(e),a=i.length;a--;)r=i[a],(r.selected=Q.inArray(r.value,o)>=0)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),Q.each(["radio","checkbox"],function(){Q.valHooks[this]={set:function(t,e){return Q.isArray(e)?t.checked=Q.inArray(Q(t).val(),e)>=0:void 0}},Z.checkOn||(Q.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),Q.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){Q.fn[e]=function(data,t){return arguments.length>0?this.on(e,null,data,t):this.trigger(e)
-}}),Q.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,data,e){return this.on(t,null,data,e)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,data,n){return this.on(e,t,data,n)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var cn=Q.now(),fn=/\?/;Q.parseJSON=function(data){return JSON.parse(data+"")},Q.parseXML=function(data){var t,e;if(!data||"string"!=typeof data)return null;try{e=new DOMParser,t=e.parseFromString(data,"text/xml")}catch(n){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&Q.error("Invalid XML: "+data),t};var hn=/#.*$/,pn=/([?&])_=[^&]*/,dn=/^(.*?):[ \t]*([^\r\n]*)$/gm,gn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,yn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,bn={},xn={},wn="*/".concat("*"),_n=t.location.href,Mn=yn.exec(_n.toLowerCase())||[];Q.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_n,type:"GET",isLocal:gn.test(Mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":Q.parseJSON,"text xml":Q.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?z(z(t,Q.ajaxSettings),e):z(Q.ajaxSettings,t)},ajaxPrefilter:L(bn),ajaxTransport:L(xn),ajax:function(t,e){function n(t,e,n,a){var s,c,m,y,x,_=e;2!==b&&(b=2,u&&clearTimeout(u),r=void 0,o=a||"",w.readyState=t>0?4:0,s=t>=200&&300>t||304===t,n&&(y=R(f,w,n)),y=I(f,y,w,s),s?(f.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(Q.lastModified[i]=x),x=w.getResponseHeader("etag"),x&&(Q.etag[i]=x)),204===t||"HEAD"===f.type?_="nocontent":304===t?_="notmodified":(_=y.state,c=y.data,m=y.error,s=!m)):(m=_,(t||!_)&&(_="error",0>t&&(t=0))),w.status=t,w.statusText=(e||_)+"",s?d.resolveWith(h,[c,_,w]):d.rejectWith(h,[w,_,m]),w.statusCode(v),v=void 0,l&&p.trigger(s?"ajaxSuccess":"ajaxError",[w,f,s?c:m]),g.fireWith(h,[w,_]),l&&(p.trigger("ajaxComplete",[w,f]),--Q.active||Q.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,a,u,s,l,c,f=Q.ajaxSetup({},e),h=f.context||f,p=f.context&&(h.nodeType||h.jquery)?Q(h):Q.event,d=Q.Deferred(),g=Q.Callbacks("once memory"),v=f.statusCode||{},m={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!a)for(a={};e=dn.exec(o);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return b||(t=y[n]=y[n]||t,m[t]=e),this},overrideMimeType:function(t){return b||(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)v[e]=[v[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||x;return r&&r.abort(e),n(0,e),this}};if(d.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,f.url=((t||f.url||_n)+"").replace(hn,"").replace(mn,Mn[1]+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=Q.trim(f.dataType||"*").toLowerCase().match(pe)||[""],null==f.crossDomain&&(s=yn.exec(f.url.toLowerCase()),f.crossDomain=!(!s||s[1]===Mn[1]&&s[2]===Mn[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(Mn[3]||("http:"===Mn[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Q.param(f.data,f.traditional)),F(bn,f,e,w),2===b)return w;l=Q.event&&f.global,l&&0===Q.active++&&Q.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!vn.test(f.type),i=f.url,f.hasContent||(f.data&&(i=f.url+=(fn.test(i)?"&":"?")+f.data,delete f.data),f.cache===!1&&(f.url=pn.test(i)?i.replace(pn,"$1_="+cn++):i+(fn.test(i)?"&":"?")+"_="+cn++)),f.ifModified&&(Q.lastModified[i]&&w.setRequestHeader("If-Modified-Since",Q.lastModified[i]),Q.etag[i]&&w.setRequestHeader("If-None-Match",Q.etag[i])),(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)&&w.setRequestHeader("Content-Type",f.contentType),w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+wn+"; q=0.01":""):f.accepts["*"]);for(c in f.headers)w.setRequestHeader(c,f.headers[c]);if(f.beforeSend&&(f.beforeSend.call(h,w,f)===!1||2===b))return w.abort();x="abort";for(c in{success:1,error:1,complete:1})w[c](f[c]);if(r=F(xn,f,e,w)){w.readyState=1,l&&p.trigger("ajaxSend",[w,f]),f.async&&f.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1,r.send(m,n)}catch(_){if(!(2>b))throw _;n(-1,_)}}else n(-1,"No Transport");return w},getJSON:function(t,data,e){return Q.get(t,data,e,"json")},getScript:function(t,e){return Q.get(t,void 0,e,"script")}}),Q.each(["get","post"],function(t,e){Q[e]=function(t,data,n,r){return Q.isFunction(data)&&(r=r||n,n=data,data=void 0),Q.ajax({url:t,type:e,dataType:r,data:data,success:n})}}),Q._evalUrl=function(t){return Q.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},Q.fn.extend({wrapAll:function(t){var e;return Q.isFunction(t)?this.each(function(e){Q(this).wrapAll(t.call(this,e))}):(this[0]&&(e=Q(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return this.each(Q.isFunction(t)?function(e){Q(this).wrapInner(t.call(this,e))}:function(){var e=Q(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=Q.isFunction(t);return this.each(function(n){Q(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){Q.nodeName(this,"body")||Q(this).replaceWith(this.childNodes)}).end()}}),Q.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Q.expr.filters.visible=function(t){return!Q.expr.filters.hidden(t)};var kn=/%20/g,En=/\[\]$/,Cn=/\r?\n/g,Sn=/^(?:submit|button|image|reset|file)$/i,Tn=/^(?:input|select|textarea|keygen)/i;Q.param=function(t,e){var n,r=[],i=function(t,e){e=Q.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=Q.ajaxSettings&&Q.ajaxSettings.traditional),Q.isArray(t)||t.jquery&&!Q.isPlainObject(t))Q.each(t,function(){i(this.name,this.value)});else for(n in t)P(n,t[n],e,i);return r.join("&").replace(kn,"+")},Q.fn.extend({serialize:function(){return Q.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=Q.prop(this,"elements");return t?Q.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!Q(this).is(":disabled")&&Tn.test(this.nodeName)&&!Sn.test(t)&&(this.checked||!ke.test(t))}).map(function(t,e){var n=Q(this).val();return null==n?null:Q.isArray(n)?Q.map(n,function(t){return{name:e.name,value:t.replace(Cn,"\r\n")}}):{name:e.name,value:n.replace(Cn,"\r\n")}}).get()}}),Q.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var jn=0,An={},Nn={0:200,1223:204},On=Q.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in An)An[t]()}),Z.cors=!!On&&"withCredentials"in On,Z.ajax=On=!!On,Q.ajaxTransport(function(t){var e;return Z.cors||On&&!t.crossDomain?{send:function(n,r){var i,o=t.xhr(),a=++jn;if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);e=function(t){return function(){e&&(delete An[a],e=o.onload=o.onerror=null,"abort"===t?o.abort():"error"===t?r(o.status,o.statusText):r(Nn[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=e(),o.onerror=e("error"),e=An[a]=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(u){if(e)throw u}},abort:function(){e&&e()}}:void 0}),Q.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return Q.globalEval(t),t}}}),Q.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),Q.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(r,i){e=Q("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),K.head.appendChild(e[0])},abort:function(){n&&n()}}}});var qn=[],Dn=/(=)\?(?=&|$)|\?\?/;Q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=qn.pop()||Q.expando+"_"+cn++;return this[t]=!0,t}}),Q.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,u=e.jsonp!==!1&&(Dn.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(e.data)&&"data");return u||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=Q.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,u?e[u]=e[u].replace(Dn,"$1"+i):e.jsonp!==!1&&(e.url+=(fn.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||Q.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){a=arguments},r.always(function(){t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,qn.push(i)),a&&Q.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),Q.parseHTML=function(data,t,e){if(!data||"string"!=typeof data)return null;"boolean"==typeof t&&(e=t,t=!1),t=t||K;var n=ae.exec(data),r=!e&&[];return n?[t.createElement(n[1])]:(n=Q.buildFragment([data],t,r),r&&r.length&&Q(r).remove(),Q.merge([],n.childNodes))};var Ln=Q.fn.load;Q.fn.load=function(t,e,n){if("string"!=typeof t&&Ln)return Ln.apply(this,arguments);var r,i,o,a=this,u=t.indexOf(" ");return u>=0&&(r=Q.trim(t.slice(u)),t=t.slice(0,u)),Q.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),a.length>0&&Q.ajax({url:t,type:i,dataType:"html",data:e}).done(function(t){o=arguments,a.html(r?Q("<div>").append(Q.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){a.each(n,o||[t.responseText,e,t])}),this},Q.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){Q.fn[e]=function(t){return this.on(e,t)}}),Q.expr.filters.animated=function(t){return Q.grep(Q.timers,function(e){return t===e.elem}).length};var Fn=t.document.documentElement;Q.offset={setOffset:function(t,e,n){var r,i,o,a,u,s,l,c=Q.css(t,"position"),f=Q(t),h={};"static"===c&&(t.style.position="relative"),u=f.offset(),o=Q.css(t,"top"),s=Q.css(t,"left"),l=("absolute"===c||"fixed"===c)&&(o+s).indexOf("auto")>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(s)||0),Q.isFunction(e)&&(e=e.call(t,n,u)),null!=e.top&&(h.top=e.top-u.top+a),null!=e.left&&(h.left=e.left-u.left+i),"using"in e?e.using.call(t,h):f.css(h)}},Q.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){Q.offset.setOffset(this,t,e)});var e,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return e=o.documentElement,Q.contains(e,r)?(typeof r.getBoundingClientRect!==Ee&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-e.clientTop,left:i.left+n.pageXOffset-e.clientLeft}):i},position:function(){if(this[0]){var t,e,n=this[0],r={top:0,left:0};return"fixed"===Q.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),Q.nodeName(t[0],"html")||(r=t.offset()),r.top+=Q.css(t[0],"borderTopWidth",!0),r.left+=Q.css(t[0],"borderLeftWidth",!0)),{top:e.top-r.top-Q.css(n,"marginTop",!0),left:e.left-r.left-Q.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Fn;t&&!Q.nodeName(t,"html")&&"static"===Q.css(t,"position");)t=t.offsetParent;return t||Fn})}}),Q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r="pageYOffset"===n;Q.fn[e]=function(i){return ve(this,function(e,i,o){var a=H(e);return void 0===o?a?a[n]:e[i]:void(a?a.scrollTo(r?t.pageXOffset:o,r?o:t.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),Q.each(["top","left"],function(t,e){Q.cssHooks[e]=_(Z.pixelPosition,function(t,n){return n?(n=w(t,e),Be.test(n)?Q(t).position()[e]+"px":n):void 0})}),Q.each({Height:"height",Width:"width"},function(t,e){Q.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){Q.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return ve(this,function(e,n,r){var i;return Q.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===r?Q.css(e,n,a):Q.style(e,n,r,a)},e,o?r:void 0,o,null)}})}),Q.fn.size=function(){return this.length},Q.fn.andSelf=Q.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return Q});var zn=t.jQuery,Rn=t.$;return Q.noConflict=function(e){return t.$===Q&&(t.$=Rn),e&&t.jQuery===Q&&(t.jQuery=zn),Q},typeof e===Ee&&(t.jQuery=t.$=Q),Q})},{}],62:[function(t,e,n){(function(t){(function(){function r(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r<i;)if(t[r]===e)return r;return-1}function i(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e]?0:-1;"number"!=n&&"string"!=n&&(n="object");var i="number"==n?e:x+e;return t=(t=t[n])&&t[i],"object"==n?t&&r(t,e)>-1?0:-1:t?0:-1}function o(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:x+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function a(t){return t.charCodeAt(0)}function u(t,e){for(var n=t.criteria,r=e.criteria,i=-1,o=n.length;++i<o;){var a=n[i],u=r[i];if(a!==u){if(a>u||"undefined"==typeof a)return 1;if(u>a||"undefined"==typeof u)return-1}}return t.index-e.index}function s(t){var e=-1,n=t.length,r=t[0],i=t[n/2|0],a=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&a&&"object"==typeof a)return!1;var u=f();u["false"]=u["null"]=u["true"]=u.undefined=!1;var s=f();for(s.array=t,s.cache=u,s.push=o;++e<n;)s.push(t[e]);return s}function l(t){return"\\"+Z[t]}function c(){return m.pop()||[]}function f(){return y.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function h(t){t.length=0,m.length<_&&m.push(t)}function p(t){var e=t.cache;e&&p(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,y.length<_&&y.push(t)}function d(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,i=n-e||0,o=Array(0>i?0:i);++r<i;)o[r]=t[e+r];return o}function g(t){function e(t){return t&&"object"==typeof t&&!Gr(t)&&Dr.call(t,"__wrapped__")?t:new n(t)}function n(t,e){this.__chain__=!!e,this.__wrapped__=t}function o(t){function e(){if(r){var t=d(r);Lr.apply(t,arguments)}if(this instanceof e){var o=y(n.prototype),a=n.apply(o,t||arguments);return Ae(a)?a:o}return n.apply(i,t||arguments)}var n=t[0],r=t[2],i=t[4];return Kr(e,t),e}function m(t,e,n,r,i){if(n){var o=n(t);if("undefined"!=typeof o)return o}var a=Ae(t);if(!a)return t;var u=Sr.call(t);if(!W[u])return t;var s=Jr[u];switch(u){case I:case P:return new s(+t);case B:case U:return new s(t);case V:return o=s(t.source,T.exec(t)),o.lastIndex=t.lastIndex,o}var l=Gr(t);if(e){var f=!r;r||(r=c()),i||(i=c());for(var p=r.length;p--;)if(r[p]==t)return i[p];o=l?s(t.length):{}}else o=l?d(t):oi({},t);return l&&(Dr.call(t,"index")&&(o.index=t.index),Dr.call(t,"input")&&(o.input=t.input)),e?(r.push(t),i.push(o),(l?Ze:si)(t,function(t,a){o[a]=m(t,e,n,r,i)}),f&&(h(r),h(i)),o):o}function y(t){return Ae(t)?Pr(t):{}}function _(t,e,n){if("function"!=typeof t)return Gn;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(Zr.funcNames&&(r=!t.name),r=r||!Zr.funcDecomp,!r)){var i=Or.call(t);Zr.funcNames||(r=!j.test(i)),r||(r=q.test(i),Kr(t,r))}if(r===!1||r!==!0&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return Ln(t,e)}function Z(t){function e(){var t=s?a:this;if(i){var p=d(i);Lr.apply(p,arguments)}if((o||c)&&(p||(p=d(arguments)),o&&Lr.apply(p,o),c&&p.length<u))return r|=16,Z([n,f?r:-4&r,p,null,a,u]);if(p||(p=arguments),l&&(n=t[h]),this instanceof e){t=y(n.prototype);var g=n.apply(t,p);return Ae(g)?g:t}return n.apply(t,p)}var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=1&r,l=2&r,c=4&r,f=8&r,h=n;return Kr(e,t),e}function G(t,e){var n=-1,o=se(),a=t?t.length:0,u=a>=w&&o===r,l=[];if(u){var c=s(e);c?(o=i,e=c):u=!1}for(;++n<a;){var f=t[n];o(e,f)<0&&l.push(f)}return u&&p(e),l}function Q(t,e,n,r){for(var i=(r||0)-1,o=t?t.length:0,a=[];++i<o;){var u=t[i];if(u&&"object"==typeof u&&"number"==typeof u.length&&(Gr(u)||he(u))){e||(u=Q(u,e,n));var s=-1,l=u.length,c=a.length;for(a.length+=l;++s<l;)a[c++]=u[s]}else n||a.push(u)}return a}function te(t,e,n,r,i,o){if(n){var a=n(t,e);if("undefined"!=typeof a)return!!a}if(t===e)return 0!==t||1/t==1/e;var u=typeof t,s=typeof e;if(!(t!==t||t&&J[u]||e&&J[s]))return!1;if(null==t||null==e)return t===e;var l=Sr.call(t),f=Sr.call(e);if(l==z&&(l=$),f==z&&(f=$),l!=f)return!1;switch(l){case I:case P:return+t==+e;case B:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case V:case U:return t==_r(e)}var p=l==R;if(!p){var d=Dr.call(t,"__wrapped__"),g=Dr.call(e,"__wrapped__");if(d||g)return te(d?t.__wrapped__:t,g?e.__wrapped__:e,n,r,i,o);if(l!=$)return!1;var v=t.constructor,m=e.constructor;if(v!=m&&!(je(v)&&v instanceof v&&je(m)&&m instanceof m)&&"constructor"in t&&"constructor"in e)return!1}var y=!i;i||(i=c()),o||(o=c());for(var b=i.length;b--;)if(i[b]==t)return o[b]==e;var x=0;if(a=!0,i.push(t),o.push(e),p){if(b=t.length,x=e.length,a=x==b,a||r)for(;x--;){var w=b,_=e[x];if(r)for(;w--&&!(a=te(t[w],_,n,r,i,o)););else if(!(a=te(t[x],_,n,r,i,o)))break}}else ui(e,function(e,u,s){return Dr.call(s,u)?(x++,a=Dr.call(t,u)&&te(t[u],e,n,r,i,o)):void 0}),a&&!r&&ui(t,function(t,e,n){return Dr.call(n,e)?a=--x>-1:void 0});return i.pop(),o.pop(),y&&(h(i),h(o)),a}function ee(t,e,n,r,i){(Gr(e)?Ze:si)(e,function(e,o){var a,u,s=e,l=t[o];if(e&&((u=Gr(e))||li(e))){for(var c=r.length;c--;)if(a=r[c]==e){l=i[c];break}if(!a){var f;n&&(s=n(l,e),(f="undefined"!=typeof s)&&(l=s)),f||(l=u?Gr(l)?l:[]:li(l)?l:{}),r.push(e),i.push(l),f||ee(l,e,n,r,i)}}else n&&(s=n(l,e),"undefined"==typeof s&&(s=e)),"undefined"!=typeof s&&(l=s);t[o]=l})}function re(t,e){return t+Nr(Xr()*(e-t+1))}function ie(t,e,n){var o=-1,a=se(),u=t?t.length:0,l=[],f=!e&&u>=w&&a===r,d=n||f?c():l;if(f){var g=s(d);a=i,d=g}for(;++o<u;){var v=t[o],m=n?n(v,o,t):v;(e?!o||d[d.length-1]!==m:a(d,m)<0)&&((n||f)&&d.push(m),l.push(v))}return f?(h(d.array),p(d)):n&&h(d),l}function oe(t){return function(n,r,i){var o={};r=e.createCallback(r,i,3);var a=-1,u=n?n.length:0;if("number"==typeof u)for(;++a<u;){var s=n[a];t(o,s,r(s,a,n),n)}else si(n,function(e,n,i){t(o,e,r(e,n,i),i)});return o}}function ae(t,e,n,r,i,a){var u=1&e,s=2&e,l=4&e,c=16&e,f=32&e;if(!s&&!je(t))throw new Mr;c&&!n.length&&(e&=-17,c=n=!1),f&&!r.length&&(e&=-33,f=r=!1);var h=t&&t.__bindData__;if(h&&h!==!0)return h=d(h),h[2]&&(h[2]=d(h[2])),h[3]&&(h[3]=d(h[3])),!u||1&h[1]||(h[4]=i),!u&&1&h[1]&&(e|=8),!l||4&h[1]||(h[5]=a),c&&Lr.apply(h[2]||(h[2]=[]),n),f&&Rr.apply(h[3]||(h[3]=[]),r),h[1]|=e,ae.apply(null,h);var p=1==e||17===e?o:Z;return p([t,e,n,r,i,a])}function ue(t){return ei[t]}function se(){var t=(t=e.indexOf)===yn?r:t;return t}function le(t){return"function"==typeof t&&Tr.test(t)}function ce(t){var e,n;return t&&Sr.call(t)==$&&(e=t.constructor,!je(e)||e instanceof e)?(ui(t,function(t,e){n=e}),"undefined"==typeof n||Dr.call(t,n)):!1}function fe(t){return ni[t]}function he(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sr.call(t)==z||!1}function pe(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),m(t,e,"function"==typeof n&&_(n,r,1))}function de(t,e,n){return m(t,!0,"function"==typeof e&&_(e,n,1))}function ge(t,e){var n=y(t);return e?oi(n,e):n}function ve(t,n,r){var i;return n=e.createCallback(n,r,3),si(t,function(t,e,r){return n(t,e,r)?(i=e,!1):void 0}),i}function me(t,n,r){var i;return n=e.createCallback(n,r,3),be(t,function(t,e,r){return n(t,e,r)?(i=e,!1):void 0}),i}function ye(t,e,n){var r=[];ui(t,function(t,e){r.push(e,t)});var i=r.length;for(e=_(e,n,3);i--&&e(r[i--],r[i],t)!==!1;);return t}function be(t,e,n){var r=ti(t),i=r.length;for(e=_(e,n,3);i--;){var o=r[i];if(e(t[o],o,t)===!1)break}return t}function xe(t){var e=[];return ui(t,function(t,n){je(t)&&e.push(n)}),e.sort()}function we(t,e){return t?Dr.call(t,e):!1}function _e(t){for(var e=-1,n=ti(t),r=n.length,i={};++e<r;){var o=n[e];i[t[o]]=o}return i}function Me(t){return t===!0||t===!1||t&&"object"==typeof t&&Sr.call(t)==I||!1}function ke(t){return t&&"object"==typeof t&&Sr.call(t)==P||!1}function Ee(t){return t&&1===t.nodeType||!1}function Ce(t){var e=!0;if(!t)return e;var n=Sr.call(t),r=t.length;return n==R||n==U||n==z||n==$&&"number"==typeof r&&je(t.splice)?!r:(si(t,function(){return e=!1}),e)}function Se(t,e,n,r){return te(t,e,"function"==typeof n&&_(n,r,2))}function Te(t){return Br(t)&&!$r(parseFloat(t))}function je(t){return"function"==typeof t}function Ae(t){return!(!t||!J[typeof t])}function Ne(t){return qe(t)&&t!=+t}function Oe(t){return null===t}function qe(t){return"number"==typeof t||t&&"object"==typeof t&&Sr.call(t)==B||!1}function De(t){return t&&"object"==typeof t&&Sr.call(t)==V||!1}function Le(t){return"string"==typeof t||t&&"object"==typeof t&&Sr.call(t)==U||!1}function Fe(t){return"undefined"==typeof t}function ze(t,n,r){var i={};return n=e.createCallback(n,r,3),si(t,function(t,e,r){i[e]=n(t,e,r)}),i}function Re(t){var e=arguments,n=2;if(!Ae(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var r=_(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=d(arguments,1,n),o=-1,a=c(),u=c();++o<n;)ee(t,i[o],r,a,u);return h(a),h(u),t}function Ie(t,n,r){var i={};if("function"!=typeof n){var o=[];ui(t,function(t,e){o.push(e)}),o=G(o,Q(arguments,!0,!1,1));for(var a=-1,u=o.length;++a<u;){var s=o[a];i[s]=t[s]}}else n=e.createCallback(n,r,3),ui(t,function(t,e,r){n(t,e,r)||(i[e]=t)});return i}function Pe(t){for(var e=-1,n=ti(t),r=n.length,i=dr(r);++e<r;){var o=n[e];i[e]=[o,t[o]]}return i}function He(t,n,r){var i={};if("function"!=typeof n)for(var o=-1,a=Q(arguments,!0,!1,1),u=Ae(t)?a.length:0;++o<u;){var s=a[o];s in t&&(i[s]=t[s])}else n=e.createCallback(n,r,3),ui(t,function(t,e,r){n(t,e,r)&&(i[e]=t)});return i}function Be(t,n,r,i){var o=Gr(t);if(null==r)if(o)r=[];else{var a=t&&t.constructor,u=a&&a.prototype;r=y(u)}return n&&(n=e.createCallback(n,i,4),(o?Ze:si)(t,function(t,e,i){return n(r,t,e,i)})),r}function $e(t){for(var e=-1,n=ti(t),r=n.length,i=dr(r);++e<r;)i[e]=t[n[e]];return i}function Ve(t){for(var e=arguments,n=-1,r=Q(e,!0,!1,1),i=e[2]&&e[2][e[1]]===t?1:r.length,o=dr(i);++n<i;)o[n]=t[r[n]];return o}function Ue(t,e,n){var r=-1,i=se(),o=t?t.length:0,a=!1;return n=(0>n?Ur(0,o+n):n)||0,Gr(t)?a=i(t,e,n)>-1:"number"==typeof o?a=(Le(t)?t.indexOf(e,n):i(t,e,n))>-1:si(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function We(t,n,r){var i=!0;n=e.createCallback(n,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a&&(i=!!n(t[o],o,t)););else si(t,function(t,e,r){return i=!!n(t,e,r)});return i}function Ye(t,n,r){var i=[];n=e.createCallback(n,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a;){var u=t[o];n(u,o,t)&&i.push(u)}else si(t,function(t,e,r){n(t,e,r)&&i.push(t)});return i}function Xe(t,n,r){n=e.createCallback(n,r,3);var i=-1,o=t?t.length:0;if("number"!=typeof o){var a;return si(t,function(t,e,r){return n(t,e,r)?(a=t,!1):void 0}),a}for(;++i<o;){var u=t[i];if(n(u,i,t))return u}}function Je(t,n,r){var i;return n=e.createCallback(n,r,3),Ke(t,function(t,e,r){return n(t,e,r)?(i=t,!1):void 0}),i}function Ze(t,e,n){var r=-1,i=t?t.length:0;if(e=e&&"undefined"==typeof n?e:_(e,n,3),"number"==typeof i)for(;++r<i&&e(t[r],r,t)!==!1;);else si(t,e);return t}function Ke(t,e,n){var r=t?t.length:0;if(e=e&&"undefined"==typeof n?e:_(e,n,3),"number"==typeof r)for(;r--&&e(t[r],r,t)!==!1;);else{var i=ti(t);r=i.length,si(t,function(t,n,o){return n=i?i[--r]:--r,e(o[n],n,o)})}return t}function Ge(t,e){var n=d(arguments,2),r=-1,i="function"==typeof e,o=t?t.length:0,a=dr("number"==typeof o?o:0);return Ze(t,function(t){a[++r]=(i?e:t[e]).apply(t,n)}),a}function Qe(t,n,r){var i=-1,o=t?t.length:0;if(n=e.createCallback(n,r,3),"number"==typeof o)for(var a=dr(o);++i<o;)a[i]=n(t[i],i,t);else a=[],si(t,function(t,e,r){a[++i]=n(t,e,r)});return a}function tn(t,n,r){var i=-1/0,o=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Gr(t))for(var u=-1,s=t.length;++u<s;){var l=t[u];l>o&&(o=l)}else n=null==n&&Le(t)?a:e.createCallback(n,r,3),Ze(t,function(t,e,r){var a=n(t,e,r);a>i&&(i=a,o=t)});return o}function en(t,n,r){var i=1/0,o=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Gr(t))for(var u=-1,s=t.length;++u<s;){var l=t[u];o>l&&(o=l)}else n=null==n&&Le(t)?a:e.createCallback(n,r,3),Ze(t,function(t,e,r){var a=n(t,e,r);i>a&&(i=a,o=t)});return o}function nn(t,n,r,i){if(!t)return r;var o=arguments.length<3;n=e.createCallback(n,i,4);var a=-1,u=t.length;if("number"==typeof u)for(o&&(r=t[++a]);++a<u;)r=n(r,t[a],a,t);else si(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)});return r}function rn(t,n,r,i){var o=arguments.length<3;return n=e.createCallback(n,i,4),Ke(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)}),r}function on(t,n,r){return n=e.createCallback(n,r,3),Ye(t,function(t,e,r){return!n(t,e,r)})}function an(t,e,n){if(t&&"number"!=typeof t.length&&(t=$e(t)),null==e||n)return t?t[re(0,t.length-1)]:v;var r=un(t);return r.length=Wr(Ur(0,e),r.length),r}function un(t){var e=-1,n=t?t.length:0,r=dr("number"==typeof n?n:0);return Ze(t,function(t){var n=re(0,++e);r[e]=r[n],r[n]=t}),r}function sn(t){var e=t?t.length:0;return"number"==typeof e?e:ti(t).length}function ln(t,n,r){var i;n=e.createCallback(n,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a&&!(i=n(t[o],o,t)););else si(t,function(t,e,r){return!(i=n(t,e,r))});return!!i}function cn(t,n,r){var i=-1,o=Gr(n),a=t?t.length:0,s=dr("number"==typeof a?a:0);for(o||(n=e.createCallback(n,r,3)),Ze(t,function(t,e,r){var a=s[++i]=f();o?a.criteria=Qe(n,function(e){return t[e]}):(a.criteria=c())[0]=n(t,e,r),a.index=i,a.value=t}),a=s.length,s.sort(u);a--;){var l=s[a];s[a]=l.value,o||h(l.criteria),p(l)}return s}function fn(t){return t&&"number"==typeof t.length?d(t):$e(t)}function hn(t){for(var e=-1,n=t?t.length:0,r=[];++e<n;){var i=t[e];i&&r.push(i)}return r}function pn(t){return G(t,Q(arguments,!0,!0,1))}function dn(t,n,r){var i=-1,o=t?t.length:0;for(n=e.createCallback(n,r,3);++i<o;)if(n(t[i],i,t))return i;return-1}function gn(t,n,r){var i=t?t.length:0;for(n=e.createCallback(n,r,3);i--;)if(n(t[i],i,t))return i;return-1}function vn(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=-1;for(n=e.createCallback(n,r,3);++a<o&&n(t[a],a,t);)i++}else if(i=n,null==i||r)return t?t[0]:v;return d(t,0,Wr(Ur(0,i),o))}function mn(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n="function"!=typeof e&&r&&r[e]===t?null:e,e=!1),null!=n&&(t=Qe(t,n,r)),Q(t,e)}function yn(t,e,n){if("number"==typeof n){var i=t?t.length:0;n=0>n?Ur(0,i+n):n||0}else if(n){var o=Sn(t,e);return t[o]===e?o:-1}return r(t,e,n)}function bn(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=o;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else i=null==n||r?1:n||i;return d(t,0,Wr(Ur(0,o-i),o))}function xn(){for(var t=[],e=-1,n=arguments.length,o=c(),a=se(),u=a===r,l=c();++e<n;){var f=arguments[e];(Gr(f)||he(f))&&(t.push(f),o.push(u&&f.length>=w&&s(e?t[e]:l)))}var d=t[0],g=-1,v=d?d.length:0,m=[];t:for(;++g<v;){var y=o[0];if(f=d[g],(y?i(y,f):a(l,f))<0){for(e=n,(y||l).push(f);--e;)if(y=o[e],(y?i(y,f):a(t[e],f))<0)continue t;m.push(f)}}for(;n--;)y=o[n],y&&p(y);return h(o),h(l),m}function wn(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=o;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else if(i=n,null==i||r)return t?t[o-1]:v;return d(t,Ur(0,o-i))}function _n(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?Ur(0,r+n):Wr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function Mn(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++n<r;)for(var o=-1,a=e[n];++o<i;)t[o]===a&&(zr.call(t,o--,1),i--);return t}function kn(t,e,n){t=+t||0,n="number"==typeof n?n:+n||1,null==e&&(e=t,t=0);for(var r=-1,i=Ur(0,jr((e-t)/(n||1))),o=dr(i);++r<i;)o[r]=t,t+=n;return o}function En(t,n,r){var i=-1,o=t?t.length:0,a=[];for(n=e.createCallback(n,r,3);++i<o;){var u=t[i];n(u,i,t)&&(a.push(u),zr.call(t,i--,1),o--)}return a}function Cn(t,n,r){if("number"!=typeof n&&null!=n){var i=0,o=-1,a=t?t.length:0;for(n=e.createCallback(n,r,3);++o<a&&n(t[o],o,t);)i++}else i=null==n||r?1:Ur(0,n);return d(t,i)}function Sn(t,n,r,i){var o=0,a=t?t.length:o;for(r=r?e.createCallback(r,i,1):Gn,n=r(n);a>o;){var u=o+a>>>1;r(t[u])<n?o=u+1:a=u}return o}function Tn(){return ie(Q(arguments,!0,!0))}function jn(t,n,r,i){return"boolean"!=typeof n&&null!=n&&(i=r,r="function"!=typeof n&&i&&i[n]===t?null:n,n=!1),null!=r&&(r=e.createCallback(r,i,3)),ie(t,n,r)}function An(t){return G(t,d(arguments,1))}function Nn(){for(var t=-1,e=arguments.length;++t<e;){var n=arguments[t];if(Gr(n)||he(n))var r=r?ie(G(r,n).concat(G(n,r))):n}return r||[]}function On(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,n=t?tn(pi(t,"length")):0,r=dr(0>n?0:n);++e<n;)r[e]=pi(t,e);return r}function qn(t,e){var n=-1,r=t?t.length:0,i={};for(e||!r||Gr(t[0])||(e=[]);++n<r;){var o=t[n];e?i[o]=e[n]:o&&(i[o[0]]=o[1])}return i}function Dn(t,e){if(!je(e))throw new Mr;return function(){return--t<1?e.apply(this,arguments):void 0}}function Ln(t,e){return arguments.length>2?ae(t,17,d(arguments,2),null,e):ae(t,1,null,null,e)}function Fn(t){for(var e=arguments.length>1?Q(arguments,!0,!1,1):xe(t),n=-1,r=e.length;++n<r;){var i=e[n];t[i]=ae(t[i],1,null,null,t)}return t}function zn(t,e){return arguments.length>2?ae(e,19,d(arguments,2),null,t):ae(e,3,null,null,t)}function Rn(){for(var t=arguments,e=t.length;e--;)if(!je(t[e]))throw new Mr;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function In(t,e){return e="number"==typeof e?e:+e||t.length,ae(t,4,null,null,null,e)}function Pn(t,e,n){var r,i,o,a,u,s,l,c=0,f=!1,h=!0;if(!je(t))throw new Mr;if(e=Ur(0,e)||0,n===!0){var p=!0;h=!1}else Ae(n)&&(p=n.leading,f="maxWait"in n&&(Ur(e,n.maxWait)||0),h="trailing"in n?n.trailing:h);var d=function(){var n=e-(gi()-a);if(0>=n){i&&Ar(i);var f=l;i=s=l=v,f&&(c=gi(),o=t.apply(u,r),s||i||(r=u=null))}else s=Fr(d,n)},g=function(){s&&Ar(s),i=s=l=v,(h||f!==e)&&(c=gi(),o=t.apply(u,r),s||i||(r=u=null))};return function(){if(r=arguments,a=gi(),u=this,l=h&&(s||!p),f===!1)var n=p&&!s;else{i||p||(c=a);var v=f-(a-c),m=0>=v;m?(i&&(i=Ar(i)),c=a,o=t.apply(u,r)):i||(i=Fr(g,v))}return m&&s?s=Ar(s):s||e===f||(s=Fr(d,e)),n&&(m=!0,o=t.apply(u,r)),!m||s||i||(r=u=null),o}}function Hn(t){if(!je(t))throw new Mr;var e=d(arguments,1);return Fr(function(){t.apply(v,e)},1)}function Bn(t,e){if(!je(t))throw new Mr;var n=d(arguments,2);return Fr(function(){t.apply(v,n)},e)}function $n(t,e){if(!je(t))throw new Mr;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):x+arguments[0];return Dr.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Vn(t){var e,n;if(!je(t))throw new Mr;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function Un(t){return ae(t,16,d(arguments,1))}function Wn(t){return ae(t,32,null,d(arguments,1))}function Yn(t,e,n){var r=!0,i=!0;
-if(!je(t))throw new Mr;return n===!1?r=!1:Ae(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),Y.leading=r,Y.maxWait=e,Y.trailing=i,Pn(t,e,Y)}function Xn(t,e){return ae(e,16,[t])}function Jn(t){return function(){return t}}function Zn(t,e,n){var r=typeof t;if(null==t||"function"==r)return _(t,e,n);if("object"!=r)return nr(t);var i=ti(t),o=i[0],a=t[o];return 1!=i.length||a!==a||Ae(a)?function(e){for(var n=i.length,r=!1;n--&&(r=te(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[o];return a===e&&(0!==a||1/a==1/e)}}function Kn(t){return null==t?"":_r(t).replace(ii,ue)}function Gn(t){return t}function Qn(t,r,i){var o=!0,a=r&&xe(r);r&&(i||a.length)||(null==i&&(i=r),u=n,r=t,t=e,a=xe(r)),i===!1?o=!1:Ae(i)&&"chain"in i&&(o=i.chain);var u=t,s=je(u);Ze(a,function(e){var n=t[e]=r[e];s&&(u.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,i=[r];Lr.apply(i,arguments);var a=n.apply(t,i);if(o||e){if(r===a&&Ae(a))return this;a=new u(a),a.__chain__=e}return a})})}function tr(){return t._=Cr,this}function er(){}function nr(t){return function(e){return e[t]}}function rr(t,e,n){var r=null==t,i=null==e;if(null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,n||t%1||e%1){var o=Xr();return Wr(t+o*(e-t+parseFloat("1e-"+((o+"").length-1))),e)}return re(t,e)}function ir(t,e){if(t){var n=t[e];return je(n)?t[e]():n}}function or(t,data,n){var r=e.templateSettings;t=_r(t||""),n=ai({},n,r);var i,o=ai({},n.imports,r.imports),a=ti(o),u=$e(o),s=0,c=n.interpolate||O,f="__p += '",h=wr((n.escape||O).source+"|"+c.source+"|"+(c===A?S:O).source+"|"+(n.evaluate||O).source+"|$","g");t.replace(h,function(e,n,r,o,a,u){return r||(r=o),f+=t.slice(s,u).replace(D,l),n&&(f+="' +\n__e("+n+") +\n'"),a&&(i=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=u+e.length,e}),f+="';\n";var p=n.variable,d=p;d||(p="obj",f="with ("+p+") {\n"+f+"\n}\n"),f=(i?f.replace(k,""):f).replace(E,"$1").replace(C,"$1;"),f="function("+p+") {\n"+(d?"":p+" || ("+p+" = {});\n")+"var __t, __p = '', __e = _.escape"+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+F++ +"]")+"\n*/";try{var m=mr(a,"return "+f+g).apply(v,u)}catch(y){throw y.source=f,y}return data?m(data):(m.source=f,m)}function ar(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=dr(t);for(e=_(e,n,1);++r<t;)i[r]=e(r);return i}function ur(t){return null==t?"":_r(t).replace(ri,fe)}function sr(t){var e=++b;return _r(null==t?"":t)+e}function lr(t){return t=new n(t),t.__chain__=!0,t}function cr(t,e){return e(t),t}function fr(){return this.__chain__=!0,this}function hr(){return _r(this.__wrapped__)}function pr(){return this.__wrapped__}t=t?ne.defaults(K.Object(),t,ne.pick(K,L)):K;var dr=t.Array,gr=t.Boolean,vr=t.Date,mr=t.Function,yr=t.Math,br=t.Number,xr=t.Object,wr=t.RegExp,_r=t.String,Mr=t.TypeError,kr=[],Er=xr.prototype,Cr=t._,Sr=Er.toString,Tr=wr("^"+_r(Sr).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),jr=yr.ceil,Ar=t.clearTimeout,Nr=yr.floor,Or=mr.prototype.toString,qr=le(qr=xr.getPrototypeOf)&&qr,Dr=Er.hasOwnProperty,Lr=kr.push,Fr=t.setTimeout,zr=kr.splice,Rr=kr.unshift,Ir=function(){try{var t={},e=le(e=xr.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),Pr=le(Pr=xr.create)&&Pr,Hr=le(Hr=dr.isArray)&&Hr,Br=t.isFinite,$r=t.isNaN,Vr=le(Vr=xr.keys)&&Vr,Ur=yr.max,Wr=yr.min,Yr=t.parseInt,Xr=yr.random,Jr={};Jr[R]=dr,Jr[I]=gr,Jr[P]=vr,Jr[H]=mr,Jr[$]=xr,Jr[B]=br,Jr[V]=wr,Jr[U]=_r,n.prototype=e.prototype;var Zr=e.support={};Zr.funcDecomp=!le(t.WinRTError)&&q.test(g),Zr.funcNames="string"==typeof mr.name,e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:e}},Pr||(y=function(){function e(){}return function(n){if(Ae(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var Kr=Ir?function(t,e){X.value=e,Ir(t,"__bindData__",X)}:er,Gr=Hr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sr.call(t)==R||!1},Qr=function(t){var e,n=t,r=[];if(!n)return r;if(!J[typeof t])return r;for(e in n)Dr.call(n,e)&&r.push(e);return r},ti=Vr?function(t){return Ae(t)?Vr(t):[]}:Qr,ei={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ni=_e(ei),ri=wr("("+ti(ni).join("|")+")","g"),ii=wr("["+ti(ei).join("")+"]","g"),oi=function(t,e,n){var r,i=t,o=i;if(!i)return o;var a=arguments,u=0,s="number"==typeof n?2:a.length;if(s>3&&"function"==typeof a[s-2])var l=_(a[--s-1],a[s--],2);else s>2&&"function"==typeof a[s-1]&&(l=a[--s]);for(;++u<s;)if(i=a[u],i&&J[typeof i])for(var c=-1,f=J[typeof i]&&ti(i),h=f?f.length:0;++c<h;)r=f[c],o[r]=l?l(o[r],i[r]):i[r];return o},ai=function(t,e,n){var r,i=t,o=i;if(!i)return o;for(var a=arguments,u=0,s="number"==typeof n?2:a.length;++u<s;)if(i=a[u],i&&J[typeof i])for(var l=-1,c=J[typeof i]&&ti(i),f=c?c.length:0;++l<f;)r=c[l],"undefined"==typeof o[r]&&(o[r]=i[r]);return o},ui=function(t,e,n){var r,i=t,o=i;if(!i)return o;if(!J[typeof i])return o;e=e&&"undefined"==typeof n?e:_(e,n,3);for(r in i)if(e(i[r],r,t)===!1)return o;return o},si=function(t,e,n){var r,i=t,o=i;if(!i)return o;if(!J[typeof i])return o;e=e&&"undefined"==typeof n?e:_(e,n,3);for(var a=-1,u=J[typeof i]&&ti(i),s=u?u.length:0;++a<s;)if(r=u[a],e(i[r],r,t)===!1)return o;return o},li=qr?function(t){if(!t||Sr.call(t)!=$)return!1;var e=t.valueOf,n=le(e)&&(n=qr(e))&&qr(n);return n?t==n||qr(t)==n:ce(t)}:ce,ci=oe(function(t,e,n){Dr.call(t,n)?t[n]++:t[n]=1}),fi=oe(function(t,e,n){(Dr.call(t,n)?t[n]:t[n]=[]).push(e)}),hi=oe(function(t,e,n){t[n]=e}),pi=Qe,di=Ye,gi=le(gi=vr.now)&&gi||function(){return(new vr).getTime()},vi=8==Yr(M+"08")?Yr:function(t,e){return Yr(Le(t)?t.replace(N,""):t,e||0)};return e.after=Dn,e.assign=oi,e.at=Ve,e.bind=Ln,e.bindAll=Fn,e.bindKey=zn,e.chain=lr,e.compact=hn,e.compose=Rn,e.constant=Jn,e.countBy=ci,e.create=ge,e.createCallback=Zn,e.curry=In,e.debounce=Pn,e.defaults=ai,e.defer=Hn,e.delay=Bn,e.difference=pn,e.filter=Ye,e.flatten=mn,e.forEach=Ze,e.forEachRight=Ke,e.forIn=ui,e.forInRight=ye,e.forOwn=si,e.forOwnRight=be,e.functions=xe,e.groupBy=fi,e.indexBy=hi,e.initial=bn,e.intersection=xn,e.invert=_e,e.invoke=Ge,e.keys=ti,e.map=Qe,e.mapValues=ze,e.max=tn,e.memoize=$n,e.merge=Re,e.min=en,e.omit=Ie,e.once=Vn,e.pairs=Pe,e.partial=Un,e.partialRight=Wn,e.pick=He,e.pluck=pi,e.property=nr,e.pull=Mn,e.range=kn,e.reject=on,e.remove=En,e.rest=Cn,e.shuffle=un,e.sortBy=cn,e.tap=cr,e.throttle=Yn,e.times=ar,e.toArray=fn,e.transform=Be,e.union=Tn,e.uniq=jn,e.values=$e,e.where=di,e.without=An,e.wrap=Xn,e.xor=Nn,e.zip=On,e.zipObject=qn,e.collect=Qe,e.drop=Cn,e.each=Ze,e.eachRight=Ke,e.extend=oi,e.methods=xe,e.object=qn,e.select=Ye,e.tail=Cn,e.unique=jn,e.unzip=On,Qn(e),e.clone=pe,e.cloneDeep=de,e.contains=Ue,e.escape=Kn,e.every=We,e.find=Xe,e.findIndex=dn,e.findKey=ve,e.findLast=Je,e.findLastIndex=gn,e.findLastKey=me,e.has=we,e.identity=Gn,e.indexOf=yn,e.isArguments=he,e.isArray=Gr,e.isBoolean=Me,e.isDate=ke,e.isElement=Ee,e.isEmpty=Ce,e.isEqual=Se,e.isFinite=Te,e.isFunction=je,e.isNaN=Ne,e.isNull=Oe,e.isNumber=qe,e.isObject=Ae,e.isPlainObject=li,e.isRegExp=De,e.isString=Le,e.isUndefined=Fe,e.lastIndexOf=_n,e.mixin=Qn,e.noConflict=tr,e.noop=er,e.now=gi,e.parseInt=vi,e.random=rr,e.reduce=nn,e.reduceRight=rn,e.result=ir,e.runInContext=g,e.size=sn,e.some=ln,e.sortedIndex=Sn,e.template=or,e.unescape=ur,e.uniqueId=sr,e.all=We,e.any=ln,e.detect=Xe,e.findWhere=Xe,e.foldl=nn,e.foldr=rn,e.include=Ue,e.inject=nn,Qn(function(){var t={};return si(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.first=vn,e.last=wn,e.sample=an,e.take=vn,e.head=vn,si(e,function(t,r){var i="sample"!==r;e.prototype[r]||(e.prototype[r]=function(e,r){var o=this.__chain__,a=t(this.__wrapped__,e,r);return o||null!=e&&(!r||i&&"function"==typeof e)?new n(a,o):a})}),e.VERSION="2.4.1",e.prototype.chain=fr,e.prototype.toString=hr,e.prototype.value=pr,e.prototype.valueOf=pr,Ze(["join","pop","shift"],function(t){var r=kr[t];e.prototype[t]=function(){var t=this.__chain__,e=r.apply(this.__wrapped__,arguments);return t?new n(e,t):e}}),Ze(["push","reverse","sort","unshift"],function(t){var n=kr[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(t){var r=kr[t];e.prototype[t]=function(){return new n(r.apply(this.__wrapped__,arguments),this.__chain__)}}),e}var v,m=[],y=[],b=0,x=+new Date+"",w=75,_=40,M=" \f \n\r\u2028\u2029 ᠎              ",k=/\b__p \+= '';/g,E=/\b(__p \+=) '' \+/g,C=/(__e\(.*?\)|\b__t\)) \+\n'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,T=/\w*$/,j=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,N=RegExp("^["+M+"]*0+(?=.$)"),O=/($^)/,q=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,L=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],F=0,z="[object Arguments]",R="[object Array]",I="[object Boolean]",P="[object Date]",H="[object Function]",B="[object Number]",$="[object Object]",V="[object RegExp]",U="[object String]",W={};W[H]=!1,W[z]=W[R]=W[I]=W[P]=W[B]=W[$]=W[V]=W[U]=!0;var Y={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=J[typeof window]&&window||this,G=J[typeof n]&&n&&!n.nodeType&&n,Q=J[typeof e]&&e&&!e.nodeType&&e,te=Q&&Q.exports===G&&G,ee=J[typeof t]&&t;!ee||ee.global!==ee&&ee.window!==ee||(K=ee);var ne=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K._=ne,define(function(){return ne})):G&&Q?te?(Q.exports=ne)._=ne:G._=ne:K._=ne}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],63:[function(t,e){{var n=t("ampersand-view"),r=t("./sidebar"),i=t("./chart"),o=t("jquery");t("debug")("view:app"),e.exports=n.extend({template:t("./templates/app.jade"),props:{chartView:"object",menuOpen:{type:"boolean","default":!1}},events:{"click .navbar-right label":"navButtonClicked","click [data-hook=menu-toggle]":"menuToggled"},bindings:{"model.chart.subSampled":{type:"toggle",hook:"sample-warning"},menuOpen:{type:"booleanClass",selector:"#wrapper",name:"active"}},subviews:{sidebar:{hook:"sidebar",waitFor:"model.sidebar",prepareView:function(t){return new r({el:t,model:this.model.sidebar})}},chart:{hook:"chart",waitFor:"model.chart",prepareView:function(t){return this.chartView=new i({el:t,model:this.model.chart}),this.chartView}}},statChanged:function(){this.model.chart.recalcXDomain=!0,this.chartView.render()},render:function(){this.renderWithTemplate(this.model)},navButtonClicked:function(t){var e=o(t.target).find("input"),n=e.attr("name"),r=e.val();this.model.chart[n]=r,this.model.chart.recalcXDomain="xSetting"===n,this.chartView.render()},menuToggled:function(){this.toggle("menuOpen")}})}},{"./chart":64,"./sidebar":67,"./templates/app.jade":69,"ampersand-view":33,debug:57,jquery:61}],64:[function(t,e){{var n=t("ampersand-view"),r=t("./viz"),i=t("./empty");t("d3"),t("jquery"),t("debug")("view:chart"),e.exports=n.extend({props:{vizView:{type:"any","default":null},emptyView:{type:"any","default":null},activeView:{type:"string","default":"empty",values:["empty","viz"]}},template:t("./templates/chart.jade"),bindings:{activeView:{type:"switch",cases:{empty:"[data-hook=empty]",viz:"[data-hook=graph]"}}},render:function(){this.activeView=this.model.empty?"empty":"viz",this.vizView?(this.vizView.data={series:this.model.series.filter(function(t){return t.selected}),model:this.model},this.vizView.redraw()):(this.renderWithTemplate(this.model),this.vizView=new r({width:"auto",height:600,renderMode:"svg",className:"multiline",debounceRender:!1,vizFn:t("./viz/d3-multiline"),data:{series:this.model.series.filter(function(t){return t.selected}),model:this.model}}),this.emptyView=new i,this.renderSubview(this.emptyView,"[data-hook=empty]"),this.renderSubview(this.vizView,"[data-hook=graph]"))}})}},{"./empty":65,"./templates/chart.jade":70,"./viz":75,"./viz/d3-multiline":76,"ampersand-view":33,d3:56,debug:57,jquery:61}],65:[function(t,e){{var n=t("ampersand-view");t("debug")("view:empty"),e.exports=n.extend({template:t("./templates/empty.jade"),autorender:!0})}},{"./templates/empty.jade":71,"ampersand-view":33,debug:57}],66:[function(t,e){{var n=t("ampersand-view"),r=t("ampersand-subcollection"),i=t("./stat"),o=t("jquery");t("lodash"),t("debug")("view:panel"),e.exports=n.extend({props:{indicator:{type:"string","default":"none",values:["none","some","all"]},statViews:"object",filteredStats:"object"},template:t("./templates/panel.jade"),events:{"click a":"collapsibleToggle","click [data-hook=caret]":"collapsibleToggle","click [data-hook=indicator]":"indicatorClicked"},bindings:{indicator:{type:function(t){switch($el=o(t),$el.removeClass(),this.model.selected){case"all":$el.addClass("fa fa-circle");break;case"some":$el.addClass("fa fa-adjust");break;case"none":$el.addClass("fa fa-circle-o")}},hook:"indicator"},"model.open":{type:"booleanClass",hook:"caret",yes:"fa-caret-up",no:"fa-caret-down"}},initialize:function(){this.filteredStats=new r(this.model.stats,{comparator:function(t){return t.name}})},render:function(){this.renderWithTemplate(this.model),this.statViews=this.renderCollection(this.filteredStats,i,this.queryByHook("stats"))},indicatorClicked:function(){var t="all"!==this.model.selected;switch(this.filteredStats.each(function(e){e.selected=t}),this.model.selected){case"all":case"some":this.collapsibleOpen();break;case"none":this.collapsibleClose()}this.model.app.clearSelectionState(),this.statChanged(null,{propagate:!0})},statChanged:function(t,e){e=e||{},this.indicator=this.model.selected,e.propagate&&this.parent.parent.statChanged(t,e)},collapsibleToggle:function(t){this.model.open?this.collapsibleClose(t):this.collapsibleOpen(t)},collapsibleClose:function(){o(this.query(".collapse")).collapse("hide"),this.model.open=!1},collapsibleOpen:function(){o(this.query(".collapse")).collapse("show"),this.model.open=!0},resetStats:function(){this.filteredStats.configure({},!0)},filterStats:function(t){this.filteredStats.configure({filter:function(e){return-1!==e.name.search(new RegExp(t),"gi")}},!0),0===this.filteredStats.length?this.collapsibleClose():this.collapsibleOpen()}})}},{"./stat":68,"./templates/panel.jade":72,"ampersand-subcollection":27,"ampersand-view":33,debug:57,jquery:61,lodash:62}],67:[function(t,e){{var n=t("ampersand-view"),r=t("./panel"),i=t("lodash");t("debug")("view:sidebar"),e.exports=n.extend({props:{panelViews:"object"},template:t("./templates/sidebar.jade"),events:{"click [data-hook=button]":"clearClicked","input [data-hook=input]":"inputChanged"},bindings:{"model.search.content":{type:"value",hook:"input"}},render:function(){this.renderWithTemplate(this.model),this.panelViews=this.renderCollection(this.model.panels,r,this.queryByHook("panels"))},closeAndReset:function(){i.each(this.panelViews.views,function(t){t.collapsibleClose(),t.resetStats()})},clearClicked:function(){this.model.search.content="",this.closeAndReset(),this.queryByHook("button").blur()},filterPanels:function(t){i.each(this.panelViews.views,function(e){e.filterStats(t)})},statChanged:function(t,e){this.parent.statChanged(t,e),e.all&&i.each(this.panelViews.views,function(e){e.statChanged(t,{all:!1,propagate:!1})})},inputChanged:i.debounce(function(){var t=this.queryByHook("input").value;this.model.search.content=t,""===t.trim()?this.closeAndReset():this.filterPanels(t)},200,{leading:!1,trailing:!0})})}},{"./panel":66,"./templates/sidebar.jade":73,"ampersand-view":33,debug:57,lodash:62}],68:[function(t,e){{var n=t("ampersand-view");t("debug")("view:stat"),e.exports=n.extend({template:t("./templates/stat.jade"),render:function(){this.renderWithTemplate(this.model)},events:{click:"clicked"},bindings:{"model.selected":{type:"booleanClass",hook:"circle",yes:"fa-circle",no:"fa-circle-o"}},clicked:function(t){t.shiftKey?this.model.app.toggleAllExcept(this.model):(this.model.app.clearSelectionState(),this.model.toggle("selected")),this.parent.parent.statChanged(this,{all:t.shiftKey,propagate:!0})}})}},{"./templates/stat.jade":74,"ampersand-view":33,debug:57}],69:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<div id="app"><nav id="navbar" role="navigation" class="navbar navbar-default"><div class="container-fluid"><div class="navbar-header"><div class="navbar-brand"> <div data-hook="menu-toggle" class="brand-image"></div></div></div><ul class="nav navbar-right"><li data-hook="sample-warning" class="navbar-text"><div title="warning: more series data points than pixels. data is being sub-sampled to improve performance. To avoid sub-sampling, increase the browser window width or zoom in." class="alert alert-warning"><i id="menubtn" class="fa fa-warning"></i><span>sub-sampling</span></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-clock-o"></i><span>x-axis</span><div data-toggle="buttons" data-hook="xSetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="xSetting" id="relative" value="relative" checked="checked"/>relative</label><label class="btn btn-default"><input type="radio" name="xSetting" id="absolute" value="absolute"/>absolute</label></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-line-chart"></i><span>y-axis</span><div data-toggle="buttons" data-hook="ySetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="ySetting" value="linear" checked="checked"/>linear</label><label class="btn btn-default"><input type="radio" name="ySetting" value="log-scale"/>log-scale</label></div></li></ul></div></nav><div id="wrapper"><div id="sidebar-wrapper"><div class="sidebar-nav"><div data-hook="sidebar"></div></div></div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="chart"></div></div></div></div></div></div>'),t.join("")}},{"jade/runtime":60}],70:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="empty"></div><div data-hook="graph"></div></div></div></div></div>'),t.join("")}},{"jade/runtime":60}],71:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<div class="instructions"><dl class="dl-horizontal"><dt><h1><span class="searchbox">mem|&nbsp;</span><i class="fa fa-search"></i></h1></dt><dd>filter stats by typing in the text box</dd><dt><h1> <u>cursor</u><i class="fa fa-caret-down"></i></h1></dt><dd>open/close group panels</dd><dt><h1><i class="fa fa-circle-o"></i><i class="fa fa-adjust"> </i><i class="fa fa-circle"> </i></h1></dt><dd>click to toggle individual stats or the entire group</dd><dt><h1><i class="fa fa-expand"></i><i class="fa fa-arrows-h"> </i><i class="fa fa-compress"> </i></h1></dt><dd>zoom with two-finger scroll or mouse wheel, pan with click+drag</dd><dt><h1>x<i class="fa fa-clock-o"></i>y<i class="fa fa-line-chart"> </i></h1></dt><dd>change x/y axis scaling with buttons at the top</dd></dl></div>'),t.join("")}},{"jade/runtime":60}],72:[function(t,e){var n=t("jade/runtime");e.exports=function(t){var e,r=[],i=t||{};return function(t,i){r.push('<div class="panel panel-default"><div class="panel-heading">'),i&&r.push('<span class="suptitle">'+n.escape(null==(e=i)?"":e)+"</span>"),r.push('<h4 class="panel-title"><i data-hook="indicator" class="fa fa-circle-o"></i><a data-toggle="collapse" data-parent="#panel-accordion">'+n.escape(null==(e=t)?"":e)+'</a><div class="pull-right"><i data-hook="caret" class="fa"></i></div></h4></div><div class="panel-collapse collapse"><div class="panel-body"><ul data-hook="stats" class="stats"></ul></div></div></div>')}.call(this,"subtitle"in i?i.subtitle:"undefined"!=typeof subtitle?subtitle:void 0,"suptitle"in i?i.suptitle:"undefined"!=typeof suptitle?suptitle:void 0),r.join("")}},{"jade/runtime":60}],73:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<ul class="sidebar-nav"><li><div class="input-group"><input data-hook="input" type="text" class="form-control"/><span class="input-group-btn"><button data-hook="button" type="button" class="btn btn-default">Clear</button></span></div></li><li><div data-hook="panels" id="panel-accordion" class="panel-group"></div></li></ul>'),t.join("")}},{"jade/runtime":60}],74:[function(t,e){var n=t("jade/runtime");e.exports=function(t){var e,r=[],i=t||{};return function(t,i){r.push('<li class="stat"><i data-hook="circle"'+n.attr("style","color:"+t,!0,!1)+' class="fa fa-circle"></i>'+n.escape(null==(e=i)?"":e)+"</li>")}.call(this,"color"in i?i.color:"undefined"!=typeof color?color:void 0,"name"in i?i.name:"undefined"!=typeof name?name:void 0),r.join("")}},{"jade/runtime":60}],75:[function(t,e){{var n=t("ampersand-view"),r=t("lodash"),i=t("jquery");t("debug")("view:viz")}e.exports=n.extend({_values:{},_autoWidth:!1,_autoHeight:!1,props:{data:"any",className:"any",vizFn:"any",debounceRender:{type:"boolean","default":!0},renderMode:{type:"string",values:["canvas","svg","html"],"default":"svg"},width:{type:"any","default":"auto"},height:{type:"any","default":400}},bindings:{width:[{type:"attribute",name:"width",hook:"viz-container"}],height:{type:"attribute",name:"height",hook:"viz-container"},className:{type:"attribute",name:"class",hook:"viz-container"}},initialize:function(){switch(("auto"===this.width||void 0===this.width)&&(this._autoWidth=!0,this.width=0),("auto"===this.height||void 0===this.height)&&(this._autoHeight=!0,this.height=0),(this._autoWidth||this._autoHeight)&&(this.debounceRender?window.addEventListener("resize",r.debounce(this.redraw.bind(this),100)):window.addEventListener("resize",this.redraw.bind(this))),this.renderMode){case"canvas":this.template='<canvas data-hook="viz-container" id="canvas"></canvas>';break;case"svg":this.template='<svg data-hook="viz-container"></svg>';break;case"html":this.template='<div data-hook="viz-container"></div>'}},_measure:function(){this.el&&(this._autoWidth&&(this.width=i(this.el).parent().width()),this._autoHeight&&(this.height=i(this.el).parent().height()))},_chooseDataSource:function(){void 0!==this.model?this.data=this.model.toJSON():void 0!==this.collection&&(this.data=this.collection.toJSON())},remove:function(){return window.removeEventListener("resize",this._onResize),this},transform:function(data){return data},render:function(){return this._chooseDataSource(),this.data=this.transform(this.data),this.renderWithTemplate(this),this._measure(),this.vizFn&&(this.vizFn=this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})),this},redraw:function(){this._chooseDataSource(),this.data=this.transform(this.data),this._measure(),this.vizFn&&this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})}}),e.exports.create=function(t,n){return e.exports.extend({className:t,vizFn:n})}},{"ampersand-view":33,debug:57,jquery:61,lodash:62}],76:[function(t,e){{var n=t("d3"),r=t("lodash");t("debug")("viz:d3-multiline")}n.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})},e.exports=function(t){function e(e){if(e){if(t=e,f=t.width-c.left-c.right,h=t.height-c.top-c.bottom,data=t.data,d=data.model,g=d.serialize(),F=data.series,0===F.length?T.style("visibility","hidden"):T.style("visibility","visible"),T.attr({width:f,height:h}),"relative"===g.xSetting?(v=function(t){return t.xrel},x=y,w.tickFormat(n.format(","))):(v=function(t){return t.x},x=m,w.tickFormat(b)),x.range([0,f]),(r.isEqual(x.domain(),[0,1])||r.isEqual(x.domain(),[new Date(0),new Date(1)])||g.recalcXDomain)&&(z=[n.min(F,function(t){return n.min(t.data,function(t){return v(t)})}),n.max(F,function(t){return n.max(t.data,function(t){return v(t)})})],x.domain(z),S.x(x)),F.length>0){var i=r.find(F,function(t){return t.data.length>1}).data;L=i?x(v(i[1]))-x(v(i[0])):1}else L=1;d.subSampled=g.allowSampling&&1>L,"linear"===g.ySetting?(k=_,k.domain([n.min(F,function(t){return n.min(t.data,function(t){return t.y})}),n.max(F,function(t){return n.max(t.data,function(t){return t.y})})])):(k=M,k.domain([.1,n.max(F,function(t){return n.max(t.data,function(t){return t.y})})])),k.range([h,0])}T.selectAll(".x").call(w.scale(x)),T.selectAll(".y").call(E.scale(k)),q=T.selectAll(".serie").data(F,function(t){return t.cid}),q.enter().append("g").attr("class","serie").append("path").attr("class","line").style("stroke",function(t){return t.color}),q.exit().remove(),q.selectAll(".line").attr("d",function(t){return C(v)(o(t.data))}),L>6?(D=q.selectAll(".point").data(function(t){return o(t.data).map(function(e){return{x:v(e),y:e.y,c:t.color}})}),D.enter().append("circle").attr("class","point").attr("r","3px").style("fill",function(t){return t.c}),D.exit().remove(),D.attr("cx",function(t){return x(t.x)}).attr("cy",function(t){return k(t.y)})):q.selectAll(".point").remove(),j.attr("x2",f),A.attr("y2",h+20),R.attr("width",f).attr("height",h).moveToFront()}function i(data){var t=x.domain(),e=s(v)(data,t[0]),n=s(v)(data,t[1]);return data.slice(e,n)}function o(data){data=i(data);var t=1/L;return g.allowSampling&&t>1?data.filter(function(e,n){return n%Math.ceil(t)===0}):data}function a(t,e){var n=o(e.data),r=x.invert(t),i=s(v)(n,r),a=n[i-1],u=n[i];return void 0===a?u:void 0===u?a:r-v(a)>v(u)-r?u:a}function u(){var t=n.mouse(this),e=t[0],r=t[1],i=F.map(function(t){return a(e,t)}),o=i.map(function(t){return t?Math.pow(e-x(v(t)),2)+Math.pow(r-k(t.y),2):1/0}),u=o.indexOf(Math.min.apply(Math,o)),s=F[u],l=i[u];N.attr("transform","translate("+x(v(l))+","+k(l.y)+")").moveToFront(),N.select("circle").attr("stroke",s.color),N.select("text.name").text(s.name),N.select("text.value").text(n.format(",")(l.y)),O.attr("transform","translate("+x(v(l))+","+(h+34)+")").text("relative"===g.xSetting?n.format(",")(v(l)):n.time.format("%b %d %H:%M:%S")(v(l))).moveToFront(),j.attr("y1",k(l.y)).attr("y2",k(l.y)),A.attr("x1",x(v(l))).attr("x2",x(v(l)))}function s(t){return n.bisector(function(e){return t(e)}).left}function l(){d.recalcXDomain=!1,e(t)}var c={top:80,right:20,bottom:60,left:100},f=t.width-c.left-c.right,h=t.height-c.top-c.bottom,data=t.data,p=t.el,d=data.model,g=d.serialize(),v=function(t){return t.x},m=n.time.scale(),y=n.scale.linear(),b=n.time.format.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%b %e %H:%M",function(t){return t.getMinutes()}],["%b %e %H:%M",function(t){return t.getHours()}],["%b %e",function(t){return t.getDay()&&1!=t.getDate()}],["%b %e",function(t){return 1!=t.getDate()}],["%Y",function(t){return t.getMonth()}],["%Y",function(){return!0}]]),x="relative"===g.xSetting?y:m,w=n.svg.axis().scale(x).ticks(10).orient("bottom"),_=n.scale.linear().range([h,0]),M=n.scale.log().clamp(!0).range([h,0]).nice(),k="linear"===g.ySetting?_:M,E=n.svg.axis().scale(k).orient("left"),C=function(t){return n.svg.line().x(function(e){return x(t(e))}).y(function(t){return k(t.y)})},S=n.behavior.zoom().scaleExtent([1,50]).x(x).on("zoom",l),T=n.select(p).append("g").attr("transform","translate("+c.left+","+c.top+")").call(S);T.append("g").attr("class","x axis").attr("transform","translate(0,"+h+")"),T.append("g").attr("class","y axis");var j=T.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("x1",0),A=T.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("y1",0),N=T.append("g").attr("class","focus").style("display","none");N.append("circle").attr("r",6).attr("fill","none").attr("stroke-width",2);var O=T.append("text").attr("text-anchor","middle").attr("class","xlabel").attr("font-size","0.8em").attr("fill","#bbb");N.append("text").attr("class","name").attr("fill","black").attr("x",9).attr("dy","-.8em"),N.append("text").attr("class","value").attr("fill","black").attr("font-size","20px").attr("x",8).attr("dy","-1.2em");var q,D,L,F,z,R=T.append("rect").attr("class","windshield").style("opacity",0).on("mouseover",function(){j.style("display",null),A.style("display",null),N.style("display",null),O.style("display",null)}).on("mouseout",function(){N.style("display","none"),j.style("display","none"),A.style("display","none"),O.style("display","none")}).on("mousemove",u);return e}},{d3:56,debug:57,lodash:62}]},{},[1]);
+!function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){var r=(window.$=window.jQuery=e("jquery"),e("../views/app")),o=e("../models/app");e("debug")("index");e("bootstrap/js/dropdown"),e("bootstrap/js/collapse"),e("bootstrap/js/transition"),e("bootstrap/js/button");var data="### INSERT DATA HERE ###",i=window.app=new o(data,{parse:!0}),a=document.getElementById("app"),s=new r({model:i,el:a});s.render()},{"../models/app":2,"../views/app":286,"bootstrap/js/button":274,"bootstrap/js/collapse":275,"bootstrap/js/dropdown":276,"bootstrap/js/transition":277,debug:280,jquery:284}],2:[function(e,t,n){var r=e("ampersand-state"),o=e("./chart"),i=e("./stat-collection"),a=e("./sidebar"),s=e("lodash"),u=e("debug")("model:app");t.exports=r.extend({children:{sidebar:a,chart:o},collections:{stats:i},props:{selectionState:{type:"array","default":function(){return[]}}},parse:function(e,t){var n=(new Date).getFullYear(),r={},o=s.map(e.series,function(e){if(-1!==e.key.indexOf(":"))var t=e.key.split(":"),o=t[0].trim(),i=t[1].trim();else var o="stats",i=e.key;var data=s.sortBy(s.map(e.values,function(e,t){var r=t.split(" ");r.splice(2,0,n.toString());var o=r.join(" ");return{x:new Date(o),y:e}}),"x"),a=Math.min.apply(null,data.map(function(e){return e.x}));return data.forEach(function(e){e.xrel=(e.x-a)/1e3}),r[o]=!0,{group:o,name:i,data:data}});r=s.keys(r).map(function(e){return{title:e}});var i={stats:o,sidebar:{panels:r}};return i},initialize:function(e,t){var n=this.sidebar.panels;n.each(function(e){e.app=this}.bind(this)),this.stats.each(function(e){e.app=this,n.get(e.group).stats.add(e)}.bind(this))},clearSelectionState:function(){this.selectionState=[],u("clear")},toggleAllExcept:function(e){this.stats.filter(function(t){return t!==e}).some(function(e){return e.selected});0!==this.selectionState.length&&e.selected?(this.stats.each(function(e,t){e.selected=this.selectionState.length?this.selectionState[t]:!0}.bind(this)),this.clearSelectionState()):(this.selectionState=this.stats.map(function(e){return e.selected}),this.stats.each(function(t){t.selected=t===e}))}})},{"./chart":3,"./sidebar":7,"./stat-collection":8,"ampersand-state":47,debug:280,lodash:285}],3:[function(e,t,n){var r=e("ampersand-state"),o=e("lodash");e("debug")("model:chart"),t.exports=r.extend({props:{xSetting:{type:"string","default":"relative",values:["relative","absolute"]},ySetting:{type:"string","default":"linear",values:["linear","log-scale"]},allowSampling:{type:"boolean","default":!0},subSampled:{type:"boolean","default":!1},recalcXDomain:{type:"boolean","default":!0}},derived:{series:{deps:["parent"],cache:!1,fn:function(){var e=this.parent.stats.filter(function(e){return e.selected}).map(function(e){return o.pick(e,["color","data","name","cid","selected"])});return e}},empty:{deps:["parent","series"],cache:!1,fn:function(){return 0===this.series.length}}}})},{"ampersand-state":47,debug:280,lodash:285}],4:[function(e,t,n){var r=e("d3");t.exports=function(){function e(){var e=r.scale.category20();return e}var t;return{getInstance:function(){return t||(t=e()),t}}}()},{d3:279}],5:[function(e,t,n){var r=e("ampersand-state"),o=e("./stat-collection");e("debug")("model:panel"),t.exports=r.extend({collections:{stats:o},props:{title:{type:"string",required:!0},open:{type:"boolean","default":!1},app:{type:"object"}},derived:{selected:{deps:["stats"],cache:!1,fn:function(){var e=this.stats.filter(function(e){return e.selected});return e.length===this.stats.length?"all":0===e.length?"none":"some"}},suptitle:{deps:["title"],cache:!1,fn:function(){var e=this.title.split(" ");return e.length>1?e[0]:""}},subtitle:{deps:["title"],fn:function(){var e=this.title.split(" ");return e.length>1?e[1]:this.title}}}})},{"./stat-collection":8,"ampersand-state":47,debug:280}],6:[function(e,t,n){var r=e("ampersand-state");e("debug")("model:search"),t.exports=r.extend({props:{content:{type:"string","default":""}},derived:{empty:{deps:["content"],fn:function(){return""===this.content}}}})},{"ampersand-state":47,debug:280}],7:[function(e,t,n){var r=e("ampersand-state"),o=e("ampersand-collection"),i=e("./search"),a=e("./panel"),s=(e("lodash"),e("debug")("model:sidebar"),o.extend({mainIndex:"title",model:a}));t.exports=r.extend({children:{search:i},collections:{panels:s}})},{"./panel":5,"./search":6,"ampersand-collection":12,"ampersand-state":47,debug:280,lodash:285}],8:[function(e,t,n){var r=e("ampersand-collection"),o=e("ampersand-collection-underscore-mixin"),i=e("./stat");t.exports=r.extend(o,{comparator:"name",model:i})},{"./stat":9,"ampersand-collection":12,"ampersand-collection-underscore-mixin":10}],9:[function(e,t,n){var r=e("ampersand-state"),o=e("./colors").getInstance();e("debug")("model:stat"),t.exports=r.extend({props:{name:{type:"string","default":""},group:{type:"string","default":""},selected:{type:"boolean","default":!1},data:{type:"object"},app:{type:"object"}},derived:{color:{cache:!0,fn:function(){return o(this.cid)}}}})},{"./colors":4,"ampersand-state":47,debug:280}],10:[function(e,t,n){"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-underscore-mixin"]=window.ampersand["ampersand-collection-underscore-mixin"]||[],window.ampersand["ampersand-collection-underscore-mixin"].push("1.0.4"));var r=e("underscore"),o=[].slice,i={},a=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample","partition"];r.each(a,function(e){r[e]&&(i[e]=function(){var t=o.call(arguments);return t.unshift(this.models),r[e].apply(r,t)})});var s=["groupBy","countBy","sortBy","indexBy"];r.each(s,function(e){r[e]&&(i[e]=function(t,n){var o=r.isFunction(t)?t:function(e){return e.get?e.get(t):e[t]};return r[e](this.models,o,n)})}),i.where=function(e,t){return r.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){var n;for(var r in e)if(n=t.get?t.get(r):t[r],e[r]!==n)return!1;return!0})},i.findWhere=function(e){return this.where(e,!0)},i.pluck=function(e){return r.invoke(this.models,"get",e)},t.exports=i},{underscore:11}],11:[function(e,t,n){(function(){function e(e){function t(t,n,r,o,i,a){for(;i>=0&&a>i;i+=e){var s=o?o[i]:i;r=n(r,t[s],s,t)}return r}return function(n,r,o,i){r=_(r,i,4);var a=!S(n)&&w.keys(n),s=(a||n).length,u=e>0?0:s-1;return arguments.length<3&&(o=n[a?a[u]:u],u+=e),t(n,r,o,a,u,s)}}function r(e){return function(t,n,r){n=b(n,r);for(var o=C(t),i=e>0?0:o-1;i>=0&&o>i;i+=e)if(n(t[i],i,t))return i;return-1}}function o(e,t,n){return function(r,o,i){var a=0,s=C(r);if("number"==typeof i)e>0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return i=n(r,o),r[i]===o?i:-1;if(o!==o)return i=t(f.call(r,a,s),w.isNaN),i>=0?i+a:-1;for(i=e>0?a:s-1;i>=0&&s>i;i+=e)if(r[i]===o)return i;return-1}}function i(e,t){var n=q.length,r=e.constructor,o=w.isFunction(r)&&r.prototype||l,i="constructor";for(w.has(e,i)&&!w.contains(t,i)&&t.push(i);n--;)i=q[n],i in e&&e[i]!==o[i]&&!w.contains(t,i)&&t.push(i)}var a=this,s=a._,u=Array.prototype,l=Object.prototype,c=Function.prototype,d=u.push,f=u.slice,h=l.toString,p=l.hasOwnProperty,m=Array.isArray,g=Object.keys,v=c.bind,y=Object.create,x=function(){},w=function(e){return e instanceof w?e:this instanceof w?void(this._wrapped=e):new w(e)};"undefined"!=typeof n?("undefined"!=typeof t&&t.exports&&(n=t.exports=w),n._=w):a._=w,w.VERSION="1.8.3";var _=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)}}return function(){return e.apply(t,arguments)}},b=function(e,t,n){return null==e?w.identity:w.isFunction(e)?_(e,t,n):w.isObject(e)?w.matcher(e):w.property(e)};w.iteratee=function(e,t){return b(e,t,1/0)};var k=function(e,t){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var o=1;r>o;o++)for(var i=arguments[o],a=e(i),s=a.length,u=0;s>u;u++){var l=a[u];t&&void 0!==n[l]||(n[l]=i[l])}return n}},j=function(e){if(!w.isObject(e))return{};if(y)return y(e);x.prototype=e;var t=new x;return x.prototype=null,t},M=function(e){return function(t){return null==t?void 0:t[e]}},E=Math.pow(2,53)-1,C=M("length"),S=function(e){var t=C(e);return"number"==typeof t&&t>=0&&E>=t};w.each=w.forEach=function(e,t,n){t=_(t,n);var r,o;if(S(e))for(r=0,o=e.length;o>r;r++)t(e[r],r,e);else{var i=w.keys(e);for(r=0,o=i.length;o>r;r++)t(e[i[r]],i[r],e)}return e},w.map=w.collect=function(e,t,n){t=b(t,n);for(var r=!S(e)&&w.keys(e),o=(r||e).length,i=Array(o),a=0;o>a;a++){var s=r?r[a]:a;i[a]=t(e[s],s,e)}return i},w.reduce=w.foldl=w.inject=e(1),w.reduceRight=w.foldr=e(-1),w.find=w.detect=function(e,t,n){var r;return r=S(e)?w.findIndex(e,t,n):w.findKey(e,t,n),void 0!==r&&-1!==r?e[r]:void 0},w.filter=w.select=function(e,t,n){var r=[];return t=b(t,n),w.each(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r},w.reject=function(e,t,n){return w.filter(e,w.negate(b(t)),n)},w.every=w.all=function(e,t,n){t=b(t,n);for(var r=!S(e)&&w.keys(e),o=(r||e).length,i=0;o>i;i++){var a=r?r[i]:i;if(!t(e[a],a,e))return!1}return!0},w.some=w.any=function(e,t,n){t=b(t,n);for(var r=!S(e)&&w.keys(e),o=(r||e).length,i=0;o>i;i++){var a=r?r[i]:i;if(t(e[a],a,e))return!0}return!1},w.contains=w.includes=w.include=function(e,t,n,r){return S(e)||(e=w.values(e)),("number"!=typeof n||r)&&(n=0),w.indexOf(e,t,n)>=0},w.invoke=function(e,t){var n=f.call(arguments,2),r=w.isFunction(t);return w.map(e,function(e){var o=r?t:e[t];return null==o?o:o.apply(e,n)})},w.pluck=function(e,t){return w.map(e,w.property(t))},w.where=function(e,t){return w.filter(e,w.matcher(t))},w.findWhere=function(e,t){return w.find(e,w.matcher(t))},w.max=function(e,t,n){var r,o,i=-(1/0),a=-(1/0);if(null==t&&null!=e){e=S(e)?e:w.values(e);for(var s=0,u=e.length;u>s;s++)r=e[s],r>i&&(i=r)}else t=b(t,n),w.each(e,function(e,n,r){o=t(e,n,r),(o>a||o===-(1/0)&&i===-(1/0))&&(i=e,a=o)});return i},w.min=function(e,t,n){var r,o,i=1/0,a=1/0;if(null==t&&null!=e){e=S(e)?e:w.values(e);for(var s=0,u=e.length;u>s;s++)r=e[s],i>r&&(i=r)}else t=b(t,n),w.each(e,function(e,n,r){o=t(e,n,r),(a>o||o===1/0&&i===1/0)&&(i=e,a=o)});return i},w.shuffle=function(e){for(var t,n=S(e)?e:w.values(e),r=n.length,o=Array(r),i=0;r>i;i++)t=w.random(0,i),t!==i&&(o[i]=o[t]),o[t]=n[i];return o},w.sample=function(e,t,n){return null==t||n?(S(e)||(e=w.values(e)),e[w.random(e.length-1)]):w.shuffle(e).slice(0,Math.max(0,t))},w.sortBy=function(e,t,n){return t=b(t,n),w.pluck(w.map(e,function(e,n,r){return{value:e,index:n,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return e.index-t.index}),"value")};var T=function(e){return function(t,n,r){var o={};return n=b(n,r),w.each(t,function(r,i){var a=n(r,i,t);e(o,r,a)}),o}};w.groupBy=T(function(e,t,n){w.has(e,n)?e[n].push(t):e[n]=[t]}),w.indexBy=T(function(e,t,n){e[n]=t}),w.countBy=T(function(e,t,n){w.has(e,n)?e[n]++:e[n]=1}),w.toArray=function(e){return e?w.isArray(e)?f.call(e):S(e)?w.map(e,w.identity):w.values(e):[]},w.size=function(e){return null==e?0:S(e)?e.length:w.keys(e).length},w.partition=function(e,t,n){t=b(t,n);var r=[],o=[];return w.each(e,function(e,n,i){(t(e,n,i)?r:o).push(e)}),[r,o]},w.first=w.head=w.take=function(e,t,n){return null!=e?null==t||n?e[0]:w.initial(e,e.length-t):void 0},w.initial=function(e,t,n){return f.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},w.last=function(e,t,n){return null!=e?null==t||n?e[e.length-1]:w.rest(e,Math.max(0,e.length-t)):void 0},w.rest=w.tail=w.drop=function(e,t,n){return f.call(e,null==t||n?1:t)},w.compact=function(e){return w.filter(e,w.identity)};var A=function(e,t,n,r){for(var o=[],i=0,a=r||0,s=C(e);s>a;a++){var u=e[a];if(S(u)&&(w.isArray(u)||w.isArguments(u))){t||(u=A(u,t,n));var l=0,c=u.length;for(o.length+=c;c>l;)o[i++]=u[l++]}else n||(o[i++]=u)}return o};w.flatten=function(e,t){return A(e,t,!1)},w.without=function(e){return w.difference(e,f.call(arguments,1))},w.uniq=w.unique=function(e,t,n,r){w.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=b(n,r));for(var o=[],i=[],a=0,s=C(e);s>a;a++){var u=e[a],l=n?n(u,a,e):u;t?(a&&i===l||o.push(u),i=l):n?w.contains(i,l)||(i.push(l),o.push(u)):w.contains(o,u)||o.push(u)}return o},w.union=function(){return w.uniq(A(arguments,!0,!0))},w.intersection=function(e){for(var t=[],n=arguments.length,r=0,o=C(e);o>r;r++){var i=e[r];if(!w.contains(t,i)){for(var a=1;n>a&&w.contains(arguments[a],i);a++);a===n&&t.push(i)}}return t},w.difference=function(e){var t=A(arguments,!0,!0,1);return w.filter(e,function(e){return!w.contains(t,e)})},w.zip=function(){return w.unzip(arguments)},w.unzip=function(e){for(var t=e&&w.max(e,C).length||0,n=Array(t),r=0;t>r;r++)n[r]=w.pluck(e,r);return n},w.object=function(e,t){for(var n={},r=0,o=C(e);o>r;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},w.findIndex=r(1),w.findLastIndex=r(-1),w.sortedIndex=function(e,t,n,r){n=b(n,r,1);for(var o=n(t),i=0,a=C(e);a>i;){var s=Math.floor((i+a)/2);n(e[s])<o?i=s+1:a=s}return i},w.indexOf=o(1,w.findIndex,w.sortedIndex),w.lastIndexOf=o(-1,w.findLastIndex),w.range=function(e,t,n){null==t&&(t=e||0,e=0),n=n||1;for(var r=Math.max(Math.ceil((t-e)/n),0),o=Array(r),i=0;r>i;i++,e+=n)o[i]=e;return o};var N=function(e,t,n,r,o){if(!(r instanceof t))return e.apply(n,o);var i=j(e.prototype),a=e.apply(i,o);return w.isObject(a)?a:i};w.bind=function(e,t){if(v&&e.bind===v)return v.apply(e,f.call(arguments,1));if(!w.isFunction(e))throw new TypeError("Bind must be called on a function");var n=f.call(arguments,2),r=function(){return N(e,r,t,this,n.concat(f.call(arguments)))};return r},w.partial=function(e){var t=f.call(arguments,1),n=function(){for(var r=0,o=t.length,i=Array(o),a=0;o>a;a++)i[a]=t[a]===w?arguments[r++]:t[a];for(;r<arguments.length;)i.push(arguments[r++]);return N(e,n,this,this,i)};return n},w.bindAll=function(e){var t,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(t=1;r>t;t++)n=arguments[t],e[n]=w.bind(e[n],e);return e},w.memoize=function(e,t){var n=function(r){var o=n.cache,i=""+(t?t.apply(this,arguments):r);return w.has(o,i)||(o[i]=e.apply(this,arguments)),o[i]};return n.cache={},n},w.delay=function(e,t){var n=f.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},w.defer=w.partial(w.delay,w,1),w.throttle=function(e,t,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:w.now(),a=null,i=e.apply(r,o),a||(r=o=null)};return function(){var l=w.now();s||n.leading!==!1||(s=l);var c=t-(l-s);return r=this,o=arguments,0>=c||c>t?(a&&(clearTimeout(a),a=null),s=l,i=e.apply(r,o),a||(r=o=null)):a||n.trailing===!1||(a=setTimeout(u,c)),i}},w.debounce=function(e,t,n){var r,o,i,a,s,u=function(){var l=w.now()-a;t>l&&l>=0?r=setTimeout(u,t-l):(r=null,n||(s=e.apply(i,o),r||(i=o=null)))};return function(){i=this,o=arguments,a=w.now();var l=n&&!r;return r||(r=setTimeout(u,t)),l&&(s=e.apply(i,o),i=o=null),s}},w.wrap=function(e,t){return w.partial(t,e)},w.negate=function(e){return function(){return!e.apply(this,arguments)}},w.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},w.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},w.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},w.once=w.partial(w.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),q=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];w.keys=function(e){if(!w.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)w.has(e,n)&&t.push(n);return O&&i(e,t),t},w.allKeys=function(e){if(!w.isObject(e))return[];var t=[];for(var n in e)t.push(n);return O&&i(e,t),t},w.values=function(e){for(var t=w.keys(e),n=t.length,r=Array(n),o=0;n>o;o++)r[o]=e[t[o]];return r},w.mapObject=function(e,t,n){t=b(t,n);for(var r,o=w.keys(e),i=o.length,a={},s=0;i>s;s++)r=o[s],a[r]=t(e[r],r,e);return a},w.pairs=function(e){for(var t=w.keys(e),n=t.length,r=Array(n),o=0;n>o;o++)r[o]=[t[o],e[t[o]]];return r},w.invert=function(e){for(var t={},n=w.keys(e),r=0,o=n.length;o>r;r++)t[e[n[r]]]=n[r];return t},w.functions=w.methods=function(e){var t=[];for(var n in e)w.isFunction(e[n])&&t.push(n);return t.sort()},w.extend=k(w.allKeys),w.extendOwn=w.assign=k(w.keys),w.findKey=function(e,t,n){t=b(t,n);for(var r,o=w.keys(e),i=0,a=o.length;a>i;i++)if(r=o[i],t(e[r],r,e))return r},w.pick=function(e,t,n){var r,o,i={},a=e;if(null==a)return i;w.isFunction(t)?(o=w.allKeys(a),r=_(t,n)):(o=A(arguments,!1,!1,1),r=function(e,t,n){return t in n},a=Object(a));for(var s=0,u=o.length;u>s;s++){var l=o[s],c=a[l];r(c,l,a)&&(i[l]=c)}return i},w.omit=function(e,t,n){if(w.isFunction(t))t=w.negate(t);else{var r=w.map(A(arguments,!1,!1,1),String);t=function(e,t){return!w.contains(r,t)}}return w.pick(e,t,n)},w.defaults=k(w.allKeys,!0),w.create=function(e,t){var n=j(e);return t&&w.extendOwn(n,t),n},w.clone=function(e){return w.isObject(e)?w.isArray(e)?e.slice():w.extend({},e):e},w.tap=function(e,t){return t(e),e},w.isMatch=function(e,t){var n=w.keys(t),r=n.length;if(null==e)return!r;for(var o=Object(e),i=0;r>i;i++){var a=n[i];if(t[a]!==o[a]||!(a in o))return!1}return!0};var D=function(e,t,n,r){if(e===t)return 0!==e||1/e===1/t;if(null==e||null==t)return e===t;e instanceof w&&(e=e._wrapped),t instanceof w&&(t=t._wrapped);var o=h.call(e);if(o!==h.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!==+e?+t!==+t:0===+e?1/+e===1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(w.isFunction(a)&&a instanceof a&&w.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!D(e[u],t[u],n,r))return!1}else{var l,c=w.keys(e);if(u=c.length,w.keys(t).length!==u)return!1;for(;u--;)if(l=c[u],!w.has(t,l)||!D(e[l],t[l],n,r))return!1}return n.pop(),r.pop(),!0};w.isEqual=function(e,t){return D(e,t)},w.isEmpty=function(e){return null==e?!0:S(e)&&(w.isArray(e)||w.isString(e)||w.isArguments(e))?0===e.length:0===w.keys(e).length},w.isElement=function(e){return!(!e||1!==e.nodeType)},w.isArray=m||function(e){return"[object Array]"===h.call(e)},w.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},w.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){w["is"+e]=function(t){return h.call(t)==="[object "+e+"]"}}),w.isArguments(arguments)||(w.isArguments=function(e){return w.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(w.isFunction=function(e){return"function"==typeof e||!1}),w.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},w.isNaN=function(e){return w.isNumber(e)&&e!==+e},w.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"===h.call(e)},w.isNull=function(e){return null===e},w.isUndefined=function(e){return void 0===e},w.has=function(e,t){return null!=e&&p.call(e,t)},w.noConflict=function(){return a._=s,this},w.identity=function(e){return e},w.constant=function(e){return function(){return e}},w.noop=function(){},w.property=M,w.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},w.matcher=w.matches=function(e){return e=w.extendOwn({},e),function(t){return w.isMatch(t,e)}},w.times=function(e,t,n){var r=Array(Math.max(0,e));t=_(t,n,1);for(var o=0;e>o;o++)r[o]=t(o);return r},w.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},w.now=Date.now||function(){return(new Date).getTime()};var L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},F=w.invert(L),z=function(e){var t=function(t){return e[t]},n="(?:"+w.keys(e).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(o,t):e}};w.escape=z(L),w.unescape=z(F),w.result=function(e,t,n){var r=null==e?void 0:e[t];return void 0===r&&(r=n),w.isFunction(r)?r.call(e):r};var R=0;w.uniqueId=function(e){var t=++R+"";return e?e+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,I={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,$=function(e){return"\\"+I[e]};w.template=function(e,t,n){!t&&n&&(t=n),t=w.defaults({},t,w.templateSettings);var r=RegExp([(t.escape||P).source,(t.interpolate||P).source,(t.evaluate||P).source].join("|")+"|$","g"),o=0,i="__p+='";e.replace(r,function(t,n,r,a,s){return i+=e.slice(o,s).replace(H,$),o=s+t.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(s){throw s.source=i,s}var u=function(data){return a.call(this,data,w)},l=t.variable||"obj";return u.source="function("+l+"){\n"+i+"}",u},w.chain=function(e){var t=w(e);return t._chain=!0,t};var B=function(e,t){return e._chain?w(t).chain():t};w.mixin=function(e){w.each(w.functions(e),function(t){var n=w[t]=e[t];w.prototype[t]=function(){var e=[this._wrapped];return d.apply(e,arguments),B(this,n.apply(w,e))}})},w.mixin(w),w.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=u[e];w.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],B(this,n)}}),w.each(["concat","join","slice"],function(e){var t=u[e];w.prototype[e]=function(){return B(this,t.apply(this._wrapped,arguments))}}),w.prototype.value=function(){return this._wrapped},w.prototype.valueOf=w.prototype.toJSON=w.prototype.value,w.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return w})}).call(this)},{}],12:[function(e,t,n){function r(e,t){if(t||(t={}),t.model&&(this.model=t.model),t.comparator&&(this.comparator=t.comparator),t.parent&&(this.parent=t.parent),!this.mainIndex){var n=this.model&&this.model.prototype&&this.model.prototype.idAttribute;this.mainIndex=n||"id"}this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,u({silent:!0},t))}var o=e("ampersand-events"),i=e("ampersand-class-extend"),a=e("lodash.isarray"),s=e("lodash.bind"),u=e("lodash.assign"),l=[].slice;u(r.prototype,o,{initialize:function(){},isModel:function(e){return this.model&&e instanceof this.model},add:function(e,t){return this.set(e,u({merge:!1,add:!0,remove:!1},t))},parse:function(e,t){return e},serialize:function(){return this.map(function(e){if(e.serialize)return e.serialize();var t={};return u(t,e),delete t.collection,t})},toJSON:function(){return this.serialize()},set:function(e,t){t=u({add:!0,remove:!0,merge:!0},t),t.parse&&(e=this.parse(e,t));var n=!a(e);e=n?e?[e]:[]:e.slice();var r,o,i,s,l,c,d,f=t.at,h=this.comparator&&null==f&&t.sort!==!1,p="string"==typeof this.comparator?this.comparator:null,m=[],g=[],v={},y=t.add,x=t.merge,w=t.remove,_=!h&&y&&w?[]:!1,b=this.model&&this.model.prototype||Object.prototype;for(c=0,d=e.length;d>c;c++){if(i=e[c]||{},this.isModel(i)?r=o=i:b.generateId?r=b.generateId(i):(r=i[this.mainIndex],void 0===r&&this._isDerivedIndex(b)&&(r=b._derived[this.mainIndex].fn.call(i))),s=this.get(r))w&&(v[s.cid||s[this.mainIndex]]=!0),x&&(i=i===o?o.attributes:i,t.parse&&(i=s.parse(i,t)),s.set?(s.set(i,t),h&&!l&&s.hasChanged(p)&&(l=!0)):u(s,i)),e[c]=s;else if(y){if(o=e[c]=this._prepareModel(i,t),!o)continue;m.push(o),this._addReference(o,t)}o=s||o,o&&(_&&(o.isNew&&o.isNew()||!o[this.mainIndex]||!v[o.cid||o[this.mainIndex]])&&_.push(o),v[o[this.mainIndex]]=!0)}if(w){for(c=0,d=this.length;d>c;c++)o=this.models[c],v[o.cid||o[this.mainIndex]]||g.push(o);g.length&&this.remove(g,t)}if(m.length||_&&_.length)if(h&&(l=!0),null!=f)for(c=0,d=m.length;d>c;c++)this.models.splice(f+c,0,m[c]);else{var k=_||m;for(c=0,d=k.length;d>c;c++)this.models.push(k[c])}if(l&&this.sort({silent:!0}),!t.silent){for(c=0,d=m.length;d>c;c++)o=m[c],o.trigger?o.trigger("add",o,this,t):this.trigger("add",o,this,t);(l||_&&_.length)&&this.trigger("sort",this,t)}return n?e[0]:e},get:function(e,t){if(null!=e){var n=this._indexes[t||this.mainIndex];return n&&(n[e]||n[e[this.mainIndex]])||this._indexes.cid[e]||this._indexes.cid[e.cid]}},at:function(e){return this.models[e]},remove:function(e,t){var n,r,o,i,s=!a(e);for(e=s?[e]:l.call(e),t||(t={}),n=0,r=e.length;r>n;n++)o=e[n]=this.get(e[n]),o&&(this._deIndex(o),i=this.models.indexOf(o),this.models.splice(i,1),t.silent||(t.index=i,o.trigger?o.trigger("remove",o,this,t):this.trigger("remove",o,this,t)),this._removeReference(o,t));return s?e[0]:e},reset:function(e,t){t||(t={});for(var n=0,r=this.models.length;r>n;n++)this._removeReference(this.models[n],t);return t.previousModels=this.models,this._reset(),e=this.add(e,u({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},sort:function(e){var t=this;if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),"string"==typeof this.comparator?this.models.sort(function(e,n){return e.get?(e=e.get(t.comparator),n=n.get(t.comparator)):(e=e[t.comparator],n=n[t.comparator]),e>n||void 0===e?1:n>e||void 0===n?-1:0}):1===this.comparator.length?this.models.sort(function(e,n){return e=t.comparator(e),n=t.comparator(n),e>n||void 0===e?1:n>e||void 0===n?-1:0}):this.models.sort(s(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},_reset:function(){var e=l.call(this.indexes||[]),t=0;e.push(this.mainIndex),e.push("cid");var n=e.length;for(this.models=[],this._indexes={};n>t;t++)this._indexes[e[t]]={}},_prepareModel:function(e,t){if(!this.model)return e;if(this.isModel(e))return e.collection||(e.collection=this),e;t=t?u({},t):{},t.collection=this;var n=new this.model(e,t);return n.validationError?(this.trigger("invalid",this,n.validationError,t),!1):n},_deIndex:function(e,t,n){var r;if(void 0!==t){if(void 0===this._indexes[t])throw new Error("Given attribute is not an index");return void delete this._indexes[t][n]}for(t in this._indexes)r=e.hasOwnProperty(t)?e[t]:e.get&&e.get(t),delete this._indexes[t][r]},_index:function(e,t){var n;if(void 0!==t){if(void 0===this._indexes[t])throw new Error("Given attribute is not an index");return n=e[t]||e.get&&e.get(t),void(n&&(this._indexes[t][n]=e))}for(t in this._indexes)n=e.hasOwnProperty(t)?e[t]:e.get&&e.get(t),null!=n&&(this._indexes[t][n]=e)},_isDerivedIndex:function(e){return e&&"object"==typeof e._derived?Object.keys(e._derived).indexOf(this.mainIndex)>=0:!1},_addReference:function(e,t){this._index(e),e.collection||(e.collection=this),e.on&&e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){this===e.collection&&delete e.collection,this._deIndex(e),e.off&&e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,r){var o=e.split(":")[0],i=e.split(":")[1];("add"!==o&&"remove"!==o||n===this)&&("destroy"===o&&this.remove(t,r),t&&"change"===o&&i&&this._indexes[i]&&(this._deIndex(t,i,t.previousAttributes()[i]),this._index(t,i)),this.trigger.apply(this,arguments))}}),Object.defineProperties(r.prototype,{length:{get:function(){return this.models.length}},isCollection:{value:!0}});var c=["indexOf","lastIndexOf","every","some","forEach","map","filter","reduce","reduceRight"];c.forEach(function(e){r.prototype[e]=function(){return this.models[e].apply(this.models,arguments)}}),r.prototype.each=r.prototype.forEach,r.extend=i,t.exports=r},{"ampersand-class-extend":13,"ampersand-events":14,"lodash.assign":30,"lodash.bind":40,"lodash.isarray":46}],13:[function(e,t,n){var r=e("lodash.assign"),o=function(e){var t,n=this,o=[].slice.call(arguments);t=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return n.apply(this,arguments)},r(t,n);var i=function(){this.constructor=t};return i.prototype=n.prototype,t.prototype=new i,e&&(o.unshift(t.prototype),r.apply(null,o)),t.__super__=n.prototype,t};t.exports=o},{"lodash.assign":30}],14:[function(e,t,n){"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-events"]=window.ampersand["ampersand-events"]||[],window.ampersand["ampersand-events"].push("1.1.1"));var r=e("lodash.once"),o=e("lodash.uniqueid"),i=e("lodash.keys"),a=e("lodash.isempty"),s=e("lodash.foreach"),u=(e("lodash.bind"),e("lodash.assign")),l=Array.prototype.slice,c=/\s+/,d={on:function(e,t,n){if(!f(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,n){if(!f(this,"once",e,[t,n])||!t)return this;var o=this,i=r(function(){o.off(e,i),t.apply(this,arguments)});return i._callback=t,this.on(e,i,n)},off:function(e,t,n){var r,o,a,s,u,l,c,d;if(!this._events||!f(this,"off",e,[t,n]))return this;if(!e&&!t&&!n)return this._events=void 0,this;for(s=e?[e]:i(this._events),u=0,l=s.length;l>u;u++)if(e=s[u],a=this._events[e]){if(this._events[e]=r=[],t||n)for(c=0,d=a.length;d>c;c++)o=a[c],(t&&t!==o.callback&&t!==o.callback._callback||n&&n!==o.context)&&r.push(o);r.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=l.call(arguments,1);if(!f(this,"trigger",e,t))return this;var n=this._events[e],r=this._events.all;return n&&h(n,t),r&&h(r,arguments),this},stopListening:function(e,t,n){var r=this._listeningTo;if(!r)return this;var o=!t&&!n;n||"object"!=typeof t||(n=this),e&&((r={})[e._listenId]=e);for(var i in r)e=r[i],e.off(t,n,this),(o||a(e._events))&&delete this._listeningTo[i];return this},createEmitter:function(e){return u(e||{},d)}};d.bind=d.on,d.unbind=d.off;var f=function(e,t,n,r){if(!n)return!0;if("object"==typeof n){for(var o in n)e[t].apply(e,[o,n[o]].concat(r));return!1}if(c.test(n)){for(var i=n.split(c),a=0,s=i.length;s>a;a++)e[t].apply(e,[i[a]].concat(r));return!1}return!0},h=function(e,t){var n,r=-1,o=e.length,i=t[0],a=t[1],s=t[2];switch(t.length){case 0:for(;++r<o;)(n=e[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i,a);return;case 3:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i,a,s);return;default:for(;++r<o;)(n=e[r]).callback.apply(n.ctx,t);return}},p={listenTo:"on",listenToOnce:"once"};s(p,function(e,t){d[t]=function(t,n,r,i){var a=this._listeningTo||(this._listeningTo={}),s=t._listenId||(t._listenId=o("l"));return a[s]=t,r||"object"!=typeof n||(r=this),t[e](n,r,this),this}}),d.listenToAndRun=function(e,t,n){return d.listenTo.apply(this,arguments),n||"object"!=typeof t||(n=this),n.apply(this),this},t.exports=d},{"lodash.assign":30,"lodash.bind":40,"lodash.foreach":15,"lodash.isempty":19,"lodash.keys":23,"lodash.once":26,"lodash.uniqueid":28}],15:[function(e,t,n){function r(e,t){return function(n,r,o){return"function"==typeof r&&void 0===o&&s(n)?e(n,r):t(n,a(r,o,3))}}var o=e("lodash._arrayeach"),i=e("lodash._baseeach"),a=e("lodash._bindcallback"),s=e("lodash.isarray"),u=r(o,i);
+t.exports=u},{"lodash._arrayeach":16,"lodash._baseeach":17,"lodash._bindcallback":18,"lodash.isarray":46}],16:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=r},{}],17:[function(e,t,n){function r(e,t){return h(e,t,c)}function o(e){return function(t){return null==t?void 0:t[e]}}function i(e,t){return function(n,r){var o=n?p(n):0;if(!s(o))return e(n,r);for(var i=t?o:-1,a=u(n);(t?i--:++i<o)&&r(a[i],i,a)!==!1;);return n}}function a(e){return function(t,n,r){for(var o=u(t),i=r(t),a=i.length,s=e?a:-1;e?s--:++s<a;){var l=i[s];if(n(o[l],l,o)===!1)break}return t}}function s(e){return"number"==typeof e&&e>-1&&e%1==0&&d>=e}function u(e){return l(e)?e:Object(e)}function l(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var c=e("lodash.keys"),d=9007199254740991,f=i(r),h=a(),p=o("length");t.exports=f},{"lodash.keys":23}],18:[function(e,t,n){function r(e,t,n){if("function"!=typeof e)return o;if(void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)};case 5:return function(n,r,o,i,a){return e.call(t,n,r,o,i,a)}}return function(){return e.apply(t,arguments)}}function o(e){return e}t.exports=r},{}],19:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e){return function(t){return null==t?void 0:t[e]}}function i(e){return null!=e&&a(p(e))}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&h>=e}function s(e){return null==e?!0:i(e)&&(l(e)||d(e)||u(e)||r(e)&&c(e.splice))?!e.length:!f(e).length}var u=e("lodash.isarguments"),l=e("lodash.isarray"),c=e("lodash.isfunction"),d=e("lodash.isstring"),f=e("lodash.keys"),h=9007199254740991,p=o("length");t.exports=s},{"lodash.isarguments":20,"lodash.isarray":46,"lodash.isfunction":21,"lodash.isstring":22,"lodash.keys":23}],20:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e){return function(t){return null==t?void 0:t[e]}}function i(e){return null!=e&&a(f(e))}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&d>=e}function s(e){return r(e)&&i(e)&&l.call(e,"callee")&&!c.call(e,"callee")}var u=Object.prototype,l=u.hasOwnProperty,c=u.propertyIsEnumerable,d=9007199254740991,f=o("length");t.exports=s},{}],21:[function(e,t,n){function r(e){return o(e)&&s.call(e)==i}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var i="[object Function]",a=Object.prototype,s=a.toString;t.exports=r},{}],22:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e){return"string"==typeof e||r(e)&&s.call(e)==i}var i="[object String]",a=Object.prototype,s=a.toString;t.exports=o},{}],23:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}function o(e){return null!=e&&a(y(e))}function i(e,t){return e="number"==typeof e||h.test(e)?+e:-1,t=null==t?v:t,e>-1&&e%1==0&&t>e}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&v>=e}function s(e){for(var t=l(e),n=t.length,r=n&&e.length,o=!!r&&a(r)&&(f(e)||d(e)),s=-1,u=[];++s<n;){var c=t[s];(o&&i(c,r)||m.call(e,c))&&u.push(c)}return u}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){if(null==e)return[];u(e)||(e=Object(e));var t=e.length;t=t&&a(t)&&(f(e)||d(e))&&t||0;for(var n=e.constructor,r=-1,o="function"==typeof n&&n.prototype===e,s=Array(t),l=t>0;++r<t;)s[r]=r+"";for(var c in e)l&&i(c,t)||"constructor"==c&&(o||!m.call(e,c))||s.push(c);return s}var c=e("lodash._getnative"),d=e("lodash.isarguments"),f=e("lodash.isarray"),h=/^\d+$/,p=Object.prototype,m=p.hasOwnProperty,g=c(Object,"keys"),v=9007199254740991,y=r("length"),x=g?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&o(e)?s(e):u(e)?g(e):[]}:s;t.exports=x},{"lodash._getnative":24,"lodash.isarguments":25,"lodash.isarray":46}],24:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function i(e){return a(e)&&h.call(e)==u}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null==e?!1:i(e)?p.test(d.call(e)):r(e)&&l.test(e)}var u="[object Function]",l=/^\[object .+?Constructor\]$/,c=Object.prototype,d=Function.prototype.toString,f=c.hasOwnProperty,h=c.toString,p=RegExp("^"+d.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=o},{}],25:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],26:[function(e,t,n){function r(e){return o(2,e)}var o=e("lodash.before");t.exports=r},{"lodash.before":27}],27:[function(e,t,n){function r(e,t){var n;if("function"!=typeof t){if("function"!=typeof e)throw new TypeError(o);var r=e;e=t,t=r}return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=void 0),n}}var o="Expected a function";t.exports=r},{}],28:[function(e,t,n){function r(e){var t=++i;return o(e)+t}var o=e("lodash._basetostring"),i=0;t.exports=r},{"lodash._basetostring":29}],29:[function(e,t,n){function r(e){return null==e?"":e+""}t.exports=r},{}],30:[function(e,t,n){function r(e,t,n){for(var r=-1,o=a(t),i=o.length;++r<i;){var s=o[r],u=e[s],l=n(u,t[s],s,e,t);(l===l?l===u:u!==u)&&(void 0!==u||s in e)||(e[s]=l)}return e}var o=e("lodash._baseassign"),i=e("lodash._createassigner"),a=e("lodash.keys"),s=i(function(e,t,n){return n?r(e,t,n):o(e,t)});t.exports=s},{"lodash._baseassign":31,"lodash._createassigner":33,"lodash.keys":37}],31:[function(e,t,n){function r(e,t){return null==t?e:o(t,i(t),e)}var o=e("lodash._basecopy"),i=e("lodash.keys");t.exports=r},{"lodash._basecopy":32,"lodash.keys":37}],32:[function(e,t,n){function r(e,t,n){n||(n={});for(var r=-1,o=t.length;++r<o;){var i=t[r];n[i]=e[i]}return n}t.exports=r},{}],33:[function(e,t,n){function r(e){return a(function(t,n){var r=-1,a=null==t?0:n.length,s=a>2?n[a-2]:void 0,u=a>2?n[2]:void 0,l=a>1?n[a-1]:void 0;for("function"==typeof s?(s=o(s,l,5),a-=2):(s="function"==typeof l?l:void 0,a-=s?1:0),u&&i(n[0],n[1],u)&&(s=3>a?void 0:s,a=1);++r<a;){var c=n[r];c&&e(t,c,s)}return t})}var o=e("lodash._bindcallback"),i=e("lodash._isiterateecall"),a=e("lodash.restparam");t.exports=r},{"lodash._bindcallback":34,"lodash._isiterateecall":35,"lodash.restparam":36}],34:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],35:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}function o(e){return null!=e&&s(d(e))}function i(e,t){return e="number"==typeof e||l.test(e)?+e:-1,t=null==t?c:t,e>-1&&e%1==0&&t>e}function a(e,t,n){if(!u(n))return!1;var r=typeof t;if("number"==r?o(n)&&i(t,n.length):"string"==r&&t in n){var a=n[t];return e===e?e===a:a!==a}return!1}function s(e){return"number"==typeof e&&e>-1&&e%1==0&&c>=e}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var l=/^\d+$/,c=9007199254740991,d=r("length");t.exports=a},{}],36:[function(e,t,n){function r(e,t){if("function"!=typeof e)throw new TypeError(o);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,n[0],a);case 2:return e.call(this,n[0],n[1],a)}var s=Array(t+1);for(r=-1;++r<t;)s[r]=n[r];return s[t]=a,e.apply(this,s)}}var o="Expected a function",i=Math.max;t.exports=r},{}],37:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":38,"lodash.isarguments":39,"lodash.isarray":46}],38:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],39:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],40:[function(e,t,n){var r=e("lodash._createwrapper"),o=e("lodash._replaceholders"),i=e("lodash.restparam"),a=1,s=32,u=i(function(e,t,n){var i=a;if(n.length){var l=o(n,u.placeholder);i|=s}return r(e,i,t,n,l)});u.placeholder={},t.exports=u},{"lodash._createwrapper":41,"lodash._replaceholders":44,"lodash.restparam":45}],41:[function(e,t,n){(function(n){function r(e,t,n){for(var r=n.length,o=-1,i=E(e.length-r,0),a=-1,s=t.length,u=Array(s+i);++a<s;)u[a]=t[a];for(;++o<r;)u[n[o]]=e[o];for(;i--;)u[a++]=e[o++];return u}function o(e,t,n){for(var r=-1,o=n.length,i=-1,a=E(e.length-o,0),s=-1,u=t.length,l=Array(a+u);++i<a;)l[i]=e[i];for(var c=i;++s<u;)l[c+s]=t[s];for(;++r<o;)l[c+n[r]]=e[i++];return l}function i(e,t){function r(){var i=this&&this!==n&&this instanceof r?o:e;return i.apply(t,arguments)}var o=a(e);return r}function a(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=p(e.prototype),r=e.apply(n,t);return f(r)?r:n}}function s(e,t,i,u,l,c,f,p,j,M){function C(){for(var y=arguments.length,x=y,w=Array(y);x--;)w[x]=arguments[x];if(u&&(w=r(w,u,l)),c&&(w=o(w,c,f)),N||q){var k=C.placeholder,L=m(w,k);if(y-=L.length,M>y){var F=p?h(p):void 0,z=E(M-y,0),R=N?L:void 0,P=N?void 0:L,I=N?w:void 0,H=N?void 0:w;t|=N?_:b,t&=~(N?b:_),O||(t&=~(g|v));var $=s(e,t,i,I,R,H,P,F,j,z);return $.placeholder=k,$}}var B=T?i:this,V=A?B[e]:e;return p&&(w=d(w,p)),S&&j<w.length&&(w.length=j),this&&this!==n&&this instanceof C&&(V=D||a(e)),V.apply(B,w)}var S=t&k,T=t&g,A=t&v,N=t&x,O=t&y,q=t&w,D=A?void 0:a(e);return C}function u(e,t,r,o){function i(){for(var t=-1,a=arguments.length,l=-1,c=o.length,d=Array(c+a);++l<c;)d[l]=o[l];for(;a--;)d[l++]=arguments[++t];var f=this&&this!==n&&this instanceof i?u:e;return f.apply(s?r:this,d)}var s=t&g,u=a(e);return i}function l(e,t,n,r,o,a,l,c){var d=t&v;if(!d&&"function"!=typeof e)throw new TypeError(j);var f=r?r.length:0;if(f||(t&=~(_|b),r=o=void 0),f-=o?o.length:0,t&b){var h=r,p=o;r=o=void 0}var m=[e,t,n,r,o,h,p,a,l,c];if(m[9]=null==c?d?0:e.length:E(c-f,0)||0,t==g)var y=i(m[0],m[2]);else y=t!=_&&t!=(g|_)||m[4].length?s.apply(void 0,m):u.apply(void 0,m);return y}function c(e,t){return e="number"==typeof e||M.test(e)?+e:-1,t=null==t?S:t,e>-1&&e%1==0&&t>e}function d(e,t){for(var n=e.length,r=C(t.length,n),o=h(e);r--;){var i=t[r];e[r]=c(i,n)?o[i]:void 0}return e}function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var h=e("lodash._arraycopy"),p=e("lodash._basecreate"),m=e("lodash._replaceholders"),g=1,v=2,y=4,x=8,w=16,_=32,b=64,k=128,j="Expected a function",M=/^\d+$/,E=Math.max,C=Math.min,S=9007199254740991;t.exports=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":42,"lodash._basecreate":43,"lodash._replaceholders":44}],42:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}t.exports=r},{}],43:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var o=function(){function e(){}return function(t){if(r(t)){e.prototype=t;var n=new e;e.prototype=void 0}return n||{}}}();t.exports=o},{}],44:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,i=-1,a=[];++n<r;)e[n]===t&&(e[n]=o,a[++i]=n);return a}var o="__lodash_placeholder__";t.exports=r},{}],45:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],46:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e,t){var n=null==e?void 0:e[t];return u(n)?n:void 0}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&y>=e}function a(e){return s(e)&&m.call(e)==c}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function u(e){return null==e?!1:a(e)?g.test(h.call(e)):r(e)&&d.test(e)}var l="[object Array]",c="[object Function]",d=/^\[object .+?Constructor\]$/,f=Object.prototype,h=Function.prototype.toString,p=f.hasOwnProperty,m=f.toString,g=RegExp("^"+h.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=o(Array,"isArray"),y=9007199254740991,x=v||function(e){return r(e)&&i(e.length)&&m.call(e)==l};t.exports=x},{}],47:[function(e,t,n){"use strict";function r(e,t){t||(t={}),this.cid||(this.cid=s("state")),this._events={},this._values={},this._definition=Object.create(this._definition),t.parse&&(e=this.parse(e,t)),this.parent=t.parent,this.collection=t.collection,this._keyTree=new j,this._initCollections(),this._initChildren(),this._cache={},this._previousAttributes={},e&&this.set(e,u({silent:!0,initial:!0},t)),this._changed={},this._derived&&this._initDerived(),t.init!==!1&&this.initialize.apply(this,arguments)}function o(e,t,n,r){var o,i,a=e._definition[t]={};if(p(n))o=e._ensureValidType(n),o&&(a.type=o);else{if(Array.isArray(n)&&(i=n,n={type:i[0],required:i[1],"default":i[2]}),o=e._ensureValidType(n.type),o&&(a.type=o),n.required&&(a.required=!0),n["default"]&&"object"==typeof n["default"])throw new TypeError("The default value for "+t+" cannot be an object/array, must be a value or a function which returns a value/object/array");a["default"]=n["default"],a.allowNull=n.allowNull?n.allowNull:!1,n.setOnce&&(a.setOnce=!0),a.required&&void 0===a["default"]&&!a.setOnce&&(a["default"]=e._getDefaultForType(o)),a.test=n.test,a.values=n.values}return r&&(a.session=!0),o||(o=p(n)?n:n.type,console.warn("Invalid data type of `"+o+"` for `"+t+"` property. Use one of the default types or define your own")),Object.defineProperty(e,t,{set:function(e){this.set(t,e)},get:function(){if(!this._values)throw Error('You may be trying to `extend` a state object with "'+t+'" which has been defined in `props` on the object being extended');var e=this._values[t],n=this._dataTypes[a.type];return"undefined"!=typeof e?(n&&n.get&&(e=n.get(e)),e):(e=w(a,"default"),this._values[t]=e,e)}}),a}function i(e,t,n){var r=e._derived[t]={fn:v(n)?n:n.fn,cache:n.cache!==!1,depList:n.deps||[]};r.depList.forEach(function(n){e._deps[n]=b(e._deps[n]||[],[t])}),Object.defineProperty(e,t,{get:function(){return this._getDerivedProperty(t)},set:function(){throw new TypeError("`"+t+"` is a derived property, it can't be set directly.")}})}function a(e){var t,n=this;t=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return n.apply(this,arguments)},u(t,n);var r=function(){this.constructor=t};if(r.prototype=n.prototype,t.prototype=new r,t.prototype._derived=u({},n.prototype._derived),t.prototype._deps=u({},n.prototype._deps),t.prototype._definition=u({},n.prototype._definition),t.prototype._collections=u({},n.prototype._collections),t.prototype._children=u({},n.prototype._children),t.prototype._dataTypes=u({},n.prototype._dataTypes||C),e)for(var a=["dataTypes","props","session","derived","collections","children"],s=0;s<arguments.length;s++){var l=arguments[s];l.dataTypes&&f(l.dataTypes,function(e,n){t.prototype._dataTypes[n]=e}),l.props&&f(l.props,function(e,n){o(t.prototype,n,e)}),l.session&&f(l.session,function(e,n){o(t.prototype,n,e,!0)}),l.derived&&f(l.derived,function(e,n){i(t.prototype,n,e)}),l.collections&&f(l.collections,function(e,n){t.prototype._collections[n]=e}),l.children&&f(l.children,function(e,n){t.prototype._children[n]=e}),u(t.prototype,c(l,a))}return t.__super__=n.prototype,t}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[],window.ampersand["ampersand-state"].push("4.8.2"));var s=e("lodash.uniqueid"),u=e("lodash.assign"),l=function(e){return u({},e)},c=e("lodash.omit"),d=e("lodash.escape"),f=e("lodash.forown"),h=e("lodash.includes"),p=e("lodash.isstring"),m=e("lodash.isobject"),g=e("lodash.isdate"),v=e("lodash.isfunction"),y=e("lodash.isequal"),x=e("lodash.has"),w=e("lodash.result"),_=e("lodash.bind"),b=e("lodash.union"),k=e("ampersand-events"),j=e("key-tree-store"),M=e("array-next"),E=/^change:/;u(r.prototype,k,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return null==this.getId()},escape:function(e){return d(this.get(e))},isValid:function(e){return this._validate({},u(e||{},{validate:!0}))},parse:function(e,t){return e},serialize:function(e){var t=u({props:!0},e),n=this.getAttributes(t,!0);return f(this._children,function(e,t){n[t]=this[t].serialize()},this),f(this._collections,function(e,t){n[t]=this[t].serialize()},this),n},set:function(e,t,n){var r,o,i,a,s,u,l,c,d,f,p,g,v,y,x,_,b=this,k=this.extraProperties;if(m(e)||null===e?(d=e,n=t):(d={},d[e]=t),n=n||{},!this._validate(d,n))return!1;g=n.unset,p=n.silent,y=n.initial,o=[],r=this._changing,this._changing=!0,r||(this._previousAttributes=this.attributes,this._changed={});for(c in d){if(a=d[c],i=typeof a,v=this._values[c],s=this._definition[c],!s){if(this._children[c]||this._collections[c]){this[c].set(a,n);continue}if("ignore"===k)continue;if("reject"===k)throw new TypeError('No "'+c+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"');if("allow"===k)s=this._createPropertyDefinition(c,"any");else if(k)throw new TypeError('Invalid value for extraProperties: "'+k+'"')}if(_=this._getCompareForType(s.type),f=this._dataTypes[s.type],f&&f.set&&(u=f.set(a),a=u.val,i=u.type),s.test&&(l=s.test.call(this,a,i)))throw new TypeError("Property '"+c+"' failed validation with error: "+l);if(void 0===a&&s.required)throw new TypeError("Required property '"+c+"' must be of type "+s.type+". Tried to set "+a);if(null===a&&s.required&&!s.allowNull)throw new TypeError("Property '"+c+"' must be of type "+s.type+" (cannot be null). Tried to set "+a);if(s.type&&"any"!==s.type&&s.type!==i&&null!==a&&void 0!==a)throw new TypeError("Property '"+c+"' must be of type "+s.type+". Tried to set "+a);if(s.values&&!h(s.values,a)){var j=w(s,"default");if(g&&void 0!==j)a=j;else if(!g||g&&void 0!==a)throw new TypeError("Property '"+c+"' must be one of values: "+s.values.join(", ")+". Tried to set "+a)}if(x=!_(v,a,c),s.setOnce&&void 0!==v&&x&&!y)throw new TypeError("Property '"+c+"' can only be set once.");x?(o.push({prev:v,val:a,key:c}),b._changed[c]=a):delete b._changed[c]}if(o.forEach(function(e){b._previousAttributes[e.key]=e.prev,g?delete b._values[e.key]:b._values[e.key]=e.val}),!p&&o.length&&(b._pending=!0),p||o.forEach(function(e){b.trigger("change:"+e.key,b,e.val,n)}),r)return this;if(!p)for(;this._pending;)this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},get:function(e){return this[e]},toggle:function(e){var t=this._definition[e];if("boolean"===t.type)this[e]=!this[e];else{if(!t||!t.values)throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.");this[e]=M(t.values,this[e])}return this},previousAttributes:function(){return l(this._previousAttributes)},hasChanged:function(e){return null==e?!!Object.keys(this._changed).length:x(this._derived,e)?this._derived[e].depList.some(function(e){return this.hasChanged(e)},this):x(this._changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?l(this._changed):!1;var t,n,r,o=!1,i=this._changing?this._previousAttributes:this.attributes;for(var a in e)n=this._definition[a],n&&(r=this._getCompareForType(n.type),r(i[a],t=e[a])||((o||(o={}))[a]=t));return o},toJSON:function(){return this.serialize()},unset:function(e,t){var n=this;e=Array.isArray(e)?e:[e],e.forEach(function(e){var r=n._definition[e];if(r){var o;return r.required?(o=w(r,"default"),n.set(e,o,t)):n.set(e,o,u({},t,{unset:!0}))}})},clear:function(e){var t=this;return Object.keys(this.attributes).forEach(function(n){t.unset(n,e)}),this},previous:function(e){return null!=e&&Object.keys(this._previousAttributes).length?this._previousAttributes[e]:null},_getDefaultForType:function(e){var t=this._dataTypes[e];return t&&t["default"]},_getCompareForType:function(e){var t=this._dataTypes[e];return t&&t.compare?_(t.compare,this):y},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=u({},this.attributes,e);var n=this.validationError=this.validate(e,t)||null;return n?(this.trigger("invalid",this,n,u(t||{},{validationError:n})),!1):!0},_createPropertyDefinition:function(e,t,n){return o(this,e,t,n)},_ensureValidType:function(e){return h(["string","number","boolean","array","object","date","state","any"].concat(Object.keys(this._dataTypes)),e)?e:void 0},getAttributes:function(e,t){e=u({session:!1,props:!1,derived:!1},e||{});var n,r,o,i={};for(r in this._definition)o=this._definition[r],(e.session&&o.session||e.props&&!o.session)&&(n=t?this._values[r]:this[r],t&&n&&v(n.serialize)&&(n=n.serialize()),"undefined"==typeof n&&(n=w(o,"default")),"undefined"!=typeof n&&(i[r]=n));if(e.derived)for(r in this._derived)i[r]=this[r];return i},_initDerived:function(){var e=this;f(this._derived,function(t,n){var r=e._derived[n];r.deps=r.depList;var o=function(t){t=t||{};var o=r.fn.call(e);e._cache[n]===o&&r.cache||(r.cache&&(e._previousAttributes[n]=e._cache[n]),e._cache[n]=o,e.trigger("change:"+n,e,e._cache[n]))};r.deps.forEach(function(t){e._keyTree.add(t,o)})}),this.on("all",function(t){E.test(t)&&e._keyTree.get(t.split(":")[1]).forEach(function(e){e()})},this)},_getDerivedProperty:function(e,t){return this._derived[e].cache?((t||!this._cache.hasOwnProperty(e))&&(this._cache[e]=this._derived[e].fn.apply(this)),this._cache[e]):this._derived[e].fn.apply(this)},_initCollections:function(){var e;if(this._collections)for(e in this._collections)this._safeSet(e,new this._collections[e](null,{parent:this}))},_initChildren:function(){var e;if(this._children)for(e in this._children)this._safeSet(e,new this._children[e]({},{parent:this})),this.listenTo(this[e],"all",this._getEventBubblingHandler(e))},_getEventBubblingHandler:function(e){return _(function(t,n,r){E.test(t)?this.trigger("change:"+e+"."+t.split(":")[1],n,r):"change"===t&&this.trigger("change",this)},this)},_verifyRequired:function(){var e=this.attributes;for(var t in this._definition)if(this._definition[t].required&&"undefined"==typeof e[t])return!1;return!0},_safeSet:function(e,t){if(e in this)throw new Error("Encountered namespace collision while setting instance property `"+e+"`");return this[e]=t,this}}),Object.defineProperties(r.prototype,{attributes:{get:function(){return this.getAttributes({props:!0,session:!0})}},all:{get:function(){return this.getAttributes({session:!0,props:!0,derived:!0})}},isState:{get:function(){return!0},set:function(){}}});var C={string:{"default":function(){return""}},date:{set:function(e){var t;if(null==e)t="object";else if(g(e))t="date",e=e.valueOf();else{var n=null,r=new Date(e).valueOf();isNaN(r)&&(r=new Date(parseInt(e,10)).valueOf(),isNaN(r)&&(n=!0)),e=r,t="date",n&&(t=typeof e)}return{val:e,type:t}},get:function(e){return null==e?e:new Date(e)},"default":function(){return new Date}},array:{set:function(e){return{val:e,type:Array.isArray(e)?"array":typeof e}},"default":function(){return[]}},object:{set:function(e){var t=typeof e;return"object"!==t&&void 0===e&&(e=null,t="object"),{val:e,type:t}},"default":function(){return{}}},state:{set:function(e){var t=e instanceof r||e&&e.isState;return t?{val:e,type:"state"}:{val:e,type:typeof e}},compare:function(e,t,n){var r=e===t;return r||(e&&this.stopListening(e),null!=t&&this.listenTo(t,"all",this._getEventBubblingHandler(n))),r}}};r.extend=a,t.exports=r},{"ampersand-events":48,"array-next":60,"key-tree-store":61,"lodash.assign":62,"lodash.bind":72,"lodash.escape":78,"lodash.forown":80,"lodash.has":86,"lodash.includes":91,"lodash.isdate":99,"lodash.isequal":100,"lodash.isfunction":107,"lodash.isobject":108,"lodash.isstring":109,"lodash.omit":110,"lodash.result":126,"lodash.union":130,"lodash.uniqueid":139}],48:[function(e,t,n){t.exports=e(14)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/ampersand-events.js":14,"lodash.assign":62,"lodash.bind":72,"lodash.foreach":49,"lodash.isempty":53,"lodash.keys":55,"lodash.once":58,"lodash.uniqueid":139}],49:[function(e,t,n){t.exports=e(15)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/index.js":15,"lodash._arrayeach":50,"lodash._baseeach":51,"lodash._bindcallback":52,"lodash.isarray":98}],50:[function(e,t,n){t.exports=e(16)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._arrayeach/index.js":16}],51:[function(e,t,n){t.exports=e(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":55}],52:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],53:[function(e,t,n){t.exports=e(19)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/index.js":19,"lodash.isarguments":54,"lodash.isarray":98,"lodash.isfunction":107,"lodash.isstring":109,"lodash.keys":55}],54:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],55:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":56,"lodash.isarguments":57,"lodash.isarray":98}],56:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],57:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],58:[function(e,t,n){t.exports=e(26)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/index.js":26,"lodash.before":59}],59:[function(e,t,n){t.exports=e(27)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/node_modules/lodash.before/index.js":27}],60:[function(e,t,n){t.exports=function(e,t){var n=e.length,r=e.indexOf(t)+1;return r>n-1&&(r=0),e[r]}},{}],61:[function(e,t,n){function r(e){if(e=e||{},"object"!=typeof e)throw new TypeError("Options must be an object");var t=".";this.storage={},this.separator=e.separator||t}var o=Array.prototype.slice;r.prototype.add=function(e,t){var n=this.storage[e]||(this.storage[e]=[]);n.push(t)},r.prototype.remove=function(e){var t,n;for(t in this.storage)n=this.storage[t],n.some(function(t,r){return t===e?(n.splice(r,1),!0):void 0})},r.prototype.get=function(e){var t,n=[];for(t in this.storage)e&&e!==t&&0!==t.indexOf(e+this.separator)||(n=n.concat(this.storage[t]));return n},r.prototype.getGrouped=function(e){var t,n={};for(t in this.storage)e&&e!==t&&0!==t.indexOf(e+this.separator)||(n[t]=o.call(this.storage[t]));return n},r.prototype.getAll=function(e){var t,n={};for(t in this.storage)(e===t||0===t.indexOf(e+this.separator))&&(n[t]=o.call(this.storage[t]));return n},r.prototype.run=function(e,t){var n=o.call(arguments,2);this.get(e).forEach(function(e){e.apply(t||this,n)})},t.exports=r},{}],62:[function(e,t,n){t.exports=e(30)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/index.js":30,"lodash._baseassign":63,"lodash._createassigner":65,"lodash.keys":69}],63:[function(e,t,n){t.exports=e(31)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":64,"lodash.keys":69}],64:[function(e,t,n){t.exports=e(32)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],65:[function(e,t,n){t.exports=e(33)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/index.js":33,"lodash._bindcallback":66,"lodash._isiterateecall":67,"lodash.restparam":68}],66:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],67:[function(e,t,n){t.exports=e(35)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],68:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],69:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":70,"lodash.isarguments":71,"lodash.isarray":98}],70:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],71:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],72:[function(e,t,n){t.exports=e(40)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/index.js":40,"lodash._createwrapper":73,"lodash._replaceholders":76,"lodash.restparam":77}],73:[function(e,t,n){t.exports=e(41)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/index.js":41,"lodash._arraycopy":74,"lodash._basecreate":75,"lodash._replaceholders":76}],74:[function(e,t,n){t.exports=e(42)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._arraycopy/index.js":42}],75:[function(e,t,n){t.exports=e(43);
+},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._basecreate/index.js":43}],76:[function(e,t,n){t.exports=e(44)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._replaceholders/index.js":44}],77:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],78:[function(e,t,n){function r(e){return u[e]}function o(e){return e=i(e),e&&s.test(e)?e.replace(a,r):e}var i=e("lodash._basetostring"),a=/[&<>"'`]/g,s=RegExp(a.source),u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"};t.exports=o},{"lodash._basetostring":79}],79:[function(e,t,n){t.exports=e(29)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],80:[function(e,t,n){function r(e,t){return i(e,t,s)}function o(e){return function(t,n,r){return("function"!=typeof n||void 0!==r)&&(n=a(n,r,3)),e(t,n)}}var i=e("lodash._basefor"),a=e("lodash._bindcallback"),s=e("lodash.keys"),u=o(r);t.exports=u},{"lodash._basefor":81,"lodash._bindcallback":82,"lodash.keys":83}],81:[function(e,t,n){function r(e){return function(t,n,r){for(var i=o(t),a=r(t),s=a.length,u=e?s:-1;e?u--:++u<s;){var l=a[u];if(n(i[l],l,i)===!1)break}return t}}function o(e){return i(e)?e:Object(e)}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var a=r();t.exports=a},{}],82:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],83:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":84,"lodash.isarguments":85,"lodash.isarray":98}],84:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],85:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],86:[function(e,t,n){function r(e,t){return e="number"==typeof e||v.test(e)?+e:-1,t=null==t?w:t,e>-1&&e%1==0&&t>e}function o(e,t){var n=typeof e;if("string"==n&&g.test(e)||"number"==n)return!0;if(p(e))return!1;var r=!m.test(e);return r||null!=t&&e in a(t)}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&w>=e}function a(e){return u(e)?e:Object(e)}function s(e){var t=e?e.length:0;return t?e[t-1]:void 0}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e,t){if(null==e)return!1;var n=x.call(e,t);if(!n&&!o(t)){if(t=f(t),e=1==t.length?e:c(e,d(t,0,-1)),null==e)return!1;t=s(t),n=x.call(e,t)}return n||i(e.length)&&r(t,e.length)&&(p(e)||h(e))}var c=e("lodash._baseget"),d=e("lodash._baseslice"),f=e("lodash._topath"),h=e("lodash.isarguments"),p=e("lodash.isarray"),m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,g=/^\w*$/,v=/^\d+$/,y=Object.prototype,x=y.hasOwnProperty,w=9007199254740991;t.exports=l},{"lodash._baseget":87,"lodash._baseslice":88,"lodash._topath":89,"lodash.isarguments":90,"lodash.isarray":98}],87:[function(e,t,n){function r(e,t,n){if(null!=e){void 0!==n&&n in o(e)&&(t=[n]);for(var r=0,i=t.length;null!=e&&i>r;)e=e[t[r++]];return r&&r==i?e:void 0}}function o(e){return i(e)?e:Object(e)}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],88:[function(e,t,n){function r(e,t,n){var r=-1,o=e.length;t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}t.exports=r},{}],89:[function(e,t,n){function r(e){return null==e?"":e+""}function o(e){if(i(e))return e;var t=[];return r(e).replace(a,function(e,n,r,o){t.push(r?o.replace(s,"$1"):n||e)}),t}var i=e("lodash.isarray"),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;t.exports=o},{"lodash.isarray":98}],90:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],91:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}function o(e){return"number"==typeof e&&e>-1&&e%1==0&&p>=e}function i(e,t,n,r){var i=e?m(e):0;return o(i)||(e=a(e),i=e.length),n="number"!=typeof n||r&&l(t,n,r)?0:0>n?h(i+n,0):n||0,"string"==typeof e||!c(e)&&d(e)?i>=n&&e.indexOf(t,n)>-1:!!i&&s(e,t,n)>-1}function a(e){return u(e,f(e))}var s=e("lodash._baseindexof"),u=e("lodash._basevalues"),l=e("lodash._isiterateecall"),c=e("lodash.isarray"),d=e("lodash.isstring"),f=e("lodash.keys"),h=Math.max,p=9007199254740991,m=r("length");t.exports=i},{"lodash._baseindexof":92,"lodash._basevalues":93,"lodash._isiterateecall":94,"lodash.isarray":98,"lodash.isstring":109,"lodash.keys":95}],92:[function(e,t,n){function r(e,t,n){if(t!==t)return o(e,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function o(e,t,n){for(var r=e.length,o=t+(n?0:-1);n?o--:++o<r;){var i=e[o];if(i!==i)return o}return-1}t.exports=r},{}],93:[function(e,t,n){function r(e,t){for(var n=-1,r=t.length,o=Array(r);++n<r;)o[n]=e[t[n]];return o}t.exports=r},{}],94:[function(e,t,n){t.exports=e(35)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],95:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":96,"lodash.isarguments":97,"lodash.isarray":98}],96:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],97:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],98:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],99:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e){return r(e)&&s.call(e)==i}var i="[object Date]",a=Object.prototype,s=a.toString;t.exports=o},{}],100:[function(e,t,n){function r(e,t,n,r){n="function"==typeof n?i(n,r,3):void 0;var a=n?n(e,t):void 0;return void 0===a?o(e,t,n):!!a}var o=e("lodash._baseisequal"),i=e("lodash._bindcallback");t.exports=r},{"lodash._baseisequal":101,"lodash._bindcallback":106}],101:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e,t){for(var n=-1,r=e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function i(e,t,n,o,s,u){return e===t?!0:null==e||null==t||!c(e)&&!r(t)?e!==e&&t!==t:a(e,t,i,n,o,s,u)}function a(e,t,n,r,o,i,a){var c=d(e),h=d(t),g=m,v=m;c||(g=M.call(e),g==p?g=w:g!=w&&(c=f(e))),h||(v=M.call(t),v==p?v=w:v!=w&&(h=f(t)));var y=g==w,x=v==w,_=g==v;if(_&&!c&&!y)return u(e,t,g);if(!o){var b=y&&j.call(e,"__wrapped__"),k=x&&j.call(t,"__wrapped__");if(b||k)return n(b?e.value():e,k?t.value():t,r,o,i,a)}if(!_)return!1;i||(i=[]),a||(a=[]);for(var E=i.length;E--;)if(i[E]==e)return a[E]==t;i.push(e),a.push(t);var C=(c?s:l)(e,t,n,r,o,i,a);return i.pop(),a.pop(),C}function s(e,t,n,r,i,a,s){var u=-1,l=e.length,c=t.length;if(l!=c&&!(i&&c>l))return!1;for(;++u<l;){var d=e[u],f=t[u],h=r?r(i?f:d,i?d:f,u):void 0;if(void 0!==h){if(h)continue;return!1}if(i){if(!o(t,function(e){return d===e||n(d,e,r,i,a,s)}))return!1}else if(d!==f&&!n(d,f,r,i,a,s))return!1}return!0}function u(e,t,n){switch(n){case g:case v:return+e==+t;case y:return e.name==t.name&&e.message==t.message;case x:return e!=+e?t!=+t:e==+t;case _:case b:return e==t+""}return!1}function l(e,t,n,r,o,i,a){var s=h(e),u=s.length,l=h(t),c=l.length;if(u!=c&&!o)return!1;for(var d=u;d--;){var f=s[d];if(!(o?f in t:j.call(t,f)))return!1}for(var p=o;++d<u;){f=s[d];var m=e[f],g=t[f],v=r?r(o?g:m,o?m:g,f):void 0;if(!(void 0===v?n(m,g,r,o,i,a):v))return!1;p||(p="constructor"==f)}if(!p){var y=e.constructor,x=t.constructor;if(y!=x&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof x&&x instanceof x))return!1}return!0}function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var d=e("lodash.isarray"),f=e("lodash.istypedarray"),h=e("lodash.keys"),p="[object Arguments]",m="[object Array]",g="[object Boolean]",v="[object Date]",y="[object Error]",x="[object Number]",w="[object Object]",_="[object RegExp]",b="[object String]",k=Object.prototype,j=k.hasOwnProperty,M=k.toString;t.exports=i},{"lodash.isarray":98,"lodash.istypedarray":102,"lodash.keys":103}],102:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e){return"number"==typeof e&&e>-1&&e%1==0&&O>=e}function i(e){return r(e)&&o(e.length)&&!!T[N.call(e)]}var a="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",g="[object Set]",v="[object String]",y="[object WeakMap]",x="[object ArrayBuffer]",w="[object Float32Array]",_="[object Float64Array]",b="[object Int8Array]",k="[object Int16Array]",j="[object Int32Array]",M="[object Uint8Array]",E="[object Uint8ClampedArray]",C="[object Uint16Array]",S="[object Uint32Array]",T={};T[w]=T[_]=T[b]=T[k]=T[j]=T[M]=T[E]=T[C]=T[S]=!0,T[a]=T[s]=T[x]=T[u]=T[l]=T[c]=T[d]=T[f]=T[h]=T[p]=T[m]=T[g]=T[v]=T[y]=!1;var A=Object.prototype,N=A.toString,O=9007199254740991;t.exports=i},{}],103:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":104,"lodash.isarguments":105,"lodash.isarray":98}],104:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],105:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],106:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],107:[function(e,t,n){t.exports=e(21)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isfunction/index.js":21}],108:[function(e,t,n){function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],109:[function(e,t,n){t.exports=e(22)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isstring/index.js":22}],110:[function(e,t,n){var r=e("lodash._arraymap"),o=e("lodash._basedifference"),i=e("lodash._baseflatten"),a=e("lodash._bindcallback"),s=e("lodash._pickbyarray"),u=e("lodash._pickbycallback"),l=e("lodash.keysin"),c=e("lodash.restparam"),d=c(function(e,t){if(null==e)return{};if("function"!=typeof t[0]){var t=r(i(t),String);return s(e,o(l(e),t))}var n=a(t[0],t[1],3);return u(e,function(e,t,r){return!n(e,t,r)})});t.exports=d},{"lodash._arraymap":111,"lodash._basedifference":112,"lodash._baseflatten":117,"lodash._bindcallback":119,"lodash._pickbyarray":120,"lodash._pickbycallback":121,"lodash.keysin":123,"lodash.restparam":125}],111:[function(e,t,n){function r(e,t){for(var n=-1,r=e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}t.exports=r},{}],112:[function(e,t,n){function r(e,t){var n=e?e.length:0,r=[];if(!n)return r;var u=-1,l=o,c=!0,d=c&&t.length>=s?a(t):null,f=t.length;d&&(l=i,c=!1,t=d);e:for(;++u<n;){var h=e[u];if(c&&h===h){for(var p=f;p--;)if(t[p]===h)continue e;r.push(h)}else l(t,h,0)<0&&r.push(h)}return r}var o=e("lodash._baseindexof"),i=e("lodash._cacheindexof"),a=e("lodash._createcache"),s=200;t.exports=r},{"lodash._baseindexof":113,"lodash._cacheindexof":114,"lodash._createcache":115}],113:[function(e,t,n){t.exports=e(92)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.includes/node_modules/lodash._baseindexof/index.js":92}],114:[function(e,t,n){function r(e,t){var data=e.data,n="string"==typeof t||o(t)?data.set.has(t):data.hash[t];return n?0:-1}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],115:[function(e,t,n){(function(n){function r(e){var t=e?e.length:0;for(this.data={hash:l(null),set:new u};t--;)this.push(e[t])}function o(e){var data=this.data;"string"==typeof e||a(e)?data.set.add(e):data.hash[e]=!0}function i(e){return l&&u?new r(e):null}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var s=e("lodash._getnative"),u=s(n,"Set"),l=s(Object,"create");r.prototype.push=o,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._getnative":116}],116:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],117:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function i(e,t,n,a){a||(a=[]);for(var u=-1,d=e.length;++u<d;){var f=e[u];r(f)&&s(f)&&(n||c(f)||l(f))?t?i(f,t,n,a):o(a,f):n||(a[a.length]=f)}return a}function a(e){return function(t){return null==t?void 0:t[e]}}function s(e){return null!=e&&u(f(e))}function u(e){return"number"==typeof e&&e>-1&&e%1==0&&d>=e}var l=e("lodash.isarguments"),c=e("lodash.isarray"),d=9007199254740991,f=a("length");t.exports=i},{"lodash.isarguments":118,"lodash.isarray":98}],118:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],119:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],120:[function(e,t,n){function r(e,t){e=o(e);for(var n=-1,r=t.length,i={};++n<r;){var a=t[n];a in e&&(i[a]=e[a])}return i}function o(e){return i(e)?e:Object(e)}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}t.exports=r},{}],121:[function(e,t,n){function r(e,t){return i(e,t,a)}function o(e,t){var n={};return r(e,function(e,r,o){t(e,r,o)&&(n[r]=e)}),n}var i=e("lodash._basefor"),a=e("lodash.keysin");t.exports=o},{"lodash._basefor":122,"lodash.keysin":123}],122:[function(e,t,n){t.exports=e(81)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.forown/node_modules/lodash._basefor/index.js":81}],123:[function(e,t,n){function r(e,t){return e="number"==typeof e||l.test(e)?+e:-1,t=null==t?f:t,e>-1&&e%1==0&&t>e}function o(e){return"number"==typeof e&&e>-1&&e%1==0&&f>=e}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){if(null==e)return[];i(e)||(e=Object(e));var t=e.length;t=t&&o(t)&&(u(e)||s(e))&&t||0;for(var n=e.constructor,a=-1,l="function"==typeof n&&n.prototype===e,c=Array(t),f=t>0;++a<t;)c[a]=a+"";for(var h in e)f&&r(h,t)||"constructor"==h&&(l||!d.call(e,h))||c.push(h);return c}var s=e("lodash.isarguments"),u=e("lodash.isarray"),l=/^\d+$/,c=Object.prototype,d=c.hasOwnProperty,f=9007199254740991;t.exports=a},{"lodash.isarguments":124,"lodash.isarray":98}],124:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],125:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],126:[function(e,t,n){function r(e,t){var n=typeof e;if("string"==n&&p.test(e)||"number"==n)return!0;if(d(e))return!1;var r=!h.test(e);return r||null!=t&&e in o(t)}function o(e){return a(e)?e:Object(e)}function i(e){var t=e?e.length:0;return t?e[t-1]:void 0}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e,t,n){var o=null==e?void 0:e[t];return void 0===o&&(null==e||r(t,e)||(t=c(t),e=1==t.length?e:u(e,l(t,0,-1)),o=null==e?void 0:e[i(t)]),o=void 0===o?n:o),f(o)?o.call(e):o}var u=e("lodash._baseget"),l=e("lodash._baseslice"),c=e("lodash._topath"),d=e("lodash.isarray"),f=e("lodash.isfunction"),h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,p=/^\w*$/;t.exports=s},{"lodash._baseget":127,"lodash._baseslice":128,"lodash._topath":129,"lodash.isarray":98,"lodash.isfunction":107}],127:[function(e,t,n){t.exports=e(87)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseget/index.js":87}],128:[function(e,t,n){t.exports=e(88)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseslice/index.js":88}],129:[function(e,t,n){t.exports=e(89)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._topath/index.js":89,"lodash.isarray":98}],130:[function(e,t,n){var r=e("lodash._baseflatten"),o=e("lodash._baseuniq"),i=e("lodash.restparam"),a=i(function(e){return o(r(e,!1,!0))});t.exports=a},{"lodash._baseflatten":131,"lodash._baseuniq":133,"lodash.restparam":138}],131:[function(e,t,n){t.exports=e(117)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":132,"lodash.isarray":98}],132:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],133:[function(e,t,n){function r(e,t){var n=-1,r=o,u=e.length,l=!0,c=l&&u>=s,d=c?a():null,f=[];d?(r=i,l=!1):(c=!1,d=t?[]:f);e:for(;++n<u;){var h=e[n],p=t?t(h,n,e):h;if(l&&h===h){for(var m=d.length;m--;)if(d[m]===p)continue e;t&&d.push(p),f.push(h)}else r(d,p,0)<0&&((t||c)&&d.push(p),f.push(h))}return f}var o=e("lodash._baseindexof"),i=e("lodash._cacheindexof"),a=e("lodash._createcache"),s=200;t.exports=r},{"lodash._baseindexof":134,"lodash._cacheindexof":135,"lodash._createcache":136}],134:[function(e,t,n){t.exports=e(92)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.includes/node_modules/lodash._baseindexof/index.js":92}],135:[function(e,t,n){t.exports=e(114)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js":114}],136:[function(e,t,n){t.exports=e(115)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js":115,"lodash._getnative":137}],137:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],138:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],139:[function(e,t,n){t.exports=e(28)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/index.js":28,"lodash._basetostring":140}],140:[function(e,t,n){t.exports=e(29)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],141:[function(e,t,n){function r(e,t){t||(t={}),this.collection=e,this._reset(),this._watched=t.watched||[],this._parseFilters(t),this._runFilters(),this.listenTo(this.collection,"all",this._onCollectionEvent)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-subcollection"]=window.ampersand["ampersand-subcollection"]||[],window.ampersand["ampersand-subcollection"].push("1.5.0"));var o=e("underscore"),i=e("backbone-events-standalone"),a=e("ampersand-class-extend"),s=e("ampersand-collection-underscore-mixin"),u=Array.prototype.slice;o.extend(r.prototype,i,s,{addFilter:function(e){this.swapFilters([e],[])},removeFilter:function(e){this.swapFilters([],[e])},clearFilters:function(){this._reset(),this._runFilters()},swapFilters:function(e,t){var n=this;t?o.isArray(t)||(t=[t]):t=this._filters,e?o.isArray(e)||(e=[e]):e=[],t.forEach(function(e){n._removeFilter(e)}),e.forEach(function(e){n._addFilter(e)}),this._runFilters()},configure:function(e,t){t&&this._resetFilters(),this._parseFilters(e),this._runFilters()},at:function(e){return this.models[e]},get:function(e,t){var n=this.collection.get(e,t);return n&&this.contains(n)?n:void 0},_removeFilter:function(e){var t=this._filters.indexOf(e);-1!==t&&this._filters.splice(t,1)},_reset:function(){this.models=[],this._resetFilters()},_resetFilters:function(){this._filters=[],this._watched=[],this.limit=void 0,this.offset=void 0},_addFilter:function(e){this._filters.push(e)},_watch:function(e){this._watched=o.union(this._watched,o.isArray(e)?e:[e])},_unwatch:function(e){this._watched=o.without(this._watched,e)},_parseFilters:function(e){e.where&&(o.each(e.where,function(e,t){this._addFilter(function(n){return(n.get?n.get(t):n[t])===e})},this),this._watch(o.keys(e.where))),e.hasOwnProperty("limit")&&(this.limit=e.limit),e.hasOwnProperty("offset")&&(this.offset=e.offset),e.filter&&this._addFilter(e.filter,!1),e.filters&&e.filters.forEach(this._addFilter,this),e.comparator&&(this.comparator=e.comparator)},_runFilters:function(){var e,t,n,r=u.call(this.models),i=u.call(this.collection.models),a=this.offset||0;e=this._filters.length?o.reduce(this._filters,function(e,t){return e.filter(t)},i):u.call(i),this.comparator&&(e=o.sortBy(e,this.comparator)),(this.limit||this.offset)&&(e=e.slice(a,this.limit+a)),t=o.difference(e,r),n=o.difference(r,e),this.models=e,o.each(n,function(e){this.trigger("remove",e,this)},this),o.each(t,function(e){this.trigger("add",e,this)},this),o.isEqual(r,e)||this.trigger("sort",this)},_onCollectionEvent:function(e,t){(o.contains(this._watched,e.split(":")[1])||o.contains(["add","remove","reset","sync"],e))&&this._runFilters(),(o.contains(["sync","invalid","destroy"])||-1!==e.indexOf("change"))&&this.contains(t)&&this.trigger.apply(this,arguments)}}),Object.defineProperty(r.prototype,"length",{get:function(){return this.models.length}}),Object.defineProperty(r.prototype,"isCollection",{get:function(){return!0}}),r.extend=a,t.exports=r},{"ampersand-class-extend":142,"ampersand-collection-underscore-mixin":10,"backbone-events-standalone":155,underscore:156}],142:[function(e,t,n){t.exports=e(13)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":13,"lodash.assign":143}],143:[function(e,t,n){t.exports=e(30)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/index.js":30,"lodash._baseassign":144,"lodash._createassigner":146,"lodash.keys":150}],144:[function(e,t,n){t.exports=e(31)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":145,"lodash.keys":150}],145:[function(e,t,n){t.exports=e(32)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],146:[function(e,t,n){t.exports=e(33)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/index.js":33,"lodash._bindcallback":147,"lodash._isiterateecall":148,"lodash.restparam":149}],147:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],148:[function(e,t,n){t.exports=e(35)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],149:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],150:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":151,"lodash.isarguments":152,"lodash.isarray":153}],151:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],152:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],153:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],154:[function(e,t,n){!function(){function e(){return{keys:Object.keys,uniqueId:function(e){var t=++l+"";return e?e+t:t},has:function(e,t){return s.call(e,t)},each:function(e,t,n){if(null!=e)if(a&&e.forEach===a)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,o=e.length;o>r;r++)if(t.call(n,e[r],r,e)===i)return}else for(var s in e)if(this.has(e,s)&&t.call(n,e[s],s,e)===i)return},once:function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}}}}var r,o=this,i={},a=Array.prototype.forEach,s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,l=0,c=e();r={on:function(e,t,n){if(!f(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,n){if(!f(this,"once",e,[t,n])||!t)return this;var r=this,o=c.once(function(){r.off(e,o),t.apply(this,arguments)});return o._callback=t,this.on(e,o,n)},off:function(e,t,n){var r,o,i,a,s,u,l,d;if(!this._events||!f(this,"off",e,[t,n]))return this;if(!e&&!t&&!n)return this._events={},this;for(a=e?[e]:c.keys(this._events),s=0,u=a.length;u>s;s++)if(e=a[s],i=this._events[e]){if(this._events[e]=r=[],t||n)for(l=0,d=i.length;d>l;l++)o=i[l],(t&&t!==o.callback&&t!==o.callback._callback||n&&n!==o.context)&&r.push(o);r.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=u.call(arguments,1);if(!f(this,"trigger",e,t))return this;var n=this._events[e],r=this._events.all;return n&&h(n,t),r&&h(r,arguments),this},stopListening:function(e,t,n){var r=this._listeners;if(!r)return this;var o=!t&&!n;"object"==typeof t&&(n=this),e&&((r={})[e._listenerId]=e);for(var i in r)r[i].off(t,n,this),o&&delete this._listeners[i];return this}};var d=/\s+/,f=function(e,t,n,r){if(!n)return!0;if("object"==typeof n){for(var o in n)e[t].apply(e,[o,n[o]].concat(r));return!1}if(d.test(n)){for(var i=n.split(d),a=0,s=i.length;s>a;a++)e[t].apply(e,[i[a]].concat(r));return!1}return!0},h=function(e,t){var n,r=-1,o=e.length,i=t[0],a=t[1],s=t[2];switch(t.length){case 0:for(;++r<o;)(n=e[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i,a);return;case 3:for(;++r<o;)(n=e[r]).callback.call(n.ctx,i,a,s);return;default:for(;++r<o;)(n=e[r]).callback.apply(n.ctx,t)}},p={listenTo:"on",listenToOnce:"once"};c.each(p,function(e,t){r[t]=function(t,n,r){var o=this._listeners||(this._listeners={}),i=t._listenerId||(t._listenerId=c.uniqueId("l"));return o[i]=t,"object"==typeof n&&(r=this),t[e](n,r,this),this}}),r.bind=r.on,r.unbind=r.off,r.mixin=function(e){var t=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return c.each(t,function(t){e[t]=this[t]},this),e},"function"==typeof define?define(function(){return r}):"undefined"!=typeof n?("undefined"!=typeof t&&t.exports&&(n=t.exports=r),n.BackboneEvents=r):o.BackboneEvents=r}(this)},{}],155:[function(e,t,n){t.exports=e("./backbone-events-standalone")},{"./backbone-events-standalone":154}],156:[function(e,t,n){t.exports=e(11)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection-underscore-mixin/node_modules/underscore/underscore.js":11}],157:[function(e,t,n){function r(e){this.cid=s("view"),e||(e={});var t=e.parent;delete e.parent,_.call(this,e,{init:!1,parent:t}),this.on("change:el",this._handleElementChange,this),this._parsedBindings=x(this.bindings,this),this._initializeBindings(),e.el&&!this.autoRender&&this._handleElementChange(),this._initializeSubviews(),this.template=e.template||this.template,this.initialize.apply(this,arguments),this.set(u(e,b)),this.autoRender&&this.template&&this.render()}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-view"]=window.ampersand["ampersand-view"]||[],window.ampersand["ampersand-view"].push("7.4.2"));var o=e("ampersand-state"),i=e("ampersand-collection-view"),a=e("domify"),s=e("lodash.uniqueid"),u=e("lodash.pick"),l=e("lodash.assign"),c=e("lodash.foreach"),d=e("lodash.result"),f=e("lodash.last"),h=e("lodash.isstring"),p=e("lodash.bind"),m=e("lodash.flatten"),g=e("lodash.invoke"),v=e("events-mixin"),y=e("matches-selector"),x=e("ampersand-dom-bindings"),w=e("get-object-path"),_=o.extend({dataTypes:{element:{set:function(e){return{val:e,type:e instanceof Element?"element":typeof e}},compare:function(e,t){return e===t}},collection:{set:function(e){return{val:e,type:e&&e.isCollection?"collection":typeof e}},compare:function(e,t){return e===t}}},props:{model:"state",el:"element",collection:"collection"
+},derived:{rendered:{deps:["el"],fn:function(){return!!this.el}},hasData:{deps:["model"],fn:function(){return!!this.model}}}}),b=["model","collection","el"];r.prototype=Object.create(_.prototype),l(r.prototype,{query:function(e){return e?"string"==typeof e?y(this.el,e)?this.el:this.el.querySelector(e)||void 0:e:this.el},queryAll:function(e){var t=[];return this.el?""===e?[this.el]:(y(this.el,e)&&t.push(this.el),t.concat(Array.prototype.slice.call(this.el.querySelectorAll(e)))):t},queryByHook:function(e){return this.query('[data-hook~="'+e+'"]')},queryAllByHook:function(e){return this.queryAll('[data-hook~="'+e+'"]')},initialize:function(){},render:function(){return this.renderWithTemplate(this),this},remove:function(){var e=this._parsedBindings;return this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this._subviews&&g(m(this._subviews),"remove"),this.trigger("remove",this),this.stopListening(),c(e,function(t,n){c(t,function(t,r){delete e[n][r]}),delete e[n]}),this},_handleElementChange:function(e,t){return this.eventManager&&this.eventManager.unbind(),this.eventManager=v(this.el,this),this.delegateEvents(),this._applyBindingsForKey(),this},delegateEvents:function(e){if(!e&&!(e=d(this,"events")))return this;this.undelegateEvents();for(var t in e)this.eventManager.bind(t,e[t]);return this},undelegateEvents:function(){return this.eventManager.unbind(),this},registerSubview:function(e){return this._subviews||(this._subviews=[]),this._subviews.push(e),e.parent||(e.parent=this),e},renderSubview:function(e,t){return"string"==typeof t&&(t=this.query(t)),this.registerSubview(e),e.render(),(t||this.el).appendChild(e.el),e},_applyBindingsForKey:function(e){if(this.el){var t,n=this._parsedBindings.getGrouped(e);for(t in n)n[t].forEach(function(e){e(this.el,w(this,t),f(t.split(".")))},this)}},_initializeBindings:function(){this.bindings&&this.on("all",function(e){"change:"===e.slice(0,7)&&this._applyBindingsForKey(e.split(":")[1])},this)},_initializeSubviews:function(){if(this.subviews)for(var e in this.subviews)this._parseSubview(this.subviews[e],e)},_parseSubview:function(e,t){function n(){var e,r;this.el&&(e=this.query(o.selector))&&(!o.waitFor||w(this,o.waitFor))&&(r=this[t]=o.prepareView.call(this,e),r.render(),this.registerSubview(r),this.off("change",n))}var r=this,o={selector:e.container||'[data-hook="'+e.hook+'"]',waitFor:e.waitFor||"",prepareView:e.prepareView||function(t){return new e.constructor({el:t,parent:r})}};this.on("change",n,this)},renderWithTemplate:function(e,t){var n=t||this.template;if(!n)throw new Error("Template string or function needed.");var r=h(n)?n:n.call(this,e||this);h(r)&&(r=a(r));var o=this.el&&this.el.parentNode;if(o&&o.replaceChild(r,this.el),"#document-fragment"===r.nodeName)throw new Error("Views can only have one root element, including comment nodes.");return this.el=r,this},cacheElements:function(e){for(var t in e)this[t]=this.query(e[t]);return this},listenToAndRun:function(e,t,n){var r=p(n,this);this.listenTo(e,t,r),r()},animateRemove:function(){this.remove()},renderCollection:function(e,t,n,r){var o="string"==typeof n?this.query(n):n,a=l({collection:e,el:o||this.el,view:t,parent:this,viewOptions:{parent:this}},r),s=new i(a);return s.render(),this.registerSubview(s)}}),r.extend=_.extend,t.exports=r},{"ampersand-collection-view":158,"ampersand-dom-bindings":194,"ampersand-state":47,domify:203,"events-mixin":204,"get-object-path":209,"lodash.assign":210,"lodash.bind":221,"lodash.flatten":227,"lodash.foreach":232,"lodash.invoke":240,"lodash.isstring":251,"lodash.last":252,"lodash.pick":253,"lodash.result":265,"lodash.uniqueid":271,"matches-selector":273}],158:[function(e,t,n){function r(e){if(!e)throw new ReferenceError("Collection view missing required parameters: collection, el");if(!e.collection)throw new ReferenceError("Collection view requires a collection");if(!e.el&&!this.insertSelf)throw new ReferenceError("Collection view requires an el");o(this,a(e,d)),this.views=[],this.listenTo(this.collection,"add",this._addViewForModel),this.listenTo(this.collection,"remove",this._removeViewForModel),this.listenTo(this.collection,"sort",this._rerenderAll),this.listenTo(this.collection,"refresh reset",this._reset)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-view"]=window.ampersand["ampersand-collection-view"]||[],window.ampersand["ampersand-collection-view"].push("1.4.0"));var o=e("lodash.assign"),i=e("lodash.invoke"),a=e("lodash.pick"),s=e("lodash.find"),u=e("lodash.difference"),l=e("ampersand-events"),c=e("ampersand-class-extend"),d=["collection","el","viewOptions","view","emptyView","filter","reverse","parent"];o(r.prototype,l,{render:function(){return this._renderAll(),this},remove:function(){i(this.views,"remove"),this.stopListening()},_getViewByModel:function(e){return s(this.views,function(t){return e===t.model})},_createViewForModel:function(e,t){var n={model:e,collection:this.collection,parent:this},r=new this.view(o(n,this.viewOptions));return this.views.push(r),r.renderedByParentView=!0,r.render(t),r},_getOrCreateByModel:function(e,t){return this._getViewByModel(e)||this._createViewForModel(e,t)},_addViewForModel:function(e,t,n){var r=this.filter?this.filter(e):!0;if(r){this.renderedEmptyView&&(this.renderedEmptyView.remove(),delete this.renderedEmptyView);var o=this._getOrCreateByModel(e,{containerEl:this.el});n&&n.rerender?this._insertView(o):this._insertViewAtIndex(o)}},_insertViewAtIndex:function(e){if(!e.insertSelf){var t,n,r=this.collection.indexOf(e.model);t=this.reverse?this.collection.at(r-1):this.collection.at(r+1),n=this._getViewByModel(t),n?this.el.insertBefore(e.el,n&&n.el):this.el.appendChild(e.el)}},_insertView:function(e){e.insertSelf||(this.reverse&&this.el.firstChild?this.el.insertBefore(e.el,this.el.firstChild):this.el.appendChild(e.el))},_removeViewForModel:function(e){var t=this._getViewByModel(e);if(t){var n=this.views.indexOf(t);-1!==n&&(t=this.views.splice(n,1)[0],this._removeView(t),0===this.views.length&&this._renderEmptyView())}},_removeView:function(e){e.animateRemove?e.animateRemove():e.remove()},_renderAll:function(){this.collection.each(this._addViewForModel,this),0===this.views.length&&this._renderEmptyView()},_rerenderAll:function(e,t){t=t||{},this.collection.each(function(e){this._addViewForModel(e,this,o(t,{rerender:!0}))},this)},_renderEmptyView:function(){if(this.emptyView&&!this.renderedEmptyView){var e=this.renderedEmptyView=new this.emptyView({parent:this});this.el.appendChild(e.render().el)}},_reset:function(){var e=this.collection.map(this._getOrCreateByModel,this),t=u(this.views,e);t.forEach(this._removeView,this),this.views=e,this._rerenderAll(),0===this.views.length&&this._renderEmptyView()}}),r.extend=c,t.exports=r},{"ampersand-class-extend":159,"ampersand-events":160,"lodash.assign":210,"lodash.difference":171,"lodash.find":181,"lodash.invoke":240,"lodash.pick":253}],159:[function(e,t,n){t.exports=e(13)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":13,"lodash.assign":210}],160:[function(e,t,n){t.exports=e(14)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/ampersand-events.js":14,"lodash.assign":210,"lodash.bind":221,"lodash.foreach":232,"lodash.isempty":161,"lodash.keys":165,"lodash.once":169,"lodash.uniqueid":271}],161:[function(e,t,n){t.exports=e(19)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/index.js":19,"lodash.isarguments":162,"lodash.isarray":163,"lodash.isfunction":164,"lodash.isstring":251,"lodash.keys":165}],162:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],163:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],164:[function(e,t,n){t.exports=e(21)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isfunction/index.js":21}],165:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":166,"lodash.isarguments":167,"lodash.isarray":168}],166:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],167:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],168:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],169:[function(e,t,n){t.exports=e(26)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/index.js":26,"lodash.before":170}],170:[function(e,t,n){t.exports=e(27)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/node_modules/lodash.before/index.js":27}],171:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e){return function(t){return null==t?void 0:t[e]}}function i(e){return null!=e&&a(d(e))}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&c>=e}var s=e("lodash._basedifference"),u=e("lodash._baseflatten"),l=e("lodash.restparam"),c=9007199254740991,d=o("length"),f=l(function(e,t){return r(e)&&i(e)?s(e,u(t,!1,!0)):[]});t.exports=f},{"lodash._basedifference":172,"lodash._baseflatten":177,"lodash.restparam":180}],172:[function(e,t,n){t.exports=e(112)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/index.js":112,"lodash._baseindexof":173,"lodash._cacheindexof":174,"lodash._createcache":175}],173:[function(e,t,n){t.exports=e(92)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.includes/node_modules/lodash._baseindexof/index.js":92}],174:[function(e,t,n){t.exports=e(114)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js":114}],175:[function(e,t,n){t.exports=e(115)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js":115,"lodash._getnative":176}],176:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],177:[function(e,t,n){t.exports=e(117)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":178,"lodash.isarray":179}],178:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],179:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],180:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],181:[function(e,t,n){function r(e,t){return function(n,r,i){if(r=o(r,i,3),u(n)){var l=s(n,r,t);return l>-1?n[l]:void 0}return a(n,r,e)}}var o=e("lodash._basecallback"),i=e("lodash._baseeach"),a=e("lodash._basefind"),s=e("lodash._basefindindex"),u=e("lodash.isarray"),l=r(i);t.exports=l},{"lodash._basecallback":182,"lodash._baseeach":187,"lodash._basefind":188,"lodash._basefindindex":189,"lodash.isarray":190}],182:[function(e,t,n){function r(e){return null==e?"":e+""}function o(e,t,n){var r=typeof e;return"function"==r?void 0===t?e:b(e,t,n):null==e?x:"object"==r?s(e):void 0===t?w(e):u(e,t)}function i(e,t,n){if(null!=e){void 0!==n&&n in m(e)&&(t=[n]);for(var r=0,o=t.length;null!=e&&o>r;)e=e[t[r++]];return r&&r==o?e:void 0}}function a(e,t,n){var r=t.length,o=r,i=!n;if(null==e)return!o;for(e=m(e);r--;){var data=t[r];if(i&&data[2]?data[1]!==e[data[0]]:!(data[0]in e))return!1}for(;++r<o;){data=t[r];var a=data[0],s=e[a],u=data[1];if(i&&data[2]){if(void 0===s&&!(a in e))return!1}else{var l=n?n(s,u,a):void 0;if(!(void 0===l?_(u,s,n,!0):l))return!1}}return!0}function s(e){var t=f(e);if(1==t.length&&t[0][2]){var n=t[0][0],r=t[0][1];return function(e){return null==e?!1:e[n]===r&&(void 0!==r||n in m(e))}}return function(e){return a(e,t)}}function u(e,t){var n=k(e),r=h(e)&&p(t),o=e+"";return e=g(e),function(a){if(null==a)return!1;var s=o;if(a=m(a),(n||!r)&&!(s in a)){if(a=1==e.length?a:i(a,d(e,0,-1)),null==a)return!1;s=v(e),a=m(a)}return a[s]===t?void 0!==t||s in a:_(t,a[s],void 0,!0)}}function l(e){return function(t){return null==t?void 0:t[e]}}function c(e){var t=e+"";return e=g(e),function(n){return i(n,e,t)}}function d(e,t,n){var r=-1,o=e.length;t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}function f(e){for(var t=j(e),n=t.length;n--;)t[n][2]=p(t[n][1]);return t}function h(e,t){var n=typeof e;if("string"==n&&E.test(e)||"number"==n)return!0;if(k(e))return!1;var r=!M.test(e);return r||null!=t&&e in m(t)}function p(e){return e===e&&!y(e)}function m(e){return y(e)?e:Object(e)}function g(e){if(k(e))return e;var t=[];return r(e).replace(C,function(e,n,r,o){t.push(r?o.replace(S,"$1"):n||e)}),t}function v(e){var t=e?e.length:0;return t?e[t-1]:void 0}function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){return e}function w(e){return h(e)?l(e):c(e)}var _=e("lodash._baseisequal"),b=e("lodash._bindcallback"),k=e("lodash.isarray"),j=e("lodash.pairs"),M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,E=/^\w*$/,C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,S=/\\(\\)?/g;t.exports=o},{"lodash._baseisequal":183,"lodash._bindcallback":185,"lodash.isarray":190,"lodash.pairs":186}],183:[function(e,t,n){t.exports=e(101)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.isequal/node_modules/lodash._baseisequal/index.js":101,"lodash.isarray":190,"lodash.istypedarray":184,"lodash.keys":191}],184:[function(e,t,n){t.exports=e(102)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.isequal/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/index.js":102}],185:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],186:[function(e,t,n){function r(e){return o(e)?e:Object(e)}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){e=r(e);for(var t=-1,n=a(e),o=n.length,i=Array(o);++t<o;){var s=n[t];i[t]=[s,e[s]]}return i}var a=e("lodash.keys");t.exports=i},{"lodash.keys":191}],187:[function(e,t,n){t.exports=e(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":191}],188:[function(e,t,n){function r(e,t,n,r){var o;return n(e,function(e,n,i){return t(e,n,i)?(o=r?n:e,!1):void 0}),o}t.exports=r},{}],189:[function(e,t,n){function r(e,t,n){for(var r=e.length,o=n?r:-1;n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}t.exports=r},{}],190:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],191:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":192,"lodash.isarguments":193,"lodash.isarray":190}],192:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],193:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],194:[function(e,t,n){function r(e,t){if(""===t)return[e];var n=[];return f(e,t)&&n.push(e),n.concat(p.call(e.querySelectorAll(t)))}function o(e,t){for(var n in t)d.setAttribute(e,n,t[n])}function i(e,t){for(var n in t)d.removeAttribute(e,n)}function a(e){return Array.isArray(e)?e:[e]}function s(e,t,n){var o=e.cases[n];for(var i in e.cases){var a=e.cases[i];n!==i&&a!==o&&r(t,a).forEach(function(e){d.hide(e)})}r(t,o).forEach(function(e){d.show(e)})}function u(e){return"string"==typeof e.selector?e.selector:e.hook?'[data-hook~="'+e.hook+'"]':""}function l(e,t){var n,l=e.type||"text",c="function"==typeof l,f=u(e),p=e.yes,m=e.no,g=!(!p&&!m);if(c)return function(e,o){r(e,f).forEach(function(e){l.call(t,e,o,n)}),n=o};if("text"===l)return function(e,t){r(e,f).forEach(function(e){d.text(e,t)})};if("class"===l)return function(e,t){r(e,f).forEach(function(e){d.switchClass(e,n,t)}),n=t};if("attribute"===l){if(!e.name)throw Error('attribute bindings must have a "name"');return function(t,o){var i=a(e.name);r(t,f).forEach(function(e){i.forEach(function(t){d.setAttribute(e,t,o)})}),n=o}}if("value"===l)return function(e,t){r(e,f).forEach(function(e){t||0===t||(t=""),document.activeElement!==e&&(e.value=t)}),n=t};if("booleanClass"===l)return g?(p=a(p||""),m=a(m||""),function(e,t){var n=t?m:p,o=t?p:m;r(e,f).forEach(function(e){n.forEach(function(t){d.removeClass(e,t)}),o.forEach(function(t){d.addClass(e,t)})})}):function(t,n,o){var i=a(e.name||o);r(t,f).forEach(function(e){i.forEach(function(t){d[n?"addClass":"removeClass"](e,t)})})};if("booleanAttribute"===l)return g?(p=a(p||""),m=a(m||""),function(e,t){var n=t?m:p,o=t?p:m;r(e,f).forEach(function(e){n.forEach(function(t){t&&d.removeAttribute(e,t)}),o.forEach(function(t){t&&d.addAttribute(e,t)})})}):function(t,n,o){var i=a(e.name||o);r(t,f).forEach(function(e){i.forEach(function(t){d[n?"addAttribute":"removeAttribute"](e,t)})})};if("toggle"===l){var v=e.mode||"display";return g?function(e,t){r(e,p).forEach(function(e){d[t?"show":"hide"](e,v)}),r(e,m).forEach(function(e){d[t?"hide":"show"](e,v)})}:function(e,t){r(e,f).forEach(function(e){d[t?"show":"hide"](e,v)})}}if("switch"===l){if(!e.cases)throw Error('switch bindings must have "cases"');return h(s,e)}if("innerHTML"===l)return function(e,t){r(e,f).forEach(function(e){d.html(e,t)})};if("switchClass"===l){if(!e.cases)throw Error('switchClass bindings must have "cases"');return function(t,n,o){var i=a(e.name||o);for(var s in e.cases)r(t,e.cases[s]).forEach(function(e){i.forEach(function(t){d[n===s?"addClass":"removeClass"](e,t)})})}}if("switchAttribute"===l){if(!e.cases)throw Error('switchAttribute bindings must have "cases"');return function(t,a,s){r(t,f).forEach(function(t){if(n&&i(t,n),a in e.cases){var r=e.cases[a];"string"==typeof r&&(r={},r[e.name||s]=e.cases[a]),o(t,r),n=r}})}}throw new Error("no such binding type: "+l)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom-bindings"]=window.ampersand["ampersand-dom-bindings"]||[],window.ampersand["ampersand-dom-bindings"].push("3.7.0"));var c=e("key-tree-store"),d=e("ampersand-dom"),f=e("matches-selector"),h=e("lodash.partial"),p=Array.prototype.slice;t.exports=function(e,t){var n,r,o=new c;for(n in e)r=e[n],"string"==typeof r?o.add(n,l({type:"text",selector:r})):r.forEach?r.forEach(function(e){o.add(n,l(e,t))}):o.add(n,l(r,t));return o}},{"ampersand-dom":195,"key-tree-store":196,"lodash.partial":197,"matches-selector":273}],195:[function(e,t,n){function r(e){return e||0===e?e:""}function o(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function i(e,t){var n=e[t];return t in e&&(n===!0||n===!1)}function a(e){return"true"===c.getAttribute(e,"data-anddom-hidden")}function s(e,t){c.setAttribute(e,"data-anddom-"+t,e.style[t])}function u(e,t){e.style[t]=c.getAttribute(e,"data-anddom-"+t)||"",c.removeAttribute(e,"data-anddom-hidden")}function l(e,t){c.setAttribute(e,"data-anddom-hidden","true"),e.style[t]="visibility"===t?"hidden":"none"}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom"]=window.ampersand["ampersand-dom"]||[],window.ampersand["ampersand-dom"].push("1.4.0"));var c=t.exports={text:function(e,t){e.textContent=r(t)},addClass:function(e,t){t=r(t),t&&(Array.isArray(t)?t.forEach(function(t){c.addClass(e,t)}):e.classList?e.classList.add(t):o(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t))},removeClass:function(e,t){Array.isArray(t)?t.forEach(function(t){c.removeClass(e,t)}):e.classList?(t=r(t),t&&e.classList.remove(t)):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")},hasClass:o,switchClass:function(e,t,n){t&&this.removeClass(e,t),this.addClass(e,n)},addAttribute:function(e,t){e.setAttribute(t,""),i(e,t)&&(e[t]=!0)},removeAttribute:function(e,t){e.removeAttribute(t),i(e,t)&&(e[t]=!1)},setAttribute:function(e,t,n){e.setAttribute(t,r(n))},getAttribute:function(e,t){return e.getAttribute(t)},hasAttribute:function(e,t){return e.hasAttribute(t)},hide:function(e,t){t||(t="display"),a(e)||(s(e,t),l(e,t))},show:function(e,t){t||(t="display"),u(e,t)},html:function(e,t){e.innerHTML=t}}},{}],196:[function(e,t,n){t.exports=e(61)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/key-tree-store/key-tree-store.js":61}],197:[function(e,t,n){function r(e){var t=a(function(n,r){var a=i(r,t.placeholder);return o(n,e,void 0,r,a)});return t}var o=e("lodash._createwrapper"),i=e("lodash._replaceholders"),a=e("lodash.restparam"),s=32,u=r(s);u.placeholder={},t.exports=u},{"lodash._createwrapper":198,"lodash._replaceholders":201,"lodash.restparam":202}],198:[function(e,t,n){t.exports=e(41)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/index.js":41,"lodash._arraycopy":199,"lodash._basecreate":200,"lodash._replaceholders":201}],199:[function(e,t,n){t.exports=e(42)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._arraycopy/index.js":42}],200:[function(e,t,n){t.exports=e(43)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._basecreate/index.js":43}],201:[function(e,t,n){t.exports=e(44)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._replaceholders/index.js":44}],202:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],203:[function(e,t,n){function r(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var o=t.createElement("html");return o.innerHTML=e,o.removeChild(o.lastChild)}var i=a[r]||a._default,s=i[0],u=i[1],l=i[2],o=t.createElement("div");for(o.innerHTML=u+e+l;s--;)o=o.lastChild;if(o.firstChild==o.lastChild)return o.removeChild(o.firstChild);for(var c=t.createDocumentFragment();o.firstChild;)c.appendChild(o.removeChild(o.firstChild));return c}t.exports=r;var o,i=!1;"undefined"!=typeof document&&(o=document.createElement("div"),o.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',i=!o.getElementsByTagName("link").length,o=void 0);var a={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:i?[1,"X<div>","</div>"]:[0,"",""]};a.td=a.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],a.option=a.optgroup=[1,'<select multiple="multiple">',"</select>"],a.thead=a.tbody=a.colgroup=a.caption=a.tfoot=[1,"<table>","</table>"],a.polyline=a.ellipse=a.polygon=a.circle=a.text=a.line=a.path=a.rect=a.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],204:[function(e,t,n){function r(e,t){if(!(this instanceof r))return new r(e,t);if(!e)throw new Error("element required");if(!t)throw new Error("object required");this.el=e,this.obj=t,this._events={}}function o(e){var t=e.split(/ +/);return{name:t.shift(),selector:t.join(" ")}}var i=e("component-event"),a=e("delegate-events"),s=["focus","blur"];t.exports=r,r.prototype.sub=function(e,t,n){this._events[e]=this._events[e]||{},this._events[e][t]=n},r.prototype.bind=function(e,t){var n=function(e,t){function n(){var e=[].slice.call(arguments).concat(c);if("function"==typeof t)return void t.apply(u,e);if(!u[t])throw new Error(t+" method is not defined");u[t].apply(u,e)}var r=o(e),s=this.el,u=this.obj,l=r.name,t=t||"on"+l,c=[].slice.call(arguments,2);return r.selector?n=a.bind(s,r.selector,l,n):i.bind(s,l,n),this.sub(l,t,n),n};if("string"==typeof e)n.apply(this,arguments);else for(var r in e)e.hasOwnProperty(r)&&n.call(this,r,e[r])},r.prototype.unbind=function(e,t){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(e);var n=this._events[e],r=-1!==s.indexOf(e);if(n){var o=n[t];o&&i.unbind(this.el,e,o,r)}},r.prototype.unbindAll=function(){for(var e in this._events)this.unbindAllOf(e)},r.prototype.unbindAllOf=function(e){var t=this._events[e];if(t)for(var n in t)this.unbind(e,n)}},{"component-event":205,"delegate-events":206}],205:[function(e,t,n){var r=window.addEventListener?"addEventListener":"attachEvent",o=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==r?"on":"";n.bind=function(e,t,n,o){return e[r](i+t,n,o||!1),n},n.unbind=function(e,t,n,r){return e[o](i+t,n,r||!1),n}},{}],206:[function(e,t,n){var r=e("closest"),o=e("component-event"),i=["focus","blur"];n.bind=function(e,t,n,a,s){return-1!==i.indexOf(n)&&(s=!0),o.bind(e,n,function(n){var o=n.target||n.srcElement;n.delegateTarget=r(o,t,!0,e),n.delegateTarget&&a.call(e,n)},s)},n.unbind=function(e,t,n,r){-1!==i.indexOf(t)&&(r=!0),o.unbind(e,t,n,r)}},{closest:207,"component-event":205}],207:[function(e,t,n){var r=e("matches-selector");t.exports=function(e,t,n){for(var o=n?e:e.parentNode;o&&o!==document;){if(r(o,t))return o;o=o.parentNode}}},{"matches-selector":208}],208:[function(e,t,n){function r(e,t){if(i)return i.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0;r<n.length;++r)if(n[r]==e)return!0;return!1}var o=Element.prototype,i=o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;t.exports=r},{}],209:[function(e,t,n){function r(e,t){if(-1==t.indexOf(".")&&-1==t.indexOf("["))return e[t];for(var n,r=t.split(/\.|\[|\]/g),o=-1,i=r.length;++o<i;)if(0==o&&(n=e),r[o]){if(void 0==n)break;n=n[r[o]]}return n}t.exports=r},{}],210:[function(e,t,n){t.exports=e(30)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/index.js":30,"lodash._baseassign":211,"lodash._createassigner":213,"lodash.keys":217}],211:[function(e,t,n){t.exports=e(31)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":212,"lodash.keys":217}],212:[function(e,t,n){t.exports=e(32)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],213:[function(e,t,n){t.exports=e(33)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/index.js":33,"lodash._bindcallback":214,"lodash._isiterateecall":215,"lodash.restparam":216}],214:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],215:[function(e,t,n){t.exports=e(35)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],216:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],217:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":218,"lodash.isarguments":219,"lodash.isarray":220}],218:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],219:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],220:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],221:[function(e,t,n){t.exports=e(40)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/index.js":40,"lodash._createwrapper":222,"lodash._replaceholders":225,"lodash.restparam":226}],222:[function(e,t,n){t.exports=e(41)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/index.js":41,"lodash._arraycopy":223,"lodash._basecreate":224,"lodash._replaceholders":225}],223:[function(e,t,n){t.exports=e(42)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._arraycopy/index.js":42}],224:[function(e,t,n){t.exports=e(43)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._basecreate/index.js":43
+}],225:[function(e,t,n){t.exports=e(44)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._replaceholders/index.js":44}],226:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],227:[function(e,t,n){function r(e,t,n){var r=e?e.length:0;return n&&i(e,t,n)&&(t=!1),r?o(e,t):[]}var o=e("lodash._baseflatten"),i=e("lodash._isiterateecall");t.exports=r},{"lodash._baseflatten":228,"lodash._isiterateecall":231}],228:[function(e,t,n){t.exports=e(117)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":229,"lodash.isarray":230}],229:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],230:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],231:[function(e,t,n){t.exports=e(35)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],232:[function(e,t,n){t.exports=e(15)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/index.js":15,"lodash._arrayeach":233,"lodash._baseeach":234,"lodash._bindcallback":238,"lodash.isarray":239}],233:[function(e,t,n){t.exports=e(16)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._arrayeach/index.js":16}],234:[function(e,t,n){t.exports=e(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":235}],235:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":236,"lodash.isarguments":237,"lodash.isarray":239}],236:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],237:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],238:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],239:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],240:[function(e,t,n){function r(e){return function(t){return null==t?void 0:t[e]}}function o(e){return null!=e&&a(g(e))}function i(e,t){var n=typeof e;if("string"==n&&p.test(e)||"number"==n)return!0;if(d(e))return!1;var r=!h.test(e);return r||null!=t&&e in s(t)}function a(e){return"number"==typeof e&&e>-1&&e%1==0&&m>=e}function s(e){return u(e)?e:Object(e)}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var l=e("lodash._baseeach"),c=e("lodash._invokepath"),d=e("lodash.isarray"),f=e("lodash.restparam"),h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,p=/^\w*$/,m=9007199254740991,g=r("length"),v=f(function(e,t,n){var r=-1,a="function"==typeof t,s=i(t),u=o(e)?Array(e.length):[];return l(e,function(e){var o=a?t:s&&null!=e?e[t]:void 0;u[++r]=o?o.apply(e,n):c(e,t,n)}),u});t.exports=v},{"lodash._baseeach":241,"lodash._invokepath":245,"lodash.isarray":249,"lodash.restparam":250}],241:[function(e,t,n){t.exports=e(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":242}],242:[function(e,t,n){t.exports=e(23)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash._getnative":243,"lodash.isarguments":244,"lodash.isarray":249}],243:[function(e,t,n){t.exports=e(24)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash._getnative/index.js":24}],244:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],245:[function(e,t,n){function r(e,t,n){null==e||o(t,e)||(t=c(t),e=1==t.length?e:u(e,l(t,0,-1)),t=a(t));var r=null==e?e:e[t];return null==r?void 0:r.apply(e,n)}function o(e,t){var n=typeof e;if("string"==n&&h.test(e)||"number"==n)return!0;if(d(e))return!1;var r=!f.test(e);return r||null!=t&&e in i(t)}function i(e){return s(e)?e:Object(e)}function a(e){var t=e?e.length:0;return t?e[t-1]:void 0}function s(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var u=e("lodash._baseget"),l=e("lodash._baseslice"),c=e("lodash._topath"),d=e("lodash.isarray"),f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,h=/^\w*$/;t.exports=r},{"lodash._baseget":246,"lodash._baseslice":247,"lodash._topath":248,"lodash.isarray":249}],246:[function(e,t,n){t.exports=e(87)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseget/index.js":87}],247:[function(e,t,n){t.exports=e(88)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseslice/index.js":88}],248:[function(e,t,n){t.exports=e(89)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._topath/index.js":89,"lodash.isarray":249}],249:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],250:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],251:[function(e,t,n){t.exports=e(22)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isstring/index.js":22}],252:[function(e,t,n){function r(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=r},{}],253:[function(e,t,n){var r=e("lodash._baseflatten"),o=e("lodash._bindcallback"),i=e("lodash._pickbyarray"),a=e("lodash._pickbycallback"),s=e("lodash.restparam"),u=s(function(e,t){return null==e?{}:"function"==typeof t[0]?a(e,o(t[0],t[1],3)):i(e,r(t))});t.exports=u},{"lodash._baseflatten":254,"lodash._bindcallback":257,"lodash._pickbyarray":258,"lodash._pickbycallback":259,"lodash.restparam":264}],254:[function(e,t,n){t.exports=e(117)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":255,"lodash.isarray":256}],255:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],256:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],257:[function(e,t,n){t.exports=e(18)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],258:[function(e,t,n){t.exports=e(120)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._pickbyarray/index.js":120}],259:[function(e,t,n){t.exports=e(121)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._pickbycallback/index.js":121,"lodash._basefor":260,"lodash.keysin":261}],260:[function(e,t,n){t.exports=e(81)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.forown/node_modules/lodash._basefor/index.js":81}],261:[function(e,t,n){t.exports=e(123)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash.keysin/index.js":123,"lodash.isarguments":262,"lodash.isarray":263}],262:[function(e,t,n){t.exports=e(20)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],263:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],264:[function(e,t,n){t.exports=e(36)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],265:[function(e,t,n){t.exports=e(126)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.result/index.js":126,"lodash._baseget":266,"lodash._baseslice":267,"lodash._topath":268,"lodash.isarray":269,"lodash.isfunction":270}],266:[function(e,t,n){t.exports=e(87)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseget/index.js":87}],267:[function(e,t,n){t.exports=e(88)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseslice/index.js":88}],268:[function(e,t,n){t.exports=e(89)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._topath/index.js":89,"lodash.isarray":269}],269:[function(e,t,n){t.exports=e(46)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],270:[function(e,t,n){t.exports=e(21)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isfunction/index.js":21}],271:[function(e,t,n){t.exports=e(28)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/index.js":28,"lodash._basetostring":272}],272:[function(e,t,n){t.exports=e(29)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],273:[function(e,t,n){"use strict";function r(e,t){if(i)return i.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0;r<n.length;r++)if(n[r]==e)return!0;return!1}var o=Element.prototype,i=o.matches||o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;t.exports=r},{}],274:[function(e,t,n){+function(e){"use strict";function t(t){return this.each(function(){var r=e(this),data=r.data("bs.button"),o="object"==typeof t&&t;data||r.data("bs.button",data=new n(this,o)),"toggle"==t?data.toggle():t&&data.setState(t)})}var n=function(t,r){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.2.0",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var n="disabled",r=this.$element,o=r.is("input")?"val":"html",data=r.data();t+="Text",null==data.resetText&&r.data("resetText",r[o]()),r[o](null==data[t]?this.options[t]:data[t]),setTimeout(e.proxy(function(){"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n))},this),0)},n.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?e=!1:t.find(".active").removeClass("active")),e&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}e&&this.$element.toggleClass("active")};var r=e.fn.button;e.fn.button=t,e.fn.button.Constructor=n,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=e(n.target);r.hasClass("btn")||(r=r.closest(".btn")),t.call(r,"toggle"),n.preventDefault()})}(jQuery)},{}],275:[function(e,t,n){+function(e){"use strict";function t(t){return this.each(function(){var r=e(this),data=r.data("bs.collapse"),o=e.extend({},n.DEFAULTS,r.data(),"object"==typeof t&&t);!data&&o.toggle&&"show"==t&&(t=!t),data||r.data("bs.collapse",data=new n(this,o)),"string"==typeof t&&data[t]()})}var n=function(t,r){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};n.VERSION="3.2.0",n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n=e.Event("show.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var r=this.$parent&&this.$parent.find("> .panel > .in");if(r&&r.length){var o=r.data("bs.collapse");if(o&&o.transitioning)return;t.call(r,"hide"),o||r.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[i](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var s=e.camelCase(["scroll",i].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(350)[i](this.$element[0][s])}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return e.support.transition?void this.$element[n](0).one("bsTransitionEnd",e.proxy(r,this)).emulateTransitionEnd(350):r.call(this)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var r=e.fn.collapse;e.fn.collapse=t,e.fn.collapse.Constructor=n,e.fn.collapse.noConflict=function(){return e.fn.collapse=r,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(n){var r,o=e(this),i=o.attr("data-target")||n.preventDefault()||(r=o.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),a=e(i),data=a.data("bs.collapse"),s=data?"toggle":o.data(),u=o.attr("data-parent"),l=u&&e(u);data&&data.transitioning||(l&&l.find('[data-toggle="collapse"][data-parent="'+u+'"]').not(o).addClass("collapsed"),o[a.hasClass("in")?"addClass":"removeClass"]("collapsed")),t.call(a,s)})}(jQuery)},{}],276:[function(e,t,n){+function(e){"use strict";function t(t){t&&3===t.which||(e(o).remove(),e(i).each(function(){var r=n(e(this)),o={relatedTarget:this};r.hasClass("open")&&(r.trigger(t=e.Event("hide.bs.dropdown",o)),t.isDefaultPrevented()||r.removeClass("open").trigger("hidden.bs.dropdown",o))}))}function n(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}function r(t){return this.each(function(){var n=e(this),data=n.data("bs.dropdown");data||n.data("bs.dropdown",data=new a(this)),"string"==typeof t&&data[t].call(n)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',a=function(t){e(t).on("click.bs.dropdown",this.toggle)};a.VERSION="3.2.0",a.prototype.toggle=function(r){var o=e(this);if(!o.is(".disabled, :disabled")){var i=n(o),a=i.hasClass("open");if(t(),!a){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&e('<div class="dropdown-backdrop"/>').insertAfter(e(this)).on("click",t);var s={relatedTarget:this};if(i.trigger(r=e.Event("show.bs.dropdown",s)),r.isDefaultPrevented())return;o.trigger("focus"),i.toggleClass("open").trigger("shown.bs.dropdown",s)}return!1}},a.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var r=e(this);if(t.preventDefault(),t.stopPropagation(),!r.is(".disabled, :disabled")){var o=n(r),a=o.hasClass("open");if(!a||a&&27==t.keyCode)return 27==t.which&&o.find(i).trigger("focus"),r.trigger("click");var s=" li:not(.divider):visible a",u=o.find('[role="menu"]'+s+', [role="listbox"]'+s);if(u.length){var l=u.index(u.filter(":focus"));38==t.keyCode&&l>0&&l--,40==t.keyCode&&l<u.length-1&&l++,~l||(l=0),u.eq(l).trigger("focus")}}}};var s=e.fn.dropdown;e.fn.dropdown=r,e.fn.dropdown.Constructor=a,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.bs.dropdown.data-api",t).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",i,a.prototype.toggle).on("keydown.bs.dropdown.data-api",i+', [role="menu"], [role="listbox"]',a.prototype.keydown)}(jQuery)},{}],277:[function(e,t,n){+function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one("bsTransitionEnd",function(){n=!0});var o=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(o,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){return e(t.target).is(this)?t.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery)},{}],278:[function(e,t,n){},{}],279:[function(e,t,n){!function(){function e(e){return e&&(e.ownerDocument||e.document||e).documentElement}function n(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}function r(e,t){return t>e?-1:e>t?1:e>=t?0:NaN}function o(e){return null===e?NaN:+e}function i(e){return!isNaN(e)}function a(e){return{left:function(t,n,r,o){for(arguments.length<3&&(r=0),arguments.length<4&&(o=t.length);o>r;){var i=r+o>>>1;e(t[i],n)<0?r=i+1:o=i}return r},right:function(t,n,r,o){for(arguments.length<3&&(r=0),arguments.length<4&&(o=t.length);o>r;){var i=r+o>>>1;e(t[i],n)>0?o=i:r=i+1}return r}}}function s(e){return e.length}function u(e){for(var t=1;e*t%1;)t*=10;return t}function l(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function c(){this._=Object.create(null)}function d(e){return(e+="")===ba||e[0]===ka?ka+e:e}function f(e){return(e+="")[0]===ka?e.slice(1):e}function h(e){return d(e)in this._}function p(e){return(e=d(e))in this._&&delete this._[e]}function m(){var e=[];for(var t in this._)e.push(f(t));return e}function g(){var e=0;for(var t in this._)++e;return e}function v(){for(var e in this._)return!1;return!0}function y(){this._=Object.create(null)}function x(e){return e}function w(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function _(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=ja.length;r>n;++n){var o=ja[n]+t;if(o in e)return o}}function b(){}function k(){}function j(e){function t(){for(var t,r=n,o=-1,i=r.length;++o<i;)(t=r[o].on)&&t.apply(this,arguments);return e}var n=[],r=new c;return t.on=function(t,o){var i,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,n=n.slice(0,i=n.indexOf(a)).concat(n.slice(i+1)),r.remove(t)),o&&n.push(r.set(t,{on:o})),e)},t}function M(){la.event.preventDefault()}function E(){for(var e,t=la.event;e=t.sourceEvent;)t=e;return t}function C(e){for(var t=new k,n=0,r=arguments.length;++n<r;)t[arguments[n]]=j(t);return t.of=function(n,r){return function(o){try{var i=o.sourceEvent=la.event;o.target=e,la.event=o,t[o.type].apply(n,r)}finally{la.event=i}}},t}function S(e){return Ea(e,Aa),e}function T(e){return"function"==typeof e?e:function(){return Ca(e,this)}}function A(e){return"function"==typeof e?e:function(){return Sa(e,this)}}function N(e,t){function n(){this.removeAttribute(e)}function r(){this.removeAttributeNS(e.space,e.local)}function o(){this.setAttribute(e,t)}function i(){this.setAttributeNS(e.space,e.local,t)}function a(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}function s(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}return e=la.ns.qualify(e),null==t?e.local?r:n:"function"==typeof t?e.local?s:a:e.local?i:o}function O(e){return e.trim().replace(/\s+/g," ")}function q(e){return new RegExp("(?:^|\\s+)"+la.requote(e)+"(?:\\s+|$)","g")}function D(e){return(e+"").trim().split(/^|\s+/)}function L(e,t){function n(){for(var n=-1;++n<o;)e[n](this,t)}function r(){for(var n=-1,r=t.apply(this,arguments);++n<o;)e[n](this,r)}e=D(e).map(F);var o=e.length;return"function"==typeof t?r:n}function F(e){var t=q(e);return function(n,r){if(o=n.classList)return r?o.add(e):o.remove(e);var o=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(o)||n.setAttribute("class",O(o+" "+e))):n.setAttribute("class",O(o.replace(t," ")))}}function z(e,t,n){function r(){this.style.removeProperty(e)}function o(){this.style.setProperty(e,t,n)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return null==t?r:"function"==typeof t?i:o}function R(e,t){function n(){delete this[e]}function r(){this[e]=t}function o(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}return null==t?n:"function"==typeof t?o:r}function P(e){function t(){var t=this.ownerDocument,n=this.namespaceURI;return n?t.createElementNS(n,e):t.createElement(e)}function n(){return this.ownerDocument.createElementNS(e.space,e.local)}return"function"==typeof e?e:(e=la.ns.qualify(e)).local?n:t}function I(){var e=this.parentNode;e&&e.removeChild(this)}function H(data){return{__data__:data}}function $(e){return function(){return Ta(this,e)}}function B(e){return arguments.length||(e=r),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function V(e,t){for(var n=0,r=e.length;r>n;n++)for(var o,i=e[n],a=0,s=i.length;s>a;a++)(o=i[a])&&t(o,a,n);return e}function U(e){return Ea(e,Oa),e}function W(e){var t,n;return function(r,o,i){var a,s=e[i].update,u=s.length;for(i!=n&&(n=i,t=0),o>=t&&(t=o+1);!(a=s[t])&&++t<u;);return a}}function Y(e,t,n){function r(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}function o(){var o=u(t,da(arguments));r.call(this),this.addEventListener(e,this[a]=o,o.$=n),o._=t}function i(){var t,n=new RegExp("^__on([^.]+)"+la.requote(e)+"$");for(var r in this)if(t=r.match(n)){var o=this[r];this.removeEventListener(t[1],o,o.$),delete this[r]}}var a="__on"+e,s=e.indexOf("."),u=X;s>0&&(e=e.slice(0,s));var l=qa.get(e);return l&&(e=l,u=J),s?t?o:r:t?b:i}function X(e,t){return function(n){var r=la.event;la.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{la.event=r}}}function J(e,t){var n=X(e,t);return function(e){var t=this,r=e.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||n.call(t,e)}}function Z(t){var r=".dragsuppress-"+ ++La,o="click"+r,i=la.select(n(t)).on("touchmove"+r,M).on("dragstart"+r,M).on("selectstart"+r,M);if(null==Da&&(Da="onselectstart"in t?!1:_(t.style,"userSelect")),Da){var a=e(t).style,s=a[Da];a[Da]="none"}return function(e){if(i.on(r,null),Da&&(a[Da]=s),e){var t=function(){i.on(o,null)};i.on(o,function(){M(),t()},!0),setTimeout(t,0)}}}function K(e,t){t.changedTouches&&(t=t.changedTouches[0]);var r=e.ownerSVGElement||e;if(r.createSVGPoint){var o=r.createSVGPoint();if(0>Fa){var i=n(e);if(i.scrollX||i.scrollY){r=la.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Fa=!(a.f||a.e),r.remove()}}return Fa?(o.x=t.pageX,o.y=t.pageY):(o.x=t.clientX,o.y=t.clientY),o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}function G(){return la.event.changedTouches[0].identifier}function Q(e){return e>0?1:0>e?-1:0}function ee(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function te(e){return e>1?0:-1>e?Pa:Math.acos(e)}function ne(e){return e>1?$a:-1>e?-$a:Math.asin(e)}function re(e){return((e=Math.exp(e))-1/e)/2}function oe(e){return((e=Math.exp(e))+1/e)/2}function ie(e){return((e=Math.exp(2*e))-1)/(e+1)}function ae(e){return(e=Math.sin(e/2))*e}function se(){}function ue(e,t,n){return this instanceof ue?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof ue?new ue(e.h,e.s,e.l):be(""+e,ke,ue):new ue(e,t,n)}function le(e,t,n){function r(e){return e>360?e-=360:0>e&&(e+=360),60>e?i+(a-i)*e/60:180>e?a:240>e?i+(a-i)*(240-e)/60:i}function o(e){return Math.round(255*r(e))}var i,a;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:0>t?0:t>1?1:t,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+t):n+t-n*t,i=2*n-a,new ye(o(e+120),o(e),o(e-120))}function ce(e,t,n){return this instanceof ce?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof ce?new ce(e.h,e.c,e.l):e instanceof fe?pe(e.l,e.a,e.b):pe((e=je((e=la.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new ce(e,t,n)}function de(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new fe(n,Math.cos(e*=Ba)*t,Math.sin(e)*t)}function fe(e,t,n){return this instanceof fe?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof fe?new fe(e.l,e.a,e.b):e instanceof ce?de(e.h,e.c,e.l):je((e=ye(e)).r,e.g,e.b):new fe(e,t,n)}function he(e,t,n){var r=(e+16)/116,o=r+t/500,i=r-n/200;return o=me(o)*es,r=me(r)*ts,i=me(i)*ns,new ye(ve(3.2404542*o-1.5371385*r-.4985314*i),ve(-.969266*o+1.8760108*r+.041556*i),ve(.0556434*o-.2040259*r+1.0572252*i))}function pe(e,t,n){return e>0?new ce(Math.atan2(n,t)*Va,Math.sqrt(t*t+n*n),e):new ce(NaN,NaN,e)}function me(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ge(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function ve(e){return Math.round(255*(.00304>=e?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ye(e,t,n){return this instanceof ye?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof ye?new ye(e.r,e.g,e.b):be(""+e,ye,le):new ye(e,t,n)}function xe(e){return new ye(e>>16,e>>8&255,255&e)}function we(e){return xe(e)+""}function _e(e){return 16>e?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function be(e,t,n){var r,o,i,a=0,s=0,u=0;if(r=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(o=r[2].split(","),r[1]){case"hsl":return n(parseFloat(o[0]),parseFloat(o[1])/100,parseFloat(o[2])/100);case"rgb":return t(Ee(o[0]),Ee(o[1]),Ee(o[2]))}return(i=is.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(a=(3840&i)>>4,a=a>>4|a,s=240&i,s=s>>4|s,u=15&i,u=u<<4|u):7===e.length&&(a=(16711680&i)>>16,s=(65280&i)>>8,u=255&i)),t(a,s,u))}function ke(e,t,n){var r,o,i=Math.min(e/=255,t/=255,n/=255),a=Math.max(e,t,n),s=a-i,u=(a+i)/2;return s?(o=.5>u?s/(a+i):s/(2-a-i),r=e==a?(t-n)/s+(n>t?6:0):t==a?(n-e)/s+2:(e-t)/s+4,r*=60):(r=NaN,o=u>0&&1>u?0:r),new ue(r,o,u)}function je(e,t,n){e=Me(e),t=Me(t),n=Me(n);var r=ge((.4124564*e+.3575761*t+.1804375*n)/es),o=ge((.2126729*e+.7151522*t+.072175*n)/ts),i=ge((.0193339*e+.119192*t+.9503041*n)/ns);return fe(116*o-16,500*(r-o),200*(o-i))}function Me(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ee(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}function Ce(e){return"function"==typeof e?e:function(){return e}}function Se(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),Te(t,n,e,r)}}function Te(e,t,n,r){function o(){var e,t=u.status;if(!t&&Ne(u)||t>=200&&300>t||304===t){try{e=n.call(i,u)}catch(r){return void a.error.call(i,r)}a.load.call(i,e)}else a.error.call(i,u)}var i={},a=la.dispatch("beforesend","progress","load","error"),s={},u=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=o:u.onreadystatechange=function(){u.readyState>3&&o()},u.onprogress=function(e){var t=la.event;la.event=e;try{a.progress.call(i,u)}finally{la.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(l=e,i):l},i.response=function(e){return n=e,i},["get","post"].forEach(function(e){i[e]=function(){return i.send.apply(i,[e].concat(da(arguments)))}}),i.send=function(n,data,r){if(2===arguments.length&&"function"==typeof data&&(r=data,data=null),u.open(n,e,!0),null==t||"accept"in s||(s.accept=t+",*/*"),u.setRequestHeader)for(var o in s)u.setRequestHeader(o,s[o]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=l&&(u.responseType=l),null!=r&&i.on("error",r).on("load",function(e){r(null,e)}),a.beforesend.call(i,u),u.send(null==data?null:data),i},i.abort=function(){return u.abort(),i},la.rebind(i,a,"on"),null==r?i:i.get(Ae(r))}function Ae(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}function Ne(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}function Oe(e,t,n){var r=arguments.length;2>r&&(t=0),3>r&&(n=Date.now());var o=n+t,i={c:e,t:o,n:null};return ss?ss.n=i:as=i,ss=i,us||(ls=clearTimeout(ls),us=1,cs(qe)),i}function qe(){var e=De(),t=Le()-e;t>24?(isFinite(t)&&(clearTimeout(ls),ls=setTimeout(qe,t)),us=0):(us=1,cs(qe))}function De(){for(var e=Date.now(),t=as;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Le(){for(var e,t=as,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:as=t.n;return ss=e,n}function Fe(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}function ze(e,t){var n=Math.pow(10,3*_a(8-t));return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}function Re(e){var t=e.decimal,n=e.thousands,r=e.grouping,o=e.currency,i=r&&n?function(e,t){for(var o=e.length,i=[],a=0,s=r[0],u=0;o>0&&s>0&&(u+s+1>t&&(s=Math.max(1,t-u)),i.push(e.substring(o-=s,o+s)),!((u+=s+1)>t));)s=r[a=(a+1)%r.length];return i.reverse().join(n)}:x;return function(e){var n=fs.exec(e),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",u=n[4]||"",l=n[5],c=+n[6],d=n[7],f=n[8],h=n[9],p=1,m="",g="",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(l||"0"===r&&"="===a)&&(l=r="0",
+a="="),h){case"n":d=!0,h="g";break;case"%":p=100,g="%",h="f";break;case"p":p=100,g="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+h.toLowerCase());case"c":y=!1;case"d":v=!0,f=0;break;case"s":p=-1,h="r"}"$"===u&&(m=o[0],g=o[1]),"r"!=h||f||(h="g"),null!=f&&("g"==h?f=Math.max(1,Math.min(21,f)):("e"==h||"f"==h)&&(f=Math.max(0,Math.min(20,f)))),h=hs.get(h)||Pe;var x=l&&d;return function(e){var n=g;if(v&&e%1)return"";var o=0>e||0===e&&0>1/e?(e=-e,"-"):"-"===s?"":s;if(0>p){var u=la.formatPrefix(e,f);e=u.scale(e),n=u.symbol+g}else e*=p;e=h(e,f);var w,_,b=e.lastIndexOf(".");if(0>b){var k=y?e.lastIndexOf("e"):-1;0>k?(w=e,_=""):(w=e.substring(0,k),_=e.substring(k))}else w=e.substring(0,b),_=t+e.substring(b+1);!l&&d&&(w=i(w,1/0));var j=m.length+w.length+_.length+(x?0:o.length),M=c>j?new Array(j=c-j+1).join(r):"";return x&&(w=i(M+w,M.length?c-_.length:1/0)),o+=m,e=w+_,("<"===a?o+e+M:">"===a?M+o+e:"^"===a?M.substring(0,j>>=1)+o+e+M.substring(j):o+(x?e:M+e))+n}}}function Pe(e){return e+""}function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function He(e,t,n){function r(t){var n=e(t),r=i(n,1);return r-t>t-n?n:r}function o(n){return t(n=e(new ms(n-1)),1),n}function i(e,n){return t(e=new ms(+e),n),e}function a(e,r,i){var a=o(e),s=[];if(i>1)for(;r>a;)n(a)%i||s.push(new Date(+a)),t(a,1);else for(;r>a;)s.push(new Date(+a)),t(a,1);return s}function s(e,t,n){try{ms=Ie;var r=new Ie;return r._=e,a(r,t,n)}finally{ms=Date}}e.floor=e,e.round=r,e.ceil=o,e.offset=i,e.range=a;var u=e.utc=$e(e);return u.floor=u,u.round=$e(r),u.ceil=$e(o),u.offset=$e(i),u.range=s,e}function $e(e){return function(t,n){try{ms=Ie;var r=new Ie;return r._=t,e(r,n)._}finally{ms=Date}}}function Be(e){function t(e){function t(t){for(var n,o,i,a=[],s=-1,u=0;++s<r;)37===e.charCodeAt(s)&&(a.push(e.slice(u,s)),null!=(o=vs[n=e.charAt(++s)])&&(n=e.charAt(++s)),(i=S[n])&&(n=i(t,null==o?"e"===n?" ":"0":o)),a.push(n),u=s+1);return a.push(e.slice(u,s)),a.join("")}var r=e.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},o=n(r,e,t,0);if(o!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&ms!==Ie,a=new(i?Ie:ms);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?a._:a},t.toString=function(){return e},t}function n(e,t,n,r){for(var o,i,a,s=0,u=t.length,l=n.length;u>s;){if(r>=l)return-1;if(o=t.charCodeAt(s++),37===o){if(a=t.charAt(s++),i=T[a in vs?t.charAt(s++):a],!i||(r=i(e,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}function r(e,t,n){b.lastIndex=0;var r=b.exec(t.slice(n));return r?(e.w=k.get(r[0].toLowerCase()),n+r[0].length):-1}function o(e,t,n){w.lastIndex=0;var r=w.exec(t.slice(n));return r?(e.w=_.get(r[0].toLowerCase()),n+r[0].length):-1}function i(e,t,n){E.lastIndex=0;var r=E.exec(t.slice(n));return r?(e.m=C.get(r[0].toLowerCase()),n+r[0].length):-1}function a(e,t,n){j.lastIndex=0;var r=j.exec(t.slice(n));return r?(e.m=M.get(r[0].toLowerCase()),n+r[0].length):-1}function s(e,t,r){return n(e,S.c.toString(),t,r)}function u(e,t,r){return n(e,S.x.toString(),t,r)}function l(e,t,r){return n(e,S.X.toString(),t,r)}function c(e,t,n){var r=x.get(t.slice(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)}var d=e.dateTime,f=e.date,h=e.time,p=e.periods,m=e.days,g=e.shortDays,v=e.months,y=e.shortMonths;t.utc=function(e){function n(e){try{ms=Ie;var t=new ms;return t._=e,r(t)}finally{ms=Date}}var r=t(e);return n.parse=function(e){try{ms=Ie;var t=r.parse(e);return t&&t._}finally{ms=Date}},n.toString=r.toString,n},t.multi=t.utc.multi=lt;var x=la.map(),w=Ue(m),_=We(m),b=Ue(g),k=We(g),j=Ue(v),M=We(v),E=Ue(y),C=We(y);p.forEach(function(e,t){x.set(e.toLowerCase(),t)});var S={a:function(e){return g[e.getDay()]},A:function(e){return m[e.getDay()]},b:function(e){return y[e.getMonth()]},B:function(e){return v[e.getMonth()]},c:t(d),d:function(e,t){return Ve(e.getDate(),t,2)},e:function(e,t){return Ve(e.getDate(),t,2)},H:function(e,t){return Ve(e.getHours(),t,2)},I:function(e,t){return Ve(e.getHours()%12||12,t,2)},j:function(e,t){return Ve(1+ps.dayOfYear(e),t,3)},L:function(e,t){return Ve(e.getMilliseconds(),t,3)},m:function(e,t){return Ve(e.getMonth()+1,t,2)},M:function(e,t){return Ve(e.getMinutes(),t,2)},p:function(e){return p[+(e.getHours()>=12)]},S:function(e,t){return Ve(e.getSeconds(),t,2)},U:function(e,t){return Ve(ps.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Ve(ps.mondayOfYear(e),t,2)},x:t(f),X:t(h),y:function(e,t){return Ve(e.getFullYear()%100,t,2)},Y:function(e,t){return Ve(e.getFullYear()%1e4,t,4)},Z:st,"%":function(){return"%"}},T={a:r,A:o,b:i,B:a,c:s,d:tt,e:tt,H:rt,I:rt,j:nt,L:at,m:et,M:ot,p:c,S:it,U:Xe,w:Ye,W:Je,x:u,X:l,y:Ke,Y:Ze,Z:Ge,"%":ut};return t}function Ve(e,t,n){var r=0>e?"-":"",o=(r?-e:e)+"",i=o.length;return r+(n>i?new Array(n-i+1).join(t)+o:o)}function Ue(e){return new RegExp("^(?:"+e.map(la.requote).join("|")+")","i")}function We(e){for(var t=new c,n=-1,r=e.length;++n<r;)t.set(e[n].toLowerCase(),n);return t}function Ye(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Xe(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function Je(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function Ze(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ke(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+2));return r?(e.y=Qe(+r[0]),n+r[0].length):-1}function Ge(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function Qe(e){return e+(e>68?1900:2e3)}function et(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tt(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function nt(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function rt(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ot(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function it(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function at(e,t,n){ys.lastIndex=0;var r=ys.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function st(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=_a(t)/60|0,o=_a(t)%60;return n+Ve(r,"0",2)+Ve(o,"0",2)}function ut(e,t,n){xs.lastIndex=0;var r=xs.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function lt(e){for(var t=e.length,n=-1;++n<t;)e[n][0]=this(e[n][0]);return function(t){for(var n=0,r=e[n];!r[1](t);)r=e[++n];return r[0](t)}}function ct(){}function dt(e,t,n){var r=n.s=e+t,o=r-e,i=r-o;n.t=e-i+(t-o)}function ft(e,t){e&&ks.hasOwnProperty(e.type)&&ks[e.type](e,t)}function ht(e,t,n){var r,o=-1,i=e.length-n;for(t.lineStart();++o<i;)r=e[o],t.point(r[0],r[1],r[2]);t.lineEnd()}function pt(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)ht(e[n],t,1);t.polygonEnd()}function mt(){function e(e,t){e*=Ba,t=t*Ba/2+Pa/4;var n=e-r,a=n>=0?1:-1,s=a*n,u=Math.cos(t),l=Math.sin(t),c=i*l,d=o*u+c*Math.cos(s),f=c*a*Math.sin(s);Ms.add(Math.atan2(f,d)),r=e,o=u,i=l}var t,n,r,o,i;Es.point=function(a,s){Es.point=e,r=(t=a)*Ba,o=Math.cos(s=(n=s)*Ba/2+Pa/4),i=Math.sin(s)},Es.lineEnd=function(){e(t,n)}}function gt(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function vt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function yt(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function xt(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function wt(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function _t(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function bt(e){return[Math.atan2(e[1],e[0]),ne(e[2])]}function kt(e,t){return _a(e[0]-t[0])<za&&_a(e[1]-t[1])<za}function jt(e,t){e*=Ba;var n=Math.cos(t*=Ba);Mt(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function Mt(e,t,n){++Cs,Ts+=(e-Ts)/Cs,As+=(t-As)/Cs,Ns+=(n-Ns)/Cs}function Et(){function e(e,o){e*=Ba;var i=Math.cos(o*=Ba),a=i*Math.cos(e),s=i*Math.sin(e),u=Math.sin(o),l=Math.atan2(Math.sqrt((l=n*u-r*s)*l+(l=r*a-t*u)*l+(l=t*s-n*a)*l),t*a+n*s+r*u);Ss+=l,Os+=l*(t+(t=a)),qs+=l*(n+(n=s)),Ds+=l*(r+(r=u)),Mt(t,n,r)}var t,n,r;Rs.point=function(o,i){o*=Ba;var a=Math.cos(i*=Ba);t=a*Math.cos(o),n=a*Math.sin(o),r=Math.sin(i),Rs.point=e,Mt(t,n,r)}}function Ct(){Rs.point=jt}function St(){function e(e,t){e*=Ba;var n=Math.cos(t*=Ba),a=n*Math.cos(e),s=n*Math.sin(e),u=Math.sin(t),l=o*u-i*s,c=i*a-r*u,d=r*s-o*a,f=Math.sqrt(l*l+c*c+d*d),h=r*a+o*s+i*u,p=f&&-te(h)/f,m=Math.atan2(f,h);Ls+=p*l,Fs+=p*c,zs+=p*d,Ss+=m,Os+=m*(r+(r=a)),qs+=m*(o+(o=s)),Ds+=m*(i+(i=u)),Mt(r,o,i)}var t,n,r,o,i;Rs.point=function(a,s){t=a,n=s,Rs.point=e,a*=Ba;var u=Math.cos(s*=Ba);r=u*Math.cos(a),o=u*Math.sin(a),i=Math.sin(s),Mt(r,o,i)},Rs.lineEnd=function(){e(t,n),Rs.lineEnd=Ct,Rs.point=jt}}function Tt(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function At(){return!0}function Nt(e,t,n,r,o){var i=[],a=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t];if(kt(n,r)){o.lineStart();for(var s=0;t>s;++s)o.point((n=e[s])[0],n[1]);return void o.lineEnd()}var u=new qt(n,e,null,!0),l=new qt(n,null,u,!1);u.o=l,i.push(u),a.push(l),u=new qt(r,e,null,!1),l=new qt(r,null,u,!0),u.o=l,i.push(u),a.push(l)}}),a.sort(t),Ot(i),Ot(a),i.length){for(var s=0,u=n,l=a.length;l>s;++s)a[s].e=u=!u;for(var c,d,f=i[0];;){for(var h=f,p=!0;h.v;)if((h=h.n)===f)return;c=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(var s=0,l=c.length;l>s;++s)o.point((d=c[s])[0],d[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(p){c=h.p.z;for(var s=c.length-1;s>=0;--s)o.point((d=c[s])[0],d[1])}else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);o.lineEnd()}}}function Ot(e){if(t=e.length){for(var t,n,r=0,o=e[0];++r<t;)o.n=n=e[r],n.p=o,o=n;o.n=n=e[0],n.p=o}}function qt(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Dt(e,t,n,r){return function(o,i){function a(t,n){var r=o(t,n);e(t=r[0],n=r[1])&&i.point(t,n)}function s(e,t){var n=o(e,t);g.point(n[0],n[1])}function u(){y.point=s,g.lineStart()}function l(){y.point=a,g.lineEnd()}function c(e,t){m.push([e,t]);var n=o(e,t);w.point(n[0],n[1])}function d(){w.lineStart(),m=[]}function f(){c(m[0][0],m[0][1]),w.lineEnd();var e,t=w.clean(),n=x.buffer(),r=n.length;if(m.pop(),p.push(m),m=null,r)if(1&t){e=n[0];var o,r=e.length-1,a=-1;if(r>0){for(_||(i.polygonStart(),_=!0),i.lineStart();++a<r;)i.point((o=e[a])[0],o[1]);i.lineEnd()}}else r>1&&2&t&&n.push(n.pop().concat(n.shift())),h.push(n.filter(Lt))}var h,p,m,g=t(i),v=o.invert(r[0],r[1]),y={point:a,lineStart:u,lineEnd:l,polygonStart:function(){y.point=c,y.lineStart=d,y.lineEnd=f,h=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=u,y.lineEnd=l,h=la.merge(h);var e=Ht(v,p);h.length?(_||(i.polygonStart(),_=!0),Nt(h,zt,e,n,i)):e&&(_||(i.polygonStart(),_=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),_&&(i.polygonEnd(),_=!1),h=p=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Ft(),w=t(x),_=!1;return y}}function Lt(e){return e.length>1}function Ft(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:b,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function zt(e,t){return((e=e.x)[0]<0?e[1]-$a-za:$a-e[1])-((t=t.x)[0]<0?t[1]-$a-za:$a-t[1])}function Rt(e){var t,n=NaN,r=NaN,o=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,a){var s=i>0?Pa:-Pa,u=_a(i-n);_a(u-Pa)<za?(e.point(n,r=(r+a)/2>0?$a:-$a),e.point(o,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(i,r),t=0):o!==s&&u>=Pa&&(_a(n-o)<za&&(n-=o*za),_a(i-s)<za&&(i-=s*za),r=Pt(n,r,i,a),e.point(o,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=i,r=a),o=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}function Pt(e,t,n,r){var o,i,a=Math.sin(e-n);return _a(a)>za?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(n)-Math.sin(r)*(o=Math.cos(t))*Math.sin(e))/(o*i*a)):(t+r)/2}function It(e,t,n,r){var o;if(null==e)o=n*$a,r.point(-Pa,o),r.point(0,o),r.point(Pa,o),r.point(Pa,0),r.point(Pa,-o),r.point(0,-o),r.point(-Pa,-o),r.point(-Pa,0),r.point(-Pa,o);else if(_a(e[0]-t[0])>za){var i=e[0]<t[0]?Pa:-Pa;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function Ht(e,t){var n=e[0],r=e[1],o=[Math.sin(n),-Math.cos(n),0],i=0,a=0;Ms.reset();for(var s=0,u=t.length;u>s;++s){var l=t[s],c=l.length;if(c)for(var d=l[0],f=d[0],h=d[1]/2+Pa/4,p=Math.sin(h),m=Math.cos(h),g=1;;){g===c&&(g=0),e=l[g];var v=e[0],y=e[1]/2+Pa/4,x=Math.sin(y),w=Math.cos(y),_=v-f,b=_>=0?1:-1,k=b*_,j=k>Pa,M=p*x;if(Ms.add(Math.atan2(M*b*Math.sin(k),m*w+M*Math.cos(k))),i+=j?_+b*Ia:_,j^f>=n^v>=n){var E=yt(gt(d),gt(e));_t(E);var C=yt(o,E);_t(C);var S=(j^_>=0?-1:1)*ne(C[2]);(r>S||r===S&&(E[0]||E[1]))&&(a+=j^_>=0?1:-1)}if(!g++)break;f=v,p=x,m=w,d=e}}return(-za>i||za>i&&0>Ms)^1&a}function $t(e){function t(e,t){return Math.cos(e)*Math.cos(t)>i}function n(e){var n,i,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(d,f){var h,p=[d,f],m=t(d,f),g=a?m?0:o(d,f):m?o(d+(0>d?Pa:-Pa),f):0;if(!n&&(l=u=m)&&e.lineStart(),m!==u&&(h=r(n,p),(kt(n,h)||kt(p,h))&&(p[0]+=za,p[1]+=za,m=t(p[0],p[1]))),m!==u)c=0,m?(e.lineStart(),h=r(p,n),e.point(h[0],h[1])):(h=r(n,p),e.point(h[0],h[1]),e.lineEnd()),n=h;else if(s&&n&&a^m){var v;g&i||!(v=r(p,n,!0))||(c=0,a?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!m||n&&kt(n,p)||e.point(p[0],p[1]),n=p,u=m,i=g},lineEnd:function(){u&&e.lineEnd(),n=null},clean:function(){return c|(l&&u)<<1}}}function r(e,t,n){var r=gt(e),o=gt(t),a=[1,0,0],s=yt(r,o),u=vt(s,s),l=s[0],c=u-l*l;if(!c)return!n&&e;var d=i*u/c,f=-i*l/c,h=yt(a,s),p=wt(a,d),m=wt(s,f);xt(p,m);var g=h,v=vt(p,g),y=vt(g,g),x=v*v-y*(vt(p,p)-1);if(!(0>x)){var w=Math.sqrt(x),_=wt(g,(-v-w)/y);if(xt(_,p),_=bt(_),!n)return _;var b,k=e[0],j=t[0],M=e[1],E=t[1];k>j&&(b=k,k=j,j=b);var C=j-k,S=_a(C-Pa)<za,T=S||za>C;if(!S&&M>E&&(b=M,M=E,E=b),T?S?M+E>0^_[1]<(_a(_[0]-k)<za?M:E):M<=_[1]&&_[1]<=E:C>Pa^(k<=_[0]&&_[0]<=j)){var A=wt(g,(-v+w)/y);return xt(A,p),[_,bt(A)]}}}function o(t,n){var r=a?e:Pa-e,o=0;return-r>t?o|=1:t>r&&(o|=2),-r>n?o|=4:n>r&&(o|=8),o}var i=Math.cos(e),a=i>0,s=_a(i)>za,u=gn(e,6*Ba);return Dt(t,n,u,a?[0,-e]:[-Pa,e-Pa])}function Bt(e,t,n,r){return function(o){var i,a=o.a,s=o.b,u=a.x,l=a.y,c=s.x,d=s.y,f=0,h=1,p=c-u,m=d-l;if(i=e-u,p||!(i>0)){if(i/=p,0>p){if(f>i)return;h>i&&(h=i)}else if(p>0){if(i>h)return;i>f&&(f=i)}if(i=n-u,p||!(0>i)){if(i/=p,0>p){if(i>h)return;i>f&&(f=i)}else if(p>0){if(f>i)return;h>i&&(h=i)}if(i=t-l,m||!(i>0)){if(i/=m,0>m){if(f>i)return;h>i&&(h=i)}else if(m>0){if(i>h)return;i>f&&(f=i)}if(i=r-l,m||!(0>i)){if(i/=m,0>m){if(i>h)return;i>f&&(f=i)}else if(m>0){if(f>i)return;h>i&&(h=i)}return f>0&&(o.a={x:u+f*p,y:l+f*m}),1>h&&(o.b={x:u+h*p,y:l+h*m}),o}}}}}}function Vt(e,t,n,r){function o(r,o){return _a(r[0]-e)<za?o>0?0:3:_a(r[0]-n)<za?o>0?2:1:_a(r[1]-t)<za?o>0?1:0:o>0?3:2}function i(e,t){return a(e.x,t.x)}function a(e,t){var n=o(e,1),r=o(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(s){function u(e){for(var t=0,n=g.length,r=e[1],o=0;n>o;++o)for(var i,a=1,s=g[o],u=s.length,l=s[0];u>a;++a)i=s[a],l[1]<=r?i[1]>r&&ee(l,i,e)>0&&++t:i[1]<=r&&ee(l,i,e)<0&&--t,l=i;return 0!==t}function l(i,s,u,l){var c=0,d=0;if(null==i||(c=o(i,u))!==(d=o(s,u))||a(i,s)<0^u>0){do l.point(0===c||3===c?e:n,c>1?r:t);while((c=(c+u+4)%4)!==d)}else l.point(s[0],s[1])}function c(o,i){return o>=e&&n>=o&&i>=t&&r>=i}function d(e,t){c(e,t)&&s.point(e,t)}function f(){T.point=p,g&&g.push(v=[]),j=!0,k=!1,_=b=NaN}function h(){m&&(p(y,x),w&&k&&C.rejoin(),m.push(C.buffer())),T.point=d,k&&s.lineEnd()}function p(e,t){e=Math.max(-Is,Math.min(Is,e)),t=Math.max(-Is,Math.min(Is,t));var n=c(e,t);if(g&&v.push([e,t]),j)y=e,x=t,w=n,j=!1,n&&(s.lineStart(),s.point(e,t));else if(n&&k)s.point(e,t);else{var r={a:{x:_,y:b},b:{x:e,y:t}};S(r)?(k||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),M=!1):n&&(s.lineStart(),s.point(e,t),M=!1)}_=e,b=t,k=n}var m,g,v,y,x,w,_,b,k,j,M,E=s,C=Ft(),S=Bt(e,t,n,r),T={point:d,lineStart:f,lineEnd:h,polygonStart:function(){s=C,m=[],g=[],M=!0},polygonEnd:function(){s=E,m=la.merge(m);var t=u([e,r]),n=M&&t,o=m.length;(n||o)&&(s.polygonStart(),n&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),o&&Nt(m,i,t,l,s),s.polygonEnd()),m=g=v=null}};return T}}function Ut(e){var t=0,n=Pa/3,r=un(e),o=r(t,n);return o.parallels=function(e){return arguments.length?r(t=e[0]*Pa/180,n=e[1]*Pa/180):[t/Pa*180,n/Pa*180]},o}function Wt(e,t){function n(e,t){var n=Math.sqrt(i-2*o*Math.sin(t))/o;return[n*Math.sin(e*=o),a-n*Math.cos(e)]}var r=Math.sin(e),o=(r+Math.sin(t))/2,i=1+r*(2*o-r),a=Math.sqrt(i)/o;return n.invert=function(e,t){var n=a-t;return[Math.atan2(e,n)/o,ne((i-(e*e+n*n)*o*o)/(2*o))]},n}function Yt(){function e(e,t){$s+=o*e-r*t,r=e,o=t}var t,n,r,o;Ys.point=function(i,a){Ys.point=e,t=r=i,n=o=a},Ys.lineEnd=function(){e(t,n)}}function Xt(e,t){Bs>e&&(Bs=e),e>Us&&(Us=e),Vs>t&&(Vs=t),t>Ws&&(Ws=t)}function Jt(){function e(e,t){a.push("M",e,",",t,i)}function t(e,t){a.push("M",e,",",t),s.point=n}function n(e,t){a.push("L",e,",",t)}function r(){s.point=e}function o(){a.push("Z")}var i=Zt(4.5),a=[],s={point:e,lineStart:function(){s.point=t},lineEnd:r,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=r,s.point=e},pointRadius:function(e){return i=Zt(e),s},result:function(){if(a.length){var e=a.join("");return a=[],e}}};return s}function Zt(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Kt(e,t){Ts+=e,As+=t,++Ns}function Gt(){function e(e,r){var o=e-t,i=r-n,a=Math.sqrt(o*o+i*i);Os+=a*(t+e)/2,qs+=a*(n+r)/2,Ds+=a,Kt(t=e,n=r)}var t,n;Js.point=function(r,o){Js.point=e,Kt(t=r,n=o)}}function Qt(){Js.point=Kt}function en(){function e(e,t){var n=e-r,i=t-o,a=Math.sqrt(n*n+i*i);Os+=a*(r+e)/2,qs+=a*(o+t)/2,Ds+=a,a=o*e-r*t,Ls+=a*(r+e),Fs+=a*(o+t),zs+=3*a,Kt(r=e,o=t)}var t,n,r,o;Js.point=function(i,a){Js.point=e,Kt(t=r=i,n=o=a)},Js.lineEnd=function(){e(t,n)}}function tn(e){function t(t,n){e.moveTo(t+a,n),e.arc(t,n,a,0,Ia)}function n(t,n){e.moveTo(t,n),s.point=r}function r(t,n){e.lineTo(t,n)}function o(){s.point=t}function i(){e.closePath()}var a=4.5,s={point:t,lineStart:function(){s.point=n},lineEnd:o,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=o,s.point=t},pointRadius:function(e){return a=e,s},result:b};return s}function nn(e){function t(e){return(s?r:n)(e)}function n(t){return an(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function r(t){function n(n,r){n=e(n,r),t.point(n[0],n[1])}function r(){x=NaN,j.point=i,t.lineStart()}function i(n,r){var i=gt([n,r]),a=e(n,r);o(x,w,y,_,b,k,x=a[0],w=a[1],y=n,_=i[0],b=i[1],k=i[2],s,t),t.point(x,w)}function a(){j.point=n,t.lineEnd()}function u(){r(),j.point=l,j.lineEnd=c}function l(e,t){i(d=e,f=t),h=x,p=w,m=_,g=b,v=k,j.point=i}function c(){o(x,w,y,_,b,k,h,p,d,m,g,v,s,t),j.lineEnd=a,a()}var d,f,h,p,m,g,v,y,x,w,_,b,k,j={point:n,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),j.lineStart=u},polygonEnd:function(){t.polygonEnd(),j.lineStart=r}};return j}function o(t,n,r,s,u,l,c,d,f,h,p,m,g,v){var y=c-t,x=d-n,w=y*y+x*x;if(w>4*i&&g--){var _=s+h,b=u+p,k=l+m,j=Math.sqrt(_*_+b*b+k*k),M=Math.asin(k/=j),E=_a(_a(k)-1)<za||_a(r-f)<za?(r+f)/2:Math.atan2(b,_),C=e(E,M),S=C[0],T=C[1],A=S-t,N=T-n,O=x*A-y*N;(O*O/w>i||_a((y*A+x*N)/w-.5)>.3||a>s*h+u*p+l*m)&&(o(t,n,r,s,u,l,S,T,E,_/=j,b/=j,k,g,v),v.point(S,T),o(S,T,E,_,b,k,c,d,f,h,p,m,g,v))}}var i=.5,a=Math.cos(30*Ba),s=16;return t.precision=function(e){return arguments.length?(s=(i=e*e)>0&&16,t):Math.sqrt(i)},t}function rn(e){var t=nn(function(t,n){return e([t*Va,n*Va])});return function(e){return ln(t(e))}}function on(e){this.stream=e}function an(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function sn(e){return un(function(){return e})()}function un(e){function t(e){return e=s(e[0]*Ba,e[1]*Ba),[e[0]*f+u,l-e[1]*f]}function n(e){return e=s.invert((e[0]-u)/f,(l-e[1])/f),e&&[e[0]*Va,e[1]*Va]}function r(){s=Tt(a=fn(v,y,w),i);var e=i(m,g);return u=h-e[0]*f,l=p+e[1]*f,o()}function o(){return c&&(c.valid=!1,c=null),t}var i,a,s,u,l,c,d=nn(function(e,t){return e=i(e,t),[e[0]*f+u,l-e[1]*f]}),f=150,h=480,p=250,m=0,g=0,v=0,y=0,w=0,_=Ps,b=x,k=null,j=null;return t.stream=function(e){return c&&(c.valid=!1),c=ln(_(a,d(b(e)))),c.valid=!0,c},t.clipAngle=function(e){return arguments.length?(_=null==e?(k=e,Ps):$t((k=+e)*Ba),o()):k},t.clipExtent=function(e){return arguments.length?(j=e,b=e?Vt(e[0][0],e[0][1],e[1][0],e[1][1]):x,o()):j},t.scale=function(e){return arguments.length?(f=+e,r()):f},t.translate=function(e){return arguments.length?(h=+e[0],p=+e[1],r()):[h,p]},t.center=function(e){return arguments.length?(m=e[0]%360*Ba,g=e[1]%360*Ba,r()):[m*Va,g*Va]},t.rotate=function(e){return arguments.length?(v=e[0]%360*Ba,y=e[1]%360*Ba,w=e.length>2?e[2]%360*Ba:0,r()):[v*Va,y*Va,w*Va]},la.rebind(t,d,"precision"),function(){return i=e.apply(this,arguments),t.invert=i.invert&&n,r()}}function ln(e){return an(e,function(t,n){e.point(t*Ba,n*Ba)})}function cn(e,t){return[e,t]}function dn(e,t){return[e>Pa?e-Ia:-Pa>e?e+Ia:e,t]}function fn(e,t,n){return e?t||n?Tt(pn(e),mn(t,n)):pn(e):t||n?mn(t,n):dn}function hn(e){return function(t,n){return t+=e,[t>Pa?t-Ia:-Pa>t?t+Ia:t,n]}}function pn(e){var t=hn(e);return t.invert=hn(-e),t}function mn(e,t){function n(e,t){var n=Math.cos(t),s=Math.cos(e)*n,u=Math.sin(e)*n,l=Math.sin(t),c=l*r+s*o;return[Math.atan2(u*i-c*a,s*r-l*o),ne(c*i+u*a)]}var r=Math.cos(e),o=Math.sin(e),i=Math.cos(t),a=Math.sin(t);return n.invert=function(e,t){var n=Math.cos(t),s=Math.cos(e)*n,u=Math.sin(e)*n,l=Math.sin(t),c=l*i-u*a;return[Math.atan2(u*i+l*a,s*r+c*o),ne(c*r-s*o)]},n}function gn(e,t){var n=Math.cos(e),r=Math.sin(e);return function(o,i,a,s){var u=a*t;null!=o?(o=vn(n,o),i=vn(n,i),(a>0?i>o:o>i)&&(o+=a*Ia)):(o=e+a*Ia,i=e-.5*u);for(var l,c=o;a>0?c>i:i>c;c-=u)s.point((l=bt([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],l[1])}}function vn(e,t){var n=gt(t);n[0]-=e,_t(n);var r=te(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-za)%(2*Math.PI)}function yn(e,t,n){var r=la.range(e,t-za,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function xn(e,t,n){var r=la.range(e,t-za,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function wn(e){return e.source}function _n(e){return e.target}function bn(e,t,n,r){var o=Math.cos(t),i=Math.sin(t),a=Math.cos(r),s=Math.sin(r),u=o*Math.cos(e),l=o*Math.sin(e),c=a*Math.cos(n),d=a*Math.sin(n),f=2*Math.asin(Math.sqrt(ae(r-t)+o*a*ae(n-e))),h=1/Math.sin(f),p=f?function(e){var t=Math.sin(e*=f)*h,n=Math.sin(f-e)*h,r=n*u+t*c,o=n*l+t*d,a=n*i+t*s;return[Math.atan2(o,r)*Va,Math.atan2(a,Math.sqrt(r*r+o*o))*Va]}:function(){return[e*Va,t*Va]};return p.distance=f,p}function kn(){function e(e,o){var i=Math.sin(o*=Ba),a=Math.cos(o),s=_a((e*=Ba)-t),u=Math.cos(s);Zs+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*i-n*a*u)*s),n*i+r*a*u),t=e,n=i,r=a}var t,n,r;Ks.point=function(o,i){t=o*Ba,n=Math.sin(i*=Ba),r=Math.cos(i),Ks.point=e},Ks.lineEnd=function(){Ks.point=Ks.lineEnd=b}}function jn(e,t){function n(t,n){var r=Math.cos(t),o=Math.cos(n),i=e(r*o);return[i*o*Math.sin(t),i*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),o=t(r),i=Math.sin(o),a=Math.cos(o);return[Math.atan2(e*i,r*a),Math.asin(r&&n*i/r)]},n}function Mn(e,t){function n(e,t){a>0?-$a+za>t&&(t=-$a+za):t>$a-za&&(t=$a-za);var n=a/Math.pow(o(t),i);return[n*Math.sin(i*e),a-n*Math.cos(i*e)]}var r=Math.cos(e),o=function(e){return Math.tan(Pa/4+e/2)},i=e===t?Math.sin(e):Math.log(r/Math.cos(t))/Math.log(o(t)/o(e)),a=r*Math.pow(o(e),i)/i;return i?(n.invert=function(e,t){var n=a-t,r=Q(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(a/r,1/i))-$a]},n):Cn}function En(e,t){function n(e,t){var n=i-t;return[n*Math.sin(o*e),i-n*Math.cos(o*e)]}var r=Math.cos(e),o=e===t?Math.sin(e):(r-Math.cos(t))/(t-e),i=r/o+e;return _a(o)<za?cn:(n.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/o,i-Q(o)*Math.sqrt(e*e+n*n)]},n)}function Cn(e,t){return[e,Math.log(Math.tan(Pa/4+t/2))]}function Sn(e){var t,n=sn(e),r=n.scale,o=n.translate,i=n.clipExtent;return n.scale=function(){var e=r.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.translate=function(){var e=o.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.clipExtent=function(e){var a=i.apply(n,arguments);if(a===n){if(t=null==e){var s=Pa*r(),u=o();i([[u[0]-s,u[1]-s],[u[0]+s,u[1]+s]])}}else t&&(a=null);return a},n.clipExtent(null)}function Tn(e,t){return[Math.log(Math.tan(Pa/4+t/2)),-e]}function An(e){return e[0]}function Nn(e){return e[1]}function On(e){for(var t=e.length,n=[0,1],r=2,o=2;t>o;o++){for(;r>1&&ee(e[n[r-2]],e[n[r-1]],e[o])<=0;)--r;n[r++]=o}return n.slice(0,r)}function qn(e,t){return e[0]-t[0]||e[1]-t[1]}function Dn(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Ln(e,t,n,r){var o=e[0],i=n[0],a=t[0]-o,s=r[0]-i,u=e[1],l=n[1],c=t[1]-u,d=r[1]-l,f=(s*(u-l)-d*(o-i))/(d*a-s*c);return[o+f*a,u+f*c]}function Fn(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}function zn(){or(this),this.edge=this.site=this.circle=null}function Rn(e){var t=lu.pop()||new zn;return t.site=e,t}function Pn(e){Jn(e),au.remove(e),lu.push(e),or(e)}function In(e){var t=e.circle,n=t.x,r=t.cy,o={x:n,y:r},i=e.P,a=e.N,s=[e];Pn(e);for(var u=i;u.circle&&_a(n-u.circle.x)<za&&_a(r-u.circle.cy)<za;)i=u.P,s.unshift(u),Pn(u),u=i;s.unshift(u),Jn(u);for(var l=a;l.circle&&_a(n-l.circle.x)<za&&_a(r-l.circle.cy)<za;)a=l.N,s.push(l),Pn(l),l=a;s.push(l),Jn(l);var c,d=s.length;for(c=1;d>c;++c)l=s[c],u=s[c-1],tr(l.edge,u.site,l.site,o);u=s[0],l=s[d-1],l.edge=Qn(u.site,l.site,null,o),Xn(u),Xn(l)}function Hn(e){for(var t,n,r,o,i=e.x,a=e.y,s=au._;s;)if(r=$n(s,a)-i,r>za)s=s.L;else{if(o=i-Bn(s,a),!(o>za)){r>-za?(t=s.P,n=s):o>-za?(t=s,n=s.N):t=n=s;break}if(!s.R){t=s;break}s=s.R}var u=Rn(e);if(au.insert(t,u),t||n){if(t===n)return Jn(t),n=Rn(t.site),au.insert(u,n),u.edge=n.edge=Qn(t.site,u.site),Xn(t),void Xn(n);if(!n)return void(u.edge=Qn(t.site,u.site));Jn(t),Jn(n);var l=t.site,c=l.x,d=l.y,f=e.x-c,h=e.y-d,p=n.site,m=p.x-c,g=p.y-d,v=2*(f*g-h*m),y=f*f+h*h,x=m*m+g*g,w={x:(g*y-h*x)/v+c,y:(f*x-m*y)/v+d};tr(n.edge,l,p,w),u.edge=Qn(l,e,null,w),n.edge=Qn(e,p,null,w),Xn(t),Xn(n)}}function $n(e,t){var n=e.site,r=n.x,o=n.y,i=o-t;if(!i)return r;var a=e.P;if(!a)return-(1/0);n=a.site;var s=n.x,u=n.y,l=u-t;if(!l)return s;var c=s-r,d=1/i-1/l,f=c/l;return d?(-f+Math.sqrt(f*f-2*d*(c*c/(-2*l)-u+l/2+o-i/2)))/d+r:(r+s)/2}function Bn(e,t){var n=e.N;if(n)return $n(n,t);var r=e.site;return r.y===t?r.x:1/0}function Vn(e){this.site=e,this.edges=[]}function Un(e){for(var t,n,r,o,i,a,s,u,l,c,d=e[0][0],f=e[1][0],h=e[0][1],p=e[1][1],m=iu,g=m.length;g--;)if(i=m[g],i&&i.prepare())for(s=i.edges,u=s.length,a=0;u>a;)c=s[a].end(),r=c.x,o=c.y,l=s[++a%u].start(),t=l.x,n=l.y,(_a(r-t)>za||_a(o-n)>za)&&(s.splice(a,0,new nr(er(i.site,c,_a(r-d)<za&&p-o>za?{x:d,y:_a(t-d)<za?n:p}:_a(o-p)<za&&f-r>za?{x:_a(n-p)<za?t:f,y:p}:_a(r-f)<za&&o-h>za?{x:f,y:_a(t-f)<za?n:h}:_a(o-h)<za&&r-d>za?{x:_a(n-h)<za?t:d,y:h}:null),i.site,null)),++u)}function Wn(e,t){return t.angle-e.angle}function Yn(){or(this),this.x=this.y=this.arc=this.site=this.cy=null}function Xn(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,o=e.site,i=n.site;if(r!==i){var a=o.x,s=o.y,u=r.x-a,l=r.y-s,c=i.x-a,d=i.y-s,f=2*(u*d-l*c);if(!(f>=-Ra)){var h=u*u+l*l,p=c*c+d*d,m=(d*h-l*p)/f,g=(u*p-c*h)/f,d=g+s,v=cu.pop()||new Yn;v.arc=e,v.site=o,v.x=m+a,v.y=d+Math.sqrt(m*m+g*g),v.cy=d,e.circle=v;for(var y=null,x=uu._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}uu.insert(y,v),y||(su=v)}}}}function Jn(e){var t=e.circle;t&&(t.P||(su=t.N),uu.remove(t),cu.push(t),or(t),e.circle=null)}function Zn(e){for(var t,n=ou,r=Bt(e[0][0],e[0][1],e[1][0],e[1][1]),o=n.length;o--;)t=n[o],(!Kn(t,e)||!r(t)||_a(t.a.x-t.b.x)<za&&_a(t.a.y-t.b.y)<za)&&(t.a=t.b=null,n.splice(o,1))}function Kn(e,t){var n=e.b;if(n)return!0;var r,o,i=e.a,a=t[0][0],s=t[1][0],u=t[0][1],l=t[1][1],c=e.l,d=e.r,f=c.x,h=c.y,p=d.x,m=d.y,g=(f+p)/2,v=(h+m)/2;if(m===h){if(a>g||g>=s)return;if(f>p){if(i){if(i.y>=l)return}else i={x:g,y:u};n={x:g,y:l}}else{if(i){if(i.y<u)return}else i={x:g,y:l};n={x:g,y:u}}}else if(r=(f-p)/(m-h),o=v-r*g,-1>r||r>1)if(f>p){if(i){if(i.y>=l)return}else i={x:(u-o)/r,y:u};n={x:(l-o)/r,y:l}}else{if(i){if(i.y<u)return}else i={x:(l-o)/r,y:l};n={x:(u-o)/r,y:u}}else if(m>h){if(i){if(i.x>=s)return}else i={x:a,y:r*a+o};n={x:s,y:r*s+o}}else{if(i){if(i.x<a)return}else i={x:s,y:r*s+o};n={x:a,y:r*a+o}}return e.a=i,e.b=n,!0}function Gn(e,t){this.l=e,this.r=t,this.a=this.b=null}function Qn(e,t,n,r){var o=new Gn(e,t);return ou.push(o),n&&tr(o,e,t,n),r&&tr(o,t,e,r),iu[e.i].edges.push(new nr(o,e,t)),iu[t.i].edges.push(new nr(o,t,e)),o}function er(e,t,n){var r=new Gn(e,null);return r.a=t,r.b=n,ou.push(r),r}function tr(e,t,n,r){e.a||e.b?e.l===n?e.b=r:e.a=r:(e.a=r,e.l=t,e.r=n)}function nr(e,t,n){var r=e.a,o=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(o.x-r.x,r.y-o.y):Math.atan2(r.x-o.x,o.y-r.y)}function rr(){this._=null}function or(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function ir(e,t){var n=t,r=t.R,o=n.U;o?o.L===n?o.L=r:o.R=r:e._=r,r.U=o,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function ar(e,t){var n=t,r=t.L,o=n.U;o?o.L===n?o.L=r:o.R=r:e._=r,r.U=o,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function sr(e){for(;e.L;)e=e.L;return e}function ur(e,t){var n,r,o,i=e.sort(lr).pop();for(ou=[],iu=new Array(e.length),au=new rr,uu=new rr;;)if(o=su,i&&(!o||i.y<o.y||i.y===o.y&&i.x<o.x))(i.x!==n||i.y!==r)&&(iu[i.i]=new Vn(i),Hn(i),n=i.x,r=i.y),i=e.pop();else{if(!o)break;In(o.arc)}t&&(Zn(t),Un(t));var a={cells:iu,edges:ou};return au=uu=ou=iu=null,a}function lr(e,t){return t.y-e.y||t.x-e.x}function cr(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function dr(e){return e.x}function fr(e){return e.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(e,t,n,r,o,i){if(!e(t,n,r,o,i)){var a=.5*(n+o),s=.5*(r+i),u=t.nodes;u[0]&&pr(e,u[0],n,r,a,s),u[1]&&pr(e,u[1],a,r,o,s),u[2]&&pr(e,u[2],n,s,a,i),u[3]&&pr(e,u[3],a,s,o,i)}}function mr(e,t,n,r,o,i,a){var s,u=1/0;return function l(e,c,d,f,h){if(!(c>i||d>a||r>f||o>h)){if(p=e.point){var p,m=t-e.x,g=n-e.y,v=m*m+g*g;if(u>v){var y=Math.sqrt(u=v);r=t-y,o=n-y,i=t+y,a=n+y,s=p}}for(var x=e.nodes,w=.5*(c+f),_=.5*(d+h),b=t>=w,k=n>=_,j=k<<1|b,M=j+4;M>j;++j)if(e=x[3&j])switch(3&j){case 0:l(e,c,d,w,_);break;case 1:l(e,w,d,f,_);break;case 2:l(e,c,_,w,h);break;case 3:l(e,w,_,f,h)}}}(e,r,o,i,a),s}function gr(e,t){e=la.rgb(e),t=la.rgb(t);var n=e.r,r=e.g,o=e.b,i=t.r-n,a=t.g-r,s=t.b-o;return function(e){return"#"+_e(Math.round(n+i*e))+_e(Math.round(r+a*e))+_e(Math.round(o+s*e))}}function vr(e,t){var n,r={},o={};for(n in e)n in t?r[n]=wr(e[n],t[n]):o[n]=e[n];for(n in t)n in e||(o[n]=t[n]);return function(e){for(n in r)o[n]=r[n](e);return o}}function yr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xr(e,t){var n,r,o,i=fu.lastIndex=hu.lastIndex=0,a=-1,s=[],u=[];for(e+="",t+="";(n=fu.exec(e))&&(r=hu.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:yr(n,r)})),i=hu.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?(t=u[0].x,function(e){return t(e)+""}):function(){return t}:(t=u.length,function(e){
+for(var n,r=0;t>r;++r)s[(n=u[r]).i]=n.x(e);return s.join("")})}function wr(e,t){for(var n,r=la.interpolators.length;--r>=0&&!(n=la.interpolators[r](e,t)););return n}function _r(e,t){var n,r=[],o=[],i=e.length,a=t.length,s=Math.min(e.length,t.length);for(n=0;s>n;++n)r.push(wr(e[n],t[n]));for(;i>n;++n)o[n]=e[n];for(;a>n;++n)o[n]=t[n];return function(e){for(n=0;s>n;++n)o[n]=r[n](e);return o}}function br(e){return function(t){return 0>=t?0:t>=1?1:e(t)}}function kr(e){return function(t){return 1-e(1-t)}}function jr(e){return function(t){return.5*(.5>t?e(2*t):2-e(2-2*t))}}function Mr(e){return e*e}function Er(e){return e*e*e}function Cr(e){if(0>=e)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(.5>e?n:3*(e-t)+n-.75)}function Sr(e){return function(t){return Math.pow(t,e)}}function Tr(e){return 1-Math.cos(e*$a)}function Ar(e){return Math.pow(2,10*(e-1))}function Nr(e){return 1-Math.sqrt(1-e*e)}function Or(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Ia*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Ia/t)}}function qr(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function Dr(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Lr(e,t){e=la.hcl(e),t=la.hcl(t);var n=e.h,r=e.c,o=e.l,i=t.h-n,a=t.c-r,s=t.l-o;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,n=isNaN(n)?t.h:n):i>180?i-=360:-180>i&&(i+=360),function(e){return de(n+i*e,r+a*e,o+s*e)+""}}function Fr(e,t){e=la.hsl(e),t=la.hsl(t);var n=e.h,r=e.s,o=e.l,i=t.h-n,a=t.s-r,s=t.l-o;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,n=isNaN(n)?t.h:n):i>180?i-=360:-180>i&&(i+=360),function(e){return le(n+i*e,r+a*e,o+s*e)+""}}function zr(e,t){e=la.lab(e),t=la.lab(t);var n=e.l,r=e.a,o=e.b,i=t.l-n,a=t.a-r,s=t.b-o;return function(e){return he(n+i*e,r+a*e,o+s*e)+""}}function Rr(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function Pr(e){var t=[e.a,e.b],n=[e.c,e.d],r=Hr(t),o=Ir(t,n),i=Hr($r(n,t,-o))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,o*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*Va,this.translate=[e.e,e.f],this.scale=[r,i],this.skew=i?Math.atan2(o,i)*Va:0}function Ir(e,t){return e[0]*t[0]+e[1]*t[1]}function Hr(e){var t=Math.sqrt(Ir(e,e));return t&&(e[0]/=t,e[1]/=t),t}function $r(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}function Br(e){return e.length?e.pop()+",":""}function Vr(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var o=n.push("translate(",null,",",null,")");r.push({i:o-4,x:yr(e[0],t[0])},{i:o-2,x:yr(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}function Ur(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Br(n)+"rotate(",null,")")-2,x:yr(e,t)})):t&&n.push(Br(n)+"rotate("+t+")")}function Wr(e,t,n,r){e!==t?r.push({i:n.push(Br(n)+"skewX(",null,")")-2,x:yr(e,t)}):t&&n.push(Br(n)+"skewX("+t+")")}function Yr(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var o=n.push(Br(n)+"scale(",null,",",null,")");r.push({i:o-4,x:yr(e[0],t[0])},{i:o-2,x:yr(e[1],t[1])})}else(1!==t[0]||1!==t[1])&&n.push(Br(n)+"scale("+t+")")}function Xr(e,t){var n=[],r=[];return e=la.transform(e),t=la.transform(t),Vr(e.translate,t.translate,n,r),Ur(e.rotate,t.rotate,n,r),Wr(e.skew,t.skew,n,r),Yr(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,o=-1,i=r.length;++o<i;)n[(t=r[o]).i]=t.x(e);return n.join("")}}function Jr(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function Zr(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function Kr(e){for(var t=e.source,n=e.target,r=Qr(t,n),o=[t];t!==r;)t=t.parent,o.push(t);for(var i=o.length;n!==r;)o.splice(i,0,n),n=n.parent;return o}function Gr(e){for(var t=[],n=e.parent;null!=n;)t.push(e),e=n,n=n.parent;return t.push(e),t}function Qr(e,t){if(e===t)return e;for(var n=Gr(e),r=Gr(t),o=n.pop(),i=r.pop(),a=null;o===i;)a=o,o=n.pop(),i=r.pop();return a}function eo(e){e.fixed|=2}function to(e){e.fixed&=-7}function no(e){e.fixed|=4,e.px=e.x,e.py=e.y}function ro(e){e.fixed&=-5}function oo(e,t,n){var r=0,o=0;if(e.charge=0,!e.leaf)for(var i,a=e.nodes,s=a.length,u=-1;++u<s;)i=a[u],null!=i&&(oo(i,t,n),e.charge+=i.charge,r+=i.charge*i.cx,o+=i.charge*i.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var l=t*n[e.point.index];e.charge+=e.pointCharge=l,r+=l*e.point.x,o+=l*e.point.y}e.cx=r/e.charge,e.cy=o/e.charge}function io(e,t){return la.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=fo,e}function ao(e,t){for(var n=[e];null!=(e=n.pop());)if(t(e),(o=e.children)&&(r=o.length))for(var r,o;--r>=0;)n.push(o[r])}function so(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(i=e.children)&&(o=i.length))for(var o,i,a=-1;++a<o;)n.push(i[a]);for(;null!=(e=r.pop());)t(e)}function uo(e){return e.children}function lo(e){return e.value}function co(e,t){return t.value-e.value}function fo(e){return la.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function ho(e){return e.x}function po(e){return e.y}function mo(e,t,n){e.y0=t,e.y=n}function go(data){return la.range(data.length)}function vo(data){for(var e=-1,t=data[0].length,n=[];++e<t;)n[e]=0;return n}function yo(e){for(var t,n=1,r=0,o=e[0][1],i=e.length;i>n;++n)(t=e[n][1])>o&&(r=n,o=t);return r}function xo(e){return e.reduce(wo,0)}function wo(e,t){return e+t[1]}function _o(e,t){return bo(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function bo(e,t){for(var n=-1,r=+e[0],o=(e[1]-r)/t,i=[];++n<=t;)i[n]=o*n+r;return i}function ko(e){return[la.min(e),la.max(e)]}function jo(e,t){return e.value-t.value}function Mo(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Eo(e,t){e._pack_next=t,t._pack_prev=e}function Co(e,t){var n=t.x-e.x,r=t.y-e.y,o=e.r+t.r;return.999*o*o>n*n+r*r}function So(e){function t(e){c=Math.min(e.x-e.r,c),d=Math.max(e.x+e.r,d),f=Math.min(e.y-e.r,f),h=Math.max(e.y+e.r,h)}if((n=e.children)&&(l=n.length)){var n,r,o,i,a,s,u,l,c=1/0,d=-(1/0),f=1/0,h=-(1/0);if(n.forEach(To),r=n[0],r.x=-r.r,r.y=0,t(r),l>1&&(o=n[1],o.x=o.r,o.y=0,t(o),l>2))for(i=n[2],Oo(r,o,i),t(i),Mo(r,i),r._pack_prev=i,Mo(i,o),o=r._pack_next,a=3;l>a;a++){Oo(r,o,i=n[a]);var p=0,m=1,g=1;for(s=o._pack_next;s!==o;s=s._pack_next,m++)if(Co(s,i)){p=1;break}if(1==p)for(u=r._pack_prev;u!==s._pack_prev&&!Co(u,i);u=u._pack_prev,g++);p?(g>m||m==g&&o.r<r.r?Eo(r,o=s):Eo(r=u,o),a--):(Mo(r,i),o=i,t(i))}var v=(c+d)/2,y=(f+h)/2,x=0;for(a=0;l>a;a++)i=n[a],i.x-=v,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=x,n.forEach(Ao)}}function To(e){e._pack_next=e._pack_prev=e}function Ao(e){delete e._pack_next,delete e._pack_prev}function No(e,t,n,r){var o=e.children;if(e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r,o)for(var i=-1,a=o.length;++i<a;)No(o[i],t,n,r)}function Oo(e,t,n){var r=e.r+n.r,o=t.x-e.x,i=t.y-e.y;if(r&&(o||i)){var a=t.r+n.r,s=o*o+i*i;a*=a,r*=r;var u=.5+(r-a)/(2*s),l=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=e.x+u*o+l*i,n.y=e.y+u*i-l*o}else n.x=e.x+r,n.y=e.y}function qo(e,t){return e.parent==t.parent?1:2}function Do(e){var t=e.children;return t.length?t[0]:e.t}function Lo(e){var t,n=e.children;return(t=n.length)?n[t-1]:e.t}function Fo(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function zo(e){for(var t,n=0,r=0,o=e.children,i=o.length;--i>=0;)t=o[i],t.z+=n,t.m+=n,n+=t.s+(r+=t.c)}function Ro(e,t,n){return e.a.parent===t.parent?e.a:n}function Po(e){return 1+la.max(e,function(e){return e.y})}function Io(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function Ho(e){var t=e.children;return t&&t.length?Ho(t[0]):e}function $o(e){var t,n=e.children;return n&&(t=n.length)?$o(n[t-1]):e}function Bo(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function Vo(e,t){var n=e.x+t[3],r=e.y+t[0],o=e.dx-t[1]-t[3],i=e.dy-t[0]-t[2];return 0>o&&(n+=o/2,o=0),0>i&&(r+=i/2,i=0),{x:n,y:r,dx:o,dy:i}}function Uo(e){var t=e[0],n=e[e.length-1];return n>t?[t,n]:[n,t]}function Wo(e){return e.rangeExtent?e.rangeExtent():Uo(e.range())}function Yo(e,t,n,r){var o=n(e[0],e[1]),i=r(t[0],t[1]);return function(e){return i(o(e))}}function Xo(e,t){var n,r=0,o=e.length-1,i=e[r],a=e[o];return i>a&&(n=r,r=o,o=n,n=i,i=a,a=n),e[r]=t.floor(i),e[o]=t.ceil(a),e}function Jo(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:ju}function Zo(e,t,n,r){var o=[],i=[],a=0,s=Math.min(e.length,t.length)-1;for(e[s]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<=s;)o.push(n(e[a-1],e[a])),i.push(r(t[a-1],t[a]));return function(t){var n=la.bisect(e,t,1,s)-1;return i[n](o[n](t))}}function Ko(e,t,n,r){function o(){var o=Math.min(e.length,t.length)>2?Zo:Yo,u=r?Zr:Jr;return a=o(e,t,u,n),s=o(t,e,u,wr),i}function i(e){return a(e)}var a,s;return i.invert=function(e){return s(e)},i.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},i.range=function(e){return arguments.length?(t=e,o()):t},i.rangeRound=function(e){return i.range(e).interpolate(Rr)},i.clamp=function(e){return arguments.length?(r=e,o()):r},i.interpolate=function(e){return arguments.length?(n=e,o()):n},i.ticks=function(t){return ti(e,t)},i.tickFormat=function(t,n){return ni(e,t,n)},i.nice=function(t){return Qo(e,t),o()},i.copy=function(){return Ko(e,t,n,r)},o()}function Go(e,t){return la.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Qo(e,t){return Xo(e,Jo(ei(e,t)[2]))}function ei(e,t){null==t&&(t=10);var n=Uo(e),r=n[1]-n[0],o=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*o;return.15>=i?o*=10:.35>=i?o*=5:.75>=i&&(o*=2),n[0]=Math.ceil(n[0]/o)*o,n[1]=Math.floor(n[1]/o)*o+.5*o,n[2]=o,n}function ti(e,t){return la.range.apply(la,ei(e,t))}function ni(e,t,n){var r=ei(e,t);if(n){var o=fs.exec(n);if(o.shift(),"s"===o[8]){var i=la.formatPrefix(Math.max(_a(r[0]),_a(r[1])));return o[7]||(o[7]="."+ri(i.scale(r[2]))),o[8]="f",n=la.format(o.join("")),function(e){return n(i.scale(e))+i.symbol}}o[7]||(o[7]="."+oi(o[8],r)),n=o.join("")}else n=",."+ri(r[2])+"f";return la.format(n)}function ri(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function oi(e,t){var n=ri(t[2]);return e in Mu?Math.abs(n-ri(Math.max(_a(t[0]),_a(t[1]))))+ +("e"!==e):n-2*("%"===e)}function ii(e,t,n,r){function o(e){return(n?Math.log(0>e?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function i(e){return n?Math.pow(t,e):-Math.pow(t,-e)}function a(t){return e(o(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((r=t.map(Number)).map(o)),a):r},a.base=function(n){return arguments.length?(t=+n,e.domain(r.map(o)),a):t},a.nice=function(){var t=Xo(r.map(o),n?Math:Cu);return e.domain(t),r=t.map(i),a},a.ticks=function(){var e=Uo(r),a=[],s=e[0],u=e[1],l=Math.floor(o(s)),c=Math.ceil(o(u)),d=t%1?2:t;if(isFinite(c-l)){if(n){for(;c>l;l++)for(var f=1;d>f;f++)a.push(i(l)*f);a.push(i(l))}else for(a.push(i(l));l++<c;)for(var f=d-1;f>0;f--)a.push(i(l)*f);for(l=0;a[l]<s;l++);for(c=a.length;a[c-1]>u;c--);a=a.slice(l,c)}return a},a.tickFormat=function(e,t){if(!arguments.length)return Eu;arguments.length<2?t=Eu:"function"!=typeof t&&(t=la.format(t));var r,s=Math.max(.1,e/a.ticks().length),u=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(e){return e/i(u(o(e)+r))<=s?t(e):""}},a.copy=function(){return ii(e.copy(),t,n,r)},Go(a,e)}function ai(e,t,n){function r(t){return e(o(t))}var o=si(t),i=si(1/t);return r.invert=function(t){return i(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(o)),r):n},r.ticks=function(e){return ti(n,e)},r.tickFormat=function(e,t){return ni(n,e,t)},r.nice=function(e){return r.domain(Qo(n,e))},r.exponent=function(a){return arguments.length?(o=si(t=a),i=si(1/t),e.domain(n.map(o)),r):t},r.copy=function(){return ai(e.copy(),t,n)},Go(r,e)}function si(e){return function(t){return 0>t?-Math.pow(-t,e):Math.pow(t,e)}}function ui(e,t){function n(n){return i[((o.get(n)||("range"===t.t?o.set(n,e.push(n)):NaN))-1)%i.length]}function r(t,n){return la.range(e.length).map(function(e){return t+n*e})}var o,i,a;return n.domain=function(r){if(!arguments.length)return e;e=[],o=new c;for(var i,a=-1,s=r.length;++a<s;)o.has(i=r[a])||o.set(i,e.push(i));return n[t.t].apply(n,t.a)},n.range=function(e){return arguments.length?(i=e,a=0,t={t:"range",a:arguments},n):i},n.rangePoints=function(o,s){arguments.length<2&&(s=0);var u=o[0],l=o[1],c=e.length<2?(u=(u+l)/2,0):(l-u)/(e.length-1+s);return i=r(u+c*s/2,c),a=0,t={t:"rangePoints",a:arguments},n},n.rangeRoundPoints=function(o,s){arguments.length<2&&(s=0);var u=o[0],l=o[1],c=e.length<2?(u=l=Math.round((u+l)/2),0):(l-u)/(e.length-1+s)|0;return i=r(u+Math.round(c*s/2+(l-u-(e.length-1+s)*c)/2),c),a=0,t={t:"rangeRoundPoints",a:arguments},n},n.rangeBands=function(o,s,u){arguments.length<2&&(s=0),arguments.length<3&&(u=s);var l=o[1]<o[0],c=o[l-0],d=o[1-l],f=(d-c)/(e.length-s+2*u);return i=r(c+f*u,f),l&&i.reverse(),a=f*(1-s),t={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(o,s,u){arguments.length<2&&(s=0),arguments.length<3&&(u=s);var l=o[1]<o[0],c=o[l-0],d=o[1-l],f=Math.floor((d-c)/(e.length-s+2*u));return i=r(c+Math.round((d-c-(e.length-s)*f)/2),f),l&&i.reverse(),a=Math.round(f*(1-s)),t={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return a},n.rangeExtent=function(){return Uo(t.a[0])},n.copy=function(){return ui(e,t)},n.domain(e)}function li(e,t){function n(){var n=0,r=t.length;for(s=[];++n<r;)s[n-1]=la.quantile(e,n/r);return a}function a(e){return isNaN(e=+e)?void 0:t[la.bisect(s,e)]}var s;return a.domain=function(t){return arguments.length?(e=t.map(o).filter(i).sort(r),n()):e},a.range=function(e){return arguments.length?(t=e,n()):t},a.quantiles=function(){return s},a.invertExtent=function(n){return n=t.indexOf(n),0>n?[NaN,NaN]:[n>0?s[n-1]:e[0],n<s.length?s[n]:e[e.length-1]]},a.copy=function(){return li(e,t)},n()}function ci(e,t,n){function r(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function o(){return i=n.length/(t-e),a=n.length-1,r}var i,a;return r.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],o()):[e,t]},r.range=function(e){return arguments.length?(n=e,o()):n},r.invertExtent=function(t){return t=n.indexOf(t),t=0>t?NaN:t/i+e,[t,t+1/i]},r.copy=function(){return ci(e,t,n)},o()}function di(e,t){function n(n){return n>=n?t[la.bisect(e,n)]:void 0}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(e){return arguments.length?(t=e,n):t},n.invertExtent=function(n){return n=t.indexOf(n),[e[n-1],e[n]]},n.copy=function(){return di(e,t)},n}function fi(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return ti(e,t)},t.tickFormat=function(t,n){return ni(e,t,n)},t.copy=function(){return fi(e)},t}function hi(){return 0}function pi(e){return e.innerRadius}function mi(e){return e.outerRadius}function gi(e){return e.startAngle}function vi(e){return e.endAngle}function yi(e){return e&&e.padAngle}function xi(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function wi(e,t,n,r,o){var i=e[0]-t[0],a=e[1]-t[1],s=(o?r:-r)/Math.sqrt(i*i+a*a),u=s*a,l=-s*i,c=e[0]+u,d=e[1]+l,f=t[0]+u,h=t[1]+l,p=(c+f)/2,m=(d+h)/2,g=f-c,v=h-d,y=g*g+v*v,x=n-r,w=c*h-f*d,_=(0>v?-1:1)*Math.sqrt(Math.max(0,x*x*y-w*w)),b=(w*v-g*_)/y,k=(-w*g-v*_)/y,j=(w*v+g*_)/y,M=(-w*g+v*_)/y,E=b-p,C=k-m,S=j-p,T=M-m;return E*E+C*C>S*S+T*T&&(b=j,k=M),[[b-u,k-l],[b*n/x,k*n/x]]}function _i(e){function t(data){function t(){u.push("M",i(e(l),s))}for(var a,u=[],l=[],c=-1,d=data.length,f=Ce(n),h=Ce(r);++c<d;)o.call(this,a=data[c],c)?l.push([+f.call(this,a,c),+h.call(this,a,c)]):l.length&&(t(),l=[]);return l.length&&t(),u.length?u.join(""):null}var n=An,r=Nn,o=At,i=bi,a=i.key,s=.7;return t.x=function(e){return arguments.length?(n=e,t):n},t.y=function(e){return arguments.length?(r=e,t):r},t.defined=function(e){return arguments.length?(o=e,t):o},t.interpolate=function(e){return arguments.length?(a="function"==typeof e?i=e:(i=qu.get(e)||bi).key,t):a},t.tension=function(e){return arguments.length?(s=e,t):s},t}function bi(e){return e.length>1?e.join("L"):e+"Z"}function ki(e){return e.join("L")+"Z"}function ji(e){for(var t=0,n=e.length,r=e[0],o=[r[0],",",r[1]];++t<n;)o.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&o.push("H",r[0]),o.join("")}function Mi(e){for(var t=0,n=e.length,r=e[0],o=[r[0],",",r[1]];++t<n;)o.push("V",(r=e[t])[1],"H",r[0]);return o.join("")}function Ei(e){for(var t=0,n=e.length,r=e[0],o=[r[0],",",r[1]];++t<n;)o.push("H",(r=e[t])[0],"V",r[1]);return o.join("")}function Ci(e,t){return e.length<4?bi(e):e[1]+Ai(e.slice(1,-1),Ni(e,t))}function Si(e,t){return e.length<3?ki(e):e[0]+Ai((e.push(e[0]),e),Ni([e[e.length-2]].concat(e,[e[1]]),t))}function Ti(e,t){return e.length<3?bi(e):e[0]+Ai(e,Ni(e,t))}function Ai(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return bi(e);var n=e.length!=t.length,r="",o=e[0],i=e[1],a=t[0],s=a,u=1;if(n&&(r+="Q"+(i[0]-2*a[0]/3)+","+(i[1]-2*a[1]/3)+","+i[0]+","+i[1],o=e[1],u=2),t.length>1){s=t[1],i=e[u],u++,r+="C"+(o[0]+a[0])+","+(o[1]+a[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,u++)i=e[u],s=t[l],r+="S"+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1]}if(n){var c=e[u];r+="Q"+(i[0]+2*s[0]/3)+","+(i[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function Ni(e,t){for(var n,r=[],o=(1-t)/2,i=e[0],a=e[1],s=1,u=e.length;++s<u;)n=i,i=a,a=e[s],r.push([o*(a[0]-n[0]),o*(a[1]-n[1])]);return r}function Oi(e){if(e.length<3)return bi(e);var t=1,n=e.length,r=e[0],o=r[0],i=r[1],a=[o,o,o,(r=e[1])[0]],s=[i,i,i,r[1]],u=[o,",",i,"L",Fi(Fu,a),",",Fi(Fu,s)];for(e.push(e[n-1]);++t<=n;)r=e[t],a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),zi(u,a,s);return e.pop(),u.push("L",r),u.join("")}function qi(e){if(e.length<4)return bi(e);for(var t,n=[],r=-1,o=e.length,i=[0],a=[0];++r<3;)t=e[r],i.push(t[0]),a.push(t[1]);for(n.push(Fi(Fu,i)+","+Fi(Fu,a)),--r;++r<o;)t=e[r],i.shift(),i.push(t[0]),a.shift(),a.push(t[1]),zi(n,i,a);return n.join("")}function Di(e){for(var t,n,r=-1,o=e.length,i=o+4,a=[],s=[];++r<4;)n=e[r%o],a.push(n[0]),s.push(n[1]);for(t=[Fi(Fu,a),",",Fi(Fu,s)],--r;++r<i;)n=e[r%o],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),zi(t,a,s);return t.join("")}function Li(e,t){var n=e.length-1;if(n)for(var r,o,i=e[0][0],a=e[0][1],s=e[n][0]-i,u=e[n][1]-a,l=-1;++l<=n;)r=e[l],o=l/n,r[0]=t*r[0]+(1-t)*(i+o*s),r[1]=t*r[1]+(1-t)*(a+o*u);return Oi(e)}function Fi(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function zi(e,t,n){e.push("C",Fi(Du,t),",",Fi(Du,n),",",Fi(Lu,t),",",Fi(Lu,n),",",Fi(Fu,t),",",Fi(Fu,n))}function Ri(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Pi(e){for(var t=0,n=e.length-1,r=[],o=e[0],i=e[1],a=r[0]=Ri(o,i);++t<n;)r[t]=(a+(a=Ri(o=i,i=e[t+1])))/2;return r[t]=a,r}function Ii(e){for(var t,n,r,o,i=[],a=Pi(e),s=-1,u=e.length-1;++s<u;)t=Ri(e[s],e[s+1]),_a(t)<za?a[s]=a[s+1]=0:(n=a[s]/t,r=a[s+1]/t,o=n*n+r*r,o>9&&(o=3*t/Math.sqrt(o),a[s]=o*n,a[s+1]=o*r));for(s=-1;++s<=u;)o=(e[Math.min(u,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),i.push([o||0,a[s]*o||0]);return i}function Hi(e){return e.length<3?bi(e):e[0]+Ai(e,Ii(e))}function $i(e){for(var t,n,r,o=-1,i=e.length;++o<i;)t=e[o],n=t[0],r=t[1]-$a,t[0]=n*Math.cos(r),t[1]=n*Math.sin(r);return e}function Bi(e){function t(data){function t(){p.push("M",s(e(g),d),c,l(e(m.reverse()),d),"Z")}for(var u,f,h,p=[],m=[],g=[],v=-1,y=data.length,x=Ce(n),w=Ce(o),_=n===r?function(){return f}:Ce(r),b=o===i?function(){return h}:Ce(i);++v<y;)a.call(this,u=data[v],v)?(m.push([f=+x.call(this,u,v),h=+w.call(this,u,v)]),g.push([+_.call(this,u,v),+b.call(this,u,v)])):m.length&&(t(),m=[],g=[]);return m.length&&t(),p.length?p.join(""):null}var n=An,r=An,o=0,i=Nn,a=At,s=bi,u=s.key,l=s,c="L",d=.7;return t.x=function(e){return arguments.length?(n=r=e,t):r},t.x0=function(e){return arguments.length?(n=e,t):n},t.x1=function(e){return arguments.length?(r=e,t):r},t.y=function(e){return arguments.length?(o=i=e,t):i},t.y0=function(e){return arguments.length?(o=e,t):o},t.y1=function(e){return arguments.length?(i=e,t):i},t.defined=function(e){return arguments.length?(a=e,t):a},t.interpolate=function(e){return arguments.length?(u="function"==typeof e?s=e:(s=qu.get(e)||bi).key,l=s.reverse||s,c=s.closed?"M":"L",t):u},t.tension=function(e){return arguments.length?(d=e,t):d},t}function Vi(e){return e.radius}function Ui(e){return[e.x,e.y]}function Wi(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-$a;return[n*Math.cos(r),n*Math.sin(r)]}}function Yi(){return 64}function Xi(){return"circle"}function Ji(e){var t=Math.sqrt(e/Pa);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Zi(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Ki(e,t,n){return Ea(e,Bu),e.namespace=t,e.id=n,e}function Gi(e,t,n,r){var o=e.id,i=e.namespace;return V(e,"function"==typeof n?function(e,a,s){e[i][o].tween.set(t,r(n.call(e,e.__data__,a,s)))}:(n=r(n),function(e){e[i][o].tween.set(t,n)}))}function Qi(e){return null==e&&(e=""),function(){this.textContent=e}}function ea(e){return null==e?"__transition__":"__transition_"+e+"__"}function ta(e,t,n,r,o){function i(e){var t=m.delay;return l.t=t+u,e>=t?a(e-t):void(l.c=a)}function a(n){var o=p.active,i=p[o];i&&(i.timer.c=null,i.timer.t=NaN,--p.count,delete p[o],i.event&&i.event.interrupt.call(e,e.__data__,i.index));for(var a in p)if(r>+a){var c=p[a];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[a]}l.c=s,Oe(function(){return l.c&&s(n||1)&&(l.c=null,l.t=NaN),1},0,u),p.active=r,m.event&&m.event.start.call(e,e.__data__,t),h=[],m.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&h.push(r)}),f=m.ease,d=m.duration}function s(o){for(var i=o/d,a=f(i),s=h.length;s>0;)h[--s].call(e,a);return i>=1?(m.event&&m.event.end.call(e,e.__data__,t),--p.count?delete p[r]:delete e[n],1):void 0}var u,l,d,f,h,p=e[n]||(e[n]={active:0,count:0}),m=p[r];m||(u=o.time,l=Oe(i,0,u),m=p[r]={tween:new c,time:u,timer:l,delay:o.delay,duration:o.duration,ease:o.ease,index:t},o=null,++p.count)}function na(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function ra(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}function oa(e){return e.toISOString()}function ia(e,t,n){function r(t){return e(t)}function o(e,n){var r=e[1]-e[0],o=r/n,i=la.bisect(Gu,o);return i==Gu.length?[t.year,ei(e.map(function(e){return e/31536e6}),n)[2]]:i?t[o/Gu[i-1]<Gu[i]/o?i-1:i]:[tl,ei(e,n)[2]]}return r.invert=function(t){return aa(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain().map(aa)},r.nice=function(e,t){function n(n){return!isNaN(n)&&!e.range(n,aa(+n+1),t).length}var i=r.domain(),a=Uo(i),s=null==e?o(a,10):"number"==typeof e&&o(a,e);return s&&(e=s[0],t=s[1]),r.domain(Xo(i,t>1?{floor:function(t){for(;n(t=e.floor(t));)t=aa(t-1);return t},ceil:function(t){for(;n(t=e.ceil(t));)t=aa(+t+1);return t}}:e))},r.ticks=function(e,t){var n=Uo(r.domain()),i=null==e?o(n,10):"number"==typeof e?o(n,e):!e.range&&[{range:e},t];return i&&(e=i[0],t=i[1]),e.range(n[0],aa(+n[1]+1),1>t?1:t)},r.tickFormat=function(){return n},r.copy=function(){return ia(e.copy(),t,n)},Go(r,e)}function aa(e){return new Date(e)}function sa(e){return JSON.parse(e.responseText)}function ua(e){var t=fa.createRange();return t.selectNode(fa.body),t.createContextualFragment(e.responseText)}var la={version:"3.5.10"},ca=[].slice,da=function(e){return ca.call(e)},fa=this.document;if(fa)try{da(fa.documentElement.childNodes)[0].nodeType}catch(ha){da=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),fa)try{fa.createElement("DIV").style.setProperty("opacity",0,"")}catch(pa){var ma=this.Element.prototype,ga=ma.setAttribute,va=ma.setAttributeNS,ya=this.CSSStyleDeclaration.prototype,xa=ya.setProperty;ma.setAttribute=function(e,t){ga.call(this,e,t+"")},ma.setAttributeNS=function(e,t,n){va.call(this,e,t,n+"")},ya.setProperty=function(e,t,n){xa.call(this,e,t+"",n)}}la.ascending=r,la.descending=function(e,t){return e>t?-1:t>e?1:t>=e?0:NaN},la.min=function(e,t){var n,r,o=-1,i=e.length;if(1===arguments.length){for(;++o<i;)if(null!=(r=e[o])&&r>=r){n=r;break}for(;++o<i;)null!=(r=e[o])&&n>r&&(n=r)}else{for(;++o<i;)if(null!=(r=t.call(e,e[o],o))&&r>=r){n=r;break}for(;++o<i;)null!=(r=t.call(e,e[o],o))&&n>r&&(n=r)}return n},la.max=function(e,t){var n,r,o=-1,i=e.length;if(1===arguments.length){for(;++o<i;)if(null!=(r=e[o])&&r>=r){n=r;break}for(;++o<i;)null!=(r=e[o])&&r>n&&(n=r)}else{for(;++o<i;)if(null!=(r=t.call(e,e[o],o))&&r>=r){n=r;break}for(;++o<i;)null!=(r=t.call(e,e[o],o))&&r>n&&(n=r)}return n},la.extent=function(e,t){var n,r,o,i=-1,a=e.length;if(1===arguments.length){for(;++i<a;)if(null!=(r=e[i])&&r>=r){n=o=r;break}for(;++i<a;)null!=(r=e[i])&&(n>r&&(n=r),r>o&&(o=r))}else{for(;++i<a;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=o=r;break}for(;++i<a;)null!=(r=t.call(e,e[i],i))&&(n>r&&(n=r),r>o&&(o=r))}return[n,o]},la.sum=function(e,t){var n,r=0,o=e.length,a=-1;if(1===arguments.length)for(;++a<o;)i(n=+e[a])&&(r+=n);else for(;++a<o;)i(n=+t.call(e,e[a],a))&&(r+=n);return r},la.mean=function(e,t){var n,r=0,a=e.length,s=-1,u=a;if(1===arguments.length)for(;++s<a;)i(n=o(e[s]))?r+=n:--u;else for(;++s<a;)i(n=o(t.call(e,e[s],s)))?r+=n:--u;return u?r/u:void 0},la.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),o=+e[r-1],i=n-r;return i?o+i*(e[r]-o):o},la.median=function(e,t){var n,a=[],s=e.length,u=-1;if(1===arguments.length)for(;++u<s;)i(n=o(e[u]))&&a.push(n);else for(;++u<s;)i(n=o(t.call(e,e[u],u)))&&a.push(n);return a.length?la.quantile(a.sort(r),.5):void 0},la.variance=function(e,t){var n,r,a=e.length,s=0,u=0,l=-1,c=0;if(1===arguments.length)for(;++l<a;)i(n=o(e[l]))&&(r=n-s,s+=r/++c,u+=r*(n-s));else for(;++l<a;)i(n=o(t.call(e,e[l],l)))&&(r=n-s,s+=r/++c,u+=r*(n-s));return c>1?u/(c-1):void 0},la.deviation=function(){var e=la.variance.apply(this,arguments);return e?Math.sqrt(e):e};var wa=a(r);la.bisectLeft=wa.left,la.bisect=la.bisectRight=wa.right,la.bisector=function(e){return a(1===e.length?function(t,n){return r(e(t),n)}:e)},la.shuffle=function(e,t,n){(i=arguments.length)<3&&(n=e.length,2>i&&(t=0));for(var r,o,i=n-t;i;)o=Math.random()*i--|0,r=e[i+t],e[i+t]=e[o+t],e[o+t]=r;return e},la.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},la.pairs=function(e){for(var t,n=0,r=e.length-1,o=e[0],i=new Array(0>r?0:r);r>n;)i[n]=[t=o,o=e[++n]];return i},la.zip=function(){if(!(r=arguments.length))return[];for(var e=-1,t=la.min(arguments,s),n=new Array(t);++e<t;)for(var r,o=-1,i=n[e]=new Array(r);++o<r;)i[o]=arguments[o][e];return n},la.transpose=function(e){return la.zip.apply(la,e)},la.keys=function(e){var t=[];for(var n in e)t.push(n);return t},la.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},la.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},la.merge=function(e){for(var t,n,r,o=e.length,i=-1,a=0;++i<o;)a+=e[i].length;for(n=new Array(a);--o>=0;)for(r=e[o],t=r.length;--t>=0;)n[--a]=r[t];return n};var _a=Math.abs;la.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n===1/0)throw new Error("infinite range");var r,o=[],i=u(_a(n)),a=-1;if(e*=i,t*=i,n*=i,0>n)for(;(r=e+n*++a)>t;)o.push(r/i);else for(;(r=e+n*++a)<t;)o.push(r/i);return o},la.map=function(e,t){var n=new c;if(e instanceof c)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r,o=-1,i=e.length;if(1===arguments.length)for(;++o<i;)n.set(o,e[o]);else for(;++o<i;)n.set(t.call(e,r=e[o],o),r)}else for(var a in e)n.set(a,e[a]);return n};var ba="__proto__",ka="\x00";l(c,{has:h,get:function(e){return this._[d(e)]},set:function(e,t){return this._[d(e)]=t},remove:p,keys:m,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:f(t),value:this._[t]});return e},size:g,empty:v,forEach:function(e){for(var t in this._)e.call(this,f(t),this._[t])}}),la.nest=function(){function e(t,a,s){if(s>=i.length)return r?r.call(o,a):n?a.sort(n):a;for(var u,l,d,f,h=-1,p=a.length,m=i[s++],g=new c;++h<p;)(f=g.get(u=m(l=a[h])))?f.push(l):g.set(u,[l]);return t?(l=t(),d=function(n,r){l.set(n,e(t,r,s))}):(l={},d=function(n,r){l[n]=e(t,r,s)}),g.forEach(d),l}function t(e,n){if(n>=i.length)return e;var r=[],o=a[n++];return e.forEach(function(e,o){r.push({key:e,values:t(o,n)})}),o?r.sort(function(e,t){return o(e.key,t.key)}):r}var n,r,o={},i=[],a=[];return o.map=function(t,n){return e(n,t,0)},o.entries=function(n){return t(e(la.map,n,0),0)},o.key=function(e){return i.push(e),o},o.sortKeys=function(e){return a[i.length-1]=e,o},o.sortValues=function(e){return n=e,o},o.rollup=function(e){return r=e,o},o},la.set=function(e){var t=new y;if(e)for(var n=0,r=e.length;r>n;++n)t.add(e[n]);return t},l(y,{has:h,add:function(e){return this._[d(e+="")]=!0,e},remove:p,values:m,size:g,empty:v,forEach:function(e){for(var t in this._)e.call(this,f(t))}}),la.behavior={},la.rebind=function(e,t){for(var n,r=1,o=arguments.length;++r<o;)e[n=arguments[r]]=w(e,t,t[n]);return e};var ja=["webkit","ms","moz","Moz","o","O"];la.dispatch=function(){for(var e=new k,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=j(e);return e},k.prototype.on=function(e,t){var n=e.indexOf("."),r="";if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},la.event=null,la.requote=function(e){return e.replace(Ma,"\\$&")};var Ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ea={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},Ca=function(e,t){return t.querySelector(e)},Sa=function(e,t){return t.querySelectorAll(e)},Ta=function(e,t){var n=e.matches||e[_(e,"matchesSelector")];return(Ta=function(e,t){return n.call(e,t)})(e,t)};"function"==typeof Sizzle&&(Ca=function(e,t){return Sizzle(e,t)[0]||null},Sa=Sizzle,Ta=Sizzle.matchesSelector),la.selection=function(){return la.select(fa.documentElement)};var Aa=la.selection.prototype=[];Aa.select=function(e){var t,n,r,o,i=[];e=T(e);for(var a=-1,s=this.length;++a<s;){i.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var u=-1,l=r.length;++u<l;)(o=r[u])?(t.push(n=e.call(o,o.__data__,u,a)),n&&"__data__"in o&&(n.__data__=o.__data__)):t.push(null)}return S(i)},Aa.selectAll=function(e){var t,n,r=[];e=A(e);for(var o=-1,i=this.length;++o<i;)for(var a=this[o],s=-1,u=a.length;++s<u;)(n=a[s])&&(r.push(t=da(e.call(n,n.__data__,s,o))),t.parentNode=n);return S(r)};var Na={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};la.ns={prefix:Na,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),Na.hasOwnProperty(n)?{space:Na[n],local:e}:e}},Aa.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return e=la.ns.qualify(e),e.local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(N(t,e[t]));return this}return this.each(N(e,t))},Aa.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=D(e)).length,o=-1;if(t=n.classList){for(;++o<r;)if(!t.contains(e[o]))return!1}else for(t=n.getAttribute("class");++o<r;)if(!q(e[o]).test(t))return!1;return!0}for(t in e)this.each(L(t,e[t]));return this}return this.each(L(e,t))},Aa.style=function(e,t,r){var o=arguments.length;if(3>o){if("string"!=typeof e){2>o&&(t="");for(r in e)this.each(z(r,e[r],t));return this}if(2>o){var i=this.node();return n(i).getComputedStyle(i,null).getPropertyValue(e)}r=""}return this.each(z(e,t,r))},Aa.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(R(t,e[t]));
+return this}return this.each(R(e,t))},Aa.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},Aa.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},Aa.append=function(e){return e=P(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},Aa.insert=function(e,t){return e=P(e),t=T(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},Aa.remove=function(){return this.each(I)},Aa.data=function(e,t){function n(e,n){var r,o,i,a=e.length,d=n.length,f=Math.min(a,d),h=new Array(d),p=new Array(d),m=new Array(a);if(t){var g,v=new c,y=new Array(a);for(r=-1;++r<a;)(o=e[r])&&(v.has(g=t.call(o,o.__data__,r))?m[r]=o:v.set(g,o),y[r]=g);for(r=-1;++r<d;)(o=v.get(g=t.call(n,i=n[r],r)))?o!==!0&&(h[r]=o,o.__data__=i):p[r]=H(i),v.set(g,!0);for(r=-1;++r<a;)r in y&&v.get(y[r])!==!0&&(m[r]=e[r])}else{for(r=-1;++r<f;)o=e[r],i=n[r],o?(o.__data__=i,h[r]=o):p[r]=H(i);for(;d>r;++r)p[r]=H(n[r]);for(;a>r;++r)m[r]=e[r]}p.update=h,p.parentNode=h.parentNode=m.parentNode=e.parentNode,s.push(p),u.push(h),l.push(m)}var r,o,i=-1,a=this.length;if(!arguments.length){for(e=new Array(a=(r=this[0]).length);++i<a;)(o=r[i])&&(e[i]=o.__data__);return e}var s=U([]),u=S([]),l=S([]);if("function"==typeof e)for(;++i<a;)n(r=this[i],e.call(r,r.parentNode.__data__,i));else for(;++i<a;)n(r=this[i],e);return u.enter=function(){return s},u.exit=function(){return l},u},Aa.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Aa.filter=function(e){var t,n,r,o=[];"function"!=typeof e&&(e=$(e));for(var i=0,a=this.length;a>i;i++){o.push(t=[]),t.parentNode=(n=this[i]).parentNode;for(var s=0,u=n.length;u>s;s++)(r=n[s])&&e.call(r,r.__data__,s,i)&&t.push(r)}return S(o)},Aa.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n,r=this[e],o=r.length-1,i=r[o];--o>=0;)(n=r[o])&&(i&&i!==n.nextSibling&&i.parentNode.insertBefore(n,i),i=n);return this},Aa.sort=function(e){e=B.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},Aa.each=function(e){return V(this,function(t,n,r){e.call(t,t.__data__,n,r)})},Aa.call=function(e){var t=da(arguments);return e.apply(t[0]=this,t),this},Aa.empty=function(){return!this.node()},Aa.node=function(){for(var e=0,t=this.length;t>e;e++)for(var n=this[e],r=0,o=n.length;o>r;r++){var i=n[r];if(i)return i}return null},Aa.size=function(){var e=0;return V(this,function(){++e}),e};var Oa=[];la.selection.enter=U,la.selection.enter.prototype=Oa,Oa.append=Aa.append,Oa.empty=Aa.empty,Oa.node=Aa.node,Oa.call=Aa.call,Oa.size=Aa.size,Oa.select=function(e){for(var t,n,r,o,i,a=[],s=-1,u=this.length;++s<u;){r=(o=this[s]).update,a.push(t=[]),t.parentNode=o.parentNode;for(var l=-1,c=o.length;++l<c;)(i=o[l])?(t.push(r[l]=n=e.call(o.parentNode,i.__data__,l,s)),n.__data__=i.__data__):t.push(null)}return S(a)},Oa.insert=function(e,t){return arguments.length<2&&(t=W(this)),Aa.insert.call(this,e,t)},la.select=function(t){var n;return"string"==typeof t?(n=[Ca(t,fa)],n.parentNode=fa.documentElement):(n=[t],n.parentNode=e(t)),S([n])},la.selectAll=function(e){var t;return"string"==typeof e?(t=da(Sa(e,fa)),t.parentNode=fa.documentElement):(t=da(e),t.parentNode=null),S([t])},Aa.on=function(e,t,n){var r=arguments.length;if(3>r){if("string"!=typeof e){2>r&&(t=!1);for(n in e)this.each(Y(n,e[n],t));return this}if(2>r)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(Y(e,t,n))};var qa=la.map({mouseenter:"mouseover",mouseleave:"mouseout"});fa&&qa.forEach(function(e){"on"+e in fa&&qa.remove(e)});var Da,La=0;la.mouse=function(e){return K(e,E())};var Fa=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;la.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=E().changedTouches),t)for(var r,o=0,i=t.length;i>o;++o)if((r=t[o]).identifier===n)return K(e,r)},la.behavior.drag=function(){function e(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function t(e,t,n,i,a){return function(){function s(){var e,n,r=t(f,m);r&&(e=r[0]-x[0],n=r[1]-x[1],p|=e|n,x=r,h({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:e,dy:n}))}function u(){t(f,m)&&(v.on(i+g,null).on(a+g,null),y(p),h({type:"dragend"}))}var l,c=this,d=la.event.target,f=c.parentNode,h=r.of(c,arguments),p=0,m=e(),g=".drag"+(null==m?"":"-"+m),v=la.select(n(d)).on(i+g,s).on(a+g,u),y=Z(d),x=t(f,m);o?(l=o.apply(c,arguments),l=[l.x-x[0],l.y-x[1]]):l=[0,0],h({type:"dragstart"})}}var r=C(e,"drag","dragstart","dragend"),o=null,i=t(b,la.mouse,n,"mousemove","mouseup"),a=t(G,la.touch,x,"touchmove","touchend");return e.origin=function(t){return arguments.length?(o=t,e):o},la.rebind(e,r,"on")},la.touches=function(e,t){return arguments.length<2&&(t=E().touches),t?da(t).map(function(t){var n=K(e,t);return n.identifier=t.identifier,n}):[]};var za=1e-6,Ra=za*za,Pa=Math.PI,Ia=2*Pa,Ha=Ia-za,$a=Pa/2,Ba=Pa/180,Va=180/Pa,Ua=Math.SQRT2,Wa=2,Ya=4;la.interpolateZoom=function(e,t){var n,r,o=e[0],i=e[1],a=e[2],s=t[0],u=t[1],l=t[2],c=s-o,d=u-i,f=c*c+d*d;if(Ra>f)r=Math.log(l/a)/Ua,n=function(e){return[o+e*c,i+e*d,a*Math.exp(Ua*e*r)]};else{var h=Math.sqrt(f),p=(l*l-a*a+Ya*f)/(2*a*Wa*h),m=(l*l-a*a-Ya*f)/(2*l*Wa*h),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(m*m+1)-m);r=(v-g)/Ua,n=function(e){var t=e*r,n=oe(g),s=a/(Wa*h)*(n*ie(Ua*t+g)-re(g));return[o+s*c,i+s*d,a*n/oe(Ua*t+g)]}}return n.duration=1e3*r,n},la.behavior.zoom=function(){function e(e){e.on(N,d).on(Ja+".zoom",h).on("dblclick.zoom",p).on(D,f)}function t(e){return[(e[0]-j.x)/j.k,(e[1]-j.y)/j.k]}function r(e){return[e[0]*j.k+j.x,e[1]*j.k+j.y]}function o(e){j.k=Math.max(S[0],Math.min(S[1],e))}function i(e,t){t=r(t),j.x+=e[0]-t[0],j.y+=e[1]-t[1]}function a(t,n,r,a){t.__chart__={x:j.x,y:j.y,k:j.k},o(Math.pow(2,a)),i(g=n,r),t=la.select(t),T>0&&(t=t.transition().duration(T)),t.call(e.event)}function s(){_&&_.domain(w.range().map(function(e){return(e-j.x)/j.k}).map(w.invert)),k&&k.domain(b.range().map(function(e){return(e-j.y)/j.k}).map(b.invert))}function u(e){A++||e({type:"zoomstart"})}function l(e){s(),e({type:"zoom",scale:j.k,translate:[j.x,j.y]})}function c(e){--A||(e({type:"zoomend"}),g=null)}function d(){function e(){s=1,i(la.mouse(o),f),l(a)}function r(){d.on(O,null).on(q,null),h(s),c(a)}var o=this,a=L.of(o,arguments),s=0,d=la.select(n(o)).on(O,e).on(q,r),f=t(la.mouse(o)),h=Z(o);$u.call(o),u(a)}function f(){function e(){var e=la.touches(p);return h=j.k,e.forEach(function(e){e.identifier in g&&(g[e.identifier]=t(e))}),e}function n(){var t=la.event.target;la.select(t).on(w,r).on(_,s),b.push(t);for(var n=la.event.changedTouches,o=0,i=n.length;i>o;++o)g[n[o].identifier]=null;var u=e(),l=Date.now();if(1===u.length){if(500>l-x){var c=u[0];a(p,c,g[c.identifier],Math.floor(Math.log(j.k)/Math.LN2)+1),M()}x=l}else if(u.length>1){var c=u[0],d=u[1],f=c[0]-d[0],h=c[1]-d[1];v=f*f+h*h}}function r(){var e,t,n,r,a=la.touches(p);$u.call(p);for(var s=0,u=a.length;u>s;++s,r=null)if(n=a[s],r=g[n.identifier]){if(t)break;e=n,t=r}if(r){var c=(c=n[0]-e[0])*c+(c=n[1]-e[1])*c,d=v&&Math.sqrt(c/v);e=[(e[0]+n[0])/2,(e[1]+n[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],o(d*h)}x=null,i(e,t),l(m)}function s(){if(la.event.touches.length){for(var t=la.event.changedTouches,n=0,r=t.length;r>n;++n)delete g[t[n].identifier];for(var o in g)return void e()}la.selectAll(b).on(y,null),k.on(N,d).on(D,f),E(),c(m)}var h,p=this,m=L.of(p,arguments),g={},v=0,y=".zoom-"+la.event.changedTouches[0].identifier,w="touchmove"+y,_="touchend"+y,b=[],k=la.select(p),E=Z(p);n(),u(m),k.on(N,null).on(D,n)}function h(){var e=L.of(this,arguments);y?clearTimeout(y):($u.call(this),m=t(g=v||la.mouse(this)),u(e)),y=setTimeout(function(){y=null,c(e)},50),M(),o(Math.pow(2,.002*Xa())*j.k),i(g,m),l(e)}function p(){var e=la.mouse(this),n=Math.log(j.k)/Math.LN2;a(this,e,t(e),la.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var m,g,v,y,x,w,_,b,k,j={x:0,y:0,k:1},E=[960,500],S=Za,T=250,A=0,N="mousedown.zoom",O="mousemove.zoom",q="mouseup.zoom",D="touchstart.zoom",L=C(e,"zoomstart","zoom","zoomend");return Ja||(Ja="onwheel"in fa?(Xa=function(){return-la.event.deltaY*(la.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fa?(Xa=function(){return la.event.wheelDelta},"mousewheel"):(Xa=function(){return-la.event.detail},"MozMousePixelScroll")),e.event=function(e){e.each(function(){var e=L.of(this,arguments),t=j;Iu?la.select(this).transition().each("start.zoom",function(){j=this.__chart__||{x:0,y:0,k:1},u(e)}).tween("zoom:zoom",function(){var n=E[0],r=E[1],o=g?g[0]:n/2,i=g?g[1]:r/2,a=la.interpolateZoom([(o-j.x)/j.k,(i-j.y)/j.k,n/j.k],[(o-t.x)/t.k,(i-t.y)/t.k,n/t.k]);return function(t){var r=a(t),s=n/r[2];this.__chart__=j={x:o-r[0]*s,y:i-r[1]*s,k:s},l(e)}}).each("interrupt.zoom",function(){c(e)}).each("end.zoom",function(){c(e)}):(this.__chart__=j,u(e),l(e),c(e))})},e.translate=function(t){return arguments.length?(j={x:+t[0],y:+t[1],k:j.k},s(),e):[j.x,j.y]},e.scale=function(t){return arguments.length?(j={x:j.x,y:j.y,k:null},o(+t),s(),e):j.k},e.scaleExtent=function(t){return arguments.length?(S=null==t?Za:[+t[0],+t[1]],e):S},e.center=function(t){return arguments.length?(v=t&&[+t[0],+t[1]],e):v},e.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],e):E},e.duration=function(t){return arguments.length?(T=+t,e):T},e.x=function(t){return arguments.length?(_=t,w=t.copy(),j={x:0,y:0,k:1},e):_},e.y=function(t){return arguments.length?(k=t,b=t.copy(),j={x:0,y:0,k:1},e):k},la.rebind(e,L,"on")};var Xa,Ja,Za=[0,1/0];la.color=se,se.prototype.toString=function(){return this.rgb()+""},la.hsl=ue;var Ka=ue.prototype=new se;Ka.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new ue(this.h,this.s,this.l/e)},Ka.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new ue(this.h,this.s,e*this.l)},Ka.rgb=function(){return le(this.h,this.s,this.l)},la.hcl=ce;var Ga=ce.prototype=new se;Ga.brighter=function(e){return new ce(this.h,this.c,Math.min(100,this.l+Qa*(arguments.length?e:1)))},Ga.darker=function(e){return new ce(this.h,this.c,Math.max(0,this.l-Qa*(arguments.length?e:1)))},Ga.rgb=function(){return de(this.h,this.c,this.l).rgb()},la.lab=fe;var Qa=18,es=.95047,ts=1,ns=1.08883,rs=fe.prototype=new se;rs.brighter=function(e){return new fe(Math.min(100,this.l+Qa*(arguments.length?e:1)),this.a,this.b)},rs.darker=function(e){return new fe(Math.max(0,this.l-Qa*(arguments.length?e:1)),this.a,this.b)},rs.rgb=function(){return he(this.l,this.a,this.b)},la.rgb=ye;var os=ye.prototype=new se;os.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,o=30;return t||n||r?(t&&o>t&&(t=o),n&&o>n&&(n=o),r&&o>r&&(r=o),new ye(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new ye(o,o,o)},os.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new ye(e*this.r,e*this.g,e*this.b)},os.hsl=function(){return ke(this.r,this.g,this.b)},os.toString=function(){return"#"+_e(this.r)+_e(this.g)+_e(this.b)};var is=la.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});is.forEach(function(e,t){is.set(e,xe(t))}),la.functor=Ce,la.xhr=Se(x),la.dsv=function(e,t){function n(e,n,i){arguments.length<3&&(i=n,n=null);var a=Te(e,t,null==n?r:o(n),i);return a.row=function(e){return arguments.length?a.response(null==(n=e)?r:o(e)):n},a}function r(e){return n.parse(e.responseText)}function o(e){return function(t){return n.parse(t.responseText,e)}}function i(t){return t.map(a).join(e)}function a(e){return s.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var s=new RegExp('["'+e+"\n]"),u=e.charCodeAt(0);return n.parse=function(e,t){var r;return n.parseRows(e,function(e,n){if(r)return r(e,n-1);var o=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");r=t?function(e,n){return t(o(e),n)}:o})},n.parseRows=function(e,t){function n(){if(c>=l)return a;if(o)return o=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var n=t;n++<l;)if(34===e.charCodeAt(n)){if(34!==e.charCodeAt(n+1))break;++n}c=n+2;var r=e.charCodeAt(n+1);return 13===r?(o=!0,10===e.charCodeAt(n+2)&&++c):10===r&&(o=!0),e.slice(t+1,n).replace(/""/g,'"')}for(;l>c;){var r=e.charCodeAt(c++),s=1;if(10===r)o=!0;else if(13===r)o=!0,10===e.charCodeAt(c)&&(++c,++s);else if(r!==u)continue;return e.slice(t,c-s)}return e.slice(t)}for(var r,o,i={},a={},s=[],l=e.length,c=0,d=0;(r=n())!==a;){for(var f=[];r!==i&&r!==a;)f.push(r),r=n();t&&null==(f=t(f,d++))||s.push(f)}return s},n.format=function(t){if(Array.isArray(t[0]))return n.formatRows(t);var r=new y,o=[];return t.forEach(function(e){for(var t in e)r.has(t)||o.push(r.add(t))}),[o.map(a).join(e)].concat(t.map(function(t){return o.map(function(e){return a(t[e])}).join(e)})).join("\n")},n.formatRows=function(e){return e.map(i).join("\n")},n},la.csv=la.dsv(",","text/csv"),la.tsv=la.dsv(" ","text/tab-separated-values");var as,ss,us,ls,cs=this[_(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};la.timer=function(){Oe.apply(this,arguments)},la.timer.flush=function(){De(),Le()},la.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var ds=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(ze);la.formatPrefix=function(e,t){var n=0;return(e=+e)&&(0>e&&(e*=-1),t&&(e=la.round(e,Fe(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),ds[8+n/3]};var fs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,hs=la.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=la.round(e,Fe(e,t))).toFixed(Math.max(0,Math.min(20,Fe(e*(1+1e-15),t))))}}),ps=la.time={},ms=Date;Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gs.setUTCDate.apply(this._,arguments)},setDay:function(){gs.setUTCDay.apply(this._,arguments)},setFullYear:function(){gs.setUTCFullYear.apply(this._,arguments)},setHours:function(){gs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gs.setUTCSeconds.apply(this._,arguments)},setTime:function(){gs.setTime.apply(this._,arguments)}};var gs=Date.prototype;ps.year=He(function(e){return e=ps.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),ps.years=ps.year.range,ps.years.utc=ps.year.utc.range,ps.day=He(function(e){var t=new ms(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),ps.days=ps.day.range,ps.days.utc=ps.day.utc.range,ps.dayOfYear=function(e){var t=ps.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=ps[e]=He(function(e){return(e=ps.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var n=ps.year(e).getDay();return Math.floor((ps.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});ps[e+"s"]=n.range,ps[e+"s"].utc=n.utc.range,ps[e+"OfYear"]=function(e){var n=ps.year(e).getDay();return Math.floor((ps.dayOfYear(e)+(n+t)%7)/7)}}),ps.week=ps.sunday,ps.weeks=ps.sunday.range,ps.weeks.utc=ps.sunday.utc.range,ps.weekOfYear=ps.sundayOfYear;var vs={"-":"",_:" ",0:"0"},ys=/^\s*\d+/,xs=/^%/;la.locale=function(e){return{numberFormat:Re(e),timeFormat:Be(e)}};var ws=la.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});la.format=ws.numberFormat,la.geo={},ct.prototype={s:0,t:0,add:function(e){dt(e,this.t,_s),dt(_s.s,this.s,this),this.s?this.t+=_s.t:this.s=_s.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var _s=new ct;la.geo.stream=function(e,t){e&&bs.hasOwnProperty(e.type)?bs[e.type](e,t):ft(e,t)};var bs={Feature:function(e,t){ft(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)ft(n[r].geometry,t)}},ks={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){ht(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)ht(n[r],t,0)},Polygon:function(e,t){pt(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)pt(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)ft(n[r],t)}};la.geo.area=function(e){return js=0,la.geo.stream(e,Es),js};var js,Ms=new ct,Es={sphere:function(){js+=4*Pa},point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ms.reset(),Es.lineStart=mt},polygonEnd:function(){var e=2*Ms;js+=0>e?4*Pa+e:e,Es.lineStart=Es.lineEnd=Es.point=b}};la.geo.bounds=function(){function e(e,t){x.push(w=[c=e,f=e]),d>t&&(d=t),t>h&&(h=t)}function t(t,n){var r=gt([t*Ba,n*Ba]);if(v){var o=yt(v,r),i=[o[1],-o[0],0],a=yt(i,o);_t(a),a=bt(a);var u=t-p,l=u>0?1:-1,m=a[0]*Va*l,g=_a(u)>180;if(g^(m>l*p&&l*t>m)){var y=a[1]*Va;y>h&&(h=y)}else if(m=(m+360)%360-180,g^(m>l*p&&l*t>m)){var y=-a[1]*Va;d>y&&(d=y)}else d>n&&(d=n),n>h&&(h=n);g?p>t?s(c,t)>s(c,f)&&(f=t):s(t,f)>s(c,f)&&(c=t):f>=c?(c>t&&(c=t),t>f&&(f=t)):t>p?s(c,t)>s(c,f)&&(f=t):s(t,f)>s(c,f)&&(c=t)}else e(t,n);v=r,p=t}function n(){_.point=t}function r(){w[0]=c,w[1]=f,_.point=e,v=null}function o(e,n){if(v){var r=e-p;y+=_a(r)>180?r+(r>0?360:-360):r}else m=e,g=n;Es.point(e,n),t(e,n)}function i(){Es.lineStart()}function a(){o(m,g),Es.lineEnd(),_a(y)>za&&(c=-(f=180)),w[0]=c,w[1]=f,v=null}function s(e,t){return(t-=e)<0?t+360:t}function u(e,t){return e[0]-t[0]}function l(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var c,d,f,h,p,m,g,v,y,x,w,_={point:e,lineStart:n,lineEnd:r,polygonStart:function(){_.point=o,_.lineStart=i,_.lineEnd=a,y=0,Es.polygonStart()},polygonEnd:function(){Es.polygonEnd(),_.point=e,_.lineStart=n,_.lineEnd=r,0>Ms?(c=-(f=180),d=-(h=90)):y>za?h=90:-za>y&&(d=-90),w[0]=c,w[1]=f}};return function(e){h=f=-(c=d=1/0),x=[],la.geo.stream(e,_);var t=x.length;if(t){x.sort(u);for(var n,r=1,o=x[0],i=[o];t>r;++r)n=x[r],l(n[0],o)||l(n[1],o)?(s(o[0],n[1])>s(o[0],o[1])&&(o[1]=n[1]),s(n[0],o[1])>s(o[0],o[1])&&(o[0]=n[0])):i.push(o=n);for(var a,n,p=-(1/0),t=i.length-1,r=0,o=i[t];t>=r;o=n,++r)n=i[r],(a=s(o[1],n[0]))>p&&(p=a,c=n[0],f=o[1])}return x=w=null,c===1/0||d===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,d],[f,h]]}}(),la.geo.centroid=function(e){Cs=Ss=Ts=As=Ns=Os=qs=Ds=Ls=Fs=zs=0,la.geo.stream(e,Rs);var t=Ls,n=Fs,r=zs,o=t*t+n*n+r*r;return Ra>o&&(t=Os,n=qs,r=Ds,za>Ss&&(t=Ts,n=As,r=Ns),o=t*t+n*n+r*r,Ra>o)?[NaN,NaN]:[Math.atan2(n,t)*Va,ne(r/Math.sqrt(o))*Va]};var Cs,Ss,Ts,As,Ns,Os,qs,Ds,Ls,Fs,zs,Rs={sphere:b,point:jt,lineStart:Et,lineEnd:Ct,polygonStart:function(){Rs.lineStart=St},polygonEnd:function(){Rs.lineStart=Et}},Ps=Dt(At,Rt,It,[-Pa,-Pa/2]),Is=1e9;la.geo.clipExtent=function(){var e,t,n,r,o,i,a={stream:function(e){return o&&(o.valid=!1),o=i(e),o.valid=!0,o},extent:function(s){return arguments.length?(i=Vt(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1]),o&&(o.valid=!1,o=null),a):[[e,t],[n,r]]}};return a.extent([[0,0],[960,500]])},(la.geo.conicEqualArea=function(){return Ut(Wt)}).raw=Wt,la.geo.albers=function(){return la.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},la.geo.albersUsa=function(){function e(e){var i=e[0],a=e[1];return t=null,n(i,a),t||(r(i,a),t)||o(i,a),t}var t,n,r,o,i=la.geo.albers(),a=la.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=la.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,n){t=[e,n]}};return e.invert=function(e){var t=i.scale(),n=i.translate(),r=(e[0]-n[0])/t,o=(e[1]-n[1])/t;return(o>=.12&&.234>o&&r>=-.425&&-.214>r?a:o>=.166&&.234>o&&r>=-.214&&-.115>r?s:i).invert(e)},e.stream=function(e){var t=i.stream(e),n=a.stream(e),r=s.stream(e);return{point:function(e,o){t.point(e,o),n.point(e,o),r.point(e,o)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},e.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),s.precision(t),e):i.precision()},e.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),s.scale(t),e.translate(i.translate())):i.scale()},e.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),c=+t[0],d=+t[1];return n=i.translate(t).clipExtent([[c-.455*l,d-.238*l],[c+.455*l,d+.238*l]]).stream(u).point,r=a.translate([c-.307*l,d+.201*l]).clipExtent([[c-.425*l+za,d+.12*l+za],[c-.214*l-za,d+.234*l-za]]).stream(u).point,o=s.translate([c-.205*l,d+.212*l]).clipExtent([[c-.214*l+za,d+.166*l+za],[c-.115*l-za,d+.234*l-za]]).stream(u).point,e},e.scale(1070)};var Hs,$s,Bs,Vs,Us,Ws,Ys={point:b,lineStart:b,lineEnd:b,polygonStart:function(){$s=0,Ys.lineStart=Yt},polygonEnd:function(){Ys.lineStart=Ys.lineEnd=Ys.point=b,Hs+=_a($s/2)}},Xs={point:Xt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Js={point:Kt,lineStart:Gt,lineEnd:Qt,polygonStart:function(){Js.lineStart=en},polygonEnd:function(){Js.point=Kt,Js.lineStart=Gt,Js.lineEnd=Qt}};la.geo.path=function(){function e(e){return e&&("function"==typeof s&&i.pointRadius(+s.apply(this,arguments)),a&&a.valid||(a=o(i)),la.geo.stream(e,a)),i.result()}function t(){return a=null,e}var n,r,o,i,a,s=4.5;return e.area=function(e){return Hs=0,la.geo.stream(e,o(Ys)),Hs},e.centroid=function(e){return Ts=As=Ns=Os=qs=Ds=Ls=Fs=zs=0,la.geo.stream(e,o(Js)),zs?[Ls/zs,Fs/zs]:Ds?[Os/Ds,qs/Ds]:Ns?[Ts/Ns,As/Ns]:[NaN,NaN]},e.bounds=function(e){return Us=Ws=-(Bs=Vs=1/0),la.geo.stream(e,o(Xs)),[[Bs,Vs],[Us,Ws]]},e.projection=function(e){return arguments.length?(o=(n=e)?e.stream||rn(e):x,t()):n},e.context=function(e){return arguments.length?(i=null==(r=e)?new Jt:new tn(e),"function"!=typeof s&&i.pointRadius(s),t()):r},e.pointRadius=function(t){return arguments.length?(s="function"==typeof t?t:(i.pointRadius(+t),+t),e):s},e.projection(la.geo.albersUsa()).context(null)},la.geo.transform=function(e){return{stream:function(t){var n=new on(t);for(var r in e)n[r]=e[r];return n}}},on.prototype={point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},la.geo.projection=sn,la.geo.projectionMutator=un,(la.geo.equirectangular=function(){return sn(cn)}).raw=cn.invert=cn,la.geo.rotation=function(e){function t(t){return t=e(t[0]*Ba,t[1]*Ba),t[0]*=Va,t[1]*=Va,t}return e=fn(e[0]%360*Ba,e[1]*Ba,e.length>2?e[2]*Ba:0),t.invert=function(t){return t=e.invert(t[0]*Ba,t[1]*Ba),t[0]*=Va,t[1]*=Va,t},t},dn.invert=cn,la.geo.circle=function(){function e(){var e="function"==typeof r?r.apply(this,arguments):r,t=fn(-e[0]*Ba,-e[1]*Ba,0).invert,o=[];return n(null,null,1,{point:function(e,n){o.push(e=t(e,n)),e[0]*=Va,e[1]*=Va}}),{type:"Polygon",coordinates:[o]}}var t,n,r=[0,0],o=6;return e.origin=function(t){return arguments.length?(r=t,e):r},e.angle=function(r){return arguments.length?(n=gn((t=+r)*Ba,o*Ba),e):t},e.precision=function(r){return arguments.length?(n=gn(t*Ba,(o=+r)*Ba),e):o},e.angle(90)},la.geo.distance=function(e,t){var n,r=(t[0]-e[0])*Ba,o=e[1]*Ba,i=t[1]*Ba,a=Math.sin(r),s=Math.cos(r),u=Math.sin(o),l=Math.cos(o),c=Math.sin(i),d=Math.cos(i);return Math.atan2(Math.sqrt((n=d*a)*n+(n=l*c-u*d*s)*n),u*c+l*d*s)},la.geo.graticule=function(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return la.range(Math.ceil(i/g)*g,o,g).map(f).concat(la.range(Math.ceil(l/v)*v,u,v).map(h)).concat(la.range(Math.ceil(r/p)*p,n,p).filter(function(e){return _a(e%g)>za}).map(c)).concat(la.range(Math.ceil(s/m)*m,a,m).filter(function(e){return _a(e%v)>za}).map(d))}var n,r,o,i,a,s,u,l,c,d,f,h,p=10,m=p,g=90,v=360,y=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(u).slice(1),f(o).reverse().slice(1),h(l).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.majorExtent(t).minorExtent(t):e.minorExtent()},e.majorExtent=function(t){return arguments.length?(i=+t[0][0],o=+t[1][0],l=+t[0][1],u=+t[1][1],i>o&&(t=i,i=o,o=t),l>u&&(t=l,l=u,u=t),e.precision(y)):[[i,l],[o,u]]},e.minorExtent=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(y)):[[r,s],[n,a]]},e.step=function(t){return arguments.length?e.majorStep(t).minorStep(t):e.minorStep()},e.majorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],e):[g,v]},e.minorStep=function(t){return arguments.length?(p=+t[0],m=+t[1],e):[p,m]},e.precision=function(t){return arguments.length?(y=+t,c=yn(s,a,90),d=xn(r,n,y),f=yn(l,u,90),h=xn(i,o,y),e):y},e.majorExtent([[-180,-90+za],[180,90-za]]).minorExtent([[-180,-80-za],[180,80+za]])},la.geo.greatArc=function(){function e(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),n||o.apply(this,arguments)]}}var t,n,r=wn,o=_n;return e.distance=function(){return la.geo.distance(t||r.apply(this,arguments),n||o.apply(this,arguments))},e.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,e):r},e.target=function(t){return arguments.length?(o=t,n="function"==typeof t?null:t,e):o},e.precision=function(){return arguments.length?e:0},e},la.geo.interpolate=function(e,t){return bn(e[0]*Ba,e[1]*Ba,t[0]*Ba,t[1]*Ba)},la.geo.length=function(e){return Zs=0,la.geo.stream(e,Ks),Zs};var Zs,Ks={sphere:b,point:b,lineStart:kn,lineEnd:b,polygonStart:b,polygonEnd:b},Gs=jn(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(la.geo.azimuthalEqualArea=function(){return sn(Gs)}).raw=Gs;var Qs=jn(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},x);(la.geo.azimuthalEquidistant=function(){return sn(Qs)}).raw=Qs,(la.geo.conicConformal=function(){return Ut(Mn)}).raw=Mn,(la.geo.conicEquidistant=function(){return Ut(En)}).raw=En;var eu=jn(function(e){return 1/e},Math.atan);(la.geo.gnomonic=function(){return sn(eu)}).raw=eu,Cn.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-$a]},(la.geo.mercator=function(){return Sn(Cn)}).raw=Cn;var tu=jn(function(){return 1},Math.asin);(la.geo.orthographic=function(){return sn(tu)}).raw=tu;var nu=jn(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(la.geo.stereographic=function(){return sn(nu)}).raw=nu,Tn.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-$a]},(la.geo.transverseMercator=function(){var e=Sn(Tn),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90])}).raw=Tn,la.geom={},la.geom.hull=function(e){function t(data){if(data.length<3)return[];var e,t=Ce(n),o=Ce(r),i=data.length,a=[],s=[];for(e=0;i>e;e++)a.push([+t.call(this,data[e],e),+o.call(this,data[e],e),e]);for(a.sort(qn),e=0;i>e;e++)s.push([a[e][0],-a[e][1]]);var u=On(a),l=On(s),c=l[0]===u[0],d=l[l.length-1]===u[u.length-1],f=[];for(e=u.length-1;e>=0;--e)f.push(data[a[u[e]][2]]);for(e=+c;e<l.length-d;++e)f.push(data[a[l[e]][2]]);return f}var n=An,r=Nn;return arguments.length?t(e):(t.x=function(e){return arguments.length?(n=e,t):n},t.y=function(e){return arguments.length?(r=e,t):r},t)},la.geom.polygon=function(e){return Ea(e,ru),e};var ru=la.geom.polygon.prototype=[];ru.area=function(){for(var e,t=-1,n=this.length,r=this[n-1],o=0;++t<n;)e=r,r=this[t],o+=e[1]*r[0]-e[0]*r[1];return.5*o},
+ru.centroid=function(e){var t,n,r=-1,o=this.length,i=0,a=0,s=this[o-1];for(arguments.length||(e=-1/(6*this.area()));++r<o;)t=s,s=this[r],n=t[0]*s[1]-s[0]*t[1],i+=(t[0]+s[0])*n,a+=(t[1]+s[1])*n;return[i*e,a*e]},ru.clip=function(e){for(var t,n,r,o,i,a,s=Fn(e),u=-1,l=this.length-Fn(this),c=this[l-1];++u<l;){for(t=e.slice(),e.length=0,o=this[u],i=t[(r=t.length-s)-1],n=-1;++n<r;)a=t[n],Dn(a,c,o)?(Dn(i,c,o)||e.push(Ln(i,a,c,o)),e.push(a)):Dn(i,c,o)&&e.push(Ln(i,a,c,o)),i=a;s&&e.push(e[0]),c=o}return e};var ou,iu,au,su,uu,lu=[],cu=[];Vn.prototype.prepare=function(){for(var e,t=this.edges,n=t.length;n--;)e=t[n].edge,e.b&&e.a||t.splice(n,1);return t.sort(Wn),t.length},nr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},rr.prototype={insert:function(e,t){var n,r,o;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=sr(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)r=n.U,n===r.L?(o=r.R,o&&o.C?(n.C=o.C=!1,r.C=!0,e=r):(e===n.R&&(ir(this,n),e=n,n=e.U),n.C=!1,r.C=!0,ar(this,r))):(o=r.L,o&&o.C?(n.C=o.C=!1,r.C=!0,e=r):(e===n.L&&(ar(this,n),e=n,n=e.U),n.C=!1,r.C=!0,ir(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,o=e.U,i=e.L,a=e.R;if(n=i?a?sr(a):i:a,o?o.L===e?o.L=n:o.R=n:this._=n,i&&a?(r=n.C,n.C=e.C,n.L=i,i.U=n,n!==a?(o=n.U,n.U=e.U,e=n.R,o.L=e,n.R=a,a.U=n):(n.U=o,o=n,e=n.R)):(r=e.C,e=n),e&&(e.U=o),!r){if(e&&e.C)return void(e.C=!1);do{if(e===this._)break;if(e===o.L){if(t=o.R,t.C&&(t.C=!1,o.C=!0,ir(this,o),t=o.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ar(this,t),t=o.R),t.C=o.C,o.C=t.R.C=!1,ir(this,o),e=this._;break}}else if(t=o.L,t.C&&(t.C=!1,o.C=!0,ar(this,o),t=o.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=o.L),t.C=o.C,o.C=t.L.C=!1,ar(this,o),e=this._;break}t.C=!0,e=o,o=o.U}while(!e.C);e&&(e.C=!1)}}},la.geom.voronoi=function(e){function t(data){var e=new Array(data.length),t=s[0][0],r=s[0][1],o=s[1][0],i=s[1][1];return ur(n(data),s).cells.forEach(function(n,a){var s=n.edges,u=n.site,l=e[a]=s.length?s.map(function(e){var t=e.start();return[t.x,t.y]}):u.x>=t&&u.x<=o&&u.y>=r&&u.y<=i?[[t,i],[o,i],[o,r],[t,r]]:[];l.point=data[a]}),e}function n(data){return data.map(function(e,t){return{x:Math.round(i(e,t)/za)*za,y:Math.round(a(e,t)/za)*za,i:t}})}var r=An,o=Nn,i=r,a=o,s=du;return e?t(e):(t.links=function(data){return ur(n(data)).edges.filter(function(e){return e.l&&e.r}).map(function(e){return{source:data[e.l.i],target:data[e.r.i]}})},t.triangles=function(data){var e=[];return ur(n(data)).cells.forEach(function(t,n){for(var r,o,i=t.site,a=t.edges.sort(Wn),s=-1,u=a.length,l=a[u-1].edge,c=l.l===i?l.r:l.l;++s<u;)r=l,o=c,l=a[s].edge,c=l.l===i?l.r:l.l,n<o.i&&n<c.i&&cr(i,o,c)<0&&e.push([data[n],data[o.i],data[c.i]])}),e},t.x=function(e){return arguments.length?(i=Ce(r=e),t):r},t.y=function(e){return arguments.length?(a=Ce(o=e),t):o},t.clipExtent=function(e){return arguments.length?(s=null==e?du:e,t):s===du?null:s},t.size=function(e){return arguments.length?t.clipExtent(e&&[[0,0],e]):s===du?null:s&&s[1]},t)};var du=[[-1e6,-1e6],[1e6,1e6]];la.geom.delaunay=function(e){return la.geom.voronoi().triangles(e)},la.geom.quadtree=function(e,t,n,r,o){function i(data){function e(e,t,n,r,o,a,s,u){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var l=e.x,c=e.y;if(null!=l)if(_a(l-n)+_a(c-r)<.01)i(e,t,n,r,o,a,s,u);else{var d=e.point;e.x=e.y=e.point=null,i(e,d,l,c,o,a,s,u),i(e,t,n,r,o,a,s,u)}else e.x=n,e.y=r,e.point=t}else i(e,t,n,r,o,a,s,u)}function i(t,n,r,o,i,a,s,u){var l=.5*(i+s),c=.5*(a+u),d=r>=l,f=o>=c,h=f<<1|d;t.leaf=!1,t=t.nodes[h]||(t.nodes[h]=hr()),d?i=l:s=l,f?a=c:u=c,e(t,n,r,o,i,a,s,u)}var l,c,d,f,h,p,m,g,v,y=Ce(s),x=Ce(u);if(null!=t)p=t,m=n,g=r,v=o;else if(g=v=-(p=m=1/0),c=[],d=[],h=data.length,a)for(f=0;h>f;++f)l=data[f],l.x<p&&(p=l.x),l.y<m&&(m=l.y),l.x>g&&(g=l.x),l.y>v&&(v=l.y),c.push(l.x),d.push(l.y);else for(f=0;h>f;++f){var w=+y(l=data[f],f),_=+x(l,f);p>w&&(p=w),m>_&&(m=_),w>g&&(g=w),_>v&&(v=_),c.push(w),d.push(_)}var b=g-p,k=v-m;b>k?v=m+b:g=p+k;var j=hr();if(j.add=function(t){e(j,t,+y(t,++f),+x(t,f),p,m,g,v)},j.visit=function(e){pr(e,j,p,m,g,v)},j.find=function(e){return mr(j,e[0],e[1],p,m,g,v)},f=-1,null==t){for(;++f<h;)e(j,data[f],c[f],d[f],p,m,g,v);--f}else data.forEach(j.add);return c=d=data=l=null,j}var a,s=An,u=Nn;return(a=arguments.length)?(s=dr,u=fr,3===a&&(o=n,r=t,n=t=0),i(e)):(i.x=function(e){return arguments.length?(s=e,i):s},i.y=function(e){return arguments.length?(u=e,i):u},i.extent=function(e){return arguments.length?(null==e?t=n=r=o=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],o=+e[1][1]),i):null==t?null:[[t,n],[r,o]]},i.size=function(e){return arguments.length?(null==e?t=n=r=o=null:(t=n=0,r=+e[0],o=+e[1]),i):null==t?null:[r-t,o-n]},i)},la.interpolateRgb=gr,la.interpolateObject=vr,la.interpolateNumber=yr,la.interpolateString=xr;var fu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hu=new RegExp(fu.source,"g");la.interpolate=wr,la.interpolators=[function(e,t){var n=typeof t;return("string"===n?is.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?gr:xr:t instanceof se?gr:Array.isArray(t)?_r:"object"===n&&isNaN(t)?vr:yr)(e,t)}],la.interpolateArray=_r;var pu=function(){return x},mu=la.map({linear:pu,poly:Sr,quad:function(){return Mr},cubic:function(){return Er},sin:function(){return Tr},exp:function(){return Ar},circle:function(){return Nr},elastic:Or,back:qr,bounce:function(){return Dr}}),gu=la.map({"in":x,out:kr,"in-out":jr,"out-in":function(e){return jr(kr(e))}});la.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):"in";return n=mu.get(n)||pu,r=gu.get(r)||x,br(r(n.apply(null,ca.call(arguments,1))))},la.interpolateHcl=Lr,la.interpolateHsl=Fr,la.interpolateLab=zr,la.interpolateRound=Rr,la.transform=function(e){var t=fa.createElementNS(la.ns.prefix.svg,"g");return(la.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new Pr(n?n.matrix:vu)})(e)},Pr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var vu={a:1,b:0,c:0,d:1,e:0,f:0};la.interpolateTransform=Xr,la.layout={},la.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(Kr(e[n]));return t}},la.layout.chord=function(){function e(){var e,l,d,f,h,p={},m=[],g=la.range(i),v=[];for(n=[],r=[],e=0,f=-1;++f<i;){for(l=0,h=-1;++h<i;)l+=o[f][h];m.push(l),v.push(la.range(i)),e+=l}for(a&&g.sort(function(e,t){return a(m[e],m[t])}),s&&v.forEach(function(e,t){e.sort(function(e,n){return s(o[t][e],o[t][n])})}),e=(Ia-c*i)/e,l=0,f=-1;++f<i;){for(d=l,h=-1;++h<i;){var y=g[f],x=v[y][h],w=o[y][x],_=l,b=l+=w*e;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:b,value:w}}r[y]={index:y,startAngle:d,endAngle:l,value:(l-d)/e},l+=c}for(f=-1;++f<i;)for(h=f-1;++h<i;){var k=p[f+"-"+h],j=p[h+"-"+f];(k.value||j.value)&&n.push(k.value<j.value?{source:j,target:k}:{source:k,target:j})}u&&t()}function t(){n.sort(function(e,t){return u((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var n,r,o,i,a,s,u,l={},c=0;return l.matrix=function(e){return arguments.length?(i=(o=e)&&o.length,n=r=null,l):o},l.padding=function(e){return arguments.length?(c=e,n=r=null,l):c},l.sortGroups=function(e){return arguments.length?(a=e,n=r=null,l):a},l.sortSubgroups=function(e){return arguments.length?(s=e,n=null,l):s},l.sortChords=function(e){return arguments.length?(u=e,n&&t(),l):u},l.chords=function(){return n||e(),n},l.groups=function(){return r||e(),r},l},la.layout.force=function(){function e(e){return function(t,n,r,o){if(t.point!==e){var i=t.cx-e.x,a=t.cy-e.y,s=o-n,u=i*i+a*a;if(u>s*s/v){if(m>u){var l=t.charge/u;e.px-=i*l,e.py-=a*l}return!0}if(t.point&&u&&m>u){var l=t.pointCharge/u;e.px-=i*l,e.py-=a*l}}return!t.charge}}function t(e){e.px=la.event.x,e.py=la.event.y,u.resume()}var n,r,o,i,a,s,u={},l=la.dispatch("start","tick","end"),c=[1,1],d=.9,f=yu,h=xu,p=-30,m=wu,g=.1,v=.64,y=[],w=[];return u.tick=function(){if((o*=.99)<.005)return n=null,l.end({type:"end",alpha:o=0}),!0;var t,r,u,f,h,m,v,x,_,b=y.length,k=w.length;for(r=0;k>r;++r)u=w[r],f=u.source,h=u.target,x=h.x-f.x,_=h.y-f.y,(m=x*x+_*_)&&(m=o*a[r]*((m=Math.sqrt(m))-i[r])/m,x*=m,_*=m,h.x-=x*(v=f.weight+h.weight?f.weight/(f.weight+h.weight):.5),h.y-=_*v,f.x+=x*(v=1-v),f.y+=_*v);if((v=o*g)&&(x=c[0]/2,_=c[1]/2,r=-1,v))for(;++r<b;)u=y[r],u.x+=(x-u.x)*v,u.y+=(_-u.y)*v;if(p)for(oo(t=la.geom.quadtree(y),o,s),r=-1;++r<b;)(u=y[r]).fixed||t.visit(e(u));for(r=-1;++r<b;)u=y[r],u.fixed?(u.x=u.px,u.y=u.py):(u.x-=(u.px-(u.px=u.x))*d,u.y-=(u.py-(u.py=u.y))*d);l.tick({type:"tick",alpha:o})},u.nodes=function(e){return arguments.length?(y=e,u):y},u.links=function(e){return arguments.length?(w=e,u):w},u.size=function(e){return arguments.length?(c=e,u):c},u.linkDistance=function(e){return arguments.length?(f="function"==typeof e?e:+e,u):f},u.distance=u.linkDistance,u.linkStrength=function(e){return arguments.length?(h="function"==typeof e?e:+e,u):h},u.friction=function(e){return arguments.length?(d=+e,u):d},u.charge=function(e){return arguments.length?(p="function"==typeof e?e:+e,u):p},u.chargeDistance=function(e){return arguments.length?(m=e*e,u):Math.sqrt(m)},u.gravity=function(e){return arguments.length?(g=+e,u):g},u.theta=function(e){return arguments.length?(v=e*e,u):Math.sqrt(v)},u.alpha=function(e){return arguments.length?(e=+e,o?e>0?o=e:(n.c=null,n.t=NaN,n=null,l.end({type:"end",alpha:o=0})):e>0&&(l.start({type:"start",alpha:o=e}),n=Oe(u.tick)),u):o},u.start=function(){function e(e,r){if(!n){for(n=new Array(o),u=0;o>u;++u)n[u]=[];for(u=0;l>u;++u){var i=w[u];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var a,s=n[t],u=-1,c=s.length;++u<c;)if(!isNaN(a=s[u][e]))return a;return Math.random()*r}var t,n,r,o=y.length,l=w.length,d=c[0],m=c[1];for(t=0;o>t;++t)(r=y[t]).index=t,r.weight=0;for(t=0;l>t;++t)r=w[t],"number"==typeof r.source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(t=0;o>t;++t)r=y[t],isNaN(r.x)&&(r.x=e("x",d)),isNaN(r.y)&&(r.y=e("y",m)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof f)for(t=0;l>t;++t)i[t]=+f.call(this,w[t],t);else for(t=0;l>t;++t)i[t]=f;if(a=[],"function"==typeof h)for(t=0;l>t;++t)a[t]=+h.call(this,w[t],t);else for(t=0;l>t;++t)a[t]=h;if(s=[],"function"==typeof p)for(t=0;o>t;++t)s[t]=+p.call(this,y[t],t);else for(t=0;o>t;++t)s[t]=p;return u.resume()},u.resume=function(){return u.alpha(.1)},u.stop=function(){return u.alpha(0)},u.drag=function(){return r||(r=la.behavior.drag().origin(x).on("dragstart.force",eo).on("drag.force",t).on("dragend.force",to)),arguments.length?void this.on("mouseover.force",no).on("mouseout.force",ro).call(r):r},la.rebind(u,l,"on")};var yu=20,xu=1,wu=1/0;la.layout.hierarchy=function(){function e(o){var i,a=[o],s=[];for(o.depth=0;null!=(i=a.pop());)if(s.push(i),(l=n.call(e,i,i.depth))&&(u=l.length)){for(var u,l,c;--u>=0;)a.push(c=l[u]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(e,i,i.depth)||0),delete i.children;return so(o,function(e){var n,o;t&&(n=e.children)&&n.sort(t),r&&(o=e.parent)&&(o.value+=e.value)}),s}var t=co,n=uo,r=lo;return e.sort=function(n){return arguments.length?(t=n,e):t},e.children=function(t){return arguments.length?(n=t,e):n},e.value=function(t){return arguments.length?(r=t,e):r},e.revalue=function(t){return r&&(ao(t,function(e){e.children&&(e.value=0)}),so(t,function(t){var n;t.children||(t.value=+r.call(e,t,t.depth)||0),(n=t.parent)&&(n.value+=t.value)})),t},e},la.layout.partition=function(){function e(t,n,r,o){var i=t.children;if(t.x=n,t.y=t.depth*o,t.dx=r,t.dy=o,i&&(a=i.length)){var a,s,u,l=-1;for(r=t.value?r/t.value:0;++l<a;)e(s=i[l],n,u=s.value*r,o),n+=u}}function t(e){var n=e.children,r=0;if(n&&(o=n.length))for(var o,i=-1;++i<o;)r=Math.max(r,t(n[i]));return 1+r}function n(n,i){var a=r.call(this,n,i);return e(a[0],0,o[0],o[1]/t(a[0])),a}var r=la.layout.hierarchy(),o=[1,1];return n.size=function(e){return arguments.length?(o=e,n):o},io(n,r)},la.layout.pie=function(){function e(data){var a,s=data.length,u=data.map(function(n,r){return+t.call(e,n,r)}),l=+("function"==typeof r?r.apply(this,arguments):r),c=("function"==typeof o?o.apply(this,arguments):o)-l,d=Math.min(Math.abs(c)/s,+("function"==typeof i?i.apply(this,arguments):i)),f=d*(0>c?-1:1),h=la.sum(u),p=h?(c-s*f)/h:0,m=la.range(s),g=[];return null!=n&&m.sort(n===_u?function(e,t){return u[t]-u[e]}:function(e,t){return n(data[e],data[t])}),m.forEach(function(e){g[e]={data:data[e],value:a=u[e],startAngle:l,endAngle:l+=a*p+f,padAngle:d}}),g}var t=Number,n=_u,r=0,o=Ia,i=0;return e.value=function(n){return arguments.length?(t=n,e):t},e.sort=function(t){return arguments.length?(n=t,e):n},e.startAngle=function(t){return arguments.length?(r=t,e):r},e.endAngle=function(t){return arguments.length?(o=t,e):o},e.padAngle=function(t){return arguments.length?(i=t,e):i},e};var _u={};la.layout.stack=function(){function e(data,s){if(!(d=data.length))return data;var u=data.map(function(n,r){return t.call(e,n,r)}),l=u.map(function(t){return t.map(function(t,n){return[i.call(e,t,n),a.call(e,t,n)]})}),c=n.call(e,l,s);u=la.permute(u,c),l=la.permute(l,c);var d,f,h,p,m=r.call(e,l,s),g=u[0].length;for(h=0;g>h;++h)for(o.call(e,u[0][h],p=m[h],l[0][h][1]),f=1;d>f;++f)o.call(e,u[f][h],p+=l[f-1][h][1],l[f][h][1]);return data}var t=x,n=go,r=vo,o=mo,i=ho,a=po;return e.values=function(n){return arguments.length?(t=n,e):t},e.order=function(t){return arguments.length?(n="function"==typeof t?t:bu.get(t)||go,e):n},e.offset=function(t){return arguments.length?(r="function"==typeof t?t:ku.get(t)||vo,e):r},e.x=function(t){return arguments.length?(i=t,e):i},e.y=function(t){return arguments.length?(a=t,e):a},e.out=function(t){return arguments.length?(o=t,e):o},e};var bu=la.map({"inside-out":function(data){var e,t,n=data.length,r=data.map(yo),o=data.map(xo),i=la.range(n).sort(function(e,t){return r[e]-r[t]}),a=0,s=0,u=[],l=[];for(e=0;n>e;++e)t=i[e],s>a?(a+=o[t],u.push(t)):(s+=o[t],l.push(t));return l.reverse().concat(u)},reverse:function(data){return la.range(data.length).reverse()},"default":go}),ku=la.map({silhouette:function(data){var e,t,n,r=data.length,o=data[0].length,i=[],a=0,s=[];for(t=0;o>t;++t){for(e=0,n=0;r>e;e++)n+=data[e][t][1];n>a&&(a=n),i.push(n)}for(t=0;o>t;++t)s[t]=(a-i[t])/2;return s},wiggle:function(data){var e,t,n,r,o,i,a,s,u,l=data.length,c=data[0],d=c.length,f=[];for(f[0]=s=u=0,t=1;d>t;++t){for(e=0,r=0;l>e;++e)r+=data[e][t][1];for(e=0,o=0,a=c[t][0]-c[t-1][0];l>e;++e){for(n=0,i=(data[e][t][1]-data[e][t-1][1])/(2*a);e>n;++n)i+=(data[n][t][1]-data[n][t-1][1])/a;o+=i*data[e][t][1]}f[t]=s-=r?o/r*a:0,u>s&&(u=s)}for(t=0;d>t;++t)f[t]-=u;return f},expand:function(data){var e,t,n,r=data.length,o=data[0].length,i=1/r,a=[];for(t=0;o>t;++t){for(e=0,n=0;r>e;e++)n+=data[e][t][1];if(n)for(e=0;r>e;e++)data[e][t][1]/=n;else for(e=0;r>e;e++)data[e][t][1]=i}for(t=0;o>t;++t)a[t]=0;return a},zero:vo});la.layout.histogram=function(){function e(data,e){for(var i,a,s=[],u=data.map(n,this),l=r.call(this,u,e),c=o.call(this,l,u,e),e=-1,d=u.length,f=c.length-1,h=t?1:1/d;++e<f;)i=s[e]=[],i.dx=c[e+1]-(i.x=c[e]),i.y=0;if(f>0)for(e=-1;++e<d;)a=u[e],a>=l[0]&&a<=l[1]&&(i=s[la.bisect(c,a,1,f)-1],i.y+=h,i.push(data[e]));return s}var t=!0,n=Number,r=ko,o=_o;return e.value=function(t){return arguments.length?(n=t,e):n},e.range=function(t){return arguments.length?(r=Ce(t),e):r},e.bins=function(t){return arguments.length?(o="number"==typeof t?function(e){return bo(e,t)}:Ce(t),e):o},e.frequency=function(n){return arguments.length?(t=!!n,e):t},e},la.layout.pack=function(){function e(e,i){var a=n.call(this,e,i),s=a[0],u=o[0],l=o[1],c=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,so(s,function(e){e.r=+c(e.value)}),so(s,So),r){var d=r*(t?1:Math.max(2*s.r/u,2*s.r/l))/2;so(s,function(e){e.r+=d}),so(s,So),so(s,function(e){e.r-=d})}return No(s,u/2,l/2,t?1:1/Math.max(2*s.r/u,2*s.r/l)),a}var t,n=la.layout.hierarchy().sort(jo),r=0,o=[1,1];return e.size=function(t){return arguments.length?(o=t,e):o},e.radius=function(n){return arguments.length?(t=null==n||"function"==typeof n?n:+n,e):t},e.padding=function(t){return arguments.length?(r=+t,e):r},io(e,n)},la.layout.tree=function(){function e(e,o){var c=a.call(this,e,o),d=c[0],f=t(d);if(so(f,n),f.parent.m=-f.z,ao(f,r),l)ao(d,i);else{var h=d,p=d,m=d;ao(d,function(e){e.x<h.x&&(h=e),e.x>p.x&&(p=e),e.depth>m.depth&&(m=e)});var g=s(h,p)/2-h.x,v=u[0]/(p.x+s(p,h)/2+g),y=u[1]/(m.depth||1);ao(d,function(e){e.x=(e.x+g)*v,e.y=e.depth*y})}return c}function t(e){for(var t,n={A:null,children:[e]},r=[n];null!=(t=r.pop());)for(var o,i=t.children,a=0,s=i.length;s>a;++a)r.push((i[a]=o={_:i[a],parent:t,children:(o=i[a].children)&&o.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=o);return n.children[0]}function n(e){var t=e.children,n=e.parent.children,r=e.i?n[e.i-1]:null;if(t.length){zo(e);var i=(t[0].z+t[t.length-1].z)/2;r?(e.z=r.z+s(e._,r._),e.m=e.z-i):e.z=i}else r&&(e.z=r.z+s(e._,r._));e.parent.A=o(e,r,e.parent.A||n[0])}function r(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function o(e,t,n){if(t){for(var r,o=e,i=e,a=t,u=o.parent.children[0],l=o.m,c=i.m,d=a.m,f=u.m;a=Lo(a),o=Do(o),a&&o;)u=Do(u),i=Lo(i),i.a=e,r=a.z+d-o.z-l+s(a._,o._),r>0&&(Fo(Ro(a,e,n),e,r),l+=r,c+=r),d+=a.m,l+=o.m,f+=u.m,c+=i.m;a&&!Lo(i)&&(i.t=a,i.m+=d-c),o&&!Do(u)&&(u.t=o,u.m+=l-f,n=e)}return n}function i(e){e.x*=u[0],e.y=e.depth*u[1]}var a=la.layout.hierarchy().sort(null).value(null),s=qo,u=[1,1],l=null;return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(l=null==(u=t)?i:null,e):l?null:u},e.nodeSize=function(t){return arguments.length?(l=null==(u=t)?null:i,e):l?u:null},io(e,a)},la.layout.cluster=function(){function e(e,i){var a,s=t.call(this,e,i),u=s[0],l=0;so(u,function(e){var t=e.children;t&&t.length?(e.x=Io(t),e.y=Po(t)):(e.x=a?l+=n(e,a):0,e.y=0,a=e)});var c=Ho(u),d=$o(u),f=c.x-n(c,d)/2,h=d.x+n(d,c)/2;return so(u,o?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-f)/(h-f)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),s}var t=la.layout.hierarchy().sort(null).value(null),n=qo,r=[1,1],o=!1;return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(o=null==(r=t),e):o?null:r},e.nodeSize=function(t){return arguments.length?(o=null!=(r=t),e):o?r:null},io(e,t)},la.layout.treemap=function(){function e(e,t){for(var n,r,o=-1,i=e.length;++o<i;)r=(n=e[o]).value*(0>t?0:t),n.area=isNaN(r)||0>=r?0:r}function t(n){var i=n.children;if(i&&i.length){var a,s,u,l=d(n),c=[],f=i.slice(),p=1/0,m="slice"===h?l.dx:"dice"===h?l.dy:"slice-dice"===h?1&n.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(e(f,l.dx*l.dy/n.value),c.area=0;(u=f.length)>0;)c.push(a=f[u-1]),c.area+=a.area,"squarify"!==h||(s=r(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,o(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(o(c,m,l,!0),c.length=c.area=0),i.forEach(t)}}function n(t){var r=t.children;if(r&&r.length){var i,a=d(t),s=r.slice(),u=[];for(e(s,a.dx*a.dy/t.value),u.area=0;i=s.pop();)u.push(i),u.area+=i.area,null!=i.z&&(o(u,i.z?a.dx:a.dy,a,!s.length),u.length=u.area=0);r.forEach(n)}}function r(e,t){for(var n,r=e.area,o=0,i=1/0,a=-1,s=e.length;++a<s;)(n=e[a].area)&&(i>n&&(i=n),n>o&&(o=n));return r*=r,t*=t,r?Math.max(t*o*p/r,r/(t*i*p)):1/0}function o(e,t,n,r){var o,i=-1,a=e.length,s=n.x,l=n.y,c=t?u(e.area/t):0;if(t==n.dx){for((r||c>n.dy)&&(c=n.dy);++i<a;)o=e[i],o.x=s,o.y=l,o.dy=c,s+=o.dx=Math.min(n.x+n.dx-s,c?u(o.area/c):0);o.z=!0,o.dx+=n.x+n.dx-s,n.y+=c,n.dy-=c}else{for((r||c>n.dx)&&(c=n.dx);++i<a;)o=e[i],o.x=s,o.y=l,o.dx=c,l+=o.dy=Math.min(n.y+n.dy-l,c?u(o.area/c):0);o.z=!1,o.dy+=n.y+n.dy-l,n.x+=c,n.dx-=c}}function i(r){var o=a||s(r),i=o[0];return i.x=i.y=0,i.value?(i.dx=l[0],i.dy=l[1]):i.dx=i.dy=0,a&&s.revalue(i),e([i],i.dx*i.dy/i.value),(a?n:t)(i),f&&(a=o),o}var a,s=la.layout.hierarchy(),u=Math.round,l=[1,1],c=null,d=Bo,f=!1,h="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(e){return arguments.length?(l=e,i):l},i.padding=function(e){function t(t){var n=e.call(i,t,t.depth);return null==n?Bo(t):Vo(t,"number"==typeof n?[n,n,n,n]:n)}function n(t){return Vo(t,e)}if(!arguments.length)return c;var r;return d=null==(c=e)?Bo:"function"==(r=typeof e)?t:"number"===r?(e=[e,e,e,e],n):n,i},i.round=function(e){return arguments.length?(u=e?Math.round:Number,i):u!=Number},i.sticky=function(e){return arguments.length?(f=e,a=null,i):f},i.ratio=function(e){return arguments.length?(p=e,i):p},i.mode=function(e){return arguments.length?(h=e+"",i):h},io(i,s)},la.random={normal:function(e,t){var n=arguments.length;return 2>n&&(t=1),1>n&&(e=0),function(){var n,r,o;do n=2*Math.random()-1,r=2*Math.random()-1,o=n*n+r*r;while(!o||o>1);return e+t*n*Math.sqrt(-2*Math.log(o)/o)}},logNormal:function(){var e=la.random.normal.apply(la,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=la.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;e>n;n++)t+=Math.random();return t}}},la.scale={};var ju={floor:x,ceil:x};la.scale.linear=function(){return Ko([0,1],[0,1],wr,!1)};var Mu={s:1,g:1,p:1,r:1,e:1};la.scale.log=function(){return ii(la.scale.linear().domain([0,1]),10,!0,[1,10])};var Eu=la.format(".0e"),Cu={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};la.scale.pow=function(){return ai(la.scale.linear(),1,[0,1])},la.scale.sqrt=function(){return la.scale.pow().exponent(.5)},la.scale.ordinal=function(){return ui([],{t:"range",a:[[]]})},la.scale.category10=function(){return la.scale.ordinal().range(Su)},la.scale.category20=function(){return la.scale.ordinal().range(Tu)},la.scale.category20b=function(){return la.scale.ordinal().range(Au)},la.scale.category20c=function(){return la.scale.ordinal().range(Nu)};var Su=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(we),Tu=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(we),Au=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(we),Nu=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(we);la.scale.quantile=function(){return li([],[])},la.scale.quantize=function(){return ci(0,1,[0,1])},la.scale.threshold=function(){return di([.5],[0,1])},la.scale.identity=function(){return fi([0,1])},la.svg={},la.svg.arc=function(){function e(){var e=Math.max(0,+n.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-$a,d=s.apply(this,arguments)-$a,f=Math.abs(d-c),h=c>d?0:1;if(e>l&&(p=l,l=e,e=p),f>=Ha)return t(l,h)+(e?t(e,1-h):"")+"Z";var p,m,g,v,y,x,w,_,b,k,j,M,E=0,C=0,S=[];if((v=(+u.apply(this,arguments)||0)/2)&&(g=i===Ou?Math.sqrt(e*e+l*l):+i.apply(this,arguments),h||(C*=-1),l&&(C=ne(g/l*Math.sin(v))),e&&(E=ne(g/e*Math.sin(v)))),l){y=l*Math.cos(c+C),x=l*Math.sin(c+C),w=l*Math.cos(d-C),_=l*Math.sin(d-C);var T=Math.abs(d-c-2*C)<=Pa?0:1;if(C&&xi(y,x,w,_)===h^T){var A=(c+d)/2;y=l*Math.cos(A),x=l*Math.sin(A),w=_=null}}else y=x=0;if(e){b=e*Math.cos(d-E),k=e*Math.sin(d-E),j=e*Math.cos(c+E),M=e*Math.sin(c+E);var N=Math.abs(c-d+2*E)<=Pa?0:1;if(E&&xi(b,k,j,M)===1-h^N){var O=(c+d)/2;b=e*Math.cos(O),k=e*Math.sin(O),j=M=null}}else b=k=0;if(f>za&&(p=Math.min(Math.abs(l-e)/2,+o.apply(this,arguments)))>.001){m=l>e^h?0:1;var q=p,D=p;if(Pa>f){var L=null==j?[b,k]:null==w?[y,x]:Ln([y,x],[j,M],[w,_],[b,k]),F=y-L[0],z=x-L[1],R=w-L[0],P=_-L[1],I=1/Math.sin(Math.acos((F*R+z*P)/(Math.sqrt(F*F+z*z)*Math.sqrt(R*R+P*P)))/2),H=Math.sqrt(L[0]*L[0]+L[1]*L[1]);D=Math.min(p,(e-H)/(I-1)),q=Math.min(p,(l-H)/(I+1))}if(null!=w){var $=wi(null==j?[b,k]:[j,M],[y,x],l,q,h),B=wi([w,_],[b,k],l,q,h);p===q?S.push("M",$[0],"A",q,",",q," 0 0,",m," ",$[1],"A",l,",",l," 0 ",1-h^xi($[1][0],$[1][1],B[1][0],B[1][1]),",",h," ",B[1],"A",q,",",q," 0 0,",m," ",B[0]):S.push("M",$[0],"A",q,",",q," 0 1,",m," ",B[0])}else S.push("M",y,",",x);if(null!=j){var V=wi([y,x],[j,M],e,-D,h),U=wi([b,k],null==w?[y,x]:[w,_],e,-D,h);p===D?S.push("L",U[0],"A",D,",",D," 0 0,",m," ",U[1],"A",e,",",e," 0 ",h^xi(U[1][0],U[1][1],V[1][0],V[1][1]),",",1-h," ",V[1],"A",D,",",D," 0 0,",m," ",V[0]):S.push("L",U[0],"A",D,",",D," 0 0,",m," ",V[0])}else S.push("L",b,",",k)}else S.push("M",y,",",x),null!=w&&S.push("A",l,",",l," 0 ",T,",",h," ",w,",",_),S.push("L",b,",",k),null!=j&&S.push("A",e,",",e," 0 ",N,",",1-h," ",j,",",M);return S.push("Z"),S.join("")}function t(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}var n=pi,r=mi,o=hi,i=Ou,a=gi,s=vi,u=yi;return e.innerRadius=function(t){return arguments.length?(n=Ce(t),e):n},e.outerRadius=function(t){return arguments.length?(r=Ce(t),e):r},e.cornerRadius=function(t){return arguments.length?(o=Ce(t),e):o},e.padRadius=function(t){return arguments.length?(i=t==Ou?Ou:Ce(t),e):i},e.startAngle=function(t){return arguments.length?(a=Ce(t),e):a},e.endAngle=function(t){return arguments.length?(s=Ce(t),e):s},e.padAngle=function(t){return arguments.length?(u=Ce(t),e):u},e.centroid=function(){var e=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-$a;return[Math.cos(t)*e,Math.sin(t)*e]},e};var Ou="auto";la.svg.line=function(){return _i(x)};var qu=la.map({linear:bi,"linear-closed":ki,step:ji,"step-before":Mi,"step-after":Ei,basis:Oi,"basis-open":qi,"basis-closed":Di,bundle:Li,cardinal:Ti,"cardinal-open":Ci,"cardinal-closed":Si,monotone:Hi});qu.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var Du=[0,2/3,1/3,0],Lu=[0,1/3,2/3,0],Fu=[0,1/6,2/3,1/6];la.svg.line.radial=function(){var e=_i($i);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Mi.reverse=Ei,Ei.reverse=Mi,la.svg.area=function(){return Bi(x)},la.svg.area.radial=function(){var e=Bi($i);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},la.svg.chord=function(){function e(e,s){var u=t(this,i,e,s),l=t(this,a,e,s);return"M"+u.p0+r(u.r,u.p1,u.a1-u.a0)+(n(u,l)?o(u.r,u.p1,u.r,u.p0):o(u.r,u.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+o(l.r,l.p1,u.r,u.p0))+"Z"}function t(e,t,n,r){var o=t.call(e,n,r),i=s.call(e,o,r),a=u.call(e,o,r)-$a,c=l.call(e,o,r)-$a;return{r:i,a0:a,a1:c,p0:[i*Math.cos(a),i*Math.sin(a)],p1:[i*Math.cos(c),i*Math.sin(c)]}}function n(e,t){return e.a0==t.a0&&e.a1==t.a1}function r(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Pa)+",1 "+t}function o(e,t,n,r){return"Q 0,0 "+r}var i=wn,a=_n,s=Vi,u=gi,l=vi;return e.radius=function(t){return arguments.length?(s=Ce(t),e):s},e.source=function(t){return arguments.length?(i=Ce(t),e):i},e.target=function(t){return arguments.length?(a=Ce(t),e):a},e.startAngle=function(t){return arguments.length?(u=Ce(t),e):u},e.endAngle=function(t){return arguments.length?(l=Ce(t),e):l},e},la.svg.diagonal=function(){function e(e,o){var i=t.call(this,e,o),a=n.call(this,e,o),s=(i.y+a.y)/2,u=[i,{x:i.x,y:s},{x:a.x,y:s},a];return u=u.map(r),"M"+u[0]+"C"+u[1]+" "+u[2]+" "+u[3]}var t=wn,n=_n,r=Ui;return e.source=function(n){return arguments.length?(t=Ce(n),e):t},e.target=function(t){return arguments.length?(n=Ce(t),e):n},e.projection=function(t){return arguments.length?(r=t,e):r},e},la.svg.diagonal.radial=function(){var e=la.svg.diagonal(),t=Ui,n=e.projection;return e.projection=function(e){return arguments.length?n(Wi(t=e)):t},e},la.svg.symbol=function(){function e(e,r){return(zu.get(t.call(this,e,r))||Ji)(n.call(this,e,r))}var t=Xi,n=Yi;return e.type=function(n){return arguments.length?(t=Ce(n),e):t},e.size=function(t){return arguments.length?(n=Ce(t),e):n},e};var zu=la.map({circle:Ji,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Pu)),n=t*Pu;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ru),n=t*Ru/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ru),n=t*Ru/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});la.svg.symbolTypes=zu.keys();var Ru=Math.sqrt(3),Pu=Math.tan(30*Ba);Aa.transition=function(e){for(var t,n,r=Iu||++Vu,o=ea(e),i=[],a=Hu||{time:Date.now(),ease:Cr,delay:0,duration:250},s=-1,u=this.length;++s<u;){i.push(t=[]);for(var l=this[s],c=-1,d=l.length;++c<d;)(n=l[c])&&ta(n,c,o,r,a),t.push(n)}return Ki(i,o,r)},Aa.interrupt=function(e){return this.each(null==e?$u:Zi(ea(e)))};var Iu,Hu,$u=Zi(ea()),Bu=[],Vu=0;Bu.call=Aa.call,Bu.empty=Aa.empty,Bu.node=Aa.node,Bu.size=Aa.size,la.transition=function(e,t){return e&&e.transition?Iu?e.transition(t):e:la.selection().transition(e)},la.transition.prototype=Bu,Bu.select=function(e){var t,n,r,o=this.id,i=this.namespace,a=[];e=T(e);for(var s=-1,u=this.length;++s<u;){a.push(t=[]);for(var l=this[s],c=-1,d=l.length;++c<d;)(r=l[c])&&(n=e.call(r,r.__data__,c,s))?("__data__"in r&&(n.__data__=r.__data__),ta(n,c,i,o,r[i][o]),t.push(n)):t.push(null)}return Ki(a,i,o)},Bu.selectAll=function(e){var t,n,r,o,i,a=this.id,s=this.namespace,u=[];e=A(e);for(var l=-1,c=this.length;++l<c;)for(var d=this[l],f=-1,h=d.length;++f<h;)if(r=d[f]){i=r[s][a],n=e.call(r,r.__data__,f,l),u.push(t=[]);for(var p=-1,m=n.length;++p<m;)(o=n[p])&&ta(o,p,s,a,i),t.push(o)}return Ki(u,s,a)},Bu.filter=function(e){var t,n,r,o=[];"function"!=typeof e&&(e=$(e));for(var i=0,a=this.length;a>i;i++){o.push(t=[]);for(var n=this[i],s=0,u=n.length;u>s;s++)(r=n[s])&&e.call(r,r.__data__,s,i)&&t.push(r)}return Ki(o,this.namespace,this.id)},Bu.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):V(this,null==t?function(t){t[r][n].tween.remove(e)}:function(o){o[r][n].tween.set(e,t)})},Bu.attr=function(e,t){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function o(e){return null==e?n:(e+="",function(){var t,n=this.getAttribute(s);return n!==e&&(t=a(n,e),function(e){this.setAttribute(s,t(e))})})}function i(e){return null==e?r:(e+="",function(){var t,n=this.getAttributeNS(s.space,s.local);return n!==e&&(t=a(n,e),function(e){this.setAttributeNS(s.space,s.local,t(e))})})}if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var a="transform"==e?Xr:wr,s=la.ns.qualify(e);return Gi(this,"attr."+e,t,s.local?i:o)},Bu.attrTween=function(e,t){function n(e,n){var r=t.call(this,e,n,this.getAttribute(o));return r&&function(e){this.setAttribute(o,r(e))}}function r(e,n){var r=t.call(this,e,n,this.getAttributeNS(o.space,o.local));return r&&function(e){this.setAttributeNS(o.space,o.local,r(e))}}var o=la.ns.qualify(e);return this.tween("attr."+e,o.local?r:n)},Bu.style=function(e,t,r){function o(){this.style.removeProperty(e)}function i(t){return null==t?o:(t+="",function(){var o,i=n(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(o=wr(i,t),function(t){this.style.setProperty(e,o(t),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof e){2>a&&(t="");for(r in e)this.style(r,e[r],t);return this}r=""}return Gi(this,"style."+e,t,i)},Bu.styleTween=function(e,t,r){function o(o,i){var a=t.call(this,o,i,n(this).getComputedStyle(this,null).getPropertyValue(e));return a&&function(t){this.style.setProperty(e,a(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+e,o)},Bu.text=function(e){return Gi(this,"text",e,Qi);
+},Bu.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Bu.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=la.ease.apply(la,arguments)),V(this,function(r){r[n][t].ease=e}))},Bu.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:V(this,"function"==typeof e?function(r,o,i){r[n][t].delay=+e.call(r,r.__data__,o,i)}:(e=+e,function(r){r[n][t].delay=e}))},Bu.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:V(this,"function"==typeof e?function(r,o,i){r[n][t].duration=Math.max(1,e.call(r,r.__data__,o,i))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Bu.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var o=Hu,i=Iu;try{Iu=n,V(this,function(t,o,i){Hu=t[r][n],e.call(t,t.__data__,o,i)})}finally{Hu=o,Iu=i}}else V(this,function(o){var i=o[r][n];(i.event||(i.event=la.dispatch("start","end","interrupt"))).on(e,t)});return this},Bu.transition=function(){for(var e,t,n,r,o=this.id,i=++Vu,a=this.namespace,s=[],u=0,l=this.length;l>u;u++){s.push(e=[]);for(var t=this[u],c=0,d=t.length;d>c;c++)(n=t[c])&&(r=n[a][o],ta(n,c,a,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),e.push(n)}return Ki(s,a,i)},la.svg.axis=function(){function e(e){e.each(function(){var e,l=la.select(this),c=this.__chart__||n,d=this.__chart__=n.copy(),f=null==u?d.ticks?d.ticks.apply(d,s):d.domain():u,h=null==t?d.tickFormat?d.tickFormat.apply(d,s):x:t,p=l.selectAll(".tick").data(f,d),m=p.enter().insert("g",".domain").attr("class","tick").style("opacity",za),g=la.transition(p.exit()).style("opacity",za).remove(),v=la.transition(p.order()).style("opacity",1),y=Math.max(o,0)+a,w=Wo(d),_=l.selectAll(".domain").data([0]),b=(_.enter().append("path").attr("class","domain"),la.transition(_));m.append("line"),m.append("text");var k,j,M,E,C=m.select("line"),S=v.select("line"),T=p.select("text").text(h),A=m.select("text"),N=v.select("text"),O="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(e=na,k="x",M="y",j="x2",E="y2",T.attr("dy",0>O?"0em":".71em").style("text-anchor","middle"),b.attr("d","M"+w[0]+","+O*i+"V0H"+w[1]+"V"+O*i)):(e=ra,k="y",M="x",j="y2",E="x2",T.attr("dy",".32em").style("text-anchor",0>O?"end":"start"),b.attr("d","M"+O*i+","+w[0]+"H0V"+w[1]+"H"+O*i)),C.attr(E,O*o),A.attr(M,O*y),S.attr(j,0).attr(E,O*o),N.attr(k,0).attr(M,O*y),d.rangeBand){var q=d,D=q.rangeBand()/2;c=d=function(e){return q(e)+D}}else c.rangeBand?c=d:g.call(e,d,c);m.call(e,c,d),v.call(e,d,d)})}var t,n=la.scale.linear(),r=Uu,o=6,i=6,a=3,s=[10],u=null;return e.scale=function(t){return arguments.length?(n=t,e):n},e.orient=function(t){return arguments.length?(r=t in Wu?t+"":Uu,e):r},e.ticks=function(){return arguments.length?(s=da(arguments),e):s},e.tickValues=function(t){return arguments.length?(u=t,e):u},e.tickFormat=function(n){return arguments.length?(t=n,e):t},e.tickSize=function(t){var n=arguments.length;return n?(o=+t,i=+arguments[n-1],e):o},e.innerTickSize=function(t){return arguments.length?(o=+t,e):o},e.outerTickSize=function(t){return arguments.length?(i=+t,e):i},e.tickPadding=function(t){return arguments.length?(a=+t,e):a},e.tickSubdivide=function(){return arguments.length&&e},e};var Uu="bottom",Wu={top:1,right:1,bottom:1,left:1};la.svg.brush=function(){function e(n){n.each(function(){var n=la.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=n.selectAll(".resize").data(m,x);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Yu[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",e.empty()?"none":null);var u,d=la.transition(n),f=la.transition(a);l&&(u=Wo(l),f.attr("x",u[0]).attr("width",u[1]-u[0]),r(d)),c&&(u=Wo(c),f.attr("y",u[0]).attr("height",u[1]-u[0]),o(d)),t(d)})}function t(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+d[+/e$/.test(e)]+","+f[+/^s/.test(e)]+")"})}function r(e){e.select(".extent").attr("x",d[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",d[1]-d[0])}function o(e){e.select(".extent").attr("y",f[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function i(){function i(){32==la.event.keyCode&&(T||(x=null,N[0]-=d[1],N[1]-=f[1],T=2),M())}function m(){32==la.event.keyCode&&2==T&&(N[0]+=d[1],N[1]+=f[1],T=0,M())}function g(){var e=la.mouse(_),n=!1;w&&(e[0]+=w[0],e[1]+=w[1]),T||(la.event.altKey?(x||(x=[(d[0]+d[1])/2,(f[0]+f[1])/2]),N[0]=d[+(e[0]<x[0])],N[1]=f[+(e[1]<x[1])]):x=null),C&&v(e,l,0)&&(r(j),n=!0),S&&v(e,c,1)&&(o(j),n=!0),n&&(t(j),k({type:"brush",mode:T?"move":"resize"}))}function v(e,t,n){var r,o,i=Wo(t),u=i[0],l=i[1],c=N[n],m=n?f:d,g=m[1]-m[0];return T&&(u-=c,l-=g+c),r=(n?p:h)?Math.max(u,Math.min(l,e[n])):e[n],T?o=(r+=c)+g:(x&&(c=Math.max(u,Math.min(l,2*x[n]-r))),r>c?(o=r,r=c):o=c),m[0]!=r||m[1]!=o?(n?s=null:a=null,m[0]=r,m[1]=o,!0):void 0}function y(){g(),j.style("pointer-events","all").selectAll(".resize").style("display",e.empty()?"none":null),la.select("body").style("cursor",null),O.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),k({type:"brushend"})}var x,w,_=this,b=la.select(la.event.target),k=u.of(_,arguments),j=la.select(_),E=b.datum(),C=!/^(n|s)$/.test(E)&&l,S=!/^(e|w)$/.test(E)&&c,T=b.classed("extent"),A=Z(_),N=la.mouse(_),O=la.select(n(_)).on("keydown.brush",i).on("keyup.brush",m);if(la.event.changedTouches?O.on("touchmove.brush",g).on("touchend.brush",y):O.on("mousemove.brush",g).on("mouseup.brush",y),j.interrupt().selectAll("*").interrupt(),T)N[0]=d[0]-N[0],N[1]=f[0]-N[1];else if(E){var q=+/w$/.test(E),D=+/^n/.test(E);w=[d[1-q]-N[0],f[1-D]-N[1]],N[0]=d[q],N[1]=f[D]}else la.event.altKey&&(x=N.slice());j.style("pointer-events","none").selectAll(".resize").style("display",null),la.select("body").style("cursor",b.style("cursor")),k({type:"brushstart"}),g()}var a,s,u=C(e,"brushstart","brush","brushend"),l=null,c=null,d=[0,0],f=[0,0],h=!0,p=!0,m=Xu[0];return e.event=function(e){e.each(function(){var e=u.of(this,arguments),t={x:d,y:f,i:a,j:s},n=this.__chart__||t;this.__chart__=t,Iu?la.select(this).transition().each("start.brush",function(){a=n.i,s=n.j,d=n.x,f=n.y,e({type:"brushstart"})}).tween("brush:brush",function(){var n=_r(d,t.x),r=_r(f,t.y);return a=s=null,function(o){d=t.x=n(o),f=t.y=r(o),e({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=t.i,s=t.j,e({type:"brush",mode:"resize"}),e({type:"brushend"})}):(e({type:"brushstart"}),e({type:"brush",mode:"resize"}),e({type:"brushend"}))})},e.x=function(t){return arguments.length?(l=t,m=Xu[!l<<1|!c],e):l},e.y=function(t){return arguments.length?(c=t,m=Xu[!l<<1|!c],e):c},e.clamp=function(t){return arguments.length?(l&&c?(h=!!t[0],p=!!t[1]):l?h=!!t:c&&(p=!!t),e):l&&c?[h,p]:l?h:c?p:null},e.extent=function(t){var n,r,o,i,u;return arguments.length?(l&&(n=t[0],r=t[1],c&&(n=n[0],r=r[0]),a=[n,r],l.invert&&(n=l(n),r=l(r)),n>r&&(u=n,n=r,r=u),(n!=d[0]||r!=d[1])&&(d=[n,r])),c&&(o=t[0],i=t[1],l&&(o=o[1],i=i[1]),s=[o,i],c.invert&&(o=c(o),i=c(i)),o>i&&(u=o,o=i,i=u),(o!=f[0]||i!=f[1])&&(f=[o,i])),e):(l&&(a?(n=a[0],r=a[1]):(n=d[0],r=d[1],l.invert&&(n=l.invert(n),r=l.invert(r)),n>r&&(u=n,n=r,r=u))),c&&(s?(o=s[0],i=s[1]):(o=f[0],i=f[1],c.invert&&(o=c.invert(o),i=c.invert(i)),o>i&&(u=o,o=i,i=u))),l&&c?[[n,o],[r,i]]:l?[n,r]:c&&[o,i])},e.clear=function(){return e.empty()||(d=[0,0],f=[0,0],a=s=null),e},e.empty=function(){return!!l&&d[0]==d[1]||!!c&&f[0]==f[1]},la.rebind(e,u,"on")};var Yu={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Xu=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ju=ps.format=ws.timeFormat,Zu=Ju.utc,Ku=Zu("%Y-%m-%dT%H:%M:%S.%LZ");Ju.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?oa:Ku,oa.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},oa.toString=Ku.toString,ps.second=He(function(e){return new ms(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),ps.seconds=ps.second.range,ps.seconds.utc=ps.second.utc.range,ps.minute=He(function(e){return new ms(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),ps.minutes=ps.minute.range,ps.minutes.utc=ps.minute.utc.range,ps.hour=He(function(e){var t=e.getTimezoneOffset()/60;return new ms(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),ps.hours=ps.hour.range,ps.hours.utc=ps.hour.utc.range,ps.month=He(function(e){return e=ps.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),ps.months=ps.month.range,ps.months.utc=ps.month.utc.range;var Gu=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Qu=[[ps.second,1],[ps.second,5],[ps.second,15],[ps.second,30],[ps.minute,1],[ps.minute,5],[ps.minute,15],[ps.minute,30],[ps.hour,1],[ps.hour,3],[ps.hour,6],[ps.hour,12],[ps.day,1],[ps.day,2],[ps.week,1],[ps.month,1],[ps.month,3],[ps.year,1]],el=Ju.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",At]]),tl={range:function(e,t,n){return la.range(Math.ceil(e/n)*n,+t,n).map(aa)},floor:x,ceil:x};Qu.year=ps.year,ps.scale=function(){return ia(la.scale.linear(),Qu,el)};var nl=Qu.map(function(e){return[e[0].utc,e[1]]}),rl=Zu.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",At]]);nl.year=ps.year.utc,ps.scale.utc=function(){return ia(la.scale.linear(),nl,rl)},la.text=Se(function(e){return e.responseText}),la.json=function(e,t){return Te(e,"application/json",sa,t)},la.html=function(e,t){return Te(e,"text/html",ua,t)},la.xml=Se(function(e){return e.responseXML}),"function"==typeof define&&define.amd?(this.d3=la,define(la)):"object"==typeof t&&t.exports?t.exports=la:this.d3=la}()},{}],280:[function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,r),e}function i(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(t){}}function s(){var e;try{e=n.storage.debug}catch(t){}return e}function u(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=i,n.formatArgs=o,n.save=a,n.load=s,n.useColors=r,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(s())},{"./debug":281}],281:[function(e,t,n){function r(){return n.colors[c++%n.colors.length]}function o(e){function t(){}function o(){var e=o,t=+new Date,i=t-(l||t);e.diff=i,e.prev=l,e.curr=t,l=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;s++;var o=n.formatters[r];if("function"==typeof o){var i=a[s];t=o.call(e,i),a.splice(s,1),s--}return t}),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(e,a));var u=o.log||n.log||console.log.bind(console);u.apply(e,a)}t.enabled=!1,o.enabled=!0;var i=n.enabled(e)?o:t;return i.namespace=e,i}function i(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,o=0;r>o;o++)t[o]&&(e=t[o].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function a(){n.enable("")}function s(e){var t,r;for(t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=o,n.coerce=u,n.disable=a,n.enable=i,n.enabled=s,n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={};var l,c=0},{ms:282}],282:[function(e,t,n){function r(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*d;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function o(e){return e>=c?Math.round(e/c)+"d":e>=l?Math.round(e/l)+"h":e>=u?Math.round(e/u)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function i(e){return a(e,c,"day")||a(e,l,"hour")||a(e,u,"minute")||a(e,s,"second")||e+" ms"}function a(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var s=1e3,u=60*s,l=60*u,c=24*l,d=365.25*c;t.exports=function(e,t){return t=t||{},"string"==typeof e?r(e):t["long"]?i(e):o(e)}},{}],283:[function(e,t,n){(function(r){!function(e){if("object"==typeof n&&"undefined"!=typeof t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof r?r:"undefined"!=typeof self?self:this,o.jade=e()}}(function(){return function t(n,r,o){function i(s,u){if(!r[s]){if(!n[s]){var l="function"==typeof e&&e;if(!u&&l)return l(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return i(t?t:e)},d,d.exports,t,n,r,o)}return r[s].exports}for(var a="function"==typeof e&&e,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){"use strict";function r(e){return null!=e&&""!==e}function o(e){return(Array.isArray(e)?e.map(o):e&&"object"==typeof e?Object.keys(e).filter(function(t){return e[t]}):[e]).filter(r).join(" ")}function i(e){return s[e]||e}function a(e){var t=String(e).replace(u,i);return t===""+e?e:t}n.merge=function l(e,t){if(1===arguments.length){for(var n=e[0],o=1;o<e.length;o++)n=l(n,e[o]);return n}var i=e["class"],a=t["class"];(i||a)&&(i=i||[],a=a||[],Array.isArray(i)||(i=[i]),Array.isArray(a)||(a=[a]),e["class"]=i.concat(a).filter(r));for(var s in t)"class"!=s&&(e[s]=t[s]);return e},n.joinClasses=o,n.cls=function(e,t){for(var r=[],i=0;i<e.length;i++)t&&t[i]?r.push(n.escape(o([e[i]]))):r.push(o(e[i]));var a=o(r);return a.length?' class="'+a+'"':""},n.style=function(e){return e&&"object"==typeof e?Object.keys(e).map(function(t){return t+":"+e[t]}).join(";"):e},n.attr=function(e,t,r,o){return"style"===e&&(t=n.style(t)),"boolean"==typeof t||null==t?t?" "+(o?e:e+'="'+e+'"'):"":0==e.indexOf("data")&&"string"!=typeof t?(-1!==JSON.stringify(t).indexOf("&")&&console.warn("Since Jade 2.0.0, ampersands (`&`) in data attributes will be escaped to `&amp;`"),t&&"function"==typeof t.toISOString&&console.warn("Jade will eliminate the double quotes around dates in ISO form after 2.0.0")," "+e+"='"+JSON.stringify(t).replace(/'/g,"&apos;")+"'"):r?(t&&"function"==typeof t.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+e+'="'+n.escape(t)+'"'):(t&&"function"==typeof t.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+e+'="'+t+'"')},n.attrs=function(e,t){var r=[],i=Object.keys(e);if(i.length)for(var a=0;a<i.length;++a){var s=i[a],u=e[s];"class"==s?(u=o(u))&&r.push(" "+s+'="'+u+'"'):r.push(n.attr(s,u,!1,t))}return r.join("")};var s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},u=/[&<>"]/g;n.escape=a,n.rethrow=function c(t,n,r,o){if(!(t instanceof Error))throw t;if(!("undefined"==typeof window&&n||o))throw t.message+=" on line "+r,t;try{o=o||e("fs").readFileSync(n,"utf8")}catch(i){c(t,null,r)}var a=3,s=o.split("\n"),u=Math.max(r-a,0),l=Math.min(s.length,r+a),a=s.slice(u,l).map(function(e,t){var n=t+u+1;return(n==r?" > ":" ")+n+"| "+e}).join("\n");throw t.path=n,t.message=(n||"Jade")+":"+r+"\n"+a+"\n\n"+t.message,t},n.DebugItem=function(e,t){this.lineno=e,this.filename=t}},{fs:2}],2:[function(e,t,n){},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{fs:278}],284:[function(e,t,n){!function(e,n){"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=Q.type(e);return"function"===n||Q.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(Q.isFunction(t))return Q.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Q.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(se.test(t))return Q.filter(t,e,n);t=Q.filter(t,e)}return Q.grep(e,function(e){return W.call(t,e)>=0!==n})}function o(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function i(e){var t=pe[e]={};return Q.each(e.match(he)||[],function(e,n){t[n]=!0}),t}function a(){K.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1),Q.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Q.expando+s.uid++}function u(e,t,data){var n;if(void 0===data&&1===e.nodeType)if(n="data-"+t.replace(we,"-$1").toLowerCase(),data=e.getAttribute(n),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:xe.test(data)?Q.parseJSON(data):data}catch(r){}ye.set(e,t,data)}else data=void 0;return data}function l(){return!0}function c(){return!1}function d(){try{return K.activeElement}catch(e){}}function f(e,t){return Q.nodeName(e,"table")&&Q.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function p(e){var t=Fe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n=0,r=e.length;r>n;n++)ve.set(e[n],"globalEval",!t||ve.get(t[n],"globalEval"))}function g(e,t){var n,r,o,i,a,s,u,l;if(1===t.nodeType){if(ve.hasData(e)&&(i=ve.access(e),a=ve.set(t,i),l=i.events)){delete a.handle,a.events={};for(o in l)for(n=0,r=l[o].length;r>n;n++)Q.event.add(t,o,l[o][n])}ye.hasData(e)&&(s=ye.access(e),u=Q.extend({},s),ye.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Q.nodeName(e,t)?Q.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&je.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function x(t,n){var r,o=Q(n.createElement(t)).appendTo(n.body),i=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(o[0]))?r.display:Q.css(o[0],"display");return o.detach(),i}function w(e){var t=K,n=Ie[e];return n||(n=x(e,t),"none"!==n&&n||(Pe=(Pe||Q("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=Pe[0].contentDocument,t.write(),t.close(),n=x(e,t),Pe.detach()),Ie[e]=n),n}function _(e,t,n){var r,o,i,a,s=e.style;return n=n||Be(e),n&&(a=n.getPropertyValue(t)||n[t]),n&&(""!==a||Q.contains(e.ownerDocument,e)||(a=Q.style(e,t)),$e.test(a)&&He.test(t)&&(r=s.width,o=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=o,s.maxWidth=i)),void 0!==a?a+"":a}function b(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function k(e,t){if(t in e)return t;for(var n=t[0].toUpperCase()+t.slice(1),r=t,o=Je.length;o--;)if(t=Je[o]+n,t in e)return t;return r}function j(e,t,n){var r=Ue.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function M(e,t,n,r,o){for(var i=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>i;i+=2)"margin"===n&&(a+=Q.css(e,n+be[i],!0,o)),r?("content"===n&&(a-=Q.css(e,"padding"+be[i],!0,o)),"margin"!==n&&(a-=Q.css(e,"border"+be[i]+"Width",!0,o))):(a+=Q.css(e,"padding"+be[i],!0,o),"padding"!==n&&(a+=Q.css(e,"border"+be[i]+"Width",!0,o)));return a}function E(e,t,n){var r=!0,o="width"===t?e.offsetWidth:e.offsetHeight,i=Be(e),a="border-box"===Q.css(e,"boxSizing",!1,i);if(0>=o||null==o){if(o=_(e,t,i),(0>o||null==o)&&(o=e.style[t]),$e.test(o))return o;r=a&&(Z.boxSizingReliable()||o===e.style[t]),o=parseFloat(o)||0}return o+M(e,t,n||(a?"border":"content"),r,i)+"px"}function C(e,t){for(var n,r,o,i=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(i[a]=ve.get(r,"olddisplay"),n=r.style.display,t?(i[a]||"none"!==n||(r.style.display=""),""===r.style.display&&ke(r)&&(i[a]=ve.access(r,"olddisplay",w(r.nodeName)))):(o=ke(r),"none"===n&&o||ve.set(r,"olddisplay",o?n:Q.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?i[a]||"":"none"));return e}function S(e,t,n,r,o){return new S.prototype.init(e,t,n,r,o)}function T(){return setTimeout(function(){Ze=void 0}),Ze=Q.now()}function A(e,t){var n,r=0,o={height:e};for(t=t?1:0;4>r;r+=2-t)n=be[r],o["margin"+n]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function N(e,t,n){for(var r,o=(nt[t]||[]).concat(nt["*"]),i=0,a=o.length;a>i;i++)if(r=o[i].call(n,t,e))return r}function O(e,t,n){var r,o,i,a,s,u,l,c,d=this,f={},h=e.style,p=e.nodeType&&ke(e),m=ve.get(e,"fxshow");n.queue||(s=Q._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,u=s.empty.fire,s.empty.fire=function(){s.unqueued||u()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,Q.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],l=Q.css(e,"display"),c="none"===l?ve.get(e,"olddisplay")||w(e.nodeName):l,"inline"===c&&"none"===Q.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Ge.exec(o)){if(delete t[r],i=i||"toggle"===o,o===(p?"hide":"show")){if("show"!==o||!m||void 0===m[r])continue;p=!0}f[r]=m&&m[r]||Q.style(e,r)}else l=void 0;if(Q.isEmptyObject(f))"inline"===("none"===l?w(e.nodeName):l)&&(h.display=l);else{m?"hidden"in m&&(p=m.hidden):m=ve.access(e,"fxshow",{}),i&&(m.hidden=!p),p?Q(e).show():d.done(function(){Q(e).hide()}),d.done(function(){var t;ve.remove(e,"fxshow");for(t in f)Q.style(e,t,f[t])});for(r in f)a=N(p?m[r]:0,r,d),r in m||(m[r]=a.start,p&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function q(e,t){var n,r,o,i,a;for(n in e)if(r=Q.camelCase(n),o=t[r],i=e[n],Q.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),a=Q.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete e[r];for(n in i)n in e||(e[n]=i[n],t[n]=o)}else t[r]=o}function D(e,t,n){var r,o,i=0,a=tt.length,s=Q.Deferred().always(function(){delete u.elem}),u=function(){if(o)return!1;for(var t=Ze||T(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,i=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(i);return s.notifyWith(e,[l,i,n]),1>i&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:Q.extend({},t),opts:Q.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Ze||T(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Q.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(o)return this;for(o=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(q(c,l.opts.specialEasing);a>i;i++)if(r=tt[i].call(l,e,c,l.opts))return r;return Q.map(c,N,l),Q.isFunction(l.opts.start)&&l.opts.start.call(e,l),Q.fx.timer(Q.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function L(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(he)||[];if(Q.isFunction(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function F(e,t,n,r){function o(s){var u;return i[s]=!0,Q.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||a||i[l]?a?!(u=l):void 0:(t.dataTypes.unshift(l),o(l),!1)}),u}var i={},a=e===xt;return o(t.dataTypes[0])||!i["*"]&&o("*")}function z(e,t){var n,r,o=Q.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&Q.extend(!0,e,r),e}function R(e,t,n){for(var r,o,i,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){u.unshift(o);break}if(u[0]in n)i=u[0];else{for(o in n){if(!u[0]||e.converters[o+" "+u[0]]){i=o;break}a||(a=o)}i=i||a}return i?(i!==u[0]&&u.unshift(i),n[i]):void 0}function P(e,t,n,r){var o,i,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(i=c.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=i,i=c.shift())if("*"===i)i=u;else if("*"!==u&&u!==i){if(a=l[u+" "+i]||l["* "+i],!a)for(o in l)if(s=o.split(" "),s[1]===i&&(a=l[u+" "+s[0]]||l["* "+s[0]])){a===!0?a=l[o]:l[o]!==!0&&(i=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+u+" to "+i}}}return{state:"success",data:t}}function I(e,t,n,r){var o;if(Q.isArray(t))Q.each(t,function(t,o){n||jt.test(e)?r(e,o):I(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==Q.type(t))r(e,t);else for(o in t)I(e+"["+o+"]",t[o],n,r)}function H(e){return Q.isWindow(e)?e:9===e.nodeType&&e.defaultView}var $=[],B=$.slice,V=$.concat,U=$.push,W=$.indexOf,Y={},X=Y.toString,J=Y.hasOwnProperty,Z={},K=e.document,G="2.1.4",Q=function(e,t){return new Q.fn.init(e,t)},ee=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,te=/^-ms-/,ne=/-([\da-z])/gi,re=function(e,t){return t.toUpperCase()};Q.fn=Q.prototype={jquery:G,constructor:Q,selector:"",length:0,toArray:function(){return B.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:B.call(this)},pushStack:function(e){var t=Q.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return Q.each(this,e,t)},map:function(e){return this.pushStack(Q.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(B.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:$.sort,splice:$.splice},Q.extend=Q.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||Q.isFunction(a)||(a={}),s===u&&(a=this,s--);u>s;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],a!==r&&(l&&r&&(Q.isPlainObject(r)||(o=Q.isArray(r)))?(o?(o=!1,i=n&&Q.isArray(n)?n:[]):i=n&&Q.isPlainObject(n)?n:{},a[t]=Q.extend(l,i,r)):void 0!==r&&(a[t]=r));return a},Q.extend({expando:"jQuery"+(G+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===Q.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!Q.isArray(e)&&e-parseFloat(e)+1>=0},isPlainObject:function(e){return"object"!==Q.type(e)||e.nodeType||Q.isWindow(e)?!1:e.constructor&&!J.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Y[X.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;e=Q.trim(e),e&&(1===e.indexOf("use strict")?(t=K.createElement("script"),t.text=e,K.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(te,"ms-").replace(ne,re)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var o,i=0,a=e.length,s=n(e);if(r){if(s)for(;a>i&&(o=t.apply(e[i],r),o!==!1);i++);else for(i in e)if(o=t.apply(e[i],r),o===!1)break}else if(s)for(;a>i&&(o=t.call(e[i],i,e[i]),o!==!1);i++);else for(i in e)if(o=t.call(e[i],i,e[i]),o===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(ee,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?Q.merge(r,"string"==typeof e?[e]:e):U.call(r,e)),r},inArray:function(e,t,n){return null==t?-1:W.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;n>r;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r,o=[],i=0,a=e.length,s=!n;a>i;i++)r=!t(e[i],i),r!==s&&o.push(e[i]);return o},map:function(e,t,r){var o,i=0,a=e.length,s=n(e),u=[];if(s)for(;a>i;i++)o=t(e[i],i,r),null!=o&&u.push(o);else for(i in e)o=t(e[i],i,r),null!=o&&u.push(o);return V.apply([],u)},guid:1,proxy:function(e,t){var n,r,o;return"string"==typeof t&&(n=e[t],t=e,e=n),Q.isFunction(e)?(r=B.call(arguments,2),o=function(){return e.apply(t||this,r.concat(B.call(arguments)))},o.guid=e.guid=e.guid||Q.guid++,o):void 0},now:Date.now,support:Z}),Q.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Y["[object "+t+"]"]=t.toLowerCase()});var oe=function(e){function t(e,t,n,r){var o,i,a,s,u,l,d,h,p,m;if((t?t.ownerDocument||t:I)!==O&&N(t),t=t||O,n=n||[],s=t.nodeType,"string"!=typeof e||!e||1!==s&&9!==s&&11!==s)return n;if(!r&&D){if(11!==s&&(o=ye.exec(e)))if(a=o[1]){if(9===s){if(i=t.getElementById(a),!i||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&R(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return G.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&_.getElementsByClassName)return G.apply(n,t.getElementsByClassName(a)),n}if(_.qsa&&(!L||!L.test(e))){if(h=d=P,p=t,m=1!==s&&e,
+1===s&&"object"!==t.nodeName.toLowerCase()){for(l=M(e),(d=t.getAttribute("id"))?h=d.replace(we,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",u=l.length;u--;)l[u]=h+f(l[u]);p=xe.test(e)&&c(t.parentNode)||t,m=l.join(",")}if(m)try{return G.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return C(e.replace(ue,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>b.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[P]=!0,e}function o(e){var t=O.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split("|"),r=e.length;r--;)b.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=$++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var s,u,l=[H,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||o){if(u=t[P]||(t[P]={}),(s=u[r])&&s[0]===H&&s[1]===i)return l[2]=s[2];if(u[r]=l,l[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var o=0,i=n.length;i>o;o++)t(e,n[o],r);return r}function g(e,t,n,r,o){for(var i,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(i=e[s])&&(!n||n(i,r,o))&&(a.push(i),l&&t.push(s));return a}function v(e,t,n,o,i,a){return o&&!o[P]&&(o=v(o)),i&&!i[P]&&(i=v(i,a)),r(function(r,a,s,u){var l,c,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,u),x=n?i||(r?e:p||o)?[]:a:y;if(n&&n(y,x,s,u),o)for(l=g(x,h),o(l,[],s,u),c=l.length;c--;)(d=l[c])&&(x[h[c]]=!(y[h[c]]=d));if(r){if(i||e){if(i){for(l=[],c=x.length;c--;)(d=x[c])&&l.push(y[c]=d);i(null,x=[],l,u)}for(c=x.length;c--;)(d=x[c])&&(l=i?ee(r,d):f[c])>-1&&(r[l]=!(a[l]=d))}}else x=g(x===a?x.splice(p,x.length):x),i?i(null,a,x,u):G.apply(a,x)})}function y(e){for(var t,n,r,o=e.length,i=b.relative[e[0].type],a=i||b.relative[" "],s=i?1:0,u=h(function(e){return e===t},a,!0),l=h(function(e){return ee(t,e)>-1},a,!0),c=[function(e,n,r){var o=!i&&(r||n!==S)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,o}];o>s;s++)if(n=b.relative[e[s].type])c=[h(p(c),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;o>r&&!b.relative[e[r].type];r++);return v(s>1&&p(c),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ue,"$1"),n,r>s&&y(e.slice(s,r)),o>r&&y(e=e.slice(r)),o>r&&f(e))}c.push(n)}return p(c)}function x(e,n){var o=n.length>0,i=e.length>0,a=function(r,a,s,u,l){var c,d,f,h=0,p="0",m=r&&[],v=[],y=S,x=r||i&&b.find.TAG("*",l),w=H+=null==y?1:Math.random()||.1,_=x.length;for(l&&(S=a!==O&&a);p!==_&&null!=(c=x[p]);p++){if(i&&c){for(d=0;f=e[d++];)if(f(c,a,s)){u.push(c);break}l&&(H=w)}o&&((c=!f&&c)&&h--,r&&m.push(c))}if(h+=p,o&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=Z.call(u));v=g(v)}G.apply(u,v),l&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(u)}return l&&(H=w,S=y),m};return o?r(a):a}var w,_,b,k,j,M,E,C,S,T,A,N,O,q,D,L,F,z,R,P="sizzle"+1*new Date,I=e.document,H=0,$=0,B=n(),V=n(),U=n(),W=function(e,t){return e===t&&(A=!0),0},Y=1<<31,X={}.hasOwnProperty,J=[],Z=J.pop,K=J.push,G=J.push,Q=J.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe=re.replace("w","w#"),ie="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+oe+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ie+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),ue=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(ae),he=new RegExp("^"+oe+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xe=/[+~]/,we=/'|\\/g,_e=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),be=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ke=function(){N()};try{G.apply(J=Q.call(I.childNodes),I.childNodes),J[I.childNodes.length].nodeType}catch(je){G={apply:J.length?function(e,t){K.apply(e,Q.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}_=t.support={},j=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},N=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:I;return r!==O&&9===r.nodeType&&r.documentElement?(O=r,q=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",ke,!1):n.attachEvent&&n.attachEvent("onunload",ke)),D=!j(r),_.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),_.getElementsByTagName=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),_.getElementsByClassName=ve.test(r.getElementsByClassName),_.getById=o(function(e){return q.appendChild(e).id=P,!r.getElementsByName||!r.getElementsByName(P).length}),_.getById?(b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&D){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},b.filter.ID=function(e){var t=e.replace(_e,be);return function(e){return e.getAttribute("id")===t}}):(delete b.find.ID,b.filter.ID=function(e){var t=e.replace(_e,be);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),b.find.TAG=_.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):_.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},b.find.CLASS=_.getElementsByClassName&&function(e,t){return D?t.getElementsByClassName(e):void 0},F=[],L=[],(_.qsa=ve.test(r.querySelectorAll))&&(o(function(e){q.appendChild(e).innerHTML="<a id='"+P+"'></a><select id='"+P+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&L.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||L.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+P+"-]").length||L.push("~="),e.querySelectorAll(":checked").length||L.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||L.push(".#.+[+~]")}),o(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&L.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),L.push(",.*:")})),(_.matchesSelector=ve.test(z=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&o(function(e){_.disconnectedMatch=z.call(e,"div"),z.call(e,"[s!='']:x"),F.push("!=",ae)}),L=L.length&&new RegExp(L.join("|")),F=F.length&&new RegExp(F.join("|")),t=ve.test(q.compareDocumentPosition),R=t||ve.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!_.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===I&&R(I,e)?-1:t===r||t.ownerDocument===I&&R(I,t)?1:T?ee(T,e)-ee(T,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,o=0,i=e.parentNode,s=t.parentNode,u=[e],l=[t];if(!i||!s)return e===r?-1:t===r?1:i?-1:s?1:T?ee(T,e)-ee(T,t):0;if(i===s)return a(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[o]===l[o];)o++;return o?a(u[o],l[o]):u[o]===I?-1:l[o]===I?1:0},r):O},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==O&&N(e),n=n.replace(de,"='$1']"),_.matchesSelector&&D&&(!F||!F.test(n))&&(!L||!L.test(n)))try{var r=z.call(e,n);if(r||_.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(o){}return t(n,O,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==O&&N(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==O&&N(e);var n=b.attrHandle[t.toLowerCase()],r=n&&X.call(b.attrHandle,t.toLowerCase())?n(e,t,!D):void 0;return void 0!==r?r:_.attributes||!D?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,o=0;if(A=!_.detectDuplicates,T=!_.sortStable&&e.slice(0),e.sort(W),A){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return T=null,e},k=t.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=k(t);return n},b=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(_e,be),e[3]=(e[3]||e[4]||e[5]||"").replace(_e,be),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=M(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(_e,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=B[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&B(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(o){var i=t.attr(o,e);return null==i?"!="===n:n?(i+="","="===n?i===r:"!="===n?i!==r:"^="===n?r&&0===i.indexOf(r):"*="===n?r&&i.indexOf(r)>-1:"$="===n?r&&i.slice(-r.length)===r:"~="===n?(" "+i.replace(se," ")+" ").indexOf(r)>-1:"|="===n?i===r||i.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,u){var l,c,d,f,h,p,m=i!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!u&&!s;if(g){if(i){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(c=g[P]||(g[P]={}),l=c[e]||[],h=l[0]===H&&l[1],f=l[0]===H&&l[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){c[e]=[H,h,f];break}}else if(y&&(l=(t[P]||(t[P]={}))[e])&&l[0]===H)f=l[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[P]||(d[P]={}))[e]=[H,f]),d!==t)););return f-=o,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,n){var o,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return i[P]?i(n):i.length>1?(o=[e,e,"",n],b.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,o=i(e,n),a=o.length;a--;)r=ee(e,o[a]),e[r]=!(t[r]=o[a])}):function(e){return i(e,0,o)}):i}},pseudos:{not:r(function(e){var t=[],n=[],o=E(e.replace(ue,"$1"));return o[P]?r(function(e,t,n,r){for(var i,a=o(e,null,r,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,r,i){return t[0]=e,o(t,null,i,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(_e,be),function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:r(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(_e,be).toLowerCase(),function(t){var n;do if(n=D?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[0>n?n+t:n]}),even:l(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},b.pseudos.nth=b.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})b.pseudos[w]=u(w);return d.prototype=b.filters=b.pseudos,b.setFilters=new d,M=t.tokenize=function(e,n){var r,o,i,a,s,u,l,c=V[e+" "];if(c)return n?0:c.slice(0);for(s=e,u=[],l=b.preFilter;s;){(!r||(o=le.exec(s)))&&(o&&(s=s.slice(o[0].length)||s),u.push(i=[])),r=!1,(o=ce.exec(s))&&(r=o.shift(),i.push({value:r,type:o[0].replace(ue," ")}),s=s.slice(r.length));for(a in b.filter)!(o=pe[a].exec(s))||l[a]&&!(o=l[a](o))||(r=o.shift(),i.push({value:r,type:a,matches:o}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):V(e,u).slice(0)},E=t.compile=function(e,t){var n,r=[],o=[],i=U[e+" "];if(!i){for(t||(t=M(e)),n=t.length;n--;)i=y(t[n]),i[P]?r.push(i):o.push(i);i=U(e,x(o,r)),i.selector=e}return i},C=t.select=function(e,t,n,r){var o,i,a,s,u,l="function"==typeof e&&e,d=!r&&M(e=l.selector||e);if(n=n||[],1===d.length){if(i=d[0]=d[0].slice(0),i.length>2&&"ID"===(a=i[0]).type&&_.getById&&9===t.nodeType&&D&&b.relative[i[1].type]){if(t=(b.find.ID(a.matches[0].replace(_e,be),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=pe.needsContext.test(e)?0:i.length;o--&&(a=i[o],!b.relative[s=a.type]);)if((u=b.find[s])&&(r=u(a.matches[0].replace(_e,be),xe.test(i[0].type)&&c(t.parentNode)||t))){if(i.splice(o,1),e=r.length&&f(i),!e)return G.apply(n,r),n;break}}return(l||E(e,d))(r,t,!D,n,xe.test(e)&&c(t.parentNode)||t),n},_.sortStable=P.split("").sort(W).join("")===P,_.detectDuplicates=!!A,N(),_.sortDetached=o(function(e){return 1&e.compareDocumentPosition(O.createElement("div"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||i("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),_.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||i("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||i(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);Q.find=oe,Q.expr=oe.selectors,Q.expr[":"]=Q.expr.pseudos,Q.unique=oe.uniqueSort,Q.text=oe.getText,Q.isXMLDoc=oe.isXML,Q.contains=oe.contains;var ie=Q.expr.match.needsContext,ae=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,se=/^.[^:#\[\.,]*$/;Q.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?Q.find.matchesSelector(r,e)?[r]:[]:Q.find.matches(e,Q.grep(t,function(e){return 1===e.nodeType}))},Q.fn.extend({find:function(e){var t,n=this.length,r=[],o=this;if("string"!=typeof e)return this.pushStack(Q(e).filter(function(){for(t=0;n>t;t++)if(Q.contains(o[t],this))return!0}));for(t=0;n>t;t++)Q.find(e,o[t],r);return r=this.pushStack(n>1?Q.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(r(this,e||[],!1))},not:function(e){return this.pushStack(r(this,e||[],!0))},is:function(e){return!!r(this,"string"==typeof e&&ie.test(e)?Q(e):e||[],!1).length}});var ue,le=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ce=Q.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:le.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||ue).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof Q?t[0]:t,Q.merge(this,Q.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:K,!0)),ae.test(n[1])&&Q.isPlainObject(t))for(n in t)Q.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return r=K.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=K,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):Q.isFunction(e)?"undefined"!=typeof ue.ready?ue.ready(e):e(Q):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),Q.makeArray(e,this))};ce.prototype=Q.fn,ue=Q(K);var de=/^(?:parents|prev(?:Until|All))/,fe={children:!0,contents:!0,next:!0,prev:!0};Q.extend({dir:function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&Q(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),Q.fn.extend({has:function(e){var t=Q(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(Q.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,r=0,o=this.length,i=[],a=ie.test(e)||"string"!=typeof e?Q(e,t||this.context):0;o>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&Q.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?Q.unique(i):i)},index:function(e){return e?"string"==typeof e?W.call(Q(e),this[0]):W.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(Q.unique(Q.merge(this.get(),Q(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Q.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Q.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Q.dir(e,"parentNode",n)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return Q.dir(e,"nextSibling")},prevAll:function(e){return Q.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Q.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Q.dir(e,"previousSibling",n)},siblings:function(e){return Q.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Q.sibling(e.firstChild)},contents:function(e){return e.contentDocument||Q.merge([],e.childNodes)}},function(e,t){Q.fn[e]=function(n,r){var o=Q.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=Q.filter(r,o)),this.length>1&&(fe[e]||Q.unique(o),de.test(e)&&o.reverse()),this.pushStack(o)}});var he=/\S+/g,pe={};Q.Callbacks=function(e){e="string"==typeof e?pe[e]||i(e):Q.extend({},e);var t,n,r,o,a,s,u=[],l=!e.once&&[],c=function(data){for(t=e.memory&&data,n=!0,s=o||0,o=0,a=u.length,r=!0;u&&a>s;s++)if(u[s].apply(data[0],data[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,u&&(l?l.length&&c(l.shift()):t?u=[]:d.disable())},d={add:function(){if(u){var n=u.length;!function i(t){Q.each(t,function(t,n){var r=Q.type(n);"function"===r?e.unique&&d.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),r?a=u.length:t&&(o=n,c(t))}return this},remove:function(){return u&&Q.each(arguments,function(e,t){for(var n;(n=Q.inArray(t,u,n))>-1;)u.splice(n,1),r&&(a>=n&&a--,s>=n&&s--)}),this},has:function(e){return e?Q.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],a=0,this},disable:function(){return u=l=t=void 0,this},disabled:function(){return!u},lock:function(){return l=void 0,t||d.disable(),this},locked:function(){return!l},fireWith:function(e,t){return!u||n&&!l||(t=t||[],t=[e,t.slice?t.slice():t],r?l.push(t):c(t)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},Q.extend({Deferred:function(e){var t=[["resolve","done",Q.Callbacks("once memory"),"resolved"],["reject","fail",Q.Callbacks("once memory"),"rejected"],["notify","progress",Q.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Q.Deferred(function(n){Q.each(t,function(t,i){var a=Q.isFunction(e[t])&&e[t];o[i[1]](function(){var e=a&&a.apply(this,arguments);e&&Q.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[i[0]+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?Q.extend(e,r):r}},o={};return r.pipe=r.then,Q.each(t,function(e,i){var a=i[2],s=i[3];r[i[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),o[i[0]]=function(){return o[i[0]+"With"](this===o?r:this,arguments),this},o[i[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,r,o=0,i=B.call(arguments),a=i.length,s=1!==a||e&&Q.isFunction(e.promise)?a:0,u=1===s?e:Q.Deferred(),l=function(e,n,r){return function(o){n[e]=this,r[e]=arguments.length>1?B.call(arguments):o,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=new Array(a),n=new Array(a),r=new Array(a);a>o;o++)i[o]&&Q.isFunction(i[o].promise)?i[o].promise().done(l(o,r,i)).fail(u.reject).progress(l(o,n,t)):--s;return s||u.resolveWith(r,i),u.promise()}});var me;Q.fn.ready=function(e){return Q.ready.promise().done(e),this},Q.extend({isReady:!1,readyWait:1,holdReady:function(e){e?Q.readyWait++:Q.ready(!0)},ready:function(e){(e===!0?--Q.readyWait:Q.isReady)||(Q.isReady=!0,e!==!0&&--Q.readyWait>0||(me.resolveWith(K,[Q]),Q.fn.triggerHandler&&(Q(K).triggerHandler("ready"),Q(K).off("ready"))))}}),Q.ready.promise=function(t){return me||(me=Q.Deferred(),"complete"===K.readyState?setTimeout(Q.ready):(K.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",a,!1))),me.promise(t)},Q.ready.promise();var ge=Q.access=function(e,t,n,r,o,i,a){var s=0,u=e.length,l=null==n;if("object"===Q.type(n)){o=!0;for(s in n)Q.access(e,t,s,n[s],!0,i,a)}else if(void 0!==r&&(o=!0,Q.isFunction(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(Q(e),n)})),t))for(;u>s;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return o?e:l?t.call(e):u?t(e[0],n):i};Q.acceptData=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType},s.uid=1,s.accepts=Q.acceptData,s.prototype={key:function(e){if(!s.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=s.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,Q.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,data,t){var n,r=this.key(e),o=this.cache[r];if("string"==typeof data)o[data]=t;else if(Q.isEmptyObject(o))Q.extend(this.cache[r],data);else for(n in data)o[n]=data[n];return o},get:function(e,t){var n=this.cache[this.key(e)];return void 0===t?n:n[t]},access:function(e,t,n){var r;return void 0===t||t&&"string"==typeof t&&void 0===n?(r=this.get(e,t),void 0!==r?r:this.get(e,Q.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r,o,i=this.key(e),a=this.cache[i];if(void 0===t)this.cache[i]={};else{Q.isArray(t)?r=t.concat(t.map(Q.camelCase)):(o=Q.camelCase(t),t in a?r=[t,o]:(r=o,r=r in a?[r]:r.match(he)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(e){return!Q.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}};var ve=new s,ye=new s,xe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,we=/([A-Z])/g;Q.extend({hasData:function(e){return ye.hasData(e)||ve.hasData(e)},data:function(e,t,data){return ye.access(e,t,data)},removeData:function(e,t){ye.remove(e,t)},_data:function(e,t,data){return ve.access(e,t,data)},_removeData:function(e,t){ve.remove(e,t)}}),Q.fn.extend({data:function(e,t){var n,r,data,o=this[0],i=o&&o.attributes;if(void 0===e){if(this.length&&(data=ye.get(o),1===o.nodeType&&!ve.get(o,"hasDataAttrs"))){for(n=i.length;n--;)i[n]&&(r=i[n].name,0===r.indexOf("data-")&&(r=Q.camelCase(r.slice(5)),u(o,r,data[r])));ve.set(o,"hasDataAttrs",!0)}return data}return"object"==typeof e?this.each(function(){ye.set(this,e)}):ge(this,function(t){var data,n=Q.camelCase(e);if(o&&void 0===t){if(data=ye.get(o,e),void 0!==data)return data;if(data=ye.get(o,n),void 0!==data)return data;if(data=u(o,n,void 0),void 0!==data)return data}else this.each(function(){var data=ye.get(this,n);ye.set(this,n,t),-1!==e.indexOf("-")&&void 0!==data&&ye.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){ye.remove(this,e)})}}),Q.extend({queue:function(e,t,data){var n;return e?(t=(t||"fx")+"queue",n=ve.get(e,t),data&&(!n||Q.isArray(data)?n=ve.access(e,t,Q.makeArray(data)):n.push(data)),n||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=Q.queue(e,t),r=n.length,o=n.shift(),i=Q._queueHooks(e,t),a=function(){Q.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ve.get(e,n)||ve.access(e,n,{empty:Q.Callbacks("once memory").add(function(){ve.remove(e,[t+"queue",n])})})}}),Q.fn.extend({queue:function(e,data){var t=2;return"string"!=typeof e&&(data=e,e="fx",t--),arguments.length<t?Q.queue(this[0],e):void 0===data?this:this.each(function(){var t=Q.queue(this,e,data);Q._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Q.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Q.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=Q.Deferred(),i=this,a=this.length,s=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)n=ve.get(i[a],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),o.promise(t)}});var _e=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,be=["Top","Right","Bottom","Left"],ke=function(e,t){return e=t||e,"none"===Q.css(e,"display")||!Q.contains(e.ownerDocument,e)},je=/^(?:checkbox|radio)$/i;!function(){var e=K.createDocumentFragment(),t=e.appendChild(K.createElement("div")),n=K.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),Z.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",Z.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Me="undefined";Z.focusinBubbles="onfocusin"in e;var Ee=/^key/,Ce=/^(?:mouse|pointer|contextmenu)|click/,Se=/^(?:focusinfocus|focusoutblur)$/,Te=/^([^.]*)(?:\.(.+)|)$/;Q.event={global:{},add:function(e,t,n,data,r){var o,i,a,s,u,l,c,d,f,h,p,m=ve.get(e);if(m)for(n.handler&&(o=n,n=o.handler,r=o.selector),n.guid||(n.guid=Q.guid++),(s=m.events)||(s=m.events={}),(i=m.handle)||(i=m.handle=function(t){return typeof Q!==Me&&Q.event.triggered!==t.type?Q.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(he)||[""],u=t.length;u--;)a=Te.exec(t[u])||[],f=p=a[1],h=(a[2]||"").split(".").sort(),f&&(c=Q.event.special[f]||{},f=(r?c.delegateType:c.bindType)||f,c=Q.event.special[f]||{},l=Q.extend({type:f,origType:p,data:data,handler:n,guid:n.guid,selector:r,needsContext:r&&Q.expr.match.needsContext.test(r),namespace:h.join(".")},o),(d=s[f])||(d=s[f]=[],d.delegateCount=0,c.setup&&c.setup.call(e,data,h,i)!==!1||e.addEventListener&&e.addEventListener(f,i,!1)),c.add&&(c.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,l):d.push(l),Q.event.global[f]=!0)},remove:function(e,t,n,r,o){var i,a,s,u,l,c,d,f,h,p,m,g=ve.hasData(e)&&ve.get(e);if(g&&(u=g.events)){for(t=(t||"").match(he)||[""],l=t.length;l--;)if(s=Te.exec(t[l])||[],h=m=s[1],p=(s[2]||"").split(".").sort(),h){for(d=Q.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,f=u[h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=f.length;i--;)c=f[i],!o&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(i,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));a&&!f.length&&(d.teardown&&d.teardown.call(e,p,g.handle)!==!1||Q.removeEvent(e,h,g.handle),delete u[h])}else for(h in u)Q.event.remove(e,h+t[l],n,r,!0);Q.isEmptyObject(u)&&(delete g.handle,ve.remove(e,"events"))}},trigger:function(t,data,n,r){var o,i,a,s,u,l,c,d=[n||K],f=J.call(t,"type")?t.type:t,h=J.call(t,"namespace")?t.namespace.split("."):[];if(i=a=n=n||K,3!==n.nodeType&&8!==n.nodeType&&!Se.test(f+Q.event.triggered)&&(f.indexOf(".")>=0&&(h=f.split("."),f=h.shift(),h.sort()),u=f.indexOf(":")<0&&"on"+f,t=t[Q.expando]?t:new Q.Event(f,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=h.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),data=null==data?[t]:Q.makeArray(data,[t]),c=Q.event.special[f]||{},r||!c.trigger||c.trigger.apply(n,data)!==!1)){if(!r&&!c.noBubble&&!Q.isWindow(n)){for(s=c.delegateType||f,Se.test(s+f)||(i=i.parentNode);i;i=i.parentNode)d.push(i),a=i;a===(n.ownerDocument||K)&&d.push(a.defaultView||a.parentWindow||e)}for(o=0;(i=d[o++])&&!t.isPropagationStopped();)t.type=o>1?s:c.bindType||f,l=(ve.get(i,"events")||{})[t.type]&&ve.get(i,"handle"),l&&l.apply(i,data),l=u&&i[u],l&&l.apply&&Q.acceptData(i)&&(t.result=l.apply(i,data),
+t.result===!1&&t.preventDefault());return t.type=f,r||t.isDefaultPrevented()||c._default&&c._default.apply(d.pop(),data)!==!1||!Q.acceptData(n)||u&&Q.isFunction(n[f])&&!Q.isWindow(n)&&(a=n[u],a&&(n[u]=null),Q.event.triggered=f,n[f](),Q.event.triggered=void 0,a&&(n[u]=a)),t.result}},dispatch:function(e){e=Q.event.fix(e);var t,n,r,o,i,a=[],s=B.call(arguments),u=(ve.get(this,"events")||{})[e.type]||[],l=Q.event.special[e.type]||{};if(s[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){for(a=Q.event.handlers.call(this,e,u),t=0;(o=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((Q.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,s),void 0!==r&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,o,i,a=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;s>n;n++)i=t[n],o=i.selector+" ",void 0===r[o]&&(r[o]=i.needsContext?Q(o,this).index(u)>=0:Q.find(o,this,null,[u]).length),r[o]&&r.push(i);r.length&&a.push({elem:u,handlers:r})}return s<t.length&&a.push({elem:this,handlers:t.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,o,i=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||K,r=n.documentElement,o=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),e.which||void 0===i||(e.which=1&i?1:2&i?3:4&i?2:0),e}},fix:function(e){if(e[Q.expando])return e;var t,n,r,o=e.type,i=e,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=Ce.test(o)?this.mouseHooks:Ee.test(o)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new Q.Event(i),t=r.length;t--;)n=r[t],e[n]=i[n];return e.target||(e.target=K),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,i):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==d()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===d()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&Q.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return Q.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var o=Q.extend(new Q.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?Q.event.trigger(o,null,t):Q.event.dispatch.call(t,o),o.isDefaultPrevented()&&n.preventDefault()}},Q.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},Q.Event=function(e,t){return this instanceof Q.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?l:c):this.type=e,t&&Q.extend(this,t),this.timeStamp=e&&e.timeStamp||Q.now(),void(this[Q.expando]=!0)):new Q.Event(e,t)},Q.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=l,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=l,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=l,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},Q.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){Q.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return(!o||o!==r&&!Q.contains(r,o))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),Z.focusinBubbles||Q.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){Q.event.simulate(t,e.target,Q.event.fix(e),!0)};Q.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=ve.access(r,t);o||r.addEventListener(e,n,!0),ve.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=ve.access(r,t)-1;o?ve.access(r,t,o):(r.removeEventListener(e,n,!0),ve.remove(r,t))}}}),Q.fn.extend({on:function(e,t,data,n,r){var o,i;if("object"==typeof e){"string"!=typeof t&&(data=data||t,t=void 0);for(i in e)this.on(i,t,data,e[i],r);return this}if(null==data&&null==n?(n=t,data=t=void 0):null==n&&("string"==typeof t?(n=data,data=void 0):(n=data,data=t,t=void 0)),n===!1)n=c;else if(!n)return this;return 1===r&&(o=n,n=function(e){return Q().off(e),o.apply(this,arguments)},n.guid=o.guid||(o.guid=Q.guid++)),this.each(function(){Q.event.add(this,e,n,data,t)})},one:function(e,t,data,n){return this.on(e,t,data,n,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,Q(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=void 0),n===!1&&(n=c),this.each(function(){Q.event.remove(this,e,n,t)})},trigger:function(e,data){return this.each(function(){Q.event.trigger(e,data,this)})},triggerHandler:function(e,data){var t=this[0];return t?Q.event.trigger(e,data,t,!0):void 0}});var Ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ne=/<([\w:]+)/,Oe=/<|&#?\w+;/,qe=/<(?:script|style|link)/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,Le=/^$|\/(?:java|ecma)script/i,Fe=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Re={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Re.optgroup=Re.option,Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.thead,Re.th=Re.td,Q.extend({clone:function(e,t,n){var r,o,i,a,s=e.cloneNode(!0),u=Q.contains(e.ownerDocument,e);if(!(Z.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Q.isXMLDoc(e)))for(a=v(s),i=v(e),r=0,o=i.length;o>r;r++)y(i[r],a[r]);if(t)if(n)for(i=i||v(e),a=a||v(s),r=0,o=i.length;o>r;r++)g(i[r],a[r]);else g(e,s);return a=v(s,"script"),a.length>0&&m(a,!u&&v(e,"script")),s},buildFragment:function(e,t,n,r){for(var o,i,a,s,u,l,c=t.createDocumentFragment(),d=[],f=0,h=e.length;h>f;f++)if(o=e[f],o||0===o)if("object"===Q.type(o))Q.merge(d,o.nodeType?[o]:o);else if(Oe.test(o)){for(i=i||c.appendChild(t.createElement("div")),a=(Ne.exec(o)||["",""])[1].toLowerCase(),s=Re[a]||Re._default,i.innerHTML=s[1]+o.replace(Ae,"<$1></$2>")+s[2],l=s[0];l--;)i=i.lastChild;Q.merge(d,i.childNodes),i=c.firstChild,i.textContent=""}else d.push(t.createTextNode(o));for(c.textContent="",f=0;o=d[f++];)if((!r||-1===Q.inArray(o,r))&&(u=Q.contains(o.ownerDocument,o),i=v(c.appendChild(o),"script"),u&&m(i),n))for(l=0;o=i[l++];)Le.test(o.type||"")&&n.push(o);return c},cleanData:function(e){for(var data,t,n,r,o=Q.event.special,i=0;void 0!==(t=e[i]);i++){if(Q.acceptData(t)&&(r=t[ve.expando],r&&(data=ve.cache[r]))){if(data.events)for(n in data.events)o[n]?Q.event.remove(t,n):Q.removeEvent(t,n,data.handle);ve.cache[r]&&delete ve.cache[r]}delete ye.cache[t[ye.expando]]}}}),Q.fn.extend({text:function(e){return ge(this,function(e){return void 0===e?Q.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=f(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=f(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?Q.filter(e,this):this,o=0;null!=(n=r[o]);o++)t||1!==n.nodeType||Q.cleanData(v(n)),n.parentNode&&(t&&Q.contains(n.ownerDocument,n)&&m(v(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(Q.cleanData(v(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Q.clone(this,e,t)})},html:function(e){return ge(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!Re[(Ne.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ae,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(Q.cleanData(v(t,!1)),t.innerHTML=e);t=0}catch(o){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,Q.cleanData(v(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=V.apply([],e);var n,r,o,i,a,s,u=0,l=this.length,c=this,d=l-1,f=e[0],m=Q.isFunction(f);if(m||l>1&&"string"==typeof f&&!Z.checkClone&&De.test(f))return this.each(function(n){var r=c.eq(n);m&&(e[0]=f.call(this,n,r.html())),r.domManip(e,t)});if(l&&(n=Q.buildFragment(e,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(o=Q.map(v(n,"script"),h),i=o.length;l>u;u++)a=n,u!==d&&(a=Q.clone(a,!0,!0),i&&Q.merge(o,v(a,"script"))),t.call(this[u],a,u);if(i)for(s=o[o.length-1].ownerDocument,Q.map(o,p),u=0;i>u;u++)a=o[u],Le.test(a.type||"")&&!ve.access(a,"globalEval")&&Q.contains(s,a)&&(a.src?Q._evalUrl&&Q._evalUrl(a.src):Q.globalEval(a.textContent.replace(ze,"")))}return this}}),Q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Q.fn[e]=function(e){for(var n,r=[],o=Q(e),i=o.length-1,a=0;i>=a;a++)n=a===i?this:this.clone(!0),Q(o[a])[t](n),U.apply(r,n.get());return this.pushStack(r)}});var Pe,Ie={},He=/^margin/,$e=new RegExp("^("+_e+")(?!px)[a-z%]+$","i"),Be=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};!function(){function t(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",o.appendChild(i);var t=e.getComputedStyle(a,null);n="1%"!==t.top,r="4px"===t.width,o.removeChild(i)}var n,r,o=K.documentElement,i=K.createElement("div"),a=K.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",Z.clearCloneStyle="content-box"===a.style.backgroundClip,i.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",i.appendChild(a),e.getComputedStyle&&Q.extend(Z,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==r&&t(),r},reliableMarginRight:function(){var t,n=a.appendChild(K.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",o.appendChild(i),t=!parseFloat(e.getComputedStyle(n,null).marginRight),o.removeChild(i),a.removeChild(n),t}}))}(),Q.swap=function(e,t,n,r){var o,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];o=n.apply(e,r||[]);for(i in t)e.style[i]=a[i];return o};var Ve=/^(none|table(?!-c[ea]).+)/,Ue=new RegExp("^("+_e+")(.*)$","i"),We=new RegExp("^([+-])=("+_e+")","i"),Ye={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"},Je=["Webkit","O","Moz","ms"];Q.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,s=Q.camelCase(t),u=e.style;return t=Q.cssProps[s]||(Q.cssProps[s]=k(u,s)),a=Q.cssHooks[t]||Q.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:u[t]:(i=typeof n,"string"===i&&(o=We.exec(n))&&(n=(o[1]+1)*o[2]+parseFloat(Q.css(e,t)),i="number"),null!=n&&n===n&&("number"!==i||Q.cssNumber[s]||(n+="px"),Z.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u[t]=n)),void 0)}},css:function(e,t,n,r){var o,i,a,s=Q.camelCase(t);return t=Q.cssProps[s]||(Q.cssProps[s]=k(e.style,s)),a=Q.cssHooks[t]||Q.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=_(e,t,r)),"normal"===o&&t in Xe&&(o=Xe[t]),""===n||n?(i=parseFloat(o),n===!0||Q.isNumeric(i)?i||0:o):o}}),Q.each(["height","width"],function(e,t){Q.cssHooks[t]={get:function(e,n,r){return n?Ve.test(Q.css(e,"display"))&&0===e.offsetWidth?Q.swap(e,Ye,function(){return E(e,t,r)}):E(e,t,r):void 0},set:function(e,n,r){var o=r&&Be(e);return j(e,n,r?M(e,t,r,"border-box"===Q.css(e,"boxSizing",!1,o),o):0)}}}),Q.cssHooks.marginRight=b(Z.reliableMarginRight,function(e,t){return t?Q.swap(e,{display:"inline-block"},_,[e,"marginRight"]):void 0}),Q.each({margin:"",padding:"",border:"Width"},function(e,t){Q.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];4>r;r++)o[e+be[r]+t]=i[r]||i[r-2]||i[0];return o}},He.test(e)||(Q.cssHooks[e+t].set=j)}),Q.fn.extend({css:function(e,t){return ge(this,function(e,t,n){var r,o,i={},a=0;if(Q.isArray(t)){for(r=Be(e),o=t.length;o>a;a++)i[t[a]]=Q.css(e,t[a],!1,r);return i}return void 0!==n?Q.style(e,t,n):Q.css(e,t)},e,t,arguments.length>1)},show:function(){return C(this,!0)},hide:function(){return C(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ke(this)?Q(this).show():Q(this).hide()})}}),Q.Tween=S,S.prototype={constructor:S,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(Q.cssNumber[n]?"":"px")},cur:function(){var e=S.propHooks[this.prop];return e&&e.get?e.get(this):S.propHooks._default.get(this)},run:function(e){var t,n=S.propHooks[this.prop];return this.options.duration?this.pos=t=Q.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):S.propHooks._default.set(this),this}},S.prototype.init.prototype=S.prototype,S.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Q.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Q.fx.step[e.prop]?Q.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Q.cssProps[e.prop]]||Q.cssHooks[e.prop])?Q.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},S.propHooks.scrollTop=S.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Q.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Q.fx=S.prototype.init,Q.fx.step={};var Ze,Ke,Ge=/^(?:toggle|show|hide)$/,Qe=new RegExp("^(?:([+-])=|)("+_e+")([a-z%]*)$","i"),et=/queueHooks$/,tt=[O],nt={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),o=Qe.exec(t),i=o&&o[3]||(Q.cssNumber[e]?"":"px"),a=(Q.cssNumber[e]||"px"!==i&&+r)&&Qe.exec(Q.css(n.elem,e)),s=1,u=20;if(a&&a[3]!==i){i=i||a[3],o=o||[],a=+r||1;do s=s||".5",a/=s,Q.style(n.elem,e,a+i);while(s!==(s=n.cur()/r)&&1!==s&&--u)}return o&&(a=n.start=+a||+r||0,n.unit=i,n.end=o[1]?a+(o[1]+1)*o[2]:+o[2]),n}]};Q.Animation=Q.extend(D,{tweener:function(e,t){Q.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,o=e.length;o>r;r++)n=e[r],nt[n]=nt[n]||[],nt[n].unshift(t)},prefilter:function(e,t){t?tt.unshift(e):tt.push(e)}}),Q.speed=function(e,t,n){var r=e&&"object"==typeof e?Q.extend({},e):{complete:n||!n&&t||Q.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Q.isFunction(t)&&t};return r.duration=Q.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Q.fx.speeds?Q.fx.speeds[r.duration]:Q.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Q.isFunction(r.old)&&r.old.call(this),r.queue&&Q.dequeue(this,r.queue)},r},Q.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ke).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=Q.isEmptyObject(e),i=Q.speed(t,n,r),a=function(){var t=D(this,Q.extend({},e),i);(o||ve.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||i.queue===!1?this.each(a):this.queue(i.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",i=Q.timers,data=ve.get(this);if(o)data[o]&&data[o].stop&&r(data[o]);else for(o in data)data[o]&&data[o].stop&&et.test(o)&&r(data[o]);for(o=i.length;o--;)i[o].elem!==this||null!=e&&i[o].queue!==e||(i[o].anim.stop(n),t=!1,i.splice(o,1));(t||!n)&&Q.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,data=ve.get(this),n=data[e+"queue"],r=data[e+"queueHooks"],o=Q.timers,i=n?n.length:0;for(data.finish=!0,Q.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;i>t;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete data.finish})}}),Q.each(["toggle","show","hide"],function(e,t){var n=Q.fn[t];Q.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(A(t,!0),e,r,o)}}),Q.each({slideDown:A("show"),slideUp:A("hide"),slideToggle:A("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Q.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Q.timers=[],Q.fx.tick=function(){var e,t=0,n=Q.timers;for(Ze=Q.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||Q.fx.stop(),Ze=void 0},Q.fx.timer=function(e){Q.timers.push(e),e()?Q.fx.start():Q.timers.pop()},Q.fx.interval=13,Q.fx.start=function(){Ke||(Ke=setInterval(Q.fx.tick,Q.fx.interval))},Q.fx.stop=function(){clearInterval(Ke),Ke=null},Q.fx.speeds={slow:600,fast:200,_default:400},Q.fn.delay=function(e,t){return e=Q.fx?Q.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e=K.createElement("input"),t=K.createElement("select"),n=t.appendChild(K.createElement("option"));e.type="checkbox",Z.checkOn=""!==e.value,Z.optSelected=n.selected,t.disabled=!0,Z.optDisabled=!n.disabled,e=K.createElement("input"),e.value="t",e.type="radio",Z.radioValue="t"===e.value}();var rt,ot,it=Q.expr.attrHandle;Q.fn.extend({attr:function(e,t){return ge(this,Q.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Q.removeAttr(this,e)})}}),Q.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(e&&3!==i&&8!==i&&2!==i)return typeof e.getAttribute===Me?Q.prop(e,t,n):(1===i&&Q.isXMLDoc(e)||(t=t.toLowerCase(),r=Q.attrHooks[t]||(Q.expr.match.bool.test(t)?ot:rt)),void 0===n?r&&"get"in r&&null!==(o=r.get(e,t))?o:(o=Q.find.attr(e,t),null==o?void 0:o):null!==n?r&&"set"in r&&void 0!==(o=r.set(e,n,t))?o:(e.setAttribute(t,n+""),n):void Q.removeAttr(e,t))},removeAttr:function(e,t){var n,r,o=0,i=t&&t.match(he);if(i&&1===e.nodeType)for(;n=i[o++];)r=Q.propFix[n]||n,Q.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!Z.radioValue&&"radio"===t&&Q.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),ot={set:function(e,t,n){return t===!1?Q.removeAttr(e,n):e.setAttribute(n,n),n}},Q.each(Q.expr.match.bool.source.match(/\w+/g),function(e,t){var n=it[t]||Q.find.attr;it[t]=function(e,t,r){var o,i;return r||(i=it[t],it[t]=o,o=null!=n(e,t,r)?t.toLowerCase():null,it[t]=i),o}});var at=/^(?:input|select|textarea|button)$/i;Q.fn.extend({prop:function(e,t){return ge(this,Q.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[Q.propFix[e]||e]})}}),Q.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,o,i,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return i=1!==a||!Q.isXMLDoc(e),i&&(t=Q.propFix[t]||t,o=Q.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||at.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),Z.optSelected||(Q.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),Q.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Q.propFix[this.toLowerCase()]=this});var st=/[\t\r\n\f]/g;Q.fn.extend({addClass:function(e){var t,n,r,o,i,a,s="string"==typeof e&&e,u=0,l=this.length;if(Q.isFunction(e))return this.each(function(t){Q(this).addClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(he)||[];l>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(st," "):" ")){for(i=0;o=t[i++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a=Q.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(e){var t,n,r,o,i,a,s=0===arguments.length||"string"==typeof e&&e,u=0,l=this.length;if(Q.isFunction(e))return this.each(function(t){Q(this).removeClass(e.call(this,t,this.className))});if(s)for(t=(e||"").match(he)||[];l>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(st," "):"")){for(i=0;o=t[i++];)for(;r.indexOf(" "+o+" ")>=0;)r=r.replace(" "+o+" "," ");a=e?Q.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):Q.isFunction(e)?this.each(function(n){Q(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,o=Q(this),i=e.match(he)||[];t=i[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else(n===Me||"boolean"===n)&&(this.className&&ve.set(this,"__className__",this.className),this.className=this.className||e===!1?"":ve.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(st," ").indexOf(t)>=0)return!0;return!1}});var ut=/\r/g;Q.fn.extend({val:function(e){var t,n,r,o=this[0];{if(arguments.length)return r=Q.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=r?e.call(this,n,Q(this).val()):e,null==o?o="":"number"==typeof o?o+="":Q.isArray(o)&&(o=Q.map(o,function(e){return null==e?"":e+""})),t=Q.valHooks[this.type]||Q.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return t=Q.valHooks[o.type]||Q.valHooks[o.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(ut,""):null==n?"":n)}}}),Q.extend({valHooks:{option:{get:function(e){var t=Q.find.attr(e,"value");return null!=t?t:Q.trim(Q.text(e))}},select:{get:function(e){for(var t,n,r=e.options,o=e.selectedIndex,i="select-one"===e.type||0>o,a=i?null:[],s=i?o+1:r.length,u=0>o?s:i?o:0;s>u;u++)if(n=r[u],(n.selected||u===o)&&(Z.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!Q.nodeName(n.parentNode,"optgroup"))){if(t=Q(n).val(),i)return t;a.push(t)}return a},set:function(e,t){for(var n,r,o=e.options,i=Q.makeArray(t),a=o.length;a--;)r=o[a],(r.selected=Q.inArray(r.value,i)>=0)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),Q.each(["radio","checkbox"],function(){Q.valHooks[this]={set:function(e,t){return Q.isArray(t)?e.checked=Q.inArray(Q(e).val(),t)>=0:void 0}},Z.checkOn||(Q.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),Q.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Q.fn[t]=function(data,e){return arguments.length>0?this.on(t,null,data,e):this.trigger(t)}}),Q.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,data,t){return this.on(e,null,data,t)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,data,n){return this.on(t,e,data,n)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var lt=Q.now(),ct=/\?/;Q.parseJSON=function(data){return JSON.parse(data+"")},Q.parseXML=function(data){var e,t;if(!data||"string"!=typeof data)return null;try{t=new DOMParser,e=t.parseFromString(data,"text/xml")}catch(n){e=void 0}return(!e||e.getElementsByTagName("parsererror").length)&&Q.error("Invalid XML: "+data),e};var dt=/#.*$/,ft=/([?&])_=[^&]*/,ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,mt=/^(?:GET|HEAD)$/,gt=/^\/\//,vt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,yt={},xt={},wt="*/".concat("*"),_t=e.location.href,bt=vt.exec(_t.toLowerCase())||[];Q.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t,type:"GET",isLocal:pt.test(bt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":Q.parseJSON,"text xml":Q.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?z(z(e,Q.ajaxSettings),t):z(Q.ajaxSettings,e)},ajaxPrefilter:L(yt),ajaxTransport:L(xt),ajax:function(e,t){function n(e,t,n,a){var u,c,v,y,w,b=t;2!==x&&(x=2,s&&clearTimeout(s),r=void 0,i=a||"",_.readyState=e>0?4:0,u=e>=200&&300>e||304===e,n&&(y=R(d,_,n)),y=P(d,y,_,u),u?(d.ifModified&&(w=_.getResponseHeader("Last-Modified"),w&&(Q.lastModified[o]=w),w=_.getResponseHeader("etag"),w&&(Q.etag[o]=w)),204===e||"HEAD"===d.type?b="nocontent":304===e?b="notmodified":(b=y.state,c=y.data,v=y.error,u=!v)):(v=b,(e||!b)&&(b="error",0>e&&(e=0))),_.status=e,_.statusText=(t||b)+"",u?p.resolveWith(f,[c,b,_]):p.rejectWith(f,[_,b,v]),_.statusCode(g),g=void 0,l&&h.trigger(u?"ajaxSuccess":"ajaxError",[_,d,u?c:v]),m.fireWith(f,[_,b]),l&&(h.trigger("ajaxComplete",[_,d]),--Q.active||Q.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o,i,a,s,u,l,c,d=Q.ajaxSetup({},t),f=d.context||d,h=d.context&&(f.nodeType||f.jquery)?Q(f):Q.event,p=Q.Deferred(),m=Q.Callbacks("once memory"),g=d.statusCode||{},v={},y={},x=0,w="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!a)for(a={};t=ht.exec(i);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)g[t]=[g[t],e[t]];else _.always(e[_.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(p.promise(_).complete=m.add,_.success=_.done,_.error=_.fail,d.url=((e||d.url||_t)+"").replace(dt,"").replace(gt,bt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=Q.trim(d.dataType||"*").toLowerCase().match(he)||[""],null==d.crossDomain&&(u=vt.exec(d.url.toLowerCase()),d.crossDomain=!(!u||u[1]===bt[1]&&u[2]===bt[2]&&(u[3]||("http:"===u[1]?"80":"443"))===(bt[3]||("http:"===bt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=Q.param(d.data,d.traditional)),F(yt,d,t,_),2===x)return _;l=Q.event&&d.global,l&&0===Q.active++&&Q.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!mt.test(d.type),o=d.url,d.hasContent||(d.data&&(o=d.url+=(ct.test(o)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=ft.test(o)?o.replace(ft,"$1_="+lt++):o+(ct.test(o)?"&":"?")+"_="+lt++)),d.ifModified&&(Q.lastModified[o]&&_.setRequestHeader("If-Modified-Since",Q.lastModified[o]),Q.etag[o]&&_.setRequestHeader("If-None-Match",Q.etag[o])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&_.setRequestHeader("Content-Type",d.contentType),_.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+wt+"; q=0.01":""):d.accepts["*"]);for(c in d.headers)_.setRequestHeader(c,d.headers[c]);if(d.beforeSend&&(d.beforeSend.call(f,_,d)===!1||2===x))return _.abort();w="abort";for(c in{success:1,error:1,complete:1})_[c](d[c]);if(r=F(xt,d,t,_)){_.readyState=1,l&&h.trigger("ajaxSend",[_,d]),d.async&&d.timeout>0&&(s=setTimeout(function(){_.abort("timeout")},d.timeout));try{x=1,r.send(v,n)}catch(b){if(!(2>x))throw b;n(-1,b)}}else n(-1,"No Transport");return _},getJSON:function(e,data,t){return Q.get(e,data,t,"json")},getScript:function(e,t){return Q.get(e,void 0,t,"script")}}),Q.each(["get","post"],function(e,t){Q[t]=function(e,data,n,r){return Q.isFunction(data)&&(r=r||n,n=data,data=void 0),Q.ajax({url:e,type:t,dataType:r,data:data,success:n})}}),Q._evalUrl=function(e){return Q.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},Q.fn.extend({wrapAll:function(e){var t;return Q.isFunction(e)?this.each(function(t){Q(this).wrapAll(e.call(this,t))}):(this[0]&&(t=Q(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return Q.isFunction(e)?this.each(function(t){Q(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Q(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Q.isFunction(e);return this.each(function(n){Q(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Q.nodeName(this,"body")||Q(this).replaceWith(this.childNodes)}).end()}}),Q.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},Q.expr.filters.visible=function(e){return!Q.expr.filters.hidden(e)};var kt=/%20/g,jt=/\[\]$/,Mt=/\r?\n/g,Et=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;Q.param=function(e,t){var n,r=[],o=function(e,t){t=Q.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=Q.ajaxSettings&&Q.ajaxSettings.traditional),Q.isArray(e)||e.jquery&&!Q.isPlainObject(e))Q.each(e,function(){o(this.name,this.value)});else for(n in e)I(n,e[n],t,o);return r.join("&").replace(kt,"+")},Q.fn.extend({serialize:function(){
+return Q.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=Q.prop(this,"elements");return e?Q.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!Q(this).is(":disabled")&&Ct.test(this.nodeName)&&!Et.test(e)&&(this.checked||!je.test(e))}).map(function(e,t){var n=Q(this).val();return null==n?null:Q.isArray(n)?Q.map(n,function(e){return{name:t.name,value:e.replace(Mt,"\r\n")}}):{name:t.name,value:n.replace(Mt,"\r\n")}}).get()}}),Q.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var St=0,Tt={},At={0:200,1223:204},Nt=Q.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Tt)Tt[e]()}),Z.cors=!!Nt&&"withCredentials"in Nt,Z.ajax=Nt=!!Nt,Q.ajaxTransport(function(e){var t;return Z.cors||Nt&&!e.crossDomain?{send:function(n,r){var o,i=e.xhr(),a=++St;if(i.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)i[o]=e.xhrFields[o];e.mimeType&&i.overrideMimeType&&i.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(o in n)i.setRequestHeader(o,n[o]);t=function(e){return function(){t&&(delete Tt[a],t=i.onload=i.onerror=null,"abort"===e?i.abort():"error"===e?r(i.status,i.statusText):r(At[i.status]||i.status,i.statusText,"string"==typeof i.responseText?{text:i.responseText}:void 0,i.getAllResponseHeaders()))}},i.onload=t(),i.onerror=t("error"),t=Tt[a]=t("abort");try{i.send(e.hasContent&&e.data||null)}catch(s){if(t)throw s}},abort:function(){t&&t()}}:void 0}),Q.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return Q.globalEval(e),e}}}),Q.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),Q.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,o){t=Q("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),K.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Ot=[],qt=/(=)\?(?=&|$)|\?\?/;Q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ot.pop()||Q.expando+"_"+lt++;return this[e]=!0,e}}),Q.ajaxPrefilter("json jsonp",function(t,n,r){var o,i,a,s=t.jsonp!==!1&&(qt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&qt.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(o=t.jsonpCallback=Q.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(qt,"$1"+o):t.jsonp!==!1&&(t.url+=(ct.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return a||Q.error(o+" was not called"),a[0]},t.dataTypes[0]="json",i=e[o],e[o]=function(){a=arguments},r.always(function(){e[o]=i,t[o]&&(t.jsonpCallback=n.jsonpCallback,Ot.push(o)),a&&Q.isFunction(i)&&i(a[0]),a=i=void 0}),"script"):void 0}),Q.parseHTML=function(data,e,t){if(!data||"string"!=typeof data)return null;"boolean"==typeof e&&(t=e,e=!1),e=e||K;var n=ae.exec(data),r=!t&&[];return n?[e.createElement(n[1])]:(n=Q.buildFragment([data],e,r),r&&r.length&&Q(r).remove(),Q.merge([],n.childNodes))};var Dt=Q.fn.load;Q.fn.load=function(e,t,n){if("string"!=typeof e&&Dt)return Dt.apply(this,arguments);var r,o,i,a=this,s=e.indexOf(" ");return s>=0&&(r=Q.trim(e.slice(s)),e=e.slice(0,s)),Q.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&Q.ajax({url:e,type:o,dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?Q("<div>").append(Q.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){a.each(n,i||[e.responseText,t,e])}),this},Q.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){Q.fn[t]=function(e){return this.on(t,e)}}),Q.expr.filters.animated=function(e){return Q.grep(Q.timers,function(t){return e===t.elem}).length};var Lt=e.document.documentElement;Q.offset={setOffset:function(e,t,n){var r,o,i,a,s,u,l,c=Q.css(e,"position"),d=Q(e),f={};"static"===c&&(e.style.position="relative"),s=d.offset(),i=Q.css(e,"top"),u=Q.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(i+u).indexOf("auto")>-1,l?(r=d.position(),a=r.top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(u)||0),Q.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):d.css(f)}},Q.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){Q.offset.setOffset(this,e,t)});var t,n,r=this[0],o={top:0,left:0},i=r&&r.ownerDocument;if(i)return t=i.documentElement,Q.contains(t,r)?(typeof r.getBoundingClientRect!==Me&&(o=r.getBoundingClientRect()),n=H(i),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===Q.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),Q.nodeName(e[0],"html")||(r=e.offset()),r.top+=Q.css(e[0],"borderTopWidth",!0),r.left+=Q.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-Q.css(n,"marginTop",!0),left:t.left-r.left-Q.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||Lt;e&&!Q.nodeName(e,"html")&&"static"===Q.css(e,"position");)e=e.offsetParent;return e||Lt})}}),Q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;Q.fn[t]=function(o){return ge(this,function(t,o,i){var a=H(t);return void 0===i?a?a[n]:t[o]:void(a?a.scrollTo(r?e.pageXOffset:i,r?i:e.pageYOffset):t[o]=i)},t,o,arguments.length,null)}}),Q.each(["top","left"],function(e,t){Q.cssHooks[t]=b(Z.pixelPosition,function(e,n){return n?(n=_(e,t),$e.test(n)?Q(e).position()[t]+"px":n):void 0})}),Q.each({Height:"height",Width:"width"},function(e,t){Q.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){Q.fn[r]=function(r,o){var i=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||o===!0?"margin":"border");return ge(this,function(t,n,r){var o;return Q.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?Q.css(t,n,a):Q.style(t,n,r,a)},t,i?r:void 0,i,null)}})}),Q.fn.size=function(){return this.length},Q.fn.andSelf=Q.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return Q});var Ft=e.jQuery,zt=e.$;return Q.noConflict=function(t){return e.$===Q&&(e.$=zt),t&&e.jQuery===Q&&(e.jQuery=Ft),Q},typeof t===Me&&(e.jQuery=e.$=Q),Q})},{}],285:[function(e,t,n){(function(e){(function(){function r(e,t,n){for(var r=(n||0)-1,o=e?e.length:0;++r<o;)if(e[r]===t)return r;return-1}function o(e,t){var n=typeof t;if(e=e.cache,"boolean"==n||null==t)return e[t]?0:-1;"number"!=n&&"string"!=n&&(n="object");var o="number"==n?t:w+t;return e=(e=e[n])&&e[o],"object"==n?e&&r(e,t)>-1?0:-1:e?0:-1}function i(e){var t=this.cache,n=typeof e;if("boolean"==n||null==e)t[e]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?e:w+e,o=t[n]||(t[n]={});"object"==n?(o[r]||(o[r]=[])).push(e):o[r]=!0}}function a(e){return e.charCodeAt(0)}function s(e,t){for(var n=e.criteria,r=t.criteria,o=-1,i=n.length;++o<i;){var a=n[o],s=r[o];if(a!==s){if(a>s||"undefined"==typeof a)return 1;if(s>a||"undefined"==typeof s)return-1}}return e.index-t.index}function u(e){var t=-1,n=e.length,r=e[0],o=e[n/2|0],a=e[n-1];if(r&&"object"==typeof r&&o&&"object"==typeof o&&a&&"object"==typeof a)return!1;var s=d();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=d();for(u.array=e,u.cache=s,u.push=i;++t<n;)u.push(e[t]);return u}function l(e){return"\\"+Z[e]}function c(){return v.pop()||[]}function d(){return y.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function f(e){e.length=0,v.length<b&&v.push(e)}function h(e){var t=e.cache;t&&h(t),e.array=e.cache=e.criteria=e.object=e.number=e.string=e.value=null,y.length<b&&y.push(e)}function p(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,o=n-t||0,i=Array(0>o?0:o);++r<o;)i[r]=e[t+r];return i}function m(e){function t(e){return e&&"object"==typeof e&&!Gn(e)&&Dn.call(e,"__wrapped__")?e:new n(e)}function n(e,t){this.__chain__=!!t,this.__wrapped__=e}function i(e){function t(){if(r){var e=p(r);Ln.apply(e,arguments)}if(this instanceof t){var i=y(n.prototype),a=n.apply(i,e||arguments);return Ae(a)?a:i}return n.apply(o,e||arguments)}var n=e[0],r=e[2],o=e[4];return Kn(t,e),t}function v(e,t,n,r,o){if(n){var i=n(e);if("undefined"!=typeof i)return i}var a=Ae(e);if(!a)return e;var s=Cn.call(e);if(!W[s])return e;var u=Jn[s];switch(s){case P:case I:return new u(+e);case $:case U:return new u(e);case V:return i=u(e.source,S.exec(e)),i.lastIndex=e.lastIndex,i}var l=Gn(e);if(t){var d=!r;r||(r=c()),o||(o=c());for(var h=r.length;h--;)if(r[h]==e)return o[h];i=l?u(e.length):{}}else i=l?p(e):ir({},e);return l&&(Dn.call(e,"index")&&(i.index=e.index),Dn.call(e,"input")&&(i.input=e.input)),t?(r.push(e),o.push(i),(l?Ze:ur)(e,function(e,a){i[a]=v(e,t,n,r,o)}),d&&(f(r),f(o)),i):i}function y(e,t){return Ae(e)?In(e):{}}function b(e,t,n){if("function"!=typeof e)return Kt;if("undefined"==typeof t||!("prototype"in e))return e;var r=e.__bindData__;if("undefined"==typeof r&&(Zn.funcNames&&(r=!e.name),r=r||!Zn.funcDecomp,!r)){var o=On.call(e);Zn.funcNames||(r=!T.test(o)),r||(r=q.test(o),Kn(e,r))}if(r===!1||r!==!0&&1&r[1])return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)};case 4:return function(n,r,o,i){return e.call(t,n,r,o,i)}}return Dt(e,t)}function Z(e){function t(){var e=u?a:this;if(o){var h=p(o);Ln.apply(h,arguments)}if((i||c)&&(h||(h=p(arguments)),i&&Ln.apply(h,i),c&&h.length<s))return r|=16,Z([n,d?r:-4&r,h,null,a,s]);if(h||(h=arguments),l&&(n=e[f]),this instanceof t){e=y(n.prototype);var m=n.apply(e,h);return Ae(m)?m:e}return n.apply(e,h)}var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],s=e[5],u=1&r,l=2&r,c=4&r,d=8&r,f=n;return Kn(t,e),t}function G(e,t){var n=-1,i=ue(),a=e?e.length:0,s=a>=_&&i===r,l=[];if(s){var c=u(t);c?(i=o,t=c):s=!1}for(;++n<a;){var d=e[n];i(t,d)<0&&l.push(d)}return s&&h(t),l}function Q(e,t,n,r){for(var o=(r||0)-1,i=e?e.length:0,a=[];++o<i;){var s=e[o];if(s&&"object"==typeof s&&"number"==typeof s.length&&(Gn(s)||fe(s))){t||(s=Q(s,t,n));var u=-1,l=s.length,c=a.length;for(a.length+=l;++u<l;)a[c++]=s[u]}else n||a.push(s)}return a}function ee(e,t,n,r,o,i){if(n){var a=n(e,t);if("undefined"!=typeof a)return!!a}if(e===t)return 0!==e||1/e==1/t;var s=typeof e,u=typeof t;if(!(e!==e||e&&J[s]||t&&J[u]))return!1;if(null==e||null==t)return e===t;var l=Cn.call(e),d=Cn.call(t);if(l==z&&(l=B),d==z&&(d=B),l!=d)return!1;switch(l){case P:case I:return+e==+t;case $:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case V:case U:return e==bn(t)}var h=l==R;if(!h){var p=Dn.call(e,"__wrapped__"),m=Dn.call(t,"__wrapped__");if(p||m)return ee(p?e.__wrapped__:e,m?t.__wrapped__:t,n,r,o,i);if(l!=B)return!1;var g=e.constructor,v=t.constructor;if(g!=v&&!(Te(g)&&g instanceof g&&Te(v)&&v instanceof v)&&"constructor"in e&&"constructor"in t)return!1}var y=!o;o||(o=c()),i||(i=c());for(var x=o.length;x--;)if(o[x]==e)return i[x]==t;var w=0;if(a=!0,o.push(e),i.push(t),h){if(x=e.length,w=t.length,a=w==x,a||r)for(;w--;){var _=x,b=t[w];if(r)for(;_--&&!(a=ee(e[_],b,n,r,o,i)););else if(!(a=ee(e[w],b,n,r,o,i)))break}}else sr(t,function(t,s,u){return Dn.call(u,s)?(w++,a=Dn.call(e,s)&&ee(e[s],t,n,r,o,i)):void 0}),a&&!r&&sr(e,function(e,t,n){return Dn.call(n,t)?a=--w>-1:void 0});return o.pop(),i.pop(),y&&(f(o),f(i)),a}function te(e,t,n,r,o){(Gn(t)?Ze:ur)(t,function(t,i){var a,s,u=t,l=e[i];if(t&&((s=Gn(t))||lr(t))){for(var c=r.length;c--;)if(a=r[c]==t){l=o[c];break}if(!a){var d;n&&(u=n(l,t),(d="undefined"!=typeof u)&&(l=u)),d||(l=s?Gn(l)?l:[]:lr(l)?l:{}),r.push(t),o.push(l),d||te(l,t,n,r,o)}}else n&&(u=n(l,t),"undefined"==typeof u&&(u=t)),"undefined"!=typeof u&&(l=u);e[i]=l})}function re(e,t){return e+Nn(Xn()*(t-e+1))}function oe(e,t,n){var i=-1,a=ue(),s=e?e.length:0,l=[],d=!t&&s>=_&&a===r,p=n||d?c():l;if(d){var m=u(p);a=o,p=m}for(;++i<s;){var g=e[i],v=n?n(g,i,e):g;(t?!i||p[p.length-1]!==v:a(p,v)<0)&&((n||d)&&p.push(v),l.push(g))}return d?(f(p.array),h(p)):n&&f(p),l}function ie(e){return function(n,r,o){var i={};r=t.createCallback(r,o,3);var a=-1,s=n?n.length:0;if("number"==typeof s)for(;++a<s;){var u=n[a];e(i,u,r(u,a,n),n)}else ur(n,function(t,n,o){e(i,t,r(t,n,o),o)});return i}}function ae(e,t,n,r,o,a){var s=1&t,u=2&t,l=4&t,c=16&t,d=32&t;if(!u&&!Te(e))throw new kn;c&&!n.length&&(t&=-17,c=n=!1),d&&!r.length&&(t&=-33,d=r=!1);var f=e&&e.__bindData__;if(f&&f!==!0)return f=p(f),f[2]&&(f[2]=p(f[2])),f[3]&&(f[3]=p(f[3])),!s||1&f[1]||(f[4]=o),!s&&1&f[1]&&(t|=8),!l||4&f[1]||(f[5]=a),c&&Ln.apply(f[2]||(f[2]=[]),n),d&&Rn.apply(f[3]||(f[3]=[]),r),f[1]|=t,ae.apply(null,f);var h=1==t||17===t?i:Z;return h([e,t,n,r,o,a])}function se(e){return tr[e]}function ue(){var e=(e=t.indexOf)===vt?r:e;return e}function le(e){return"function"==typeof e&&Sn.test(e)}function ce(e){var t,n;return e&&Cn.call(e)==B&&(t=e.constructor,!Te(t)||t instanceof t)?(sr(e,function(e,t){n=t}),"undefined"==typeof n||Dn.call(e,n)):!1}function de(e){return nr[e]}function fe(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Cn.call(e)==z||!1}function he(e,t,n,r){return"boolean"!=typeof t&&null!=t&&(r=n,n=t,t=!1),v(e,t,"function"==typeof n&&b(n,r,1))}function pe(e,t,n){return v(e,!0,"function"==typeof t&&b(t,n,1))}function me(e,t){var n=y(e);return t?ir(n,t):n}function ge(e,n,r){var o;return n=t.createCallback(n,r,3),ur(e,function(e,t,r){return n(e,t,r)?(o=t,!1):void 0}),o}function ve(e,n,r){var o;return n=t.createCallback(n,r,3),xe(e,function(e,t,r){return n(e,t,r)?(o=t,!1):void 0}),o}function ye(e,t,n){var r=[];sr(e,function(e,t){r.push(t,e)});var o=r.length;for(t=b(t,n,3);o--&&t(r[o--],r[o],e)!==!1;);return e}function xe(e,t,n){var r=er(e),o=r.length;for(t=b(t,n,3);o--;){var i=r[o];if(t(e[i],i,e)===!1)break}return e}function we(e){var t=[];return sr(e,function(e,n){Te(e)&&t.push(n)}),t.sort()}function _e(e,t){return e?Dn.call(e,t):!1}function be(e){for(var t=-1,n=er(e),r=n.length,o={};++t<r;){var i=n[t];o[e[i]]=i}return o}function ke(e){return e===!0||e===!1||e&&"object"==typeof e&&Cn.call(e)==P||!1}function je(e){return e&&"object"==typeof e&&Cn.call(e)==I||!1}function Me(e){return e&&1===e.nodeType||!1}function Ee(e){var t=!0;if(!e)return t;var n=Cn.call(e),r=e.length;return n==R||n==U||n==z||n==B&&"number"==typeof r&&Te(e.splice)?!r:(ur(e,function(){return t=!1}),t)}function Ce(e,t,n,r){return ee(e,t,"function"==typeof n&&b(n,r,2))}function Se(e){return $n(e)&&!Bn(parseFloat(e))}function Te(e){return"function"==typeof e}function Ae(e){return!(!e||!J[typeof e])}function Ne(e){return qe(e)&&e!=+e}function Oe(e){return null===e}function qe(e){return"number"==typeof e||e&&"object"==typeof e&&Cn.call(e)==$||!1}function De(e){return e&&"object"==typeof e&&Cn.call(e)==V||!1}function Le(e){return"string"==typeof e||e&&"object"==typeof e&&Cn.call(e)==U||!1}function Fe(e){return"undefined"==typeof e}function ze(e,n,r){var o={};return n=t.createCallback(n,r,3),ur(e,function(e,t,r){o[t]=n(e,t,r)}),o}function Re(e){var t=arguments,n=2;if(!Ae(e))return e;if("number"!=typeof t[2]&&(n=t.length),n>3&&"function"==typeof t[n-2])var r=b(t[--n-1],t[n--],2);else n>2&&"function"==typeof t[n-1]&&(r=t[--n]);for(var o=p(arguments,1,n),i=-1,a=c(),s=c();++i<n;)te(e,o[i],r,a,s);return f(a),f(s),e}function Pe(e,n,r){var o={};if("function"!=typeof n){var i=[];sr(e,function(e,t){i.push(t)}),i=G(i,Q(arguments,!0,!1,1));for(var a=-1,s=i.length;++a<s;){var u=i[a];o[u]=e[u]}}else n=t.createCallback(n,r,3),sr(e,function(e,t,r){n(e,t,r)||(o[t]=e)});return o}function Ie(e){for(var t=-1,n=er(e),r=n.length,o=pn(r);++t<r;){var i=n[t];o[t]=[i,e[i]]}return o}function He(e,n,r){var o={};if("function"!=typeof n)for(var i=-1,a=Q(arguments,!0,!1,1),s=Ae(e)?a.length:0;++i<s;){var u=a[i];u in e&&(o[u]=e[u])}else n=t.createCallback(n,r,3),sr(e,function(e,t,r){n(e,t,r)&&(o[t]=e)});return o}function $e(e,n,r,o){var i=Gn(e);if(null==r)if(i)r=[];else{var a=e&&e.constructor,s=a&&a.prototype;r=y(s)}return n&&(n=t.createCallback(n,o,4),(i?Ze:ur)(e,function(e,t,o){return n(r,e,t,o)})),r}function Be(e){for(var t=-1,n=er(e),r=n.length,o=pn(r);++t<r;)o[t]=e[n[t]];return o}function Ve(e){for(var t=arguments,n=-1,r=Q(t,!0,!1,1),o=t[2]&&t[2][t[1]]===e?1:r.length,i=pn(o);++n<o;)i[n]=e[r[n]];return i}function Ue(e,t,n){var r=-1,o=ue(),i=e?e.length:0,a=!1;return n=(0>n?Un(0,i+n):n)||0,Gn(e)?a=o(e,t,n)>-1:"number"==typeof i?a=(Le(e)?e.indexOf(t,n):o(e,t,n))>-1:ur(e,function(e){return++r>=n?!(a=e===t):void 0}),a}function We(e,n,r){var o=!0;n=t.createCallback(n,r,3);var i=-1,a=e?e.length:0;if("number"==typeof a)for(;++i<a&&(o=!!n(e[i],i,e)););else ur(e,function(e,t,r){return o=!!n(e,t,r)});return o}function Ye(e,n,r){var o=[];n=t.createCallback(n,r,3);var i=-1,a=e?e.length:0;if("number"==typeof a)for(;++i<a;){var s=e[i];n(s,i,e)&&o.push(s)}else ur(e,function(e,t,r){n(e,t,r)&&o.push(e)});return o}function Xe(e,n,r){n=t.createCallback(n,r,3);var o=-1,i=e?e.length:0;if("number"!=typeof i){var a;return ur(e,function(e,t,r){return n(e,t,r)?(a=e,!1):void 0}),a}for(;++o<i;){var s=e[o];if(n(s,o,e))return s}}function Je(e,n,r){var o;return n=t.createCallback(n,r,3),Ke(e,function(e,t,r){return n(e,t,r)?(o=e,!1):void 0}),o}function Ze(e,t,n){var r=-1,o=e?e.length:0;if(t=t&&"undefined"==typeof n?t:b(t,n,3),"number"==typeof o)for(;++r<o&&t(e[r],r,e)!==!1;);else ur(e,t);return e}function Ke(e,t,n){var r=e?e.length:0;if(t=t&&"undefined"==typeof n?t:b(t,n,3),"number"==typeof r)for(;r--&&t(e[r],r,e)!==!1;);else{var o=er(e);r=o.length,ur(e,function(e,n,i){return n=o?o[--r]:--r,t(i[n],n,i)})}return e}function Ge(e,t){var n=p(arguments,2),r=-1,o="function"==typeof t,i=e?e.length:0,a=pn("number"==typeof i?i:0);return Ze(e,function(e){a[++r]=(o?t:e[t]).apply(e,n)}),a}function Qe(e,n,r){var o=-1,i=e?e.length:0;if(n=t.createCallback(n,r,3),"number"==typeof i)for(var a=pn(i);++o<i;)a[o]=n(e[o],o,e);else a=[],ur(e,function(e,t,r){a[++o]=n(e,t,r)});return a}function et(e,n,r){var o=-(1/0),i=o;if("function"!=typeof n&&r&&r[n]===e&&(n=null),null==n&&Gn(e))for(var s=-1,u=e.length;++s<u;){var l=e[s];l>i&&(i=l)}else n=null==n&&Le(e)?a:t.createCallback(n,r,3),Ze(e,function(e,t,r){var a=n(e,t,r);a>o&&(o=a,i=e)});return i}function tt(e,n,r){var o=1/0,i=o;if("function"!=typeof n&&r&&r[n]===e&&(n=null),null==n&&Gn(e))for(var s=-1,u=e.length;++s<u;){var l=e[s];i>l&&(i=l)}else n=null==n&&Le(e)?a:t.createCallback(n,r,3),Ze(e,function(e,t,r){var a=n(e,t,r);o>a&&(o=a,i=e)});return i}function nt(e,n,r,o){if(!e)return r;var i=arguments.length<3;n=t.createCallback(n,o,4);var a=-1,s=e.length;if("number"==typeof s)for(i&&(r=e[++a]);++a<s;)r=n(r,e[a],a,e);else ur(e,function(e,t,o){r=i?(i=!1,e):n(r,e,t,o)});return r}function rt(e,n,r,o){var i=arguments.length<3;return n=t.createCallback(n,o,4),Ke(e,function(e,t,o){r=i?(i=!1,e):n(r,e,t,o)}),r}function ot(e,n,r){return n=t.createCallback(n,r,3),Ye(e,function(e,t,r){return!n(e,t,r)})}function it(e,t,n){if(e&&"number"!=typeof e.length&&(e=Be(e)),null==t||n)return e?e[re(0,e.length-1)]:g;var r=at(e);return r.length=Wn(Un(0,t),r.length),r}function at(e){var t=-1,n=e?e.length:0,r=pn("number"==typeof n?n:0);return Ze(e,function(e){var n=re(0,++t);r[t]=r[n],r[n]=e}),r}function st(e){var t=e?e.length:0;return"number"==typeof t?t:er(e).length}function ut(e,n,r){var o;n=t.createCallback(n,r,3);var i=-1,a=e?e.length:0;if("number"==typeof a)for(;++i<a&&!(o=n(e[i],i,e)););else ur(e,function(e,t,r){return!(o=n(e,t,r))});return!!o}function lt(e,n,r){var o=-1,i=Gn(n),a=e?e.length:0,u=pn("number"==typeof a?a:0);for(i||(n=t.createCallback(n,r,3)),Ze(e,function(e,t,r){var a=u[++o]=d();i?a.criteria=Qe(n,function(t){return e[t]}):(a.criteria=c())[0]=n(e,t,r),a.index=o,a.value=e}),a=u.length,u.sort(s);a--;){var l=u[a];u[a]=l.value,i||f(l.criteria),h(l)}return u}function ct(e){return e&&"number"==typeof e.length?p(e):Be(e)}function dt(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var o=e[t];o&&r.push(o)}return r}function ft(e){return G(e,Q(arguments,!0,!0,1))}function ht(e,n,r){var o=-1,i=e?e.length:0;for(n=t.createCallback(n,r,3);++o<i;)if(n(e[o],o,e))return o;return-1}function pt(e,n,r){var o=e?e.length:0;for(n=t.createCallback(n,r,3);o--;)if(n(e[o],o,e))return o;return-1}function mt(e,n,r){var o=0,i=e?e.length:0;if("number"!=typeof n&&null!=n){var a=-1;for(n=t.createCallback(n,r,3);++a<i&&n(e[a],a,e);)o++}else if(o=n,null==o||r)return e?e[0]:g;return p(e,0,Wn(Un(0,o),i))}function gt(e,t,n,r){return"boolean"!=typeof t&&null!=t&&(r=n,n="function"!=typeof t&&r&&r[t]===e?null:t,t=!1),null!=n&&(e=Qe(e,n,r)),Q(e,t)}function vt(e,t,n){if("number"==typeof n){var o=e?e.length:0;n=0>n?Un(0,o+n):n||0}else if(n){var i=Et(e,t);return e[i]===t?i:-1}return r(e,t,n)}function yt(e,n,r){var o=0,i=e?e.length:0;if("number"!=typeof n&&null!=n){var a=i;for(n=t.createCallback(n,r,3);a--&&n(e[a],a,e);)o++}else o=null==n||r?1:n||o;return p(e,0,Wn(Un(0,i-o),i))}function xt(){for(var e=[],t=-1,n=arguments.length,i=c(),a=ue(),s=a===r,l=c();++t<n;){var d=arguments[t];(Gn(d)||fe(d))&&(e.push(d),i.push(s&&d.length>=_&&u(t?e[t]:l)))}var p=e[0],m=-1,g=p?p.length:0,v=[];e:for(;++m<g;){var y=i[0];if(d=p[m],(y?o(y,d):a(l,d))<0){for(t=n,(y||l).push(d);--t;)if(y=i[t],(y?o(y,d):a(e[t],d))<0)continue e;v.push(d)}}for(;n--;)y=i[n],y&&h(y);return f(i),f(l),v}function wt(e,n,r){var o=0,i=e?e.length:0;if("number"!=typeof n&&null!=n){var a=i;for(n=t.createCallback(n,r,3);a--&&n(e[a],a,e);)o++}else if(o=n,null==o||r)return e?e[i-1]:g;return p(e,Un(0,i-o))}function _t(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Un(0,r+n):Wn(n,r-1))+1);r--;)if(e[r]===t)return r;return-1}function bt(e){for(var t=arguments,n=0,r=t.length,o=e?e.length:0;++n<r;)for(var i=-1,a=t[n];++i<o;)e[i]===a&&(zn.call(e,i--,1),o--);return e}function kt(e,t,n){e=+e||0,n="number"==typeof n?n:+n||1,null==t&&(t=e,e=0);for(var r=-1,o=Un(0,Tn((t-e)/(n||1))),i=pn(o);++r<o;)i[r]=e,e+=n;return i}function jt(e,n,r){var o=-1,i=e?e.length:0,a=[];for(n=t.createCallback(n,r,3);++o<i;){var s=e[o];n(s,o,e)&&(a.push(s),zn.call(e,o--,1),i--)}return a}function Mt(e,n,r){if("number"!=typeof n&&null!=n){var o=0,i=-1,a=e?e.length:0;for(n=t.createCallback(n,r,3);++i<a&&n(e[i],i,e);)o++}else o=null==n||r?1:Un(0,n);return p(e,o)}function Et(e,n,r,o){var i=0,a=e?e.length:i;for(r=r?t.createCallback(r,o,1):Kt,n=r(n);a>i;){var s=i+a>>>1;r(e[s])<n?i=s+1:a=s}return i}function Ct(){return oe(Q(arguments,!0,!0))}function St(e,n,r,o){return"boolean"!=typeof n&&null!=n&&(o=r,r="function"!=typeof n&&o&&o[n]===e?null:n,n=!1),null!=r&&(r=t.createCallback(r,o,3)),oe(e,n,r)}function Tt(e){return G(e,p(arguments,1))}function At(){for(var e=-1,t=arguments.length;++e<t;){var n=arguments[e];if(Gn(n)||fe(n))var r=r?oe(G(r,n).concat(G(n,r))):n}return r||[]}function Nt(){for(var e=arguments.length>1?arguments:arguments[0],t=-1,n=e?et(hr(e,"length")):0,r=pn(0>n?0:n);++t<n;)r[t]=hr(e,t);return r}function Ot(e,t){var n=-1,r=e?e.length:0,o={};for(t||!r||Gn(e[0])||(t=[]);++n<r;){var i=e[n];t?o[i]=t[n]:i&&(o[i[0]]=i[1])}return o}function qt(e,t){if(!Te(t))throw new kn;return function(){return--e<1?t.apply(this,arguments):void 0}}function Dt(e,t){return arguments.length>2?ae(e,17,p(arguments,2),null,t):ae(e,1,null,null,t)}function Lt(e){for(var t=arguments.length>1?Q(arguments,!0,!1,1):we(e),n=-1,r=t.length;++n<r;){var o=t[n];e[o]=ae(e[o],1,null,null,e)}return e}function Ft(e,t){return arguments.length>2?ae(t,19,p(arguments,2),null,e):ae(t,3,null,null,e)}function zt(){for(var e=arguments,t=e.length;t--;)if(!Te(e[t]))throw new kn;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}}function Rt(e,t){return t="number"==typeof t?t:+t||e.length,ae(e,4,null,null,null,t)}function Pt(e,t,n){var r,o,i,a,s,u,l,c=0,d=!1,f=!0;if(!Te(e))throw new kn;if(t=Un(0,t)||0,n===!0){var h=!0;f=!1}else Ae(n)&&(h=n.leading,d="maxWait"in n&&(Un(t,n.maxWait)||0),f="trailing"in n?n.trailing:f);var p=function(){var n=t-(mr()-a);if(0>=n){o&&An(o);var d=l;o=u=l=g,d&&(c=mr(),i=e.apply(s,r),u||o||(r=s=null))}else u=Fn(p,n)},m=function(){u&&An(u),o=u=l=g,(f||d!==t)&&(c=mr(),i=e.apply(s,r),u||o||(r=s=null))};return function(){if(r=arguments,a=mr(),s=this,l=f&&(u||!h),d===!1)var n=h&&!u;else{o||h||(c=a);var g=d-(a-c),v=0>=g;v?(o&&(o=An(o)),c=a,i=e.apply(s,r)):o||(o=Fn(m,g))}return v&&u?u=An(u):u||t===d||(u=Fn(p,t)),n&&(v=!0,i=e.apply(s,r)),!v||u||o||(r=s=null),i}}function It(e){if(!Te(e))throw new kn;var t=p(arguments,1);return Fn(function(){e.apply(g,t)},1)}function Ht(e,t){if(!Te(e))throw new kn;var n=p(arguments,2);return Fn(function(){e.apply(g,n)},t)}function $t(e,t){if(!Te(e))throw new kn;var n=function(){var r=n.cache,o=t?t.apply(this,arguments):w+arguments[0];return Dn.call(r,o)?r[o]:r[o]=e.apply(this,arguments)};return n.cache={},n}function Bt(e){var t,n;if(!Te(e))throw new kn;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}}function Vt(e){return ae(e,16,p(arguments,1))}function Ut(e){return ae(e,32,null,p(arguments,1))}function Wt(e,t,n){var r=!0,o=!0;if(!Te(e))throw new kn;return n===!1?r=!1:Ae(n)&&(r="leading"in n?n.leading:r,o="trailing"in n?n.trailing:o),Y.leading=r,Y.maxWait=t,Y.trailing=o,Pt(e,t,Y)}function Yt(e,t){return ae(t,16,[e])}function Xt(e){return function(){return e}}function Jt(e,t,n){var r=typeof e;if(null==e||"function"==r)return b(e,t,n);if("object"!=r)return tn(e);var o=er(e),i=o[0],a=e[i];return 1!=o.length||a!==a||Ae(a)?function(t){for(var n=o.length,r=!1;n--&&(r=ee(t[o[n]],e[o[n]],null,!0)););return r}:function(e){var t=e[i];return a===t&&(0!==a||1/a==1/t)}}function Zt(e){return null==e?"":bn(e).replace(or,se)}function Kt(e){return e}function Gt(e,r,o){var i=!0,a=r&&we(r);r&&(o||a.length)||(null==o&&(o=r),s=n,r=e,e=t,a=we(r)),o===!1?i=!1:Ae(o)&&"chain"in o&&(i=o.chain);var s=e,u=Te(s);Ze(a,function(t){var n=e[t]=r[t];u&&(s.prototype[t]=function(){var t=this.__chain__,r=this.__wrapped__,o=[r];Ln.apply(o,arguments);var a=n.apply(e,o);if(i||t){if(r===a&&Ae(a))return this;a=new s(a),a.__chain__=t}return a})})}function Qt(){return e._=En,this}function en(){}function tn(e){return function(t){return t[e]}}function nn(e,t,n){var r=null==e,o=null==t;if(null==n&&("boolean"==typeof e&&o?(n=e,e=1):o||"boolean"!=typeof t||(n=t,o=!0)),r&&o&&(t=1),e=+e||0,o?(t=e,e=0):t=+t||0,n||e%1||t%1){var i=Xn();return Wn(e+i*(t-e+parseFloat("1e-"+((i+"").length-1))),t)}return re(e,t)}function rn(e,t){if(e){var n=e[t];return Te(n)?e[t]():n}}function on(e,data,n){var r=t.templateSettings;e=bn(e||""),n=ar({},n,r);var o,i=ar({},n.imports,r.imports),a=er(i),s=Be(i),u=0,c=n.interpolate||O,d="__p += '",f=_n((n.escape||O).source+"|"+c.source+"|"+(c===A?C:O).source+"|"+(n.evaluate||O).source+"|$","g");e.replace(f,function(t,n,r,i,a,s){return r||(r=i),d+=e.slice(u,s).replace(D,l),n&&(d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t}),d+="';\n";var h=n.variable,p=h;p||(h="obj",d="with ("+h+") {\n"+d+"\n}\n"),d=(o?d.replace(j,""):d).replace(M,"$1").replace(E,"$1;"),d="function("+h+") {\n"+(p?"":h+" || ("+h+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+F++ +"]")+"\n*/";try{var v=vn(a,"return "+d+m).apply(g,s)}catch(y){throw y.source=d,y}return data?v(data):(v.source=d,v)}function an(e,t,n){e=(e=+e)>-1?e:0;var r=-1,o=pn(e);for(t=b(t,n,1);++r<e;)o[r]=t(r);return o}function sn(e){return null==e?"":bn(e).replace(rr,de)}function un(e){var t=++x;return bn(null==e?"":e)+t}function ln(e){return e=new n(e),e.__chain__=!0,e}function cn(e,t){return t(e),e}function dn(){return this.__chain__=!0,this}function fn(){return bn(this.__wrapped__)}function hn(){return this.__wrapped__}e=e?ne.defaults(K.Object(),e,ne.pick(K,L)):K;var pn=e.Array,mn=e.Boolean,gn=e.Date,vn=e.Function,yn=e.Math,xn=e.Number,wn=e.Object,_n=e.RegExp,bn=e.String,kn=e.TypeError,jn=[],Mn=wn.prototype,En=e._,Cn=Mn.toString,Sn=_n("^"+bn(Cn).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Tn=yn.ceil,An=e.clearTimeout,Nn=yn.floor,On=vn.prototype.toString,qn=le(qn=wn.getPrototypeOf)&&qn,Dn=Mn.hasOwnProperty,Ln=jn.push,Fn=e.setTimeout,zn=jn.splice,Rn=jn.unshift,Pn=function(){try{var e={},t=le(t=wn.defineProperty)&&t,n=t(e,e,e)&&t}catch(r){}return n}(),In=le(In=wn.create)&&In,Hn=le(Hn=pn.isArray)&&Hn,$n=e.isFinite,Bn=e.isNaN,Vn=le(Vn=wn.keys)&&Vn,Un=yn.max,Wn=yn.min,Yn=e.parseInt,Xn=yn.random,Jn={};Jn[R]=pn,Jn[P]=mn,Jn[I]=gn,Jn[H]=vn,Jn[B]=wn,Jn[$]=xn,Jn[V]=_n,Jn[U]=bn,n.prototype=t.prototype;var Zn=t.support={};Zn.funcDecomp=!le(e.WinRTError)&&q.test(m),Zn.funcNames="string"==typeof vn.name,t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:t}},In||(y=function(){function t(){}return function(n){if(Ae(n)){t.prototype=n;var r=new t;t.prototype=null}return r||e.Object()}}());var Kn=Pn?function(e,t){X.value=t,Pn(e,"__bindData__",X),X.value=null}:en,Gn=Hn||function(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Cn.call(e)==R||!1},Qn=function(e){var t,n=e,r=[];if(!n)return r;if(!J[typeof e])return r;for(t in n)Dn.call(n,t)&&r.push(t);return r},er=Vn?function(e){return Ae(e)?Vn(e):[]}:Qn,tr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nr=be(tr),rr=_n("("+er(nr).join("|")+")","g"),or=_n("["+er(tr).join("")+"]","g"),ir=function(e,t,n){var r,o=e,i=o;if(!o)return i;var a=arguments,s=0,u="number"==typeof n?2:a.length;if(u>3&&"function"==typeof a[u-2])var l=b(a[--u-1],a[u--],2);else u>2&&"function"==typeof a[u-1]&&(l=a[--u]);for(;++s<u;)if(o=a[s],o&&J[typeof o])for(var c=-1,d=J[typeof o]&&er(o),f=d?d.length:0;++c<f;)r=d[c],i[r]=l?l(i[r],o[r]):o[r];return i},ar=function(e,t,n){var r,o=e,i=o;if(!o)return i;for(var a=arguments,s=0,u="number"==typeof n?2:a.length;++s<u;)if(o=a[s],o&&J[typeof o])for(var l=-1,c=J[typeof o]&&er(o),d=c?c.length:0;++l<d;)r=c[l],"undefined"==typeof i[r]&&(i[r]=o[r]);return i},sr=function(e,t,n){var r,o=e,i=o;if(!o)return i;if(!J[typeof o])return i;t=t&&"undefined"==typeof n?t:b(t,n,3);for(r in o)if(t(o[r],r,e)===!1)return i;return i},ur=function(e,t,n){var r,o=e,i=o;if(!o)return i;if(!J[typeof o])return i;t=t&&"undefined"==typeof n?t:b(t,n,3);for(var a=-1,s=J[typeof o]&&er(o),u=s?s.length:0;++a<u;)if(r=s[a],t(o[r],r,e)===!1)return i;return i},lr=qn?function(e){if(!e||Cn.call(e)!=B)return!1;var t=e.valueOf,n=le(t)&&(n=qn(t))&&qn(n);return n?e==n||qn(e)==n:ce(e)}:ce,cr=ie(function(e,t,n){Dn.call(e,n)?e[n]++:e[n]=1}),dr=ie(function(e,t,n){(Dn.call(e,n)?e[n]:e[n]=[]).push(t)}),fr=ie(function(e,t,n){e[n]=t}),hr=Qe,pr=Ye,mr=le(mr=gn.now)&&mr||function(){return(new gn).getTime()},gr=8==Yn(k+"08")?Yn:function(e,t){return Yn(Le(e)?e.replace(N,""):e,t||0)};return t.after=qt,t.assign=ir,t.at=Ve,t.bind=Dt,t.bindAll=Lt,t.bindKey=Ft,t.chain=ln,t.compact=dt,t.compose=zt,t.constant=Xt,t.countBy=cr,t.create=me,t.createCallback=Jt,t.curry=Rt,t.debounce=Pt,t.defaults=ar,t.defer=It,t.delay=Ht,t.difference=ft,t.filter=Ye,t.flatten=gt,t.forEach=Ze,t.forEachRight=Ke,t.forIn=sr,t.forInRight=ye,t.forOwn=ur,t.forOwnRight=xe,t.functions=we,t.groupBy=dr,t.indexBy=fr,t.initial=yt,t.intersection=xt,t.invert=be,t.invoke=Ge,t.keys=er,t.map=Qe,t.mapValues=ze,t.max=et,t.memoize=$t,t.merge=Re,t.min=tt,t.omit=Pe,t.once=Bt,t.pairs=Ie,t.partial=Vt,t.partialRight=Ut,t.pick=He,t.pluck=hr,t.property=tn,t.pull=bt,t.range=kt,t.reject=ot,t.remove=jt,t.rest=Mt,t.shuffle=at,t.sortBy=lt,t.tap=cn,t.throttle=Wt,t.times=an,
+t.toArray=ct,t.transform=$e,t.union=Ct,t.uniq=St,t.values=Be,t.where=pr,t.without=Tt,t.wrap=Yt,t.xor=At,t.zip=Nt,t.zipObject=Ot,t.collect=Qe,t.drop=Mt,t.each=Ze,t.eachRight=Ke,t.extend=ir,t.methods=we,t.object=Ot,t.select=Ye,t.tail=Mt,t.unique=St,t.unzip=Nt,Gt(t),t.clone=he,t.cloneDeep=pe,t.contains=Ue,t.escape=Zt,t.every=We,t.find=Xe,t.findIndex=ht,t.findKey=ge,t.findLast=Je,t.findLastIndex=pt,t.findLastKey=ve,t.has=_e,t.identity=Kt,t.indexOf=vt,t.isArguments=fe,t.isArray=Gn,t.isBoolean=ke,t.isDate=je,t.isElement=Me,t.isEmpty=Ee,t.isEqual=Ce,t.isFinite=Se,t.isFunction=Te,t.isNaN=Ne,t.isNull=Oe,t.isNumber=qe,t.isObject=Ae,t.isPlainObject=lr,t.isRegExp=De,t.isString=Le,t.isUndefined=Fe,t.lastIndexOf=_t,t.mixin=Gt,t.noConflict=Qt,t.noop=en,t.now=mr,t.parseInt=gr,t.random=nn,t.reduce=nt,t.reduceRight=rt,t.result=rn,t.runInContext=m,t.size=st,t.some=ut,t.sortedIndex=Et,t.template=on,t.unescape=sn,t.uniqueId=un,t.all=We,t.any=ut,t.detect=Xe,t.findWhere=Xe,t.foldl=nt,t.foldr=rt,t.include=Ue,t.inject=nt,Gt(function(){var e={};return ur(t,function(n,r){t.prototype[r]||(e[r]=n)}),e}(),!1),t.first=mt,t.last=wt,t.sample=it,t.take=mt,t.head=mt,ur(t,function(e,r){var o="sample"!==r;t.prototype[r]||(t.prototype[r]=function(t,r){var i=this.__chain__,a=e(this.__wrapped__,t,r);return i||null!=t&&(!r||o&&"function"==typeof t)?new n(a,i):a})}),t.VERSION="2.4.2",t.prototype.chain=dn,t.prototype.toString=fn,t.prototype.value=hn,t.prototype.valueOf=hn,Ze(["join","pop","shift"],function(e){var r=jn[e];t.prototype[e]=function(){var e=this.__chain__,t=r.apply(this.__wrapped__,arguments);return e?new n(t,e):t}}),Ze(["push","reverse","sort","unshift"],function(e){var n=jn[e];t.prototype[e]=function(){return n.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(e){var r=jn[e];t.prototype[e]=function(){return new n(r.apply(this.__wrapped__,arguments),this.__chain__)}}),t}var g,v=[],y=[],x=0,w=+new Date+"",_=75,b=40,k=" \x0B\f \ufeff\n\r\u2028\u2029 ᠎              ",j=/\b__p \+= '';/g,M=/\b(__p \+=) '' \+/g,E=/(__e\(.*?\)|\b__t\)) \+\n'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,T=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,N=RegExp("^["+k+"]*0+(?=.$)"),O=/($^)/,q=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,L=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],F=0,z="[object Arguments]",R="[object Array]",P="[object Boolean]",I="[object Date]",H="[object Function]",$="[object Number]",B="[object Object]",V="[object RegExp]",U="[object String]",W={};W[H]=!1,W[z]=W[R]=W[P]=W[I]=W[$]=W[B]=W[V]=W[U]=!0;var Y={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=J[typeof window]&&window||this,G=J[typeof n]&&n&&!n.nodeType&&n,Q=J[typeof t]&&t&&!t.nodeType&&t,ee=Q&&Q.exports===G&&G,te=J[typeof e]&&e;!te||te.global!==te&&te.window!==te||(K=te);var ne=m();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K._=ne,define(function(){return ne})):G&&Q?ee?(Q.exports=ne)._=ne:G._=ne:K._=ne}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],286:[function(e,t,n){var r=e("ampersand-view"),o=e("./sidebar"),i=e("./chart"),a=e("jquery");e("debug")("view:app"),t.exports=r.extend({template:e("./templates/app.jade"),props:{chartView:"object",menuOpen:{type:"boolean","default":!1}},events:{"click .navbar-right label":"navButtonClicked","click [data-hook=menu-toggle]":"menuToggled"},bindings:{"model.chart.subSampled":{type:"toggle",hook:"sample-warning"},menuOpen:{type:"booleanClass",selector:"#wrapper",name:"active"}},subviews:{sidebar:{hook:"sidebar",waitFor:"model.sidebar",prepareView:function(e){return new o({el:e,model:this.model.sidebar})}},chart:{hook:"chart",waitFor:"model.chart",prepareView:function(e){return this.chartView=new i({el:e,model:this.model.chart}),this.chartView}}},statChanged:function(e,t){this.model.chart.recalcXDomain=!0,this.chartView.render()},render:function(){this.renderWithTemplate(this.model)},navButtonClicked:function(e){var t=a(e.target).find("input"),n=t.attr("name"),r=t.val();this.model.chart[n]=r,this.model.chart.recalcXDomain="xSetting"===n,this.chartView.render()},menuToggled:function(e){this.toggle("menuOpen")}})},{"./chart":287,"./sidebar":290,"./templates/app.jade":292,"ampersand-view":157,debug:280,jquery:284}],287:[function(e,t,n){var r=e("ampersand-view"),o=e("./viz"),i=e("./empty");e("d3"),e("jquery"),e("debug")("view:chart"),t.exports=r.extend({props:{vizView:{type:"any","default":null},emptyView:{type:"any","default":null},activeView:{type:"string","default":"empty",values:["empty","viz"]}},template:e("./templates/chart.jade"),bindings:{activeView:{type:"switch",cases:{empty:"[data-hook=empty]",viz:"[data-hook=graph]"}}},render:function(){this.activeView=this.model.empty?"empty":"viz",this.vizView?(this.vizView.data={series:this.model.series.filter(function(e){return e.selected}),model:this.model},this.vizView.redraw()):(this.renderWithTemplate(this.model),this.vizView=new o({width:"auto",height:600,renderMode:"svg",className:"multiline",debounceRender:!1,vizFn:e("./viz/d3-multiline"),data:{series:this.model.series.filter(function(e){return e.selected}),model:this.model}}),this.emptyView=new i,this.renderSubview(this.emptyView,"[data-hook=empty]"),this.renderSubview(this.vizView,"[data-hook=graph]"))}})},{"./empty":288,"./templates/chart.jade":293,"./viz":298,"./viz/d3-multiline":299,"ampersand-view":157,d3:279,debug:280,jquery:284}],288:[function(e,t,n){var r=e("ampersand-view");e("debug")("view:empty"),t.exports=r.extend({template:e("./templates/empty.jade"),autorender:!0})},{"./templates/empty.jade":294,"ampersand-view":157,debug:280}],289:[function(e,t,n){var r=e("ampersand-view"),o=e("ampersand-subcollection"),i=e("./stat"),a=e("jquery");e("lodash"),e("debug")("view:panel"),t.exports=r.extend({props:{indicator:{type:"string","default":"none",values:["none","some","all"]},statViews:"object",filteredStats:"object"},template:e("./templates/panel.jade"),events:{"click a":"collapsibleToggle","click [data-hook=caret]":"collapsibleToggle","click [data-hook=indicator]":"indicatorClicked"},bindings:{indicator:{type:function(e,t,n){switch($el=a(e),$el.removeClass(),this.model.selected){case"all":$el.addClass("fa fa-circle");break;case"some":$el.addClass("fa fa-adjust");break;case"none":$el.addClass("fa fa-circle-o")}},hook:"indicator"},"model.open":{type:"booleanClass",hook:"caret",yes:"fa-caret-up",no:"fa-caret-down"}},initialize:function(){this.filteredStats=new o(this.model.stats,{comparator:function(e){return e.name}})},render:function(){this.renderWithTemplate(this.model),this.statViews=this.renderCollection(this.filteredStats,i,this.queryByHook("stats"))},indicatorClicked:function(e){var t="all"!==this.model.selected;switch(this.filteredStats.each(function(e){e.selected=t}),this.model.selected){case"all":case"some":this.collapsibleOpen();break;case"none":this.collapsibleClose()}this.model.app.clearSelectionState(),this.statChanged(null,{propagate:!0})},statChanged:function(e,t){t=t||{},this.indicator=this.model.selected,t.propagate&&this.parent.parent.statChanged(e,t)},collapsibleToggle:function(e){this.model.open?this.collapsibleClose(e):this.collapsibleOpen(e)},collapsibleClose:function(e){a(this.query(".collapse")).collapse("hide"),this.model.open=!1},collapsibleOpen:function(e){a(this.query(".collapse")).collapse("show"),this.model.open=!0},resetStats:function(){this.filteredStats.configure({},!0)},filterStats:function(e){this.filteredStats.configure({filter:function(t){return-1!==t.name.search(new RegExp(e),"gi")}},!0),0===this.filteredStats.length?this.collapsibleClose():this.collapsibleOpen()}})},{"./stat":291,"./templates/panel.jade":295,"ampersand-subcollection":141,"ampersand-view":157,debug:280,jquery:284,lodash:285}],290:[function(e,t,n){var r=e("ampersand-view"),o=e("./panel"),i=e("lodash");e("debug")("view:sidebar"),t.exports=r.extend({props:{panelViews:"object"},template:e("./templates/sidebar.jade"),events:{"click [data-hook=button]":"clearClicked","input [data-hook=input]":"inputChanged"},bindings:{"model.search.content":{type:"value",hook:"input"}},render:function(){this.renderWithTemplate(this.model),this.panelViews=this.renderCollection(this.model.panels,o,this.queryByHook("panels"))},closeAndReset:function(){i.each(this.panelViews.views,function(e){e.collapsibleClose(),e.resetStats()})},clearClicked:function(){this.model.search.content="",this.closeAndReset(),this.queryByHook("button").blur()},filterPanels:function(e){i.each(this.panelViews.views,function(t){t.filterStats(e)})},statChanged:function(e,t){this.parent.statChanged(e,t),t.all&&i.each(this.panelViews.views,function(t){t.statChanged(e,{all:!1,propagate:!1})})},inputChanged:i.debounce(function(){var e=this.queryByHook("input").value;this.model.search.content=e,""===e.trim()?this.closeAndReset():this.filterPanels(e)},200,{leading:!1,trailing:!0})})},{"./panel":289,"./templates/sidebar.jade":296,"ampersand-view":157,debug:280,lodash:285}],291:[function(e,t,n){var r=e("ampersand-view");e("debug")("view:stat"),t.exports=r.extend({template:e("./templates/stat.jade"),render:function(){this.renderWithTemplate(this.model)},events:{click:"clicked"},bindings:{"model.selected":{type:"booleanClass",hook:"circle",yes:"fa-circle",no:"fa-circle-o"}},clicked:function(e){e.shiftKey?this.model.app.toggleAllExcept(this.model):(this.model.app.clearSelectionState(),this.model.toggle("selected")),this.parent.parent.statChanged(this,{all:e.shiftKey,propagate:!0})}})},{"./templates/stat.jade":297,"ampersand-view":157,debug:280}],292:[function(e,t,n){e("jade/runtime");t.exports=function(e){var t=[];return t.push('<div id="app"><nav id="navbar" role="navigation" class="navbar navbar-default"><div class="container-fluid"><div class="navbar-header"><div class="navbar-brand"> <div data-hook="menu-toggle" class="brand-image"></div></div></div><ul class="nav navbar-right"><li data-hook="sample-warning" class="navbar-text"><div title="warning: more series data points than pixels. data is being sub-sampled to improve performance. To avoid sub-sampling, increase the browser window width or zoom in." class="alert alert-warning"><i id="menubtn" class="fa fa-warning"></i><span>sub-sampling</span></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-clock-o"></i><span>x-axis</span><div data-toggle="buttons" data-hook="xSetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="xSetting" id="relative" value="relative" checked="checked"/>relative</label><label class="btn btn-default"><input type="radio" name="xSetting" id="absolute" value="absolute"/>absolute</label></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-line-chart"></i><span>y-axis</span><div data-toggle="buttons" data-hook="ySetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="ySetting" value="linear" checked="checked"/>linear</label><label class="btn btn-default"><input type="radio" name="ySetting" value="log-scale"/>log-scale</label></div></li></ul></div></nav><div id="wrapper"><div id="sidebar-wrapper"><div class="sidebar-nav"><div data-hook="sidebar"></div></div></div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="chart"></div></div></div></div></div></div>'),t.join("")}},{"jade/runtime":283}],293:[function(e,t,n){e("jade/runtime");t.exports=function(e){var t=[];return t.push('<div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="empty"></div><div data-hook="graph"></div></div></div></div></div>'),t.join("")}},{"jade/runtime":283}],294:[function(e,t,n){e("jade/runtime");t.exports=function(e){var t=[];return t.push('<div class="instructions"><dl class="dl-horizontal"><dt><h1><span class="searchbox">mem|&nbsp;</span><i class="fa fa-search"></i></h1></dt><dd>filter stats by typing in the text box</dd><dt><h1> <u>cursor</u><i class="fa fa-caret-down"></i></h1></dt><dd>open/close group panels</dd><dt><h1><i class="fa fa-circle-o"></i><i class="fa fa-adjust"> </i><i class="fa fa-circle"> </i></h1></dt><dd>click to toggle individual stats or the entire group</dd><dt><h1><i class="fa fa-expand"></i><i class="fa fa-arrows-h"> </i><i class="fa fa-compress"> </i></h1></dt><dd>zoom with two-finger scroll or mouse wheel, pan with click+drag</dd><dt><h1>x<i class="fa fa-clock-o"></i>y<i class="fa fa-line-chart"> </i></h1></dt><dd>change x/y axis scaling with buttons at the top</dd></dl></div>'),t.join("")}},{"jade/runtime":283}],295:[function(e,t,n){var r=e("jade/runtime");t.exports=function(e){var t,n=[],o=e||{};return function(e,o){n.push('<div class="panel panel-default"><div class="panel-heading">'),o&&n.push('<span class="suptitle">'+r.escape(null==(t=o)?"":t)+"</span>"),n.push('<h4 class="panel-title"><i data-hook="indicator" class="fa fa-circle-o"></i><a data-toggle="collapse" data-parent="#panel-accordion">'+r.escape(null==(t=e)?"":t)+'</a><div class="pull-right"><i data-hook="caret" class="fa"></i></div></h4></div><div class="panel-collapse collapse"><div class="panel-body"><ul data-hook="stats" class="stats"></ul></div></div></div>')}.call(this,"subtitle"in o?o.subtitle:"undefined"!=typeof subtitle?subtitle:void 0,"suptitle"in o?o.suptitle:"undefined"!=typeof suptitle?suptitle:void 0),n.join("")}},{"jade/runtime":283}],296:[function(e,t,n){e("jade/runtime");t.exports=function(e){var t=[];return t.push('<ul class="sidebar-nav"><li><div class="input-group"><input data-hook="input" type="text" class="form-control"/><span class="input-group-btn"><button data-hook="button" type="button" class="btn btn-default">Clear</button></span></div></li><li><div data-hook="panels" id="panel-accordion" class="panel-group"></div></li></ul>'),t.join("")}},{"jade/runtime":283}],297:[function(e,t,n){var r=e("jade/runtime");t.exports=function(e){var t,n=[],o=e||{};return function(e,o){n.push('<li class="stat"><i data-hook="circle"'+r.attr("style","color:"+e,!0,!1)+' class="fa fa-circle"></i>'+r.escape(null==(t=o)?"":t)+"</li>")}.call(this,"color"in o?o.color:"undefined"!=typeof color?color:void 0,"name"in o?o.name:"undefined"!=typeof name?name:void 0),n.join("")}},{"jade/runtime":283}],298:[function(e,t,n){var r=e("ampersand-view"),o=e("lodash"),i=e("jquery");e("debug")("view:viz");t.exports=r.extend({_values:{},_autoWidth:!1,_autoHeight:!1,props:{data:"any",className:"any",vizFn:"any",debounceRender:{type:"boolean","default":!0},renderMode:{type:"string",values:["canvas","svg","html"],"default":"svg"},width:{type:"any","default":"auto"},height:{type:"any","default":400}},bindings:{width:[{type:"attribute",name:"width",hook:"viz-container"}],height:{type:"attribute",name:"height",hook:"viz-container"},className:{type:"attribute",name:"class",hook:"viz-container"}},initialize:function(e){switch(("auto"===this.width||void 0===this.width)&&(this._autoWidth=!0,this.width=0),("auto"===this.height||void 0===this.height)&&(this._autoHeight=!0,this.height=0),(this._autoWidth||this._autoHeight)&&(this.debounceRender?window.addEventListener("resize",o.debounce(this.redraw.bind(this),100)):window.addEventListener("resize",this.redraw.bind(this))),this.renderMode){case"canvas":this.template='<canvas data-hook="viz-container" id="canvas"></canvas>';break;case"svg":this.template='<svg data-hook="viz-container"></svg>';break;case"html":this.template='<div data-hook="viz-container"></div>'}},_measure:function(){this.el&&(this._autoWidth&&(this.width=i(this.el).parent().width()),this._autoHeight&&(this.height=i(this.el).parent().height()))},_chooseDataSource:function(){void 0!==this.model?this.data=this.model.toJSON():void 0!==this.collection&&(this.data=this.collection.toJSON())},remove:function(){return window.removeEventListener("resize",this._onResize),this},transform:function(data){return data},render:function(){return this._chooseDataSource(),this.data=this.transform(this.data),this.renderWithTemplate(this),this._measure(),this.vizFn&&(this.vizFn=this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})),this},redraw:function(){this._chooseDataSource(),this.data=this.transform(this.data),this._measure(),this.vizFn&&this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})}}),t.exports.create=function(e,n){return t.exports.extend({className:e,vizFn:n})}},{"ampersand-view":157,debug:280,jquery:284,lodash:285}],299:[function(e,t,n){var r=e("d3"),o=e("lodash");e("debug")("viz:d3-multiline");r.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})},t.exports=function(e){function t(t){if(t){if(e=t,d=e.width-c.left-c.right,f=e.height-c.top-c.bottom,data=e.data,p=data.model,m=p.serialize(),F=data.series,0===F.length?S.style("visibility","hidden"):S.style("visibility","visible"),S.attr({width:d,height:f}),"relative"===m.xSetting?(g=function(e){return e.xrel},w=y,_.tickFormat(r.format(","))):(g=function(e){return e.x},w=v,_.tickFormat(x)),w.range([0,d]),(o.isEqual(w.domain(),[0,1])||o.isEqual(w.domain(),[new Date(0),new Date(1)])||m.recalcXDomain)&&(z=[r.min(F,function(e){return r.min(e.data,function(e){return g(e)})}),r.max(F,function(e){return r.max(e.data,function(e){return g(e)})})],w.domain(z),C.x(w)),F.length>0){var n=o.find(F,function(e){return e.data.length>1}).data;L=n?w(g(n[1]))-w(g(n[0])):1}else L=1;p.subSampled=m.allowSampling&&1>L,"linear"===m.ySetting?(j=b,j.domain([r.min(F,function(e){return r.min(e.data,function(e){return e.y})}),r.max(F,function(e){return r.max(e.data,function(e){return e.y})})])):(j=k,j.domain([.1,r.max(F,function(e){return r.max(e.data,function(e){return e.y})})])),j.range([f,0])}S.selectAll(".x").call(_.scale(w)),S.selectAll(".y").call(M.scale(j)),q=S.selectAll(".serie").data(F,function(e){return e.cid}),q.enter().append("g").attr("class","serie").append("path").attr("class","line").style("stroke",function(e){return e.color}),q.exit().remove(),q.selectAll(".line").attr("d",function(e){return E(g)(i(e.data))}),L>6?(D=q.selectAll(".point").data(function(e){return i(e.data).map(function(t){return{x:g(t),y:t.y,c:e.color}})}),D.enter().append("circle").attr("class","point").attr("r","3px").style("fill",function(e){return e.c}),D.exit().remove(),D.attr("cx",function(e){return w(e.x)}).attr("cy",function(e){return j(e.y)})):q.selectAll(".point").remove(),T.attr("x2",d),A.attr("y2",f+20),R.attr("width",d).attr("height",f).moveToFront()}function n(data){var e=w.domain(),t=u(g)(data,e[0]),n=u(g)(data,e[1]);return data.slice(t,n)}function i(data){data=n(data);var e=1/L;return m.allowSampling&&e>1?data.filter(function(t,n){return n%Math.ceil(e)===0}):data}function a(e,t){var n=i(t.data),r=w.invert(e),o=u(g)(n,r),a=n[o-1],s=n[o];return void 0===a?s:void 0===s?a:r-g(a)>g(s)-r?s:a}function s(){var e=r.mouse(this),t=e[0],n=e[1],o=F.map(function(e){return a(t,e)}),i=o.map(function(e){return e?Math.pow(t-w(g(e)),2)+Math.pow(n-j(e.y),2):1/0}),s=i.indexOf(Math.min.apply(Math,i)),u=F[s],l=o[s];N.attr("transform","translate("+w(g(l))+","+j(l.y)+")").moveToFront(),N.select("circle").attr("stroke",u.color),N.select("text.name").text(u.name),N.select("text.value").text(r.format(",")(l.y)),O.attr("transform","translate("+w(g(l))+","+(f+34)+")").text("relative"===m.xSetting?r.format(",")(g(l)):r.time.format("%b %d %H:%M:%S")(g(l))).moveToFront(),T.attr("y1",j(l.y)).attr("y2",j(l.y)),A.attr("x1",w(g(l))).attr("x2",w(g(l)))}function u(e){return r.bisector(function(t){return e(t)}).left}function l(){p.recalcXDomain=!1,t(e)}var c={top:80,right:20,bottom:60,left:100},d=e.width-c.left-c.right,f=e.height-c.top-c.bottom,data=e.data,h=e.el,p=data.model,m=p.serialize(),g=function(e){return e.x},v=r.time.scale(),y=r.scale.linear(),x=r.time.format.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%b %e %H:%M",function(e){return e.getMinutes()}],["%b %e %H:%M",function(e){return e.getHours()}],["%b %e",function(e){return e.getDay()&&1!=e.getDate()}],["%b %e",function(e){return 1!=e.getDate()}],["%Y",function(e){return e.getMonth()}],["%Y",function(){return!0}]]),w="relative"===m.xSetting?y:v,_=r.svg.axis().scale(w).ticks(10).orient("bottom"),b=r.scale.linear().range([f,0]),k=r.scale.log().clamp(!0).range([f,0]).nice(),j="linear"===m.ySetting?b:k,M=r.svg.axis().scale(j).orient("left"),E=function(e){return r.svg.line().x(function(t){return w(e(t))}).y(function(e){return j(e.y)})},C=r.behavior.zoom().scaleExtent([1,50]).x(w).on("zoom",l),S=r.select(h).append("g").attr("transform","translate("+c.left+","+c.top+")").call(C);S.append("g").attr("class","x axis").attr("transform","translate(0,"+f+")"),S.append("g").attr("class","y axis");var T=S.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("x1",0),A=S.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("y1",0),N=S.append("g").attr("class","focus").style("display","none");N.append("circle").attr("r",6).attr("fill","none").attr("stroke-width",2);var O=S.append("text").attr("text-anchor","middle").attr("class","xlabel").attr("font-size","0.8em").attr("fill","#bbb");N.append("text").attr("class","name").attr("fill","black").attr("x",9).attr("dy","-.8em"),N.append("text").attr("class","value").attr("fill","black").attr("font-size","20px").attr("x",8).attr("dy","-1.2em");var q,D,L,F,z,R=S.append("rect").attr("class","windshield").style("opacity",0).on("mouseover",function(){T.style("display",null),A.style("display",null),N.style("display",null),O.style("display",null)}).on("mouseout",function(){N.style("display","none"),T.style("display","none"),A.style("display","none"),O.style("display","none")}).on("mousemove",s);return t}},{d3:279,debug:280,lodash:285}]},{},[1]);
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1])</script></html> \ No newline at end of file
diff --git a/tools/wtstats/wtstats.py b/tools/wtstats/wtstats.py
index 3749ffd6c63..ff62d99e825 100755
--- a/tools/wtstats/wtstats.py
+++ b/tools/wtstats/wtstats.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.