#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."
/* In the past, leaves simply contained key-value pairs.
/*
* In this implementatoin, leaf values are more complex
* Header file for Leafentries
* They can contain a committed value:
* - Which can be "not-present",
* - Or a key-value pair.
* They can contain a provisional value, which depends on whether a particular transaction commits or aborts.
* - A not-present value
* - Or a key-value pair.
* - Or there can be no provisional value at all (that is, the value doesn't depend on the transaction.)
* Note that if both the provisional value and the committed value are not-present, then there is simply no entry in the leaf.
* So let's enumerate the possibilities:
* committed pair A committed pair unaffected by any incomplete transaction.
* committed pair and provisional pair A committed pair to provisionally be replaced by a new pair.
* committed pair and provisional delete A committed pair that will be deleted
* provisional pair No committed pair, but if a provisional pair to add.
*
* In the case of a committed pair and a provisional pair, the key is the same in both cases. The value can be different.
*
* For DUPSORT databases, the key-value pair is everything, so we need only represent the key-value pair once. So the cases are
* committed pair
* committed pair provisionally deleted
* provisional pair
* The case of a committed pair and a provisional pair can be represented by a committed pair, since it doesn't matter whether the transction aborts or commits, the value is the same.
*/
*/
#include <toku_portability.h>
#include <toku_portability.h>
...
@@ -63,6 +42,12 @@ extern "C" {
...
@@ -63,6 +42,12 @@ extern "C" {
#if TOKU_WINDOWS
#if TOKU_WINDOWS
#pragma pack(push, 1)
#pragma pack(push, 1)
#endif
#endif
//
// enum of possible values for LEAFENTRY->type field
UXR_Suxrs_static[MAX_TRANSACTION_RECORDS*2];// uxrs[0] is oldest committed (txn commit time, not txn start time), uxrs[num_cuxrs] is outermost provisional value (if any exist/num_puxrs > 0)
UXR_Suxrs_static[MAX_TRANSACTION_RECORDS*2];// uxrs[0] is oldest committed (txn commit time, not txn start time), uxrs[num_cuxrs] is outermost provisional value (if any exist/num_puxrs > 0)
UXRuxrs;//If num_cuxrs < MAX_TRANSACTION_RECORDS then &uxrs_static[0].
UXRuxrs;//If num_cuxrs < MAX_TRANSACTION_RECORDS then uxrs = &uxrs_static[0].
//Otherwise we use a dynamically allocated array of size num_cuxrs + 1 + MAX_TRANSATION_RECORD.
//Otherwise we use a dynamically allocated array of size num_cuxrs + 1 + MAX_TRANSATION_RECORD.
//Felt that MAX_TRANSACTION_RECORD was good upper bound for number of committed UXRs we would be willing to allocate off stack.