Version 2.0.1
com.wiredtiger.db.wiredtiger Class Reference

Inherits com.wiredtiger.db.wiredtigerConstants.

Static Public Member Functions

static String wiredtiger_strerror (int err)
 
static Connection open (String home, String config)
 Open a connection to a database. More...
 

Additional Inherited Members

- Static Public Attributes inherited from com.wiredtiger.db.wiredtigerConstants
static final int WIREDTIGER_VERSION_MAJOR
 
static final int WIREDTIGER_VERSION_MINOR
 
static final int WIREDTIGER_VERSION_PATCH
 
static final String WIREDTIGER_VERSION_STRING
 
static final int WT_DEADLOCK
 
static final int WT_DUPLICATE_KEY
 
static final int WT_ERROR
 
static final int WT_NOTFOUND
 
static final int WT_PANIC
 
static final int WT_RESTART
 
static final int WT_STAT_CONN_BLOCK_BYTE_MAP_READ
 
static final int WT_STAT_CONN_BLOCK_BYTE_READ
 
static final int WT_STAT_CONN_BLOCK_BYTE_WRITE
 
static final int WT_STAT_CONN_BLOCK_MAP_READ
 
static final int WT_STAT_CONN_BLOCK_PRELOAD
 
static final int WT_STAT_CONN_BLOCK_READ
 
static final int WT_STAT_CONN_BLOCK_WRITE
 
static final int WT_STAT_CONN_CACHE_BYTES_DIRTY
 
static final int WT_STAT_CONN_CACHE_BYTES_INUSE
 
static final int WT_STAT_CONN_CACHE_BYTES_MAX
 
static final int WT_STAT_CONN_CACHE_BYTES_READ
 
static final int WT_STAT_CONN_CACHE_BYTES_WRITE
 
static final int WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT
 
static final int WT_STAT_CONN_CACHE_EVICTION_CLEAN
 
static final int WT_STAT_CONN_CACHE_EVICTION_DIRTY
 
static final int WT_STAT_CONN_CACHE_EVICTION_FAIL
 
static final int WT_STAT_CONN_CACHE_EVICTION_FORCE
 
static final int WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL
 
static final int WT_STAT_CONN_CACHE_EVICTION_HAZARD
 
static final int WT_STAT_CONN_CACHE_EVICTION_INTERNAL
 
static final int WT_STAT_CONN_CACHE_EVICTION_MERGE
 
static final int WT_STAT_CONN_CACHE_EVICTION_MERGE_FAIL
 
static final int WT_STAT_CONN_CACHE_EVICTION_MERGE_LEVELS
 
static final int WT_STAT_CONN_CACHE_EVICTION_SLOW
 
static final int WT_STAT_CONN_CACHE_EVICTION_WALK
 
static final int WT_STAT_CONN_CACHE_INMEM_SPLIT
 
static final int WT_STAT_CONN_CACHE_PAGES_DIRTY
 
static final int WT_STAT_CONN_CACHE_PAGES_INUSE
 
static final int WT_STAT_CONN_CACHE_READ
 
static final int WT_STAT_CONN_CACHE_WRITE
 
static final int WT_STAT_CONN_COND_WAIT
 
static final int WT_STAT_CONN_CURSOR_CREATE
 
static final int WT_STAT_CONN_CURSOR_INSERT
 
static final int WT_STAT_CONN_CURSOR_NEXT
 
static final int WT_STAT_CONN_CURSOR_PREV
 
static final int WT_STAT_CONN_CURSOR_REMOVE
 
static final int WT_STAT_CONN_CURSOR_RESET
 
static final int WT_STAT_CONN_CURSOR_SEARCH
 
static final int WT_STAT_CONN_CURSOR_SEARCH_NEAR
 
static final int WT_STAT_CONN_CURSOR_UPDATE
 
static final int WT_STAT_CONN_DH_CONN_HANDLES
 
static final int WT_STAT_CONN_DH_CONN_SWEEPS
 
static final int WT_STAT_CONN_DH_SESSION_HANDLES
 
