2013-04-16 23:58:59 -04:00
|
|
|
/* -*- mode: C; c-basic-offset: 4 -*- */
|
|
|
|
#ifndef YDB_LOAD_H
|
|
|
|
#define YDB_LOAD_H
|
|
|
|
|
|
|
|
#ident "Copyright (c) 2010 Tokutek Inc. All rights reserved."
|
|
|
|
|
|
|
|
/* ydb functions used by loader
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// When the loader is created, it makes this call.
|
|
|
|
// For each dictionary to be loaded, replace old iname in directory
|
|
|
|
// with a newly generated iname. This will also take a write lock
|
|
|
|
// on the directory entries. The write lock will be released when
|
|
|
|
// the transaction of the loader is completed.
|
|
|
|
// If the transaction commits, the new inames are in place.
|
|
|
|
// If the transaction aborts, the old inames will be restored.
|
|
|
|
// The new inames are returned to the caller.
|
|
|
|
// It is the caller's responsibility to free them.
|
2013-04-16 23:59:35 -04:00
|
|
|
// If "mark_as_loader" is true, then include a mark in the iname
|
|
|
|
// to indicate that the file is created by the brt loader.
|
2013-04-16 23:58:59 -04:00
|
|
|
// Return 0 on success (could fail if write lock not available).
|
2013-04-16 23:59:01 -04:00
|
|
|
int ydb_load_inames(DB_ENV * env,
|
|
|
|
DB_TXN * txn,
|
|
|
|
int N,
|
|
|
|
DB * dbs[/*N*/],
|
2013-04-16 23:59:05 -04:00
|
|
|
/*out*/ char * new_inames_in_env[N],
|
2013-04-16 23:59:35 -04:00
|
|
|
LSN *load_lsn,
|
|
|
|
BOOL mark_as_loader);
|
2013-04-16 23:58:59 -04:00
|
|
|
|
2013-04-16 23:59:03 -04:00
|
|
|
// Wrapper to ydb_load_inames if you are not holding the ydb lock.
|
|
|
|
int locked_ydb_load_inames(DB_ENV * env,
|
|
|
|
DB_TXN * txn,
|
|
|
|
int N,
|
|
|
|
DB * dbs[/*N*/],
|
2013-04-16 23:59:05 -04:00
|
|
|
/*out*/ char * new_inames_in_env[N],
|
2013-04-16 23:59:35 -04:00
|
|
|
LSN *load_lsn,
|
|
|
|
BOOL mark_as_loader);
|
|
|
|
|
2013-04-16 23:59:03 -04:00
|
|
|
|
2013-04-16 23:58:59 -04:00
|
|
|
|
|
|
|
#endif
|