#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."
#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."
// Effect: If the block is in the cachetable, then return it.
// Effect: If the block is in the cachetable, then return it.
// Otherwise call the functions in unlockers, fetch the data (but don't pin it, since we'll just end up pinning it again later), and return TOKUDB_TRY_AGAIN.
// Otherwise call the functions in unlockers, fetch the data (but don't pin it, since we'll just end up pinning it again later), and return TOKUDB_TRY_AGAIN.
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."
#include "fttypes.h"
#include "ft/fttypes.h"
#include "xids-internal.h"
#include "ft/xids-internal.h"
#include "xids.h"
#include "ft/xids.h"
#include "ft/ft_msg.h"
// If the fifo_entry is unpacked, the compiler aligns the xids array and we waste a lot of space
// If the fifo_entry is unpacked, the compiler aligns the xids array and we waste a lot of space
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."
#include <fttypes.h>
#include "ft/ft-internal.h"
#include "cachetable.h"
#include "ft/cachetable.h"
/**
/**
* Put an empty node (that is, no fields filled) into the cachetable.
* Put an empty node (that is, no fields filled) into the cachetable.
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."
// This must be first to make the 64-bit file mode work right in Linux
#include "ft/ft-internal.h"
#include "fttypes.h"
typedefenum{
typedefenum{
FT_FLUSHER_CLEANER_TOTAL_NODES=0,// total number of nodes whose buffers are potentially flushed by cleaner thread
FT_FLUSHER_CLEANER_TOTAL_NODES=0,// total number of nodes whose buffers are potentially flushed by cleaner thread
FTNODEnode;// This is the root node if next is NULL.
FTNODEnode;// This is the root node if next is NULL.
intchildnum;// which buffer holds messages destined to the node whose ancestors this list represents.
intchildnum;// which buffer holds messages destined to the node whose ancestors this list represents.
ANCESTORSnext;// Parent of this node (so next->node.(next->childnum) refers to this node).
structancestors*next;// Parent of this node (so next->node.(next->childnum) refers to this node).
};
};
typedefstructancestors*ANCESTORS;
structpivot_bounds{
structpivot_bounds{
constDBT*constlower_bound_exclusive;
constDBT*constlower_bound_exclusive;
constDBT*constupper_bound_inclusive;// NULL to indicate negative or positive infinity (which are in practice exclusive since there are now transfinite keys in messages).
constDBT*constupper_bound_inclusive;// NULL to indicate negative or positive infinity (which are in practice exclusive since there are now transfinite keys in messages).
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."
/* tree command types */
enumft_msg_type{
FT_NONE=0,
FT_INSERT=1,
FT_DELETE_ANY=2,// Delete any matching key. This used to be called FT_DELETE.
//FT_DELETE_BOTH = 3,
FT_ABORT_ANY=4,// Abort any commands on any matching key.
//FT_ABORT_BOTH = 5, // Abort commands that match both the key and the value
FT_COMMIT_ANY=6,
//FT_COMMIT_BOTH = 7,
FT_COMMIT_BROADCAST_ALL=8,// Broadcast to all leafentries, (commit all transactions).
FT_COMMIT_BROADCAST_TXN=9,// Broadcast to all leafentries, (commit specific transaction).
FT_ABORT_BROADCAST_TXN=10,// Broadcast to all leafentries, (commit specific transaction).
FT_INSERT_NO_OVERWRITE=11,
FT_OPTIMIZE=12,// Broadcast
FT_OPTIMIZE_FOR_UPGRADE=13,// same as FT_OPTIMIZE, but record version number in leafnode
FT_UPDATE=14,
FT_UPDATE_BROADCAST_ALL=15
};
staticinlinebool
ft_msg_type_applies_once(enumft_msg_typetype)
{
boolret_val;
switch(type){
caseFT_INSERT_NO_OVERWRITE:
caseFT_INSERT:
caseFT_DELETE_ANY:
caseFT_ABORT_ANY:
caseFT_COMMIT_ANY:
caseFT_UPDATE:
ret_val=true;
break;
caseFT_COMMIT_BROADCAST_ALL:
caseFT_COMMIT_BROADCAST_TXN:
caseFT_ABORT_BROADCAST_TXN:
caseFT_OPTIMIZE:
caseFT_OPTIMIZE_FOR_UPGRADE:
caseFT_UPDATE_BROADCAST_ALL:
caseFT_NONE:
ret_val=false;
break;
default:
assert(false);
}
returnret_val;
}
staticinlinebool
ft_msg_type_applies_all(enumft_msg_typetype)
{
boolret_val;
switch(type){
caseFT_NONE:
caseFT_INSERT_NO_OVERWRITE:
caseFT_INSERT:
caseFT_DELETE_ANY:
caseFT_ABORT_ANY:
caseFT_COMMIT_ANY:
caseFT_UPDATE:
ret_val=false;
break;
caseFT_COMMIT_BROADCAST_ALL:
caseFT_COMMIT_BROADCAST_TXN:
caseFT_ABORT_BROADCAST_TXN:
caseFT_OPTIMIZE:
caseFT_OPTIMIZE_FOR_UPGRADE:
caseFT_UPDATE_BROADCAST_ALL:
ret_val=true;
break;
default:
assert(false);
}
returnret_val;
}
staticinlinebool
ft_msg_type_does_nothing(enumft_msg_typetype)
{
return(type==FT_NONE);
}
typedefstructxids_t*XIDS;
/* tree commands */
structft_msg{
enumft_msg_typetype;
MSNmsn;// message sequence number
XIDSxids;
union{
/* insert or delete */
structft_msg_insert_delete{
constDBT*key;// for insert, delete, upsertdel
constDBT*val;// for insert, delete, (and it is the "extra" for upsertdel, upsertdel_broadcast_all)
}id;
}u;
};
// Message sent into the ft to implement insert, delete, update, etc
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."
#include "ft/cachetable.h"
// The loader callbacks are C functions and need to be defined as such
// The loader callbacks are C functions and need to be defined as such
#ident "Copyright (c) 2010-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2010-2013 Tokutek Inc. All rights reserved."
#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."
#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."
#include "ft.h"
#include "ft/ft.h"
#include "ft-internal.h"
#include "ft/ft-internal.h"
#include "le-cursor.h"
#include "ft/le-cursor.h"
#include "ft/cursor.h"
// A LE_CURSOR is a special purpose FT_CURSOR that:
// A LE_CURSOR is a special purpose FT_CURSOR that:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#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."
#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."