static final int WT_STAT_CONN_DH_SESSION_SWEEPS
 
static final int WT_STAT_CONN_DH_SWEEP_EVICT
 
static final int WT_STAT_CONN_FILE_OPEN
 
static final int WT_STAT_CONN_LOG_BUFFER_GROW
 
static final int WT_STAT_CONN_LOG_BUFFER_SIZE
 
static final int WT_STAT_CONN_LOG_BYTES_USER
 
static final int WT_STAT_CONN_LOG_BYTES_WRITTEN
 
static final int WT_STAT_CONN_LOG_MAX_FILESIZE
 
static final int WT_STAT_CONN_LOG_READS
 
static final int WT_STAT_CONN_LOG_SCAN_RECORDS
 
static final int WT_STAT_CONN_LOG_SCAN_REREADS
 
static final int WT_STAT_CONN_LOG_SCANS
 
static final int WT_STAT_CONN_LOG_SLOT_CLOSES
 
static final int WT_STAT_CONN_LOG_SLOT_CONSOLIDATED
 
static final int WT_STAT_CONN_LOG_SLOT_JOINS
 
static final int WT_STAT_CONN_LOG_SLOT_RACES
 
static final int WT_STAT_CONN_LOG_SLOT_READY_WAIT_TIMEOUT
 
static final int WT_STAT_CONN_LOG_SLOT_RELEASE_WAIT_TIMEOUT
 
static final int WT_STAT_CONN_LOG_SLOT_SWITCH_FAILS
 
static final int WT_STAT_CONN_LOG_SLOT_TOOBIG
 
static final int WT_STAT_CONN_LOG_SLOT_TOOSMALL
 
static final int WT_STAT_CONN_LOG_SLOT_TRANSITIONS
 
static final int WT_STAT_CONN_LOG_SYNC
 
static final int WT_STAT_CONN_LOG_WRITES
 
static final int WT_STAT_CONN_LSM_ROWS_MERGED
 
static final int WT_STAT_CONN_MEMORY_ALLOCATION
 
static final int WT_STAT_CONN_MEMORY_FREE
 
static final int WT_STAT_CONN_MEMORY_GROW
 
static final int WT_STAT_CONN_READ_IO
 
static final int WT_STAT_CONN_REC_PAGES
 
static final int WT_STAT_CONN_REC_PAGES_EVICTION
 
static final int WT_STAT_CONN_REC_SKIPPED_UPDATE
 
static final int WT_STAT_CONN_RWLOCK_READ
 
static final int WT_STAT_CONN_RWLOCK_WRITE
 
static final int WT_STAT_CONN_SESSION_CURSOR_OPEN
 
static final int WT_STAT_CONN_TXN_BEGIN
 
static final int WT_STAT_CONN_TXN_CHECKPOINT
 
static final int WT_STAT_CONN_TXN_CHECKPOINT_RUNNING
 
static final int WT_STAT_CONN_TXN_COMMIT
 
static final int WT_STAT_CONN_TXN_FAIL_CACHE
 
static final int WT_STAT_CONN_TXN_ROLLBACK
 
static final int WT_STAT_CONN_WRITE_IO
 
static final int WT_STAT_DSRC_ALLOCATION_SIZE
 
static final int WT_STAT_DSRC_BLOCK_ALLOC
 
static final int WT_STAT_DSRC_BLOCK_CHECKPOINT_SIZE
 
static final int WT_STAT_DSRC_BLOCK_EXTENSION
 
static final int WT_STAT_DSRC_BLOCK_FREE
 
static final int WT_STAT_DSRC_BLOCK_MAGIC
 
static final int WT_STAT_DSRC_BLOCK_MAJOR
 
static final int WT_STAT_DSRC_BLOCK_MINOR
 
static final int WT_STAT_DSRC_BLOCK_REUSE_BYTES
 
static final int WT_STAT_DSRC_BLOCK_SIZE
 
static final int WT_STAT_DSRC_BLOOM_COUNT
 
