2013-04-16 23:59:01 -04:00
/* -*- mode: C; c-basic-offset: 4 -*- */
2013-04-16 23:59:09 -04:00
# ifndef TOKU_BRT_LOADER_H
# define TOKU_BRT_LOADER_H
2013-04-16 23:59:01 -04:00
2013-04-16 23:59:11 -04:00
# ident "$Id$"
2013-04-16 23:59:09 -04:00
# ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
2013-04-16 23:59:11 -04:00
# ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11 / 760379 and to the patents and / or patent applications resulting from it."
2013-04-16 23:59:09 -04:00
# if defined(__cplusplus) || defined(__cilkplusplus)
extern " C " {
# endif
// The loader callbacks are C functions and need to be defined as such
typedef void ( * brt_loader_error_func ) ( DB * , int which_db , int err , DBT * key , DBT * val , void * extra ) ;
typedef int ( * brt_loader_poll_func ) ( void * extra , float progress ) ;
2013-04-16 23:59:01 -04:00
typedef struct brtloader_s * BRTLOADER ;
2013-04-16 23:59:09 -04:00
2013-04-16 23:59:01 -04:00
int toku_brt_loader_open ( BRTLOADER * bl ,
2013-04-16 23:59:03 -04:00
CACHETABLE cachetable ,
2013-04-16 23:59:01 -04:00
generate_row_for_put_func g ,
DB * src_db ,
int N ,
DB * dbs [ /*N*/ ] ,
const struct descriptor * descriptors [ /*N*/ ] ,
const char * new_fnames_in_env [ /*N*/ ] ,
brt_compare_func bt_compare_functions [ /*N*/ ] ,
2013-04-16 23:59:05 -04:00
const char * temp_file_template ,
LSN load_lsn ) ;
2013-04-16 23:59:09 -04:00
2013-04-16 23:59:01 -04:00
int toku_brt_loader_put ( BRTLOADER bl , DBT * key , DBT * val ) ;
2013-04-16 23:59:09 -04:00
2013-04-16 23:59:03 -04:00
int toku_brt_loader_close ( BRTLOADER bl ,
2013-04-16 23:59:09 -04:00
brt_loader_error_func error_callback , void * error_callback_extra ,
brt_loader_poll_func poll_callback , void * poll_callback_extra ) ;
2013-04-16 23:59:04 -04:00
int toku_brt_loader_abort ( BRTLOADER bl ,
BOOL is_error ) ;
2013-04-16 23:59:03 -04:00
void brtloader_set_os_fwrite ( size_t ( * fwrite_fun ) ( const void * , size_t , size_t , FILE * ) ) ;
2013-04-16 23:59:01 -04:00
2013-04-16 23:59:11 -04:00
// For test purposes only
void toku_brtloader_set_size_factor ( uint32_t factor ) ;
2013-04-16 23:59:12 -04:00
// For test purposes only. (In production, the rowset size is determined by negotation with the cachetable for some memory. See #2613.)
uint64_t toku_brtloader_get_rowset_budget_for_testing ( void ) ;
2013-04-16 23:59:11 -04:00
2013-04-16 23:59:12 -04:00
int toku_brt_loader_finish_extractor ( BRTLOADER bl ) ;
int toku_brt_loader_get_error ( BRTLOADER bl , int * loader_errno ) ;
2013-04-16 23:59:11 -04:00
2013-04-16 23:59:09 -04:00
# if defined(__cplusplus) || defined(__cilkplusplus)
2013-04-16 23:59:12 -04:00
}
2013-04-16 23:59:09 -04:00
# endif
2013-04-16 23:59:01 -04:00
# endif // BRTLOADER_H