本文整理汇总了C++中CURSOR_API_CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ CURSOR_API_CALL函数的具体用法?C++ CURSOR_API_CALL怎么用?C++ CURSOR_API_CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CURSOR_API_CALL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __curfile_search_near
/*
* __curfile_search_near --
* WT_CURSOR->search_near method for the btree cursor type.
*/
static int
__curfile_search_near(WT_CURSOR *cursor, int *exact)
{
WT_CURSOR_BTREE *cbt;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, search_near, cbt->btree);
WT_CURSOR_NEEDKEY(cursor);
ret = __wt_btcur_search_near(cbt, exact);
err: API_END(session);
return (ret);
}
示例2: __curbackup_reset
/*
* __curbackup_reset --
* WT_CURSOR->reset method for the backup cursor type.
*/
static int
__curbackup_reset(WT_CURSOR *cursor)
{
WT_CURSOR_BACKUP *cb;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cb = (WT_CURSOR_BACKUP *)cursor;
CURSOR_API_CALL(cursor, session, reset, NULL);
cb->next = 0;
F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);
err: API_END_RET(session, ret);
}
示例3: __clsm_next
/*
* __clsm_next --
* WT_CURSOR->next method for the LSM cursor type.
*/
static int
__clsm_next(WT_CURSOR *cursor)
{
WT_CURSOR_LSM *clsm;
WT_CURSOR *c;
WT_DECL_RET;
WT_SESSION_IMPL *session;
u_int i;
int cmp;
bool check, deleted;
clsm = (WT_CURSOR_LSM *)cursor;
CURSOR_API_CALL(cursor, session, next, NULL);
WT_CURSOR_NOVALUE(cursor);
WT_ERR(__clsm_enter(clsm, false, false));
/* If we aren't positioned for a forward scan, get started. */
if (clsm->current == NULL || !F_ISSET(clsm, WT_CLSM_ITERATE_NEXT)) {
F_CLR(clsm, WT_CLSM_MULTIPLE);
WT_FORALL_CURSORS(clsm, c, i) {
if (!F_ISSET(cursor, WT_CURSTD_KEY_SET)) {
WT_ERR(c->reset(c));
ret = c->next(c);
} else if (c != clsm->current) {
c->set_key(c, &cursor->key);
if ((ret = c->search_near(c, &cmp)) == 0) {
if (cmp < 0)
ret = c->next(c);
else if (cmp == 0) {
if (clsm->current == NULL)
clsm->current = c;
else
F_SET(clsm,
WT_CLSM_MULTIPLE);
}
} else
F_CLR(c, WT_CURSTD_KEY_SET);
}
WT_ERR_NOTFOUND_OK(ret);
}
F_SET(clsm, WT_CLSM_ITERATE_NEXT);
F_CLR(clsm, WT_CLSM_ITERATE_PREV);
/* We just positioned *at* the key, now move. */
if (clsm->current != NULL)
goto retry;
} else {
示例4: __curfile_prev
/*
* __curfile_prev --
* WT_CURSOR->prev method for the btree cursor type.
*/
static int
__curfile_prev(WT_CURSOR *cursor)
{
WT_CURSOR_BTREE *cbt;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, prev, cbt->btree);
F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);
if ((ret = __wt_btcur_prev(cbt, 0)) == 0)
F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
err: API_END_RET(session, ret);
}
示例5: __curds_search_near
/*
* __curds_search_near --
* WT_CURSOR.search_near method for the data-source cursor type.
*/
static int
__curds_search_near(WT_CURSOR *cursor, int *exact)
{
WT_DECL_RET;
WT_SESSION_IMPL *session;
CURSOR_API_CALL(cursor, session, search_near, NULL);
WT_ERR(__curds_key_set(cursor));
WT_ERR(cursor->data_source->search_near(cursor->data_source, exact));
__curds_key_get(cursor);
__curds_value_get(cursor);
err: API_END(session);
return (ret);
}
示例6: __curjoin_reset
/*
* __curjoin_reset --
* WT_CURSOR::reset for join cursors.
*/
static int
__curjoin_reset(WT_CURSOR *cursor)
{
WT_CURSOR_JOIN *cjoin;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cjoin = (WT_CURSOR_JOIN *)cursor;
CURSOR_API_CALL(cursor, session, reset, NULL);
if (F_ISSET(cjoin, WT_CURJOIN_INITIALIZED))
WT_ERR(__curjoin_entry_iter_reset(cjoin->iter));
err: API_END_RET(session, ret);
}
示例7: __curfile_reset
/*
* __curfile_reset --
* WT_CURSOR->reset method for the btree cursor type.
*/
static int
__curfile_reset(WT_CURSOR *cursor)
{
WT_CURSOR_BTREE *cbt;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, reset, cbt->btree);
ret = __wt_btcur_reset(cbt);
F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);
err: API_END_RET(session, ret);
}
示例8: __curbulk_insert_fix
/*
* __curbulk_insert_fix --
* Fixed-length column-store bulk cursor insert.
*/
static int
__curbulk_insert_fix(WT_CURSOR *cursor)
{
WT_BTREE *btree;
WT_CURSOR_BULK *cbulk;
WT_DECL_RET;
WT_SESSION_IMPL *session;
uint64_t recno;
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);
/*
* 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);
}
示例9: __curfile_search
/*
* __curfile_search --
* WT_CURSOR->search method for the btree cursor type.
*/
static int
__curfile_search(WT_CURSOR *cursor)
{
WT_CURSOR_BTREE *cbt;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, search, cbt->btree);
WT_CURSOR_NEEDKEY(cursor);
WT_CURSOR_NOVALUE(cursor);
WT_BTREE_CURSOR_SAVE_AND_RESTORE(cursor, __wt_btcur_search(cbt), ret);
err: API_END_RET(session, ret);
}
示例10: __curjoin_close
/*
* __curjoin_close --
* WT_CURSOR::close for join cursors.
*/
static int
__curjoin_close(WT_CURSOR *cursor)
{
WT_CURSOR_JOIN *cjoin;
WT_CURSOR_JOIN_ENDPOINT *end;
WT_CURSOR_JOIN_ENTRY *entry;
WT_DECL_RET;
WT_SESSION_IMPL *session;
u_int i;
cjoin = (WT_CURSOR_JOIN *)cursor;
CURSOR_API_CALL(cursor, session, close, NULL);
__wt_schema_release_table(session, cjoin->table);
/* These are owned by the table */
cursor->internal_uri = NULL;
cursor->key_format = NULL;
if (cjoin->projection != NULL) {
__wt_free(session, cjoin->projection);
__wt_free(session, cursor->value_format);
}
for (entry = cjoin->entries, i = 0; i < cjoin->entries_next;
entry++, i++) {
if (entry->main != NULL)
WT_TRET(entry->main->close(entry->main));
if (F_ISSET(entry, WT_CURJOIN_ENTRY_OWN_BLOOM))
WT_TRET(__wt_bloom_close(entry->bloom));
for (end = &entry->ends[0];
end < &entry->ends[entry->ends_next]; end++) {
F_CLR(end->cursor, WT_CURSTD_JOINED);
if (F_ISSET(end, WT_CURJOIN_END_OWN_KEY))
__wt_free(session, end->key.data);
}
__wt_free(session, entry->ends);
}
if (cjoin->iter != NULL)
WT_TRET(__curjoin_entry_iter_close(cjoin->iter));
__wt_free(session, cjoin->entries);
WT_TRET(__wt_cursor_close(cursor));
err: API_END_RET(session, ret);
}
示例11: __curjoin_next
/*
* __curjoin_next --
* WT_CURSOR::next for join cursors.
*/
static int
__curjoin_next(WT_CURSOR *cursor)
{
WT_CURSOR_JOIN *cjoin;
WT_DECL_RET;
WT_SESSION_IMPL *session;
bool skip_left;
u_int i;
cjoin = (WT_CURSOR_JOIN *)cursor;
CURSOR_API_CALL(cursor, session, next, NULL);
if (F_ISSET(cjoin, WT_CURJOIN_ERROR))
WT_ERR_MSG(session, WT_ERROR,
"join cursor encountered previous error");
if (!F_ISSET(cjoin, WT_CURJOIN_INITIALIZED))
WT_ERR(__curjoin_init_iter(session, cjoin));
nextkey:
if ((ret = __curjoin_entry_iter_next(cjoin->iter, &cursor->key,
&cursor->recno)) == 0) {
F_SET(cursor, WT_CURSTD_KEY_EXT);
/*
* We may have already established membership for the
* 'left' case for the first entry, since we're
* using that in our iteration.
*/
skip_left = F_ISSET(cjoin, WT_CURJOIN_SKIP_FIRST_LEFT);
for (i = 0; i < cjoin->entries_next; i++) {
ret = __curjoin_entry_member(session, cjoin,
&cjoin->entries[i], skip_left);
if (ret == WT_NOTFOUND)
goto nextkey;
skip_left = false;
WT_ERR(ret);
}
}
if (0) {
err: F_SET(cjoin, WT_CURJOIN_ERROR);
}
API_END_RET(session, ret);
}
示例12: __curmetadata_close
/*
* __curmetadata_close --
* WT_CURSOR->close method for the metadata cursor type.
*/
static int
__curmetadata_close(WT_CURSOR *cursor)
{
WT_CURSOR *file_cursor;
WT_CURSOR_METADATA *mdc;
WT_DECL_RET;
WT_SESSION_IMPL *session;
mdc = (WT_CURSOR_METADATA *)cursor;
file_cursor = mdc->file_cursor;
CURSOR_API_CALL(cursor, session,
close, ((WT_CURSOR_BTREE *)file_cursor)->btree);
ret = file_cursor->close(file_cursor);
WT_TRET(__wt_cursor_close(cursor));
err: API_END_RET(session, ret);
}
示例13: __curfile_next
/*
* __curfile_next --
* WT_CURSOR->next method for the btree cursor type.
*/
static int
__curfile_next(WT_CURSOR *cursor)
{
WT_CURSOR_BTREE *cbt;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, next, cbt->btree);
WT_ERR(__wt_btcur_next(cbt, false));
/* Next maintains a position, key and value. */
WT_ASSERT(session,
F_MASK(cursor, WT_CURSTD_KEY_SET) == WT_CURSTD_KEY_INT &&
F_MASK(cursor, WT_CURSTD_VALUE_SET) == WT_CURSTD_VALUE_INT);
err: API_END_RET(session, ret);
}
示例14: __curfile_reset
/*
* __curfile_reset --
* WT_CURSOR->reset method for the btree cursor type.
*/
static int
__curfile_reset(WT_CURSOR *cursor)
{
WT_CURSOR_BTREE *cbt;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, reset, cbt->btree);
ret = __wt_btcur_reset(cbt);
/* Reset maintains no position, key or value. */
WT_ASSERT(session,
F_MASK(cursor, WT_CURSTD_KEY_SET) == 0 &&
F_MASK(cursor, WT_CURSTD_VALUE_SET) == 0);
err: API_END_RET(session, ret);
}
示例15: __curdump_set_key
/*
* __curdump_set_key --
* WT_CURSOR->set_key for dump cursors.
*/
static void
__curdump_set_key(WT_CURSOR *cursor, ...)
{
WT_CURSOR_DUMP *cdump;
WT_CURSOR *child;
WT_DECL_RET;
WT_SESSION_IMPL *session;
uint64_t recno;
va_list ap;
const char *p;
cdump = (WT_CURSOR_DUMP *)cursor;
child = cdump->child;
CURSOR_API_CALL(cursor, session, set_key, NULL);
va_start(ap, cursor);
if (F_ISSET(cursor, WT_CURSTD_RAW))
p = va_arg(ap, WT_ITEM *)->data;
else