static final int WT_STAT_DSRC_BLOOM_FALSE_POSITIVE
 
static final int WT_STAT_DSRC_BLOOM_HIT
 
static final int WT_STAT_DSRC_BLOOM_MISS
 
static final int WT_STAT_DSRC_BLOOM_PAGE_EVICT
 
static final int WT_STAT_DSRC_BLOOM_PAGE_READ
 
static final int WT_STAT_DSRC_BLOOM_SIZE
 
static final int WT_STAT_DSRC_BTREE_COLUMN_DELETED
 
static final int WT_STAT_DSRC_BTREE_COLUMN_FIX
 
static final int WT_STAT_DSRC_BTREE_COLUMN_INTERNAL
 
static final int WT_STAT_DSRC_BTREE_COLUMN_VARIABLE
 
static final int WT_STAT_DSRC_BTREE_COMPACT_REWRITE
 
static final int WT_STAT_DSRC_BTREE_ENTRIES
 
static final int WT_STAT_DSRC_BTREE_FIXED_LEN
 
static final int WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH
 
static final int WT_STAT_DSRC_BTREE_MAXINTLITEM
 
static final int WT_STAT_DSRC_BTREE_MAXINTLPAGE
 
static final int WT_STAT_DSRC_BTREE_MAXLEAFITEM
 
static final int WT_STAT_DSRC_BTREE_MAXLEAFPAGE
 
static final int WT_STAT_DSRC_BTREE_OVERFLOW
 
static final int WT_STAT_DSRC_BTREE_ROW_INTERNAL
 
static final int WT_STAT_DSRC_BTREE_ROW_LEAF
 
static final int WT_STAT_DSRC_CACHE_BYTES_READ
 
static final int WT_STAT_DSRC_CACHE_BYTES_WRITE
 
static final int WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT
 
static final int WT_STAT_DSRC_CACHE_EVICTION_CLEAN
 
static final int WT_STAT_DSRC_CACHE_EVICTION_DIRTY
 
static final int WT_STAT_DSRC_CACHE_EVICTION_FAIL
 
static final int WT_STAT_DSRC_CACHE_EVICTION_HAZARD
 
static final int WT_STAT_DSRC_CACHE_EVICTION_INTERNAL
 
static final int WT_STAT_DSRC_CACHE_EVICTION_MERGE
 
static final int WT_STAT_DSRC_CACHE_EVICTION_MERGE_FAIL
 
static final int WT_STAT_DSRC_CACHE_EVICTION_MERGE_LEVELS
 
static final int WT_STAT_DSRC_CACHE_INMEM_SPLIT
 
static final int WT_STAT_DSRC_CACHE_OVERFLOW_VALUE
 
static final int WT_STAT_DSRC_CACHE_READ
 
static final int WT_STAT_DSRC_CACHE_READ_OVERFLOW
 
static final int WT_STAT_DSRC_CACHE_WRITE
 
static final int WT_STAT_DSRC_COMPRESS_RAW_FAIL
 
static final int WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY
 
static final int WT_STAT_DSRC_COMPRESS_RAW_OK
 
static final int WT_STAT_DSRC_COMPRESS_READ
 
static final int WT_STAT_DSRC_COMPRESS_WRITE
 
static final int WT_STAT_DSRC_COMPRESS_WRITE_FAIL
 
static final int WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL
 
static final int WT_STAT_DSRC_CURSOR_CREATE
 
static final int WT_STAT_DSRC_CURSOR_INSERT
 
static final int WT_STAT_DSRC_CURSOR_INSERT_BULK
 
static final int WT_STAT_DSRC_CURSOR_INSERT_BYTES
 
static final int WT_STAT_DSRC_CURSOR_NEXT
 
static final int WT_STAT_DSRC_CURSOR_PREV
 
static final int WT_STAT_DSRC_CURSOR_REMOVE
 
static final int WT_STAT_DSRC_CURSOR_REMOVE_BYTES
 
static final int WT_STAT_DSRC_CURSOR_RESET
 
static final int WT_STAT_DSRC_CURSOR_SEARCH
 
static final int WT_STAT_DSRC_CURSOR_SEARCH_NEAR
 
static final int WT_STAT_DSRC_CURSOR_UPDATE
 
static final int WT_STAT_DSRC_CURSOR_UPDATE_BYTES
 
static final int WT_STAT_DSRC_LSM_CHUNK_COUNT
 
static final int WT_STAT_DSRC_LSM_GENERATION_MAX
 
static final int WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM
 
static final int WT_STAT_DSRC_REC_DICTIONARY
 
static final int WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL
 
static final int WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF
 
static final int WT_STAT_DSRC_REC_OVERFLOW_VALUE
 
static final int WT_STAT_DSRC_REC_PAGE_DELETE
 
static final int WT_STAT_DSRC_REC_PAGE_MERGE
 
static final int WT_STAT_DSRC_REC_PAGES
 
static final int WT_STAT_DSRC_REC_PAGES_EVICTION
 
static final int WT_STAT_DSRC_REC_SKIPPED_UPDATE
 
static final int WT_STAT_DSRC_REC_SPLIT_INTERNAL
 
static final int WT_STAT_DSRC_REC_SPLIT_LEAF
 
static final int WT_STAT_DSRC_REC_SPLIT_MAX
 
static final int WT_STAT_DSRC_SESSION_COMPACT
 
static final int WT_STAT_DSRC_SESSION_CURSOR_OPEN
 
static final int WT_STAT_DSRC_TXN_UPDATE_CONFLICT
 

Member Function Documentation

static Connection com.wiredtiger.db.wiredtiger.open ( String  home,
String  config 
)
static

Open a connection to a database.

ret = wiredtiger_open(home, NULL, "create,cache_size=500M", &conn);
Parameters
homeThe path to the database home directory. See Database Home Directory for more information.
errhandlerAn error handler. If NULL, a builtin error handler is installed that writes error messages to stderr
configConfiguration string, see Configuration Strings. Permitted values:
NameEffectValues
buffer_alignmentin-memory alignment (in bytes) for buffers used for I/O. The default value of -1 indicates a platform-specific alignment value should be used (4KB on Linux systems, zero elsewhere).an integer between -1 and 1MB; default -1.
cache_sizemaximum heap memory to allocate for the cache. A database should configure either a cache_size or a shared_cache not both.an integer between 1MB and 10TB; default 100MB.
checkpoint = (periodically checkpoint the database.a set of related configuration options defined below.
    namethe checkpoint name.a string; default "WiredTigerCheckpoint".
    waitseconds to wait between each checkpoint; setting this value configures periodic checkpoints.an integer between 1 and 100000; default 0.
)
checkpoint_syncflush files to stable storage when closing or writing checkpoints.a boolean flag; default true.
createcreate the database if it does not exist.a boolean flag; default false.
direct_ioUse O_DIRECT to access files. Options are given as a list, such as "direct_io=[data]". Configuring direct_io requires care, see Direct I/O for important warnings.a list, with values chosen from the following options: "data", "log"; default empty.
error_prefixprefix string for error messages.a string; default empty.
eviction_dirty_targetcontinue evicting until the cache has less dirty pages than this (as a percentage). Dirty pages will only be evicted if the cache is full enough to trigger eviction.an integer between 10 and 99; default 80.
eviction_targetcontinue evicting until the cache becomes less full than this (as a percentage). Must be less than eviction_trigger.an integer between 10 and 99; default 80.
eviction_triggertrigger eviction when the cache becomes this full (as a percentage).an integer between 10 and 99; default 95.
extensionslist of shared library extensions to load (using dlopen). Any values specified to an library extension are passed to WT_CONNECTION::load_extension as the config parameter (for example, extensions=(/path/ext.so={entry=my_entry})).a list of strings; default empty.
file_extendfile extension configuration. If set, extend files of the set type in allocations of the set size, instead of a block at a time as each new block is written. For example, file_extend=(data=16MB).a list, with values chosen from the following options: "data", "log"; default empty.
hazard_maxmaximum number of simultaneous hazard pointers per session handle.an integer greater than or equal to 15; default 1000.
log = (enable logging.a set of related configuration options defined below.
    archiveautomatically archive unneeded log files.a boolean flag; default true.
    enabledenable logging subsystem.a boolean flag; default false.
    file_maxthe maximum size of log files.an integer between 100KB and 2GB; default 100MB.
    paththe path to a directory into which the log files are written. If the value is not an absolute path name, the files are created relative to the database home.a string; default "".
)
lsm_mergemerge LSM chunks where possible.a boolean flag; default true.
mmapUse memory mapping to access files when possible.a boolean flag; default true.
multiprocesspermit sharing between processes (will automatically start an RPC server for primary processes and use RPC for secondary processes). Not yet supported in WiredTiger.a boolean flag; default false.
session_maxmaximum expected number of sessions (including server threads).an integer greater than or equal to 1; default 50.
shared_cache = (shared cache configuration options. A database should configure either a cache_size or a shared_cache not both.a set of related configuration options defined below.
    enablewhether the connection is using a shared cache.a boolean flag; default false.
    chunkthe granularity that a shared cache is redistributed.an integer between 1MB and 10TB; default 10MB.
    reserveamount of cache this database is guaranteed to have available from the shared cache. This setting is per database. Defaults to the chunk size.an integer; default 0.
    namename of a cache that is shared between databases.a string; default pool.
    sizemaximum memory to allocate for the shared cache. Setting this will update the value if one is already set.an integer between 1MB and 10TB; default 500MB.
)
statisticsMaintain database statistics, which may impact performance. Choosing "all" maintains all statistics regardless of cost, "fast" maintains a subset of statistics that are relatively inexpensive, "none" turns off all statistics. The "clear" configuration resets statistics after they are gathered, where appropriate (for example, a cache size statistic is not cleared, while the count of cursor insert operations will be cleared). When "clear" is configured for the database, gathered statistics are reset each time a statistics cursor is used to gather statistics, as well as each time statistics are logged using the statistics_log configuration. See Statistics for more information.a list, with values chosen from the following options: "all", "fast", "none", "clear"; default none.
statistics_log = (log any statistics the database is configured to maintain, to a file. See Statistics for more information.a set of related configuration options defined below.
    paththe pathname to a file into which the log records are written, may contain ISO C standard strftime conversion specifications. If the value is not an absolute path name, the file is created relative to the database home.a string; default "WiredTigerStat.%H".
    sourcesif non-empty, include statistics for the list of data source URIs, if they are open at the time of the statistics logging. The list may include URIs matching a single data source ("table:mytable"), or a URI matching all data sources of a particular type ("table:").a list of strings; default empty.
    timestampa timestamp prepended to each log record, may contain strftime conversion specifications.a string; default "%b %d %H:%M:%S".
    waitseconds to wait between each write of the log records.an integer between 1 and 100000; default 0.
)
transaction_synchow to sync log records when the transaction commits.a string, chosen from the following options: "dsync", "fsync", "none"; default dsync.
use_environment_privuse the WIREDTIGER_CONFIG and WIREDTIGER_HOME environment variables regardless of whether or not the process is running with special privileges. See Database Home Directory for more information.a boolean flag; default false.
verboseenable messages for various events. Options are given as a list, such as "verbose=[evictserver,read]".a list, with values chosen from the following options: "block", "ckpt", "compact", "evict", "evictserver", "fileops", "hazard", "log", "lsm", "mutex", "overflow", "read", "readserver", "reconcile", "recovery", "salvage", "shared_cache", "verify", "version", "write"; default empty.
Additionally, if a file named WiredTiger.config appears in the WiredTiger home directory, it is read for configuration values (see WiredTiger.config file for details). Configuration values specified in the config argument to the wiredtiger_open function override configuration values specified in the WiredTiger.config file.
[out]connectionpA pointer to the newly opened connection handle
Returns
zero on success and a non-zero error code on failure. See Error Returns for details.