InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Index Class Reference

create INDEX object More...

#include <Index.h>

Collaboration diagram for Index:

Public Member Functions

 Index ()
 
virtual ~Index ()
 
void makeindex (indextype_e indextypearg, fieldtype_e fieldtypearg)
 in lieu of constructor, creates Index object More...
 
template<typename T >
void getequal (T input, std::vector< indexEntry_s > *returnEntries)
 return index entries matching equality expression More...
 
template<typename T >
void getin (T input, vector< indexEntry_s > *returnEntries)
 return index entries matching IN expression More...
 
void getnotequal (int64_t input, vector< indexEntry_s > *returnEntries)
 return index entries matching inequality expression More...
 
void getnotequal (uint64_t input, vector< indexEntry_s > *returnEntries)
 return index entries matching inequality expression More...
 
void getnotequal (bool input, vector< indexEntry_s > *returnEntries)
 return index entries matching inequality expression More...
 
void getnotequal (long double input, vector< indexEntry_s > *returnEntries)
 return index entries matching inequality expression More...
 
void getnotequal (char input, vector< indexEntry_s > *returnEntries)
 return index entries matching inequality expression More...
 
void getnotequal (string input, vector< indexEntry_s > *returnEntries)
 return index entries matching inequality expression More...
 
void getnotnulls (vector< indexEntry_s > *returnEntries)
 return all non-NULL entries More...
 
void comparison (int64_t input, operatortypes_e op, vector< indexEntry_s > *returnEntries)
 return index entries matching <,>,<=, or >= expression More...
 
void comparison (uint64_t input, operatortypes_e op, vector< indexEntry_s > *returnEntries)
 return index entries matching <,>,<=, or >= expression More...
 
void comparison (bool input, operatortypes_e op, vector< indexEntry_s > *returnEntries)
 return index entries matching <,>,<=, or >= expression More...
 
void comparison (long double input, operatortypes_e op, vector< indexEntry_s > *returnEntries)
 return index entries matching <,>,<=, or >= expression More...
 
void comparison (char input, operatortypes_e op, vector< indexEntry_s > *returnEntries)
 return index entries matching <,>,<=, or >= expression More...
 
void comparison (string *input, operatortypes_e op, vector< indexEntry_s > *returnEntries)
 return index entries matching <,>,<=, or >= expression More...
 
void between (int64_t lower, int64_t upper, vector< indexEntry_s > *returnEntries)
 return index entries matching BETWEEN expression More...
 
void between (uint64_t lower, uint64_t upper, vector< indexEntry_s > *returnEntries)
 return index entries matching BETWEEN expression More...
 
void between (bool lower, bool upper, vector< indexEntry_s > *returnEntries)
 return index entries matching BETWEEN expression More...
 
void between (long double lower, long double upper, vector< indexEntry_s > *returnEntries)
 return index entries matching BETWEEN expression More...
 
void between (char lower, char upper, vector< indexEntry_s > *returnEntries)
 return index entries matching BETWEEN expression More...
 
void between (string lower, string upper, vector< indexEntry_s > *returnEntries)
 return index entries matching BETWEEN expression More...
 
template<class T >
void notbetween (T lower, T upper, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT BETWEEN expression More...
 
void regex (string *regexStr, vector< indexEntry_s > *returnEntries)
 return index entries matching regex search More...
 
void like (string &likeStr, vector< indexEntry_s > *returnEntries)
 return index entries matching LIKE search More...
 
void notlike (string &likeStr, vector< indexEntry_s > *returnEntries)
 return index entries maching NOT LIKE search More...
 
void getnotin (vector< int64_t > &entries, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT IN expression More...
 
void getnotin (vector< uint64_t > &entries, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT IN expression More...
 
void getnotin (vector< bool > &entries, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT IN expression More...
 
void getnotin (vector< long double > &entries, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT IN expression More...
 
void getnotin (vector< char > &entries, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT IN expression More...
 
void getnotin (vector< string > &entries, vector< indexEntry_s > *returnEntries)
 return index entries matching NOT IN expression More...
 
void commitRollback (int64_t input, int64_t subtransactionid, enginecmd_e cmd)
 commit or rollback entry More...
 
void commitRollback (uint64_t input, int64_t subtransactionid, enginecmd_e cmd)
 commit or rollback entry More...
 
void commitRollback (bool input, int64_t subtransactionid, enginecmd_e cmd)
 commit or rollback entry More...
 
void commitRollback (long double input, int64_t subtransactionid, enginecmd_e cmd)
 commit or rollback entry More...
 
void commitRollback (char input, int64_t subtransactionid, enginecmd_e cmd)
 commit or rollback entry More...
 
void commitRollback (string input, int64_t subtransactionid, enginecmd_e cmd)
 commit or rollback entry More...
 
void replaceUnique (int64_t newrowid, int64_t newengineid, int64_t input)
 replace index value More...
 
void replaceUnique (int64_t newrowid, int64_t newengineid, uint64_t input)
 replace index value More...
 
void replaceUnique (int64_t newrowid, int64_t newengineid, bool input)
 replace index value More...
 
void replaceUnique (int64_t newrowid, int64_t newengineid, long double input)
 replace index value More...
 
void replaceUnique (int64_t newrowid, int64_t newengineid, char input)
 replace index value More...
 
void replaceUnique (int64_t newrowid, int64_t newengineid, string &input)
 replace index value More...
 
void replaceNonunique (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid, int64_t input)
 replace index value in non-unique index More...
 
void replaceNonunique (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid, uint64_t input)
 replace index value in non-unique index More...
 
void replaceNonunique (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid, bool input)
 replace index value in non-unique index More...
 
void replaceNonunique (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid, long double input)
 replace index value in non-unique index More...
 
void replaceNonunique (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid, char input)
 replace index value in non-unique index More...
 
void replaceNonunique (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid, string &input)
 replace index value in non-unique index More...
 
void replaceNull (int64_t oldrowid, int64_t oldengineid, int64_t newrowid, int64_t newengineid)
 replace NULL entry More...
 
void getnulls (vector< indexEntry_s > *returnEntries)
 return index entries matching IS NULL expression More...
 
void insertNonuniqueEntry (int64_t entry, int64_t rowid, int64_t engineid)
 insert entry into non-unique index More...
 
void insertNonuniqueEntry (uint64_t entry, int64_t rowid, int64_t engineid)
 insert entry into non-unique index More...
 
void insertNonuniqueEntry (bool entry, int64_t rowid, int64_t engineid)
 insert entry into non-unique index More...
 
void insertNonuniqueEntry (long double entry, int64_t rowid, int64_t engineid)
 insert entry into non-unique index More...
 
void insertNonuniqueEntry (char entry, int64_t rowid, int64_t engineid)
 insert entry into non-unique index More...
 
void insertNonuniqueEntry (string *entry, int64_t rowid, int64_t engineid)
 insert entry into non-unique index More...
 
void deleteNonuniqueEntry (int64_t entry, int64_t rowid, int64_t engineid)
 delete entry from non-unique index More...
 
void deleteNonuniqueEntry (uint64_t entry, int64_t rowid, int64_t engineid)
 delete entry from non-unique index More...
 
void deleteNonuniqueEntry (bool entry, int64_t rowid, int64_t engineid)
 delete entry from non-unique index More...
 
void deleteNonuniqueEntry (long double entry, int64_t rowid, int64_t engineid)
 delete entry from non-unique index More...
 
void deleteNonuniqueEntry (char entry, int64_t rowid, int64_t engineid)
 delete entry from non-unique index More...
 
void deleteNonuniqueEntry (string *engry, int64_t rowid, int64_t engineid)
 delete entry from non-unique index More...
 
void deleteUniqueEntry (int64_t entry)
 delete entry from unique index More...
 
void deleteUniqueEntry (uint64_t entry)
 delete entry from unique index More...
 
void deleteUniqueEntry (bool entry)
 delete entry from unique index More...
 
void deleteUniqueEntry (long double entry)
 delete entry from unique index More...
 
void deleteUniqueEntry (char entry)
 delete entry from unique index More...
 
void deleteUniqueEntry (string *entry)
 delete entry from unique index More...
 
void insertNullEntry (int64_t rowid, int64_t engineid)
 insert entry with NULL value More...
 
void deleteNullEntry (int64_t rowid, int64_t engineid)
 delete entry with NULL value More...
 
void getall (vector< indexEntry_s > *returnEntries)
 SELECT *. More...
 
locktype_e checkAndLock (int64_t entry, int64_t rowid, int64_t engineid, int64_t subtransactionid, int64_t pendingcmdid, int64_t tacmdentrypoint)
 (not used 12/22/13) check existence of entry and lock More...
 
locktype_e checkAndLock (uint64_t entry, int64_t rowid, int64_t engineid, int64_t subtransactionid, int64_t pendingcmdid, int64_t tacmdentrypoint)
 (not used 12/22/13) check existence of entry and lock More...
 
locktype_e checkAndLock (bool entry, int64_t rowid, int64_t engineid, int64_t subtransactionid, int64_t pendingcmdid, int64_t tacmdentrypoint)
 (not used 12/22/13) check existence of entry and lock More...
 
locktype_e checkAndLock (long double entry, int64_t rowid, int64_t engineid, int64_t subtransactionid, int64_t pendingcmdid, int64_t tacmdentrypoint)
 (not used 12/22/13) check existence of entry and lock More...
 
locktype_e checkAndLock (char entry, int64_t rowid, int64_t engineid, int64_t subtransactionid, int64_t pendingcmdid, int64_t tacmdentrypoint)
 (not used 12/22/13) check existence of entry and lock More...
 
locktype_e checkAndLock (string *entry, int64_t rowid, int64_t engineid, int64_t subtransactionid, int64_t pendingcmdid, int64_t tacmdentrypoint)
 (not used 12/22/13) check existence of entry and lock More...
 
void getequal_f (int64_t entry, vector< indexEntry_s > *returnEntries)
 perform activity to check for equality More...
 
void getequal_f (uint64_t entry, vector< indexEntry_s > *returnEntries)
 perform activity to check for equality More...
 
void getequal_f (bool entry, vector< indexEntry_s > *returnEntries)
 perform activity to check for equality More...
 
void getequal_f (long double entry, vector< indexEntry_s > *returnEntries)
 perform activity to check for equality More...
 
void getequal_f (char entry, vector< indexEntry_s > *returnEntries)
 perform activity to check for equality More...
 
void getequal_f (string entry, vector< indexEntry_s > *returnEntries)
 perform activity to check for equality More...
 
bool addifnotthere (fieldValue_s &val, int64_t rowid, int16_t engineid, int64_t subtransactionid)
 create index entry as part of synchronous replication More...
 
bool checkifthere (fieldValue_s &val)
 check for entry as part of synchronous replication More...
 
bool checkifthere (int64_t val)
 check for entry as part of synchronous replication More...
 
bool checkifthere (uint64_t val)
 check for entry as part of synchronous replication More...
 
bool checkifthere (bool val)
 check for entry as part of synchronous replication More...
 
bool checkifthere (long double val)
 check for entry as part of synchronous replication More...
 
bool checkifthere (char val)
 check for entry as part of synchronous replication More...
 
bool checkifthere (string &val)
 check for entry as part of synchronous replication More...
 
bool checkifmatch (fieldValue_s &val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
bool checkifmatch (int64_t val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
bool checkifmatch (uint64_t val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
bool checkifmatch (bool val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
bool checkifmatch (long double val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
bool checkifmatch (char val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
bool checkifmatch (string &val, int64_t rowid, int64_t engineid)
 check if entry matches row as part of synchronous replication More...
 
void rm (fieldValue_s &val)
 delete entry as part of synchronous replication More...
 
void rm (int64_t val)
 delete entry as part of synchronous replication More...
 
void rm (uint64_t val)
 delete entry as part of synchronous replication More...
 
void rm (bool val)
 delete entry as part of synchronous replication More...
 
void rm (long double val)
 delete entry as part of synchronous replication More...
 
void rm (char val)
 delete entry as part of synchronous replication More...
 
void rm (string &val)
 delete entry as part of synchronous replication More...
 
int64_t getprevioussubtransactionid (fieldValue_s &val)
 return previous subtransactionid for field More...
 
int64_t getprevioussubtransactionid (int64_t val)
 
int64_t getprevioussubtransactionid (uint64_t val)
 
int64_t getprevioussubtransactionid (bool val)
 
int64_t getprevioussubtransactionid (long double val)
 
int64_t getprevioussubtransactionid (char val)
 
int64_t getprevioussubtransactionid (string &val)
 
template<class T , class U , class V >
void getIterators (string *regexStr, T mapPtr, U itBegin, V itEnd)
 set iterators part of regex query More...
 

Public Attributes

indextype_e indextype
 
fieldtype_e fieldtype
 
maptype_e maptype
 
bool notNull
 
bool isunique
 
indexmaptype_e indexmaptype
 
uniqueIntMapuniqueIntIndex
 
nonuniqueIntMapnonuniqueIntIndex
 
unorderedIntMapunorderedIntIndex
 
uniqueUintMapuniqueUintIndex
 
nonuniqueUintMapnonuniqueUintIndex
 
unorderedUintMapunorderedUintIndex
 
uniqueBoolMapuniqueBoolIndex
 
nonuniqueBoolMapnonuniqueBoolIndex
 
unorderedBoolMapunorderedBoolIndex
 
uniqueFloatMapuniqueFloatIndex
 
nonuniqueFloatMapnonuniqueFloatIndex
 
unorderedFloatMapunorderedFloatIndex
 
uniqueCharMapuniqueCharIndex
 
nonuniqueCharMapnonuniqueCharIndex
 
unorderedCharMapunorderedCharIndex
 
uniqueStringMapuniqueStringIndex
 
nonuniqueStringMapnonuniqueStringIndex
 
unorderedStringMapunorderedStringIndex
 
unorderedIntMapintIndexShadow
 
unorderedUintMapuintIndexShadow
 
unorderedBoolMapboolIndexShadow
 
unorderedFloatMapfloatIndexShadow
 
unorderedCharMapcharIndexShadow
 
unorderedStringMapstringIndexShadow
 
boost::unordered_map< int64_t,
std::queue
< lockQueueIndexEntry > > * 
intLockQueue
 
boost::unordered_map< uint64_t,
std::queue
< lockQueueIndexEntry > > * 
uintLockQueue
 
boost::unordered_map< bool,
std::queue
< lockQueueIndexEntry > > * 
boolLockQueue
 
boost::unordered_map< long
double, std::queue
< lockQueueIndexEntry > > * 
floatLockQueue
 
boost::unordered_map< char,
std::queue
< lockQueueIndexEntry > > * 
charLockQueue
 
boost::unordered_map
< std::string, std::queue
< lockQueueIndexEntry > > * 
stringLockQueue
 
boost::unordered_set< vector
< int64_t > > 
nulls
 

Friends

class Transaction
 
class Field
 
class SubTransaction
 

Detailed Description

create INDEX object

Each field has optionally 1 index associated well, upon creation, the following should always be knowable: type,tableid,simple

Definition at line 85 of file Index.h.

Constructor & Destructor Documentation

Index::Index ( )

Definition at line 31 of file Index.cc.

32  maptype (Nomaptype), notNull (true), isunique (true),
34  nonuniqueIntIndex (NULL), unorderedIntIndex (NULL),
35  uniqueUintIndex (NULL), nonuniqueUintIndex (NULL),
36  unorderedUintIndex (NULL), uniqueBoolIndex (NULL),
39  unorderedFloatIndex (NULL), uniqueCharIndex (NULL),
42  unorderedStringIndex (NULL), intIndexShadow (NULL),
43  uintIndexShadow (NULL), boolIndexShadow (NULL),
44  floatIndexShadow (NULL), charIndexShadow (NULL),
45  stringIndexShadow (NULL), intLockQueue (NULL),
46  uintLockQueue (NULL), boolLockQueue (NULL),
47  floatLockQueue (NULL), charLockQueue (NULL),
48  stringLockQueue (NULL)
49 {
50  ;
51 }
Index::~Index ( )
virtual

Definition at line 264 of file Index.cc.

265 {
266 }

Member Function Documentation

bool Index::addifnotthere ( fieldValue_s val,
int64_t  rowid,
int16_t  engineid,
int64_t  subtransactionid 
)

create index entry as part of synchronous replication

Parameters
valfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
Returns

Definition at line 4954 of file Index.cc.

References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, checkifthere(), fieldtype, FLOAT, fieldInput_u::floating, indexmaptype, INT, fieldInput_u::integer, fieldValue_s::str, UINT, fieldInput_u::uinteger, uniquebool, uniqueBoolIndex, uniquechar, uniqueCharIndex, uniquecharx, uniquefloat, uniqueFloatIndex, uniqueint, uniqueIntIndex, uniqueStringIndex, uniqueuint, uniqueUintIndex, uniquevarchar, unorderedbool, unorderedBoolIndex, unorderedchar, unorderedCharIndex, unorderedcharx, unorderedfloat, unorderedFloatIndex, unorderedint, unorderedIntIndex, unorderedStringIndex, unordereduint, unorderedUintIndex, unorderedvarchar, fieldValue_s::value, and VARCHAR.

Referenced by Engine::applyItem().

4956 {
4957  switch (fieldtype)
4958  {
4959  case INT:
4960  if (checkifthere(val.value.integer)==true)
4961  {
4962  return false;
4963  }
4964 
4965  break;
4966 
4967  case UINT:
4968  if (checkifthere(val.value.uinteger)==true)
4969  {
4970  return false;
4971  }
4972 
4973  break;
4974 
4975  case BOOL:
4976  if (checkifthere(val.value.boolean)==true)
4977  {
4978  return false;
4979  }
4980 
4981  break;
4982 
4983  case FLOAT:
4984  if (checkifthere(val.value.floating)==true)
4985  {
4986  return false;
4987  }
4988 
4989  break;
4990 
4991  case CHAR:
4992  if (checkifthere(val.value.character)==true)
4993  {
4994  return false;
4995  }
4996 
4997  break;
4998 
4999  case CHARX:
5000  if (checkifthere(val.str)==true)
5001  {
5002  return false;
5003  }
5004 
5005  break;
5006 
5007  case VARCHAR:
5008  if (checkifthere(val.str)==true)
5009  {
5010  return false;
5011  }
5012 
5013  break;
5014 
5015  default:
5016  printf("%s %i anomaly fieldtype %i\n", __FILE__, __LINE__, fieldtype);
5017  }
5018 
5019  lockingIndexEntry entry = {rowid, engineid, 0, subtransactionid};
5020 
5021  switch (indexmaptype)
5022  {
5023  case uniqueint:
5024  uniqueIntIndex->operator [](val.value.integer) = entry;
5025  break;
5026 
5027  case unorderedint:
5028  unorderedIntIndex->operator [](val.value.integer) = entry;
5029  break;
5030 
5031  case uniqueuint:
5032  uniqueUintIndex->operator [](val.value.uinteger) = entry;
5033  break;
5034 
5035  case unordereduint:
5036  unorderedUintIndex->operator [](val.value.uinteger) = entry;
5037  break;
5038 
5039  case uniquebool:
5040  uniqueBoolIndex->operator [](val.value.boolean) = entry;
5041  break;
5042 
5043  case unorderedbool:
5044  unorderedBoolIndex->operator [](val.value.boolean) = entry;
5045  break;
5046 
5047  case uniquefloat:
5048  uniqueFloatIndex->operator [](val.value.floating) = entry;
5049  break;
5050 
5051  case unorderedfloat:
5052  unorderedFloatIndex->operator [](val.value.floating) = entry;
5053  break;
5054 
5055  case uniquechar:
5056  uniqueCharIndex->operator [](val.value.character) = entry;
5057  break;
5058 
5059  case unorderedchar:
5060  unorderedCharIndex->operator [](val.value.character) = entry;
5061  break;
5062 
5063  case uniquecharx:
5064  uniqueStringIndex->operator [](val.str) = entry;
5065  break;
5066 
5067  case unorderedcharx:
5068  unorderedStringIndex->operator [](val.str) = entry;
5069  break;
5070 
5071  case uniquevarchar:
5072  uniqueStringIndex->operator [](val.str) = entry;
5073  break;
5074 
5075  case unorderedvarchar:
5076  unorderedStringIndex->operator [](val.str) = entry;
5077  break;
5078 
5079  default:
5080  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5081  indexmaptype);
5082  }
5083 
5084  return true;
5085 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Index::between ( int64_t  lower,
int64_t  upper,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching BETWEEN expression

BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> BETWEEN lower AND upper" is equivalent to: "<fieldvalue> >= lower AND <fieldvalue> <= upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 2537 of file Index.cc.

References indexmaptype, logfile, nonuniqueint, nonuniqueIntIndex, uniqueint, and uniqueIntIndex.

Referenced by SubTransaction::indexSearch().

2539 {
2540  switch (indexmaptype)
2541  {
2542  case uniqueint:
2543  {
2544  uniqueIntMap &mapRef = *uniqueIntIndex;
2545 
2546  if (lower==upper)
2547  {
2548  if (mapRef.count(lower))
2549  {
2550  returnEntries->push_back({mapRef[lower].rowid,
2551  mapRef[lower].engineid});
2552  }
2553 
2554  return;
2555  }
2556 
2557  if (lower>upper)
2558  {
2559  return;
2560  }
2561 
2562  uniqueIntMap::const_iterator it;
2563 
2564  for (it = mapRef.lower_bound(lower); it != mapRef.lower_bound(upper);
2565  ++it)
2566  {
2567  returnEntries->push_back({it->second.rowid, it->second.engineid});
2568  }
2569 
2570  if (mapRef.count(upper))
2571  {
2572  returnEntries->push_back({mapRef[upper].rowid,
2573  mapRef[upper].engineid});
2574  }
2575  }
2576  break;
2577 
2578  case nonuniqueint:
2579  {
2580  if (lower>upper)
2581  {
2582  return;
2583  }
2584 
2585  nonuniqueIntMap::iterator it;
2586 
2587  for (it = nonuniqueIntIndex->lower_bound(lower);
2588  it != nonuniqueIntIndex->upper_bound(upper); ++it)
2589  {
2590  if (it->first <= upper)
2591  {
2592  returnEntries->push_back({it->second.rowid,
2593  it->second.engineid});
2594  }
2595  }
2596  }
2597  break;
2598 
2599  default:
2600  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2601  }
2602 }

Here is the caller graph for this function:

void Index::between ( uint64_t  lower,
uint64_t  upper,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching BETWEEN expression

BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> BETWEEN lower AND upper" is equivalent to: "<fieldvalue> >= lower AND <fieldvalue> <= upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 2604 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniqueuint, nonuniqueUintIndex, nonLockingIndexEntry_s::rowid, uniqueuint, and uniqueUintIndex.

2606 {
2607  switch (indexmaptype)
2608  {
2609  case uniqueuint:
2610  {
2611  uniqueUintMap::iterator itBegin, itEnd, it;
2612  itBegin = uniqueUintIndex->upper_bound(lower);
2613  itEnd = uniqueUintIndex->lower_bound(upper);
2614 
2615  if (uniqueUintIndex->count(lower))
2616  {
2617  indexEntry_s entry;
2618  entry.rowid = uniqueUintIndex->at(lower).rowid;
2619  entry.engineid = uniqueUintIndex->at(lower).engineid;
2620  returnEntries->push_back(entry);
2621  }
2622 
2623  for (it=itBegin; it != itEnd; ++it)
2624  {
2625  indexEntry_s entry;
2626  entry.rowid = it->second.rowid;
2627  entry.engineid = it->second.engineid;
2628  returnEntries->push_back(entry);
2629  }
2630  }
2631  break;
2632 
2633  case nonuniqueuint:
2634  {
2635  nonuniqueUintMap::iterator itBegin, itEnd, it;
2636  itBegin = nonuniqueUintIndex->upper_bound(lower);
2637  itEnd = nonuniqueUintIndex->lower_bound(upper);
2638 
2639  pair<multimap<uint64_t, nonLockingIndexEntry_s>::iterator,
2640  multimap<uint64_t, nonLockingIndexEntry_s>::iterator> itRange;
2641  itRange = nonuniqueUintIndex->equal_range(lower);
2642 
2643  for (it=itRange.first; it != itRange.second; ++it)
2644  {
2645  returnEntries->push_back(it->second);
2646  }
2647 
2648  for (it=itBegin; it != itEnd; ++it)
2649  {
2650  indexEntry_s entry;
2651  entry.rowid = it->second.rowid;
2652  entry.engineid = it->second.engineid;
2653  returnEntries->push_back(entry);
2654  }
2655  }
2656  break;
2657 
2658  default:
2659  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2660  }
2661 }
void Index::between ( bool  lower,
bool  upper,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching BETWEEN expression

BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> BETWEEN lower AND upper" is equivalent to: "<fieldvalue> >= lower AND <fieldvalue> <= upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 2663 of file Index.cc.

2664 {
2665  return;
2666 }
void Index::between ( long double  lower,
long double  upper,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching BETWEEN expression

BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> BETWEEN lower AND upper" is equivalent to: "<fieldvalue> >= lower AND <fieldvalue> <= upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 2669 of file Index.cc.

References indexmaptype, logfile, nonuniquefloat, nonuniqueFloatIndex, uniquefloat, and uniqueFloatIndex.

2671 {
2672  switch (indexmaptype)
2673  {
2674  case uniquefloat:
2675  {
2676  uniqueFloatMap &mapRef = *uniqueFloatIndex;
2677 
2678  if (lower==upper)
2679  {
2680  if (mapRef.count(lower))
2681  {
2682  returnEntries->push_back({mapRef[lower].rowid,
2683  mapRef[lower].engineid});
2684  }
2685 
2686  return;
2687  }
2688 
2689  if (lower>upper)
2690  {
2691  return;
2692  }
2693 
2694  uniqueFloatMap::const_iterator it;
2695 
2696  for (it = mapRef.lower_bound(lower); it != mapRef.lower_bound(upper);
2697  ++it)
2698  {
2699  returnEntries->push_back({it->second.rowid, it->second.engineid});
2700  }
2701 
2702  if (mapRef.count(upper))
2703  {
2704  returnEntries->push_back({mapRef[upper].rowid,
2705  mapRef[upper].engineid});
2706  }
2707  }
2708  break;
2709 
2710  case nonuniquefloat:
2711  {
2712  if (lower>upper)
2713  {
2714  return;
2715  }
2716 
2717  nonuniqueFloatMap::iterator it;
2718 
2719  for (it = nonuniqueFloatIndex->lower_bound(lower);
2720  it != nonuniqueFloatIndex->upper_bound(upper); ++it)
2721  {
2722  if (it->first <= upper)
2723  {
2724  returnEntries->push_back({it->second.rowid,
2725  it->second.engineid});
2726  }
2727  }
2728  }
2729  break;
2730 
2731  default:
2732  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2733  }
2734 }
void Index::between ( char  lower,
char  upper,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching BETWEEN expression

BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> BETWEEN lower AND upper" is equivalent to: "<fieldvalue> >= lower AND <fieldvalue> <= upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 2736 of file Index.cc.

References indexmaptype, logfile, nonuniquechar, nonuniqueCharIndex, uniquechar, and uniqueCharIndex.

2737 {
2738  switch (indexmaptype)
2739  {
2740  case uniquechar:
2741  {
2742  uniqueCharMap &mapRef = *uniqueCharIndex;
2743 
2744  if (lower==upper)
2745  {
2746  if (mapRef.count(lower))
2747  {
2748  returnEntries->push_back({mapRef[lower].rowid,
2749  mapRef[lower].engineid});
2750  }
2751 
2752  return;
2753  }
2754 
2755  if (lower>upper)
2756  {
2757  return;
2758  }
2759 
2760  uniqueCharMap::const_iterator it;
2761 
2762  for (it = mapRef.lower_bound(lower);
2763  it != mapRef.lower_bound(upper); ++it)
2764  {
2765  returnEntries->push_back({it->second.rowid, it->second.engineid});
2766  }
2767 
2768  if (mapRef.count(upper))
2769  {
2770  returnEntries->push_back({mapRef[upper].rowid,
2771  mapRef[upper].engineid});
2772  }
2773  }
2774  break;
2775 
2776  case nonuniquechar:
2777  {
2778  if (lower>upper)
2779  {
2780  return;
2781  }
2782 
2783  nonuniqueCharMap::iterator it;
2784 
2785  for (it = nonuniqueCharIndex->lower_bound(lower);
2786  it != nonuniqueCharIndex->upper_bound(upper); ++it)
2787  {
2788  if (it->first <= upper)
2789  {
2790  returnEntries->push_back({it->second.rowid,
2791  it->second.engineid});
2792  }
2793  }
2794  }
2795  break;
2796 
2797  default:
2798  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2799  }
2800 }
void Index::between ( string  lower,
string  upper,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching BETWEEN expression

BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> BETWEEN lower AND upper" is equivalent to: "<fieldvalue> >= lower AND <fieldvalue> <= upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 2802 of file Index.cc.

References indexmaptype, logfile, nonuniquecharx, nonuniqueStringIndex, nonuniquevarchar, trimspace(), uniquecharx, uniqueStringIndex, and uniquevarchar.

2804 {
2805  trimspace(lower);
2806  trimspace(upper);
2807 
2808  switch (indexmaptype)
2809  {
2810  case uniquecharx:
2811  {
2813 
2814  if (lower==upper)
2815  {
2816  if (mapRef.count(lower))
2817  {
2818  returnEntries->push_back({mapRef[lower].rowid,
2819  mapRef[lower].engineid});
2820  }
2821 
2822  return;
2823  }
2824 
2825  if (lower>upper)
2826  {
2827  return;
2828  }
2829 
2830  uniqueStringMap::const_iterator it;
2831 
2832  for (it = mapRef.lower_bound(lower); it != mapRef.lower_bound(upper);
2833  ++it)
2834  {
2835  returnEntries->push_back({it->second.rowid, it->second.engineid});
2836  }
2837 
2838  if (mapRef.count(upper))
2839  {
2840  returnEntries->push_back({mapRef[upper].rowid,
2841  mapRef[upper].engineid});
2842  }
2843  }
2844  break;
2845 
2846  case nonuniquecharx:
2847  {
2848  if (lower>upper)
2849  {
2850  return;
2851  }
2852 
2853  nonuniqueStringMap::iterator it;
2854 
2855  for (it = nonuniqueStringIndex->lower_bound(lower);
2856  it != nonuniqueStringIndex->upper_bound(upper); ++it)
2857  {
2858  if (it->first <= upper)
2859  {
2860  returnEntries->push_back({it->second.rowid,
2861  it->second.engineid});
2862  }
2863  }
2864  }
2865  break;
2866 
2867  case uniquevarchar:
2868  {
2870 
2871  if (lower==upper)
2872  {
2873  if (mapRef.count(lower))
2874  {
2875  returnEntries->push_back({mapRef[lower].rowid,
2876  mapRef[lower].engineid});
2877  }
2878 
2879  return;
2880  }
2881 
2882  if (lower>upper)
2883  {
2884  return;
2885  }
2886 
2887  uniqueStringMap::const_iterator it;
2888 
2889  for (it = mapRef.lower_bound(lower); it != mapRef.lower_bound(upper);
2890  ++it)
2891  {
2892  returnEntries->push_back({it->second.rowid, it->second.engineid});
2893  }
2894 
2895  if (mapRef.count(upper))
2896  {
2897  returnEntries->push_back({mapRef[upper].rowid,
2898  mapRef[upper].engineid});
2899  }
2900  }
2901  break;
2902 
2903  case nonuniquevarchar:
2904  {
2905  if (lower>upper)
2906  {
2907  return;
2908  }
2909 
2910  nonuniqueStringMap::iterator it;
2911 
2912  for (it = nonuniqueStringIndex->lower_bound(lower);
2913  it != nonuniqueStringIndex->upper_bound(upper); ++it)
2914  {
2915  if (it->first <= upper)
2916  {
2917  returnEntries->push_back({it->second.rowid,
2918  it->second.engineid});
2919  }
2920  }
2921  }
2922  break;
2923 
2924  default:
2925  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
2926  __LINE__);
2927  }
2928 }

Here is the call graph for this function:

locktype_e Index::checkAndLock ( int64_t  entry,
int64_t  rowid,
int64_t  engineid,
int64_t  subtransactionid,
int64_t  pendingcmdid,
int64_t  tacmdentrypoint 
)

(not used 12/22/13) check existence of entry and lock

creates pending lock if not acquirable

Parameters
entryfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
pendingcmdidpending command in calling Transaction
tacmdentrypointentry point for pending command
Returns
type of lock acquired (or pending)

Definition at line 269 of file Index.cc.

References lockingIndexEntry::engineid, lockQueueIndexEntry::entry, INDEXLOCK, indexmaptype, INDEXPENDINGLOCK, intLockQueue, logfile, NOLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, lockQueueIndexEntry::tacmdentrypoint, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

272 {
273  switch (indexmaptype)
274  {
275  case uniqueint:
276  if (uniqueIntIndex->count(entry))
277  {
278  if (uniqueIntIndex->at(entry).subtransactionid) // already locked
279  {
280  if (uniqueIntIndex->at(entry).subtransactionid==subtransactionid)
281  {
282  return INDEXPENDINGLOCK;
283  }
284 
285  // do pending & return
286  lockQueueIndexEntry queueEntry = {};
287  queueEntry.pendingcmdid = pendingcmdid;
288  queueEntry.tacmdentrypoint = tacmdentrypoint;
289  queueEntry.entry.engineid = engineid;
290  queueEntry.entry.rowid = rowid;
291  queueEntry.entry.subtransactionid = subtransactionid;
292  intLockQueue->at(entry).push(queueEntry);
293  return INDEXPENDINGLOCK;
294  }
295  else
296  {
297  return NOLOCK; // unique constraint violation
298  }
299  }
300  else
301  {
302  uniqueIntIndex->at(entry).rowid = rowid;
303  uniqueIntIndex->at(entry).engineid = engineid;
304  uniqueIntIndex->at(entry).subtransactionid = subtransactionid;
305  return INDEXLOCK;
306  }
307 
308  break;
309 
310  case unorderedint:
311  if (unorderedIntIndex->count(entry))
312  {
313  if (unorderedIntIndex->at(entry).subtransactionid) // already locked
314  {
315  // do pending & return
316  lockQueueIndexEntry queueEntry = {};
317  queueEntry.pendingcmdid = pendingcmdid;
318  queueEntry.tacmdentrypoint = tacmdentrypoint;
319  queueEntry.entry.engineid = engineid;
320  queueEntry.entry.rowid = rowid;
321  queueEntry.entry.subtransactionid = subtransactionid;
322  intLockQueue->at(entry).push(queueEntry);
323  return INDEXPENDINGLOCK;
324  }
325  else
326  {
327  return NOLOCK; // unique constraint violation
328  }
329  }
330  else
331  {
332  unorderedIntIndex->at(entry).rowid = rowid;
333  unorderedIntIndex->at(entry).engineid = engineid;
334  unorderedIntIndex->at(entry).subtransactionid = subtransactionid;
335  return INDEXLOCK; // intent to add an index entry
336  }
337 
338  break;
339 
340  default:
341  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
342  __LINE__);
343  }
344 
345  return NOLOCK;
346 }
locktype_e Index::checkAndLock ( uint64_t  entry,
int64_t  rowid,
int64_t  engineid,
int64_t  subtransactionid,
int64_t  pendingcmdid,
int64_t  tacmdentrypoint 
)

(not used 12/22/13) check existence of entry and lock

creates pending lock if not acquirable

Parameters
entryfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
pendingcmdidpending command in calling Transaction
tacmdentrypointentry point for pending command
Returns
type of lock acquired (or pending)

Definition at line 349 of file Index.cc.

References lockingIndexEntry::engineid, lockQueueIndexEntry::entry, INDEXLOCK, indexmaptype, INDEXPENDINGLOCK, logfile, NOLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, lockQueueIndexEntry::tacmdentrypoint, uintLockQueue, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

352 {
353  switch (indexmaptype)
354  {
355  case uniqueuint:
356  if (uniqueUintIndex->count(entry))
357  {
358  if (uniqueUintIndex->at(entry).subtransactionid) // already locked
359  {
360  if (uniqueUintIndex->at(entry).subtransactionid==
361  subtransactionid)
362  {
363  return INDEXPENDINGLOCK;
364  }
365 
366  // do pending & return
367  lockQueueIndexEntry queueEntry = {};
368  queueEntry.pendingcmdid = pendingcmdid;
369  queueEntry.tacmdentrypoint = tacmdentrypoint;
370  queueEntry.entry.engineid = engineid;
371  queueEntry.entry.rowid = rowid;
372  queueEntry.entry.subtransactionid = subtransactionid;
373  uintLockQueue->at(entry).push(queueEntry);
374  return INDEXPENDINGLOCK;
375  }
376  else
377  {
378  return NOLOCK; // unique constraint violation
379  }
380  }
381  else
382  {
383  uniqueUintIndex->at(entry).rowid = rowid;
384  uniqueUintIndex->at(entry).engineid = engineid;
385  uniqueUintIndex->at(entry).subtransactionid = subtransactionid;
386  return INDEXLOCK;
387  }
388 
389  break;
390 
391  case unordereduint:
392  if (unorderedUintIndex->count(entry))
393  {
394  if (unorderedUintIndex->at(entry).subtransactionid) // already locked
395  {
396  // do pending & return
397  lockQueueIndexEntry queueEntry = {};
398  queueEntry.pendingcmdid = pendingcmdid;
399  queueEntry.tacmdentrypoint = tacmdentrypoint;
400  queueEntry.entry.engineid = engineid;
401  queueEntry.entry.rowid = rowid;
402  queueEntry.entry.subtransactionid = subtransactionid;
403  uintLockQueue->at(entry).push(queueEntry);
404  return INDEXPENDINGLOCK;
405  }
406  else
407  {
408  return NOLOCK; // unique constraint violation
409  }
410  }
411  else
412  {
413  unorderedUintIndex->at(entry).rowid = rowid;
414  unorderedUintIndex->at(entry).engineid = engineid;
415  unorderedUintIndex->at(entry).subtransactionid = subtransactionid;
416  return INDEXLOCK;
417  }
418 
419  break;
420 
421  default:
422  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
423  __LINE__);
424  }
425 
426  return NOLOCK;
427 }
locktype_e Index::checkAndLock ( bool  entry,
int64_t  rowid,
int64_t  engineid,
int64_t  subtransactionid,
int64_t  pendingcmdid,
int64_t  tacmdentrypoint 
)

(not used 12/22/13) check existence of entry and lock

creates pending lock if not acquirable

Parameters
entryfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
pendingcmdidpending command in calling Transaction
tacmdentrypointentry point for pending command
Returns
type of lock acquired (or pending)

Definition at line 430 of file Index.cc.

References boolLockQueue, lockingIndexEntry::engineid, lockQueueIndexEntry::entry, INDEXLOCK, indexmaptype, INDEXPENDINGLOCK, logfile, NOLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, lockQueueIndexEntry::tacmdentrypoint, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

433 {
434  switch (indexmaptype)
435  {
436  case uniquebool:
437  if (uniqueBoolIndex->count(entry))
438  {
439  if (uniqueBoolIndex->at(entry).subtransactionid) // already locked
440  {
441  if (uniqueBoolIndex->at(entry).subtransactionid==
442  subtransactionid)
443  {
444  return INDEXPENDINGLOCK;
445  }
446 
447  // do pending & return
448  lockQueueIndexEntry queueEntry = {};
449  queueEntry.pendingcmdid = pendingcmdid;
450  queueEntry.tacmdentrypoint = tacmdentrypoint;
451  queueEntry.entry.engineid = engineid;
452  queueEntry.entry.rowid = rowid;
453  queueEntry.entry.subtransactionid = subtransactionid;
454  boolLockQueue->at(entry).push(queueEntry);
455  return INDEXPENDINGLOCK;
456  }
457  else
458  {
459  return NOLOCK; // unique constraint violation
460  }
461  }
462  else
463  {
464  uniqueBoolIndex->at(entry).rowid = rowid;
465  uniqueBoolIndex->at(entry).engineid = engineid;
466  uniqueBoolIndex->at(entry).subtransactionid = subtransactionid;
467  return INDEXLOCK;
468  }
469 
470  break;
471 
472  case unorderedbool:
473  if (unorderedBoolIndex->count(entry))
474  {
475  if (unorderedBoolIndex->at(entry).subtransactionid) // already locked
476  {
477  // do pending & return
478  lockQueueIndexEntry queueEntry = {};
479  queueEntry.pendingcmdid = pendingcmdid;
480  queueEntry.tacmdentrypoint = tacmdentrypoint;
481  queueEntry.entry.engineid = engineid;
482  queueEntry.entry.rowid = rowid;
483  queueEntry.entry.subtransactionid = subtransactionid;
484  boolLockQueue->at(entry).push(queueEntry);
485  return INDEXPENDINGLOCK;
486  }
487  else
488  {
489  return NOLOCK; // unique constraint violation
490  }
491  }
492  else
493  {
494  unorderedBoolIndex->at(entry).rowid = rowid;
495  unorderedBoolIndex->at(entry).engineid = engineid;
496  unorderedBoolIndex->at(entry).subtransactionid = subtransactionid;
497  return INDEXLOCK;
498  }
499 
500  break;
501 
502  default:
503  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
504  __LINE__);
505  }
506 
507  return NOLOCK;
508 }
locktype_e Index::checkAndLock ( long double  entry,
int64_t  rowid,
int64_t  engineid,
int64_t  subtransactionid,
int64_t  pendingcmdid,
int64_t  tacmdentrypoint 
)

(not used 12/22/13) check existence of entry and lock

creates pending lock if not acquirable

Parameters
entryfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
pendingcmdidpending command in calling Transaction
tacmdentrypointentry point for pending command
Returns
type of lock acquired (or pending)

Definition at line 511 of file Index.cc.

References lockingIndexEntry::engineid, lockQueueIndexEntry::entry, floatLockQueue, INDEXLOCK, indexmaptype, INDEXPENDINGLOCK, logfile, NOLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, lockQueueIndexEntry::tacmdentrypoint, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

514 {
515  switch (indexmaptype)
516  {
517  case uniquefloat:
518  if (uniqueFloatIndex->count(entry))
519  {
520  if (uniqueFloatIndex->at(entry).subtransactionid) // already locked
521  {
522  if (uniqueFloatIndex->at(entry).subtransactionid==
523  subtransactionid)
524  {
525  return INDEXPENDINGLOCK;
526  }
527 
528  // do pending & return
529  lockQueueIndexEntry queueEntry = {};
530  queueEntry.pendingcmdid = pendingcmdid;
531  queueEntry.tacmdentrypoint = tacmdentrypoint;
532  queueEntry.entry.engineid = engineid;
533  queueEntry.entry.rowid = rowid;
534  queueEntry.entry.subtransactionid = subtransactionid;
535  floatLockQueue->at(entry).push(queueEntry);
536  return INDEXPENDINGLOCK;
537  }
538  else
539  {
540  return NOLOCK; // unique constraint violation
541  }
542  }
543  else
544  {
545  uniqueFloatIndex->at(entry).rowid = rowid;
546  uniqueFloatIndex->at(entry).engineid = engineid;
547  uniqueFloatIndex->at(entry).subtransactionid = subtransactionid;
548  return INDEXLOCK;
549  }
550 
551  break;
552 
553  case unorderedfloat:
554  if (unorderedFloatIndex->count(entry))
555  {
556  if (unorderedFloatIndex->at(entry).subtransactionid) //already locked
557  {
558  // do pending & return
559  lockQueueIndexEntry queueEntry = {};
560  queueEntry.pendingcmdid = pendingcmdid;
561  queueEntry.tacmdentrypoint = tacmdentrypoint;
562  queueEntry.entry.engineid = engineid;
563  queueEntry.entry.rowid = rowid;
564  queueEntry.entry.subtransactionid = subtransactionid;
565  floatLockQueue->at(entry).push(queueEntry);
566  return INDEXPENDINGLOCK;
567  }
568  else
569  {
570  return NOLOCK; // unique constraint violation
571  }
572  }
573  else
574  {
575  unorderedFloatIndex->at(entry).rowid = rowid;
576  unorderedFloatIndex->at(entry).engineid = engineid;
577  unorderedFloatIndex->at(entry).subtransactionid = subtransactionid;
578  return INDEXLOCK;
579  }
580 
581  break;
582 
583  default:
584  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
585  __LINE__);
586  }
587 
588  return NOLOCK;
589 }
locktype_e Index::checkAndLock ( char  entry,
int64_t  rowid,
int64_t  engineid,
int64_t  subtransactionid,
int64_t  pendingcmdid,
int64_t  tacmdentrypoint 
)

(not used 12/22/13) check existence of entry and lock

creates pending lock if not acquirable

Parameters
entryfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
pendingcmdidpending command in calling Transaction
tacmdentrypointentry point for pending command
Returns
type of lock acquired (or pending)

Definition at line 592 of file Index.cc.

References charLockQueue, lockingIndexEntry::engineid, lockQueueIndexEntry::entry, INDEXLOCK, indexmaptype, INDEXPENDINGLOCK, logfile, NOLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, lockQueueIndexEntry::tacmdentrypoint, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

595 {
596  switch (indexmaptype)
597  {
598  case uniquechar:
599  if (uniqueCharIndex->count(entry))
600  {
601  if (uniqueCharIndex->at(entry).subtransactionid) // already locked
602  {
603  if (uniqueCharIndex->at(entry).subtransactionid==
604  subtransactionid)
605  {
606  return INDEXPENDINGLOCK;
607  }
608 
609  // do pending & return
610  lockQueueIndexEntry queueEntry = {};
611  queueEntry.pendingcmdid = pendingcmdid;
612  queueEntry.tacmdentrypoint = tacmdentrypoint;
613  queueEntry.entry.engineid = engineid;
614  queueEntry.entry.rowid = rowid;
615  queueEntry.entry.subtransactionid = subtransactionid;
616  charLockQueue->at(entry).push(queueEntry);
617  return INDEXPENDINGLOCK;
618  }
619  else
620  {
621  return NOLOCK; // unique constraint violation
622  }
623  }
624  else
625  {
626  uniqueCharIndex->at(entry).rowid = rowid;
627  uniqueCharIndex->at(entry).engineid = engineid;
628  uniqueCharIndex->at(entry).subtransactionid = subtransactionid;
629  return INDEXLOCK;
630  }
631 
632  break;
633 
634  case unorderedchar:
635  if (unorderedCharIndex->count(entry))
636  {
637  if (unorderedCharIndex->at(entry).subtransactionid) // already locked
638  {
639  // do pending & return
640  lockQueueIndexEntry queueEntry = {};
641  queueEntry.pendingcmdid = pendingcmdid;
642  queueEntry.tacmdentrypoint = tacmdentrypoint;
643  queueEntry.entry.engineid = engineid;
644  queueEntry.entry.rowid = rowid;
645  queueEntry.entry.subtransactionid = subtransactionid;
646  charLockQueue->at(entry).push(queueEntry);
647  return INDEXPENDINGLOCK;
648  }
649  else
650  {
651  return NOLOCK; // unique constraint violation
652  }
653  }
654  else
655  {
656  unorderedCharIndex->at(entry).rowid = rowid;
657  unorderedCharIndex->at(entry).engineid = engineid;
658  unorderedCharIndex->at(entry).subtransactionid = subtransactionid;
659  return INDEXLOCK;
660  }
661 
662  break;
663 
664  default:
665  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
666  __LINE__);
667  }
668 
669  return NOLOCK;
670 }
locktype_e Index::checkAndLock ( string *  entry,
int64_t  rowid,
int64_t  engineid,
int64_t  subtransactionid,
int64_t  pendingcmdid,
int64_t  tacmdentrypoint 
)

(not used 12/22/13) check existence of entry and lock

creates pending lock if not acquirable

Parameters
entryfield value
rowidrowid
engineidengineid
subtransactionidsubtransactionid
pendingcmdidpending command in calling Transaction
tacmdentrypointentry point for pending command
Returns
type of lock acquired (or pending)

Definition at line 673 of file Index.cc.

References lockingIndexEntry::engineid, lockQueueIndexEntry::entry, INDEXLOCK, indexmaptype, INDEXPENDINGLOCK, logfile, NOLOCK, lockQueueIndexEntry::pendingcmdid, lockingIndexEntry::rowid, stringLockQueue, lockingIndexEntry::subtransactionid, lockQueueIndexEntry::tacmdentrypoint, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

676 {
677  switch (indexmaptype)
678  {
679  case uniquecharx:
680  if (uniqueStringIndex->count(*entry))
681  {
682  if (uniqueStringIndex->at(*entry).subtransactionid) // already locked
683  {
684  if (uniqueStringIndex->at(*entry).subtransactionid==
685  subtransactionid)
686  {
687  return INDEXPENDINGLOCK;
688  }
689 
690  // do pending & return
691  lockQueueIndexEntry queueEntry = {};
692  queueEntry.pendingcmdid = pendingcmdid;
693  queueEntry.tacmdentrypoint = tacmdentrypoint;
694  queueEntry.entry.engineid = engineid;
695  queueEntry.entry.rowid = rowid;
696  queueEntry.entry.subtransactionid = subtransactionid;
697  stringLockQueue->at(*entry).push(queueEntry);
698  return INDEXPENDINGLOCK;
699  }
700  else
701  {
702  return NOLOCK; // unique constraint violation
703  }
704  }
705  else
706  {
707  uniqueStringIndex->at(*entry).rowid = rowid;
708  uniqueStringIndex->at(*entry).engineid = engineid;
709  uniqueStringIndex->at(*entry).subtransactionid = subtransactionid;
710  return INDEXLOCK;
711  }
712 
713  break;
714 
715  case unorderedcharx:
716  if (unorderedStringIndex->count(*entry))
717  {
718  if (unorderedStringIndex->at(*entry).subtransactionid)//already locked
719  {
720  // do pending & return
721  lockQueueIndexEntry queueEntry = {};
722  queueEntry.pendingcmdid = pendingcmdid;
723  queueEntry.tacmdentrypoint = tacmdentrypoint;
724  queueEntry.entry.engineid = engineid;
725  queueEntry.entry.rowid = rowid;
726  queueEntry.entry.subtransactionid = subtransactionid;
727  stringLockQueue->at(*entry).push(queueEntry);
728  return INDEXPENDINGLOCK;
729  }
730  else
731  {
732  return NOLOCK; // unique constraint violation
733  }
734  }
735  else
736  {
737  unorderedStringIndex->at(*entry).rowid = rowid;
738  unorderedStringIndex->at(*entry).engineid = engineid;
739  unorderedStringIndex->at(*entry).subtransactionid = subtransactionid;
740  return INDEXLOCK;
741  }
742 
743  break;
744 
745  case uniquevarchar:
746  if (uniqueStringIndex->count(*entry))
747  {
748  if (uniqueStringIndex->at(*entry).subtransactionid) // already locked
749  {
750  if (uniqueStringIndex->at(*entry).subtransactionid==
751  subtransactionid)
752  {
753  return INDEXPENDINGLOCK;
754  }
755 
756  // do pending & return
757  lockQueueIndexEntry queueEntry = {};
758  queueEntry.pendingcmdid = pendingcmdid;
759  queueEntry.tacmdentrypoint = tacmdentrypoint;
760  queueEntry.entry.engineid = engineid;
761  queueEntry.entry.rowid = rowid;
762  queueEntry.entry.subtransactionid = subtransactionid;
763  stringLockQueue->at(*entry).push(queueEntry);
764  return INDEXPENDINGLOCK;
765  }
766  else
767  {
768  return NOLOCK; // unique constraint violation
769  }
770  }
771  else
772  {
773  uniqueStringIndex->at(*entry).rowid = rowid;
774  uniqueStringIndex->at(*entry).engineid = engineid;
775  uniqueStringIndex->at(*entry).subtransactionid = subtransactionid;
776  return INDEXLOCK;
777  }
778 
779  break;
780 
781  case unorderedvarchar:
782  if (unorderedStringIndex->count(*entry))
783  {
784  if (unorderedStringIndex->at(*entry).subtransactionid) //already locked
785  {
786  // do pending & return
787  lockQueueIndexEntry queueEntry = {};
788  queueEntry.pendingcmdid = pendingcmdid;
789  queueEntry.tacmdentrypoint = tacmdentrypoint;
790  queueEntry.entry.engineid = engineid;
791  queueEntry.entry.rowid = rowid;
792  queueEntry.entry.subtransactionid = subtransactionid;
793  stringLockQueue->at(*entry).push(queueEntry);
794  return INDEXPENDINGLOCK;
795  }
796  else
797  {
798  return NOLOCK; // unique constraint violation
799  }
800  }
801  else
802  {
803  unorderedStringIndex->at(*entry).rowid = rowid;
804  unorderedStringIndex->at(*entry).engineid = engineid;
805  unorderedStringIndex->at(*entry).subtransactionid = subtransactionid;
806  return INDEXLOCK;
807  }
808 
809  break;
810 
811  default:
812  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
813  __LINE__);
814  }
815 
816  return NOLOCK;
817 }
bool Index::checkifmatch ( fieldValue_s val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5325 of file Index.cc.

References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, fieldtype, FLOAT, fieldInput_u::floating, INT, fieldInput_u::integer, fieldValue_s::str, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.

Referenced by Engine::applyItem().

5326 {
5327  switch (fieldtype)
5328  {
5329  case INT:
5330  return checkifmatch(val.value.integer, rowid, engineid);
5331  break;
5332 
5333  case UINT:
5334  return checkifmatch(val.value.uinteger, rowid, engineid);
5335  break;
5336 
5337  case BOOL:
5338  return checkifmatch(val.value.boolean, rowid, engineid);
5339  break;
5340 
5341  case FLOAT:
5342  return checkifmatch(val.value.floating, rowid, engineid);
5343  break;
5344 
5345  case CHAR:
5346  return checkifmatch(val.value.character, rowid, engineid);
5347  break;
5348 
5349  case CHARX:
5350  return checkifmatch(val.str, rowid, engineid);
5351  break;
5352 
5353  case VARCHAR:
5354  return checkifmatch(val.str, rowid, engineid);
5355  break;
5356 
5357  default:
5358  printf("%s %i anomaly fieldtype %i\n", __FILE__, __LINE__,
5359  fieldtype);
5360  }
5361 
5362  return false;
5363 }

Here is the caller graph for this function:

bool Index::checkifmatch ( int64_t  val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5365 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, lockingIndexEntry::rowid, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

5366 {
5367  lockingIndexEntry entry;
5368 
5369  switch (indexmaptype)
5370  {
5371  case uniqueint:
5372  entry = uniqueIntIndex->at(val);
5373  break;
5374 
5375  case unorderedint:
5376  entry = unorderedIntIndex->at(val);
5377  break;
5378 
5379  default:
5380  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5381  indexmaptype);
5382  entry = {};
5383  }
5384 
5385  if (entry.rowid != rowid || entry.engineid != engineid)
5386  {
5387  return false;
5388  }
5389 
5390  return true;
5391 }
bool Index::checkifmatch ( uint64_t  val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5393 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, lockingIndexEntry::rowid, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

5394 {
5395  lockingIndexEntry entry;
5396 
5397  switch (indexmaptype)
5398  {
5399  case uniqueuint:
5400  entry = uniqueUintIndex->at(val);
5401  break;
5402 
5403  case unordereduint:
5404  entry = unorderedUintIndex->at(val);
5405  break;
5406 
5407  default:
5408  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5409  indexmaptype);
5410  entry = {};
5411  }
5412 
5413  if (entry.rowid != rowid || entry.engineid != engineid)
5414  {
5415  return false;
5416  }
5417 
5418  return true;
5419 }
bool Index::checkifmatch ( bool  val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5421 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, lockingIndexEntry::rowid, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

5422 {
5423  lockingIndexEntry entry;
5424 
5425  switch (indexmaptype)
5426  {
5427  case uniquebool:
5428  entry = uniqueBoolIndex->at(val);
5429  break;
5430 
5431  case unorderedbool:
5432  entry = unorderedBoolIndex->at(val);
5433  break;
5434 
5435  default:
5436  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5437  indexmaptype);
5438  entry = {};
5439  }
5440 
5441  if (entry.rowid != rowid || entry.engineid != engineid)
5442  {
5443  return false;
5444  }
5445 
5446  return true;
5447 }
bool Index::checkifmatch ( long double  val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5449 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, lockingIndexEntry::rowid, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

5450 {
5451  lockingIndexEntry entry;
5452 
5453  switch (indexmaptype)
5454  {
5455  case uniquefloat:
5456  entry = uniqueFloatIndex->at(val);
5457  break;
5458 
5459  case unorderedfloat:
5460  entry = unorderedFloatIndex->at(val);
5461  break;
5462 
5463  default:
5464  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5465  indexmaptype);
5466  entry = {};
5467  }
5468 
5469  if (entry.rowid != rowid || entry.engineid != engineid)
5470  {
5471  return false;
5472  }
5473 
5474  return true;
5475 }
bool Index::checkifmatch ( char  val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5477 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, lockingIndexEntry::rowid, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

5478 {
5479  lockingIndexEntry entry;
5480 
5481  switch (indexmaptype)
5482  {
5483  case uniquechar:
5484  entry = uniqueCharIndex->at(val);
5485  break;
5486 
5487  case unorderedchar:
5488  entry = unorderedCharIndex->at(val);
5489  break;
5490 
5491  default:
5492  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5493  indexmaptype);
5494  entry = {};
5495  }
5496 
5497  if (entry.rowid != rowid || entry.engineid != engineid)
5498  {
5499  return false;
5500  }
5501 
5502  return true;
5503 }
bool Index::checkifmatch ( string &  val,
int64_t  rowid,
int64_t  engineid 
)

check if entry matches row as part of synchronous replication

Parameters
valfield entry
rowidrowid
engineidengineid
Returns
match or no match

Definition at line 5505 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, lockingIndexEntry::rowid, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

5506 {
5507  lockingIndexEntry entry;
5508 
5509  switch (indexmaptype)
5510  {
5511  case uniquecharx:
5512  entry = uniqueStringIndex->at(val);
5513  break;
5514 
5515  case unorderedcharx:
5516  entry = unorderedStringIndex->at(val);
5517  break;
5518 
5519  case uniquevarchar:
5520  entry = uniqueStringIndex->at(val);
5521  break;
5522 
5523  case unorderedvarchar:
5524  entry = unorderedStringIndex->at(val);
5525  break;
5526 
5527  default:
5528  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5529  indexmaptype);
5530  entry = {};
5531  }
5532 
5533  if (entry.rowid != rowid || entry.engineid != engineid)
5534  {
5535  return false;
5536  }
5537 
5538  return true;
5539 }
bool Index::checkifthere ( fieldValue_s val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5087 of file Index.cc.

References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, fieldtype, FLOAT, fieldInput_u::floating, INT, fieldInput_u::integer, fieldValue_s::str, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.

Referenced by addifnotthere(), and Engine::applyItem().

5088 {
5089  switch (fieldtype)
5090  {
5091  case INT:
5092  return checkifthere(val.value.integer);
5093  break;
5094 
5095  case UINT:
5096  return checkifthere(val.value.uinteger);
5097  break;
5098 
5099  case BOOL:
5100  return checkifthere(val.value.boolean);
5101  break;
5102 
5103  case FLOAT:
5104  return checkifthere(val.value.floating);
5105  break;
5106 
5107  case CHAR:
5108  return checkifthere(val.value.character);
5109  break;
5110 
5111  case CHARX:
5112  return checkifthere(val.str);
5113  break;
5114 
5115  case VARCHAR:
5116  return checkifthere(val.str);
5117  break;
5118 
5119  default:
5120  printf("%s %i anomaly fieldtype %i\n", __FILE__, __LINE__,
5121  fieldtype);
5122  }
5123 
5124  return false;
5125 }

Here is the caller graph for this function:

bool Index::checkifthere ( int64_t  val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5127 of file Index.cc.

References indexmaptype, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

5128 {
5129  switch (indexmaptype)
5130  {
5131  case uniqueint:
5132  {
5133  if (!uniqueIntIndex->count(val))
5134  {
5135  return false;
5136  }
5137  }
5138  break;
5139 
5140  case unorderedint:
5141  {
5142  if (!unorderedIntIndex->count(val))
5143  {
5144  return false;
5145  }
5146  }
5147  break;
5148 
5149  default:
5150  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5151  indexmaptype);
5152  }
5153 
5154  return true;
5155 }
bool Index::checkifthere ( uint64_t  val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5157 of file Index.cc.

References indexmaptype, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

5158 {
5159  switch (indexmaptype)
5160  {
5161  case uniqueuint:
5162  {
5163  if (!uniqueUintIndex->count(val))
5164  {
5165  return false;
5166  }
5167  }
5168  break;
5169 
5170  case unordereduint:
5171  {
5172  if (!unorderedUintIndex->count(val))
5173  {
5174  return false;
5175  }
5176  }
5177  break;
5178 
5179  default:
5180  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5181  indexmaptype);
5182  }
5183 
5184  return true;
5185 }
bool Index::checkifthere ( bool  val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5187 of file Index.cc.

References indexmaptype, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

5188 {
5189  switch (indexmaptype)
5190  {
5191  case uniquebool:
5192  {
5193  if (!uniqueBoolIndex->count(val))
5194  {
5195  return false;
5196  }
5197  }
5198  break;
5199 
5200  case unorderedbool:
5201  {
5202  if (!unorderedBoolIndex->count(val))
5203  {
5204  return false;
5205  }
5206  }
5207  break;
5208 
5209  default:
5210  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5211  indexmaptype);
5212  }
5213 
5214  return true;
5215 }
bool Index::checkifthere ( long double  val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5217 of file Index.cc.

References indexmaptype, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

5218 {
5219  switch (indexmaptype)
5220  {
5221  case uniquefloat:
5222  {
5223  if (!uniqueFloatIndex->count(val))
5224  {
5225  return false;
5226  }
5227  }
5228  break;
5229 
5230  case unorderedfloat:
5231  {
5232  if (!unorderedFloatIndex->count(val))
5233  {
5234  return false;
5235  }
5236  }
5237  break;
5238 
5239  default:
5240  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5241  indexmaptype);
5242  }
5243 
5244  return true;
5245 }
bool Index::checkifthere ( char  val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5247 of file Index.cc.

References indexmaptype, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

5248 {
5249  switch (indexmaptype)
5250  {
5251  case uniquechar:
5252  {
5253  if (!uniqueCharIndex->count(val))
5254  {
5255  return false;
5256  }
5257  }
5258  break;
5259 
5260  case unorderedchar:
5261  {
5262  if (!unorderedCharIndex->count(val))
5263  {
5264  return false;
5265  }
5266  }
5267  break;
5268 
5269  default:
5270  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5271  indexmaptype);
5272  }
5273 
5274  return true;
5275 }
bool Index::checkifthere ( string &  val)

check for entry as part of synchronous replication

Parameters
valfield value
Returns
match or no match

Definition at line 5277 of file Index.cc.

References indexmaptype, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

5278 {
5279  switch (indexmaptype)
5280  {
5281  case uniquecharx:
5282  {
5283  if (!uniqueStringIndex->count(val))
5284  {
5285  return false;
5286  }
5287  }
5288  break;
5289 
5290  case unorderedcharx:
5291  {
5292  if (!unorderedStringIndex->count(val))
5293  {
5294  return false;
5295  }
5296  }
5297  break;
5298 
5299  case uniquevarchar:
5300  {
5301  if (!uniqueStringIndex->count(val))
5302  {
5303  return false;
5304  }
5305  }
5306  break;
5307 
5308  case unorderedvarchar:
5309  {
5310  if (!unorderedStringIndex->count(val))
5311  {
5312  return false;
5313  }
5314  }
5315  break;
5316 
5317  default:
5318  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5319  indexmaptype);
5320  }
5321 
5322  return true;
5323 }
void Index::commitRollback ( int64_t  input,
int64_t  subtransactionid,
enginecmd_e  cmd 
)

commit or rollback entry

Parameters
inputfield value
subtransactionidsubtransactionid
cmdcommit or rollback

Definition at line 3694 of file Index.cc.

References COMMITCMD, indexmaptype, logfile, ROLLBACKCMD, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

Referenced by SubTransaction::commitRollbackUnlock(), and SubTransaction::processTransactionMessage().

3696 {
3697  switch (cmd)
3698  {
3699  case COMMITCMD:
3700  switch (indexmaptype)
3701  {
3702  case uniqueint:
3703  if (!uniqueIntIndex->count(input))
3704  {
3705  return;
3706  }
3707 
3708  if (uniqueIntIndex->at(input).subtransactionid != subtransactionid)
3709  {
3710  return;
3711  }
3712 
3713  uniqueIntIndex->at(input).subtransactionid = 0;
3714  break;
3715 
3716  case unorderedint:
3717  if (!unorderedIntIndex->count(input))
3718  {
3719  return;
3720  }
3721 
3722  if (unorderedIntIndex->at(input).subtransactionid !=
3723  subtransactionid)
3724  {
3725  return;
3726  }
3727 
3728  unorderedIntIndex->at(input).subtransactionid = 0;
3729  break;
3730 
3731  default:
3732  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3733  __LINE__);
3734  }
3735 
3736  break;
3737 
3738  case ROLLBACKCMD:
3739  switch (indexmaptype)
3740  {
3741  case uniqueint:
3742  if (!uniqueIntIndex->count(input))
3743  {
3744  return;
3745  }
3746 
3747  if (uniqueIntIndex->at(input).subtransactionid != subtransactionid)
3748  {
3749  return;
3750  }
3751 
3752  uniqueIntIndex->erase(input);
3753  break;
3754 
3755  case unorderedint:
3756  if (!unorderedIntIndex->count(input))
3757  {
3758  return;
3759  }
3760 
3761  if (unorderedIntIndex->at(input).subtransactionid !=
3762  subtransactionid)
3763  {
3764  return;
3765  }
3766 
3767  unorderedIntIndex->erase(input);
3768  break;
3769 
3770  default:
3771  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3772  __LINE__);
3773  }
3774 
3775  break;
3776 
3777  default:
3778  fprintf(logfile, "anomaly %i %s %i\n", cmd, __FILE__, __LINE__);
3779  }
3780 }

Here is the caller graph for this function:

void Index::commitRollback ( uint64_t  input,
int64_t  subtransactionid,
enginecmd_e  cmd 
)

commit or rollback entry

Parameters
inputfield value
subtransactionidsubtransactionid
cmdcommit or rollback

Definition at line 3782 of file Index.cc.

References COMMITCMD, indexmaptype, logfile, ROLLBACKCMD, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

3784 {
3785  switch (cmd)
3786  {
3787  case COMMITCMD:
3788  switch (indexmaptype)
3789  {
3790  case uniqueuint:
3791  if (!uniqueUintIndex->count(input))
3792  {
3793  return;
3794  }
3795 
3796  if (uniqueUintIndex->at(input).subtransactionid != subtransactionid)
3797  {
3798  return;
3799  }
3800 
3801  uniqueUintIndex->at(input).subtransactionid = 0;
3802  break;
3803 
3804  case unordereduint:
3805  if (!unorderedUintIndex->count(input))
3806  {
3807  return;
3808  }
3809 
3810  if (unorderedUintIndex->at(input).subtransactionid !=
3811  subtransactionid)
3812  {
3813  return;
3814  }
3815 
3816  unorderedUintIndex->at(input).subtransactionid = 0;
3817  break;
3818 
3819  default:
3820  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3821  __LINE__);
3822  }
3823 
3824  break;
3825 
3826  case ROLLBACKCMD:
3827  switch (indexmaptype)
3828  {
3829  case uniqueuint:
3830  if (!uniqueUintIndex->count(input))
3831  {
3832  return;
3833  }
3834 
3835  if (uniqueUintIndex->at(input).subtransactionid != subtransactionid)
3836  {
3837  return;
3838  }
3839 
3840  uniqueUintIndex->erase(input);
3841  break;
3842 
3843  case unordereduint:
3844  if (!unorderedUintIndex->count(input))
3845  {
3846  return;
3847  }
3848 
3849  if (unorderedUintIndex->at(input).subtransactionid !=
3850  subtransactionid)
3851  {
3852  return;
3853  }
3854 
3855  unorderedUintIndex->erase(input);
3856  break;
3857 
3858  default:
3859  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3860  __LINE__);
3861  }
3862 
3863  default:
3864  fprintf(logfile, "anomaly %i %s %i\n", cmd, __FILE__, __LINE__);
3865  }
3866 }
void Index::commitRollback ( bool  input,
int64_t  subtransactionid,
enginecmd_e  cmd 
)

commit or rollback entry

Parameters
inputfield value
subtransactionidsubtransactionid
cmdcommit or rollback

Definition at line 3868 of file Index.cc.

References COMMITCMD, indexmaptype, logfile, ROLLBACKCMD, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

3870 {
3871  switch (cmd)
3872  {
3873  case COMMITCMD:
3874  switch (indexmaptype)
3875  {
3876  case uniquebool:
3877  if (!uniqueBoolIndex->count(input))
3878  {
3879  return;
3880  }
3881 
3882  if (uniqueBoolIndex->at(input).subtransactionid != subtransactionid)
3883  {
3884  return;
3885  }
3886 
3887  uniqueBoolIndex->at(input).subtransactionid = 0;
3888  break;
3889 
3890  case unorderedbool:
3891  if (!unorderedBoolIndex->count(input))
3892  {
3893  return;
3894  }
3895 
3896  if (unorderedBoolIndex->at(input).subtransactionid !=
3897  subtransactionid)
3898  {
3899  return;
3900  }
3901 
3902  unorderedBoolIndex->at(input).subtransactionid = 0;
3903  break;
3904 
3905  default:
3906  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3907  __LINE__);
3908  }
3909 
3910  break;
3911 
3912  case ROLLBACKCMD:
3913  switch (indexmaptype)
3914  {
3915  case uniquebool:
3916  if (!uniqueBoolIndex->count(input))
3917  {
3918  return;
3919  }
3920 
3921  if (uniqueBoolIndex->at(input).subtransactionid != subtransactionid)
3922  {
3923  return;
3924  }
3925 
3926  uniqueBoolIndex->erase(input);
3927  break;
3928 
3929  case unorderedbool:
3930  if (!unorderedBoolIndex->count(input))
3931  {
3932  return;
3933  }
3934 
3935  if (unorderedBoolIndex->at(input).subtransactionid !=
3936  subtransactionid)
3937  {
3938  return;
3939  }
3940 
3941  unorderedBoolIndex->erase(input);
3942  break;
3943 
3944  default:
3945  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3946  __LINE__);
3947  }
3948 
3949  default:
3950  fprintf(logfile, "anomaly %i %s %i\n", cmd, __FILE__, __LINE__);
3951  }
3952 }
void Index::commitRollback ( long double  input,
int64_t  subtransactionid,
enginecmd_e  cmd 
)

commit or rollback entry

Parameters
inputfield value
subtransactionidsubtransactionid
cmdcommit or rollback

Definition at line 3954 of file Index.cc.

References COMMITCMD, indexmaptype, logfile, ROLLBACKCMD, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

3956 {
3957  switch (cmd)
3958  {
3959  case COMMITCMD:
3960  switch (indexmaptype)
3961  {
3962  case uniquefloat:
3963  if (!uniqueFloatIndex->count(input))
3964  {
3965  return;
3966  }
3967 
3968  if (uniqueFloatIndex->at(input).subtransactionid != subtransactionid)
3969  {
3970  return;
3971  }
3972 
3973  uniqueFloatIndex->at(input).subtransactionid = 0;
3974  break;
3975 
3976  case unorderedfloat:
3977  if (!unorderedFloatIndex->count(input))
3978  {
3979  return;
3980  }
3981 
3982  if (unorderedFloatIndex->at(input).subtransactionid !=
3983  subtransactionid)
3984  {
3985  return;
3986  }
3987 
3988  unorderedFloatIndex->at(input).subtransactionid = 0;
3989  break;
3990 
3991  default:
3992  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
3993  __LINE__);
3994  }
3995 
3996  break;
3997 
3998  case ROLLBACKCMD:
3999  switch (indexmaptype)
4000  {
4001  case uniquefloat:
4002  if (!uniqueFloatIndex->count(input))
4003  {
4004  return;
4005  }
4006 
4007  if (uniqueFloatIndex->at(input).subtransactionid != subtransactionid)
4008  {
4009  return;
4010  }
4011 
4012  uniqueFloatIndex->erase(input);
4013  break;
4014 
4015  case unorderedfloat:
4016  if (!unorderedFloatIndex->count(input))
4017  {
4018  return;
4019  }
4020 
4021  if (unorderedFloatIndex->at(input).subtransactionid !=
4022  subtransactionid)
4023  {
4024  return;
4025  }
4026 
4027  unorderedFloatIndex->erase(input);
4028  break;
4029 
4030  default:
4031  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
4032  __LINE__);
4033  }
4034 
4035  default:
4036  fprintf(logfile, "anomaly %i %s %i\n", cmd, __FILE__, __LINE__);
4037  }
4038 }
void Index::commitRollback ( char  input,
int64_t  subtransactionid,
enginecmd_e  cmd 
)

commit or rollback entry

Parameters
inputfield value
subtransactionidsubtransactionid
cmdcommit or rollback

Definition at line 4040 of file Index.cc.

References COMMITCMD, indexmaptype, logfile, ROLLBACKCMD, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

4042 {
4043  switch (cmd)
4044  {
4045  case COMMITCMD:
4046  switch (indexmaptype)
4047  {
4048  case uniquechar:
4049  if (!uniqueCharIndex->count(input))
4050  {
4051  return;
4052  }
4053 
4054  if (uniqueCharIndex->at(input).subtransactionid != subtransactionid)
4055  {
4056  return;
4057  }
4058 
4059  uniqueCharIndex->at(input).subtransactionid = 0;
4060  break;
4061 
4062  case unorderedchar:
4063  if (!unorderedCharIndex->count(input))
4064  {
4065  return;
4066  }
4067 
4068  if (unorderedCharIndex->at(input).subtransactionid !=
4069  subtransactionid)
4070  {
4071  return;
4072  }
4073 
4074  unorderedCharIndex->at(input).subtransactionid = 0;
4075  break;
4076 
4077  default:
4078  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
4079  __LINE__);
4080  }
4081 
4082  break;
4083 
4084  case ROLLBACKCMD:
4085  switch (indexmaptype)
4086  {
4087  case uniquechar:
4088  if (!uniqueCharIndex->count(input))
4089  {
4090  return;
4091  }
4092 
4093  if (uniqueCharIndex->at(input).subtransactionid != subtransactionid)
4094  {
4095  return;
4096  }
4097 
4098  uniqueCharIndex->erase(input);
4099  break;
4100 
4101  case unorderedchar:
4102  if (!unorderedCharIndex->count(input))
4103  {
4104  return;
4105  }
4106 
4107  if (unorderedCharIndex->at(input).subtransactionid !=
4108  subtransactionid)
4109  {
4110  return;
4111  }
4112 
4113  unorderedCharIndex->erase(input);
4114  break;
4115 
4116  default:
4117  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
4118  __LINE__);
4119  }
4120 
4121  default:
4122  fprintf(logfile, "anomaly %i %s %i\n", cmd, __FILE__, __LINE__);
4123  }
4124 }
void Index::commitRollback ( string  input,
int64_t  subtransactionid,
enginecmd_e  cmd 
)

commit or rollback entry

Parameters
inputfield value
subtransactionidsubtransactionid
cmdcommit or rollback

Definition at line 4125 of file Index.cc.

References COMMITCMD, indexmaptype, logfile, ROLLBACKCMD, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

4127 {
4128  switch (cmd)
4129  {
4130  case COMMITCMD:
4131  switch (indexmaptype)
4132  {
4133  case uniquecharx:
4134  if (!uniqueStringIndex->count(input))
4135  {
4136  return;
4137  }
4138 
4139  if (uniqueStringIndex->at(input).subtransactionid !=
4140  subtransactionid)
4141  {
4142  return;
4143  }
4144 
4145  uniqueStringIndex->at(input).subtransactionid = 0;
4146  break;
4147 
4148  case unorderedcharx:
4149  if (!unorderedStringIndex->count(input))
4150  {
4151  return;
4152  }
4153 
4154  if (unorderedStringIndex->at(input).subtransactionid !=
4155  subtransactionid)
4156  {
4157  return;
4158  }
4159 
4160  unorderedStringIndex->at(input).subtransactionid = 0;
4161  break;
4162 
4163  case uniquevarchar:
4164  if (!uniqueStringIndex->count(input))
4165  {
4166  return;
4167  }
4168 
4169  if (uniqueStringIndex->at(input).subtransactionid !=
4170  subtransactionid)
4171  {
4172  return;
4173  }
4174 
4175  uniqueStringIndex->at(input).subtransactionid = 0;
4176  break;
4177 
4178  case unorderedvarchar:
4179  if (!unorderedStringIndex->count(input))
4180  {
4181  return;
4182  }
4183 
4184  if (unorderedStringIndex->at(input).subtransactionid !=
4185  subtransactionid)
4186  {
4187  return;
4188  }
4189 
4190  unorderedStringIndex->at(input).subtransactionid = 0;
4191  break;
4192 
4193  default:
4194  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
4195  __LINE__);
4196  }
4197 
4198  break;
4199 
4200  case ROLLBACKCMD:
4201  switch (indexmaptype)
4202  {
4203  case uniquecharx:
4204  if (!uniqueStringIndex->count(input))
4205  {
4206  return;
4207  }
4208 
4209  if (uniqueStringIndex->at(input).subtransactionid !=
4210  subtransactionid)
4211  {
4212  return;
4213  }
4214 
4215  uniqueStringIndex->erase(input);
4216  break;
4217 
4218  case unorderedcharx:
4219  if (!unorderedStringIndex->count(input))
4220  {
4221  return;
4222  }
4223 
4224  if (unorderedStringIndex->at(input).subtransactionid !=
4225  subtransactionid)
4226  {
4227  return;
4228  }
4229 
4230  unorderedStringIndex->erase(input);
4231 
4232  case uniquevarchar:
4233  if (!uniqueStringIndex->count(input))
4234  {
4235  return;
4236  }
4237 
4238  if (uniqueStringIndex->at(input).subtransactionid !=
4239  subtransactionid)
4240  {
4241  return;
4242  }
4243 
4244  uniqueStringIndex->erase(input);
4245  break;
4246 
4247  case unorderedvarchar:
4248  if (!unorderedStringIndex->count(input))
4249  {
4250  return;
4251  }
4252 
4253  if (unorderedStringIndex->at(input).subtransactionid !=
4254  subtransactionid)
4255  {
4256  return;
4257  }
4258 
4259  unorderedStringIndex->erase(input);
4260  break;
4261 
4262  default:
4263  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__,
4264  __LINE__);
4265  }
4266 
4267  default:
4268  fprintf(logfile, "anomaly %i %s %i\n", cmd, __FILE__, __LINE__);
4269  }
4270 }
void Index::comparison ( int64_t  input,
operatortypes_e  op,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching <,>,<=, or >= expression

Parameters
inputvalue to compare
opoperator
returnEntriesmatching rows

Definition at line 1881 of file Index.cc.

References indexmaptype, logfile, nonuniqueint, nonuniqueIntIndex, OPERATOR_GT, OPERATOR_GTE, OPERATOR_LT, OPERATOR_LTE, uniqueint, uniqueIntIndex, and unorderedint.

Referenced by SubTransaction::indexSearch(), and notbetween().

1883 {
1884  switch (indexmaptype)
1885  {
1886  case uniqueint:
1887  {
1888  uniqueIntMap::iterator itBegin, itEnd, it;
1889 
1890  if (op==OPERATOR_LT || op==OPERATOR_LTE)
1891  {
1892  itBegin = uniqueIntIndex->begin();
1893  itEnd = uniqueIntIndex->upper_bound(input);
1894  }
1895  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
1896  {
1897  itBegin = uniqueIntIndex->lower_bound(input);
1898  itEnd = uniqueIntIndex->end();
1899  }
1900  else
1901  {
1902  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
1903  }
1904 
1905  // lower_bound: GTE
1906  // upper_bound: LT
1907  for (it=itBegin; it != itEnd; ++it)
1908  {
1909  if ((op==OPERATOR_GT || op==OPERATOR_LT) && it->first==input) // skip equal
1910  {
1911  continue;
1912  }
1913 
1914  returnEntries->push_back({it->second.rowid, it->second.engineid});
1915  }
1916  }
1917  break;
1918 
1919  case nonuniqueint:
1920  {
1921  nonuniqueIntMap::iterator itBegin, itEnd, it;
1922 
1923  if (op==OPERATOR_LT || op==OPERATOR_LTE)
1924  {
1925  itBegin = nonuniqueIntIndex->begin();
1926  itEnd = nonuniqueIntIndex->upper_bound(input);
1927  }
1928  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
1929  {
1930  itBegin = nonuniqueIntIndex->lower_bound(input);
1931  itEnd = nonuniqueIntIndex->end();
1932  }
1933  else
1934  {
1935  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
1936  }
1937 
1938  // lower_bound: GTE
1939  // upper_bound: LT
1940  for (it=itBegin; it != itEnd; ++it)
1941  {
1942  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
1943  it->first==input) // skip equal
1944  {
1945  continue;
1946  }
1947 
1948  returnEntries->push_back({it->second.rowid, it->second.engineid});
1949  }
1950  }
1951  break;
1952 
1953  case unorderedint:
1954  {
1955  return; // unordered_map isn't sorted
1956  }
1957  break;
1958 
1959  default:
1960  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1961  }
1962 }

Here is the caller graph for this function:

void Index::comparison ( uint64_t  input,
operatortypes_e  op,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching <,>,<=, or >= expression

Parameters
inputvalue to compare
opoperator
returnEntriesmatching rows

Definition at line 1964 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniqueuint, nonuniqueUintIndex, OPERATOR_GT, OPERATOR_GTE, OPERATOR_LT, OPERATOR_LTE, nonLockingIndexEntry_s::rowid, uniqueuint, uniqueUintIndex, and unordereduint.

1966 {
1967  switch (indexmaptype)
1968  {
1969  case uniqueuint:
1970  {
1971  uniqueUintMap::iterator itBegin, itEnd, it;
1972 
1973  if (op==OPERATOR_LT || op==OPERATOR_LTE)
1974  {
1975  itBegin = uniqueUintIndex->begin();
1976  itEnd = uniqueUintIndex->upper_bound(input);
1977  }
1978  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
1979  {
1980  itBegin = uniqueUintIndex->lower_bound(input);
1981  itEnd = uniqueUintIndex->end();
1982  }
1983  else
1984  {
1985  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
1986  }
1987 
1988  // lower_bound: GTE
1989  // upper_bound: LT
1990  for (it=itBegin; it != itEnd; ++it)
1991  {
1992  if (op==OPERATOR_GT) // skip equal
1993  {
1994  if (it->first == input)
1995  {
1996  continue;
1997  }
1998 
1999  indexEntry_s entry;
2000  entry.rowid = it->second.rowid;
2001  entry.engineid = it->second.engineid;
2002  returnEntries->push_back(entry);
2003  }
2004  }
2005 
2006  if (op==OPERATOR_LTE) // need equal, too
2007  {
2008  if (uniqueUintIndex->count(input))
2009  {
2010  indexEntry_s entry;
2011  entry.rowid = uniqueUintIndex->at(input).rowid;
2012  entry.engineid = uniqueUintIndex->at(input).engineid;
2013  returnEntries->push_back(entry);
2014  }
2015  }
2016  }
2017  break;
2018 
2019  case nonuniqueuint:
2020  {
2021  nonuniqueUintMap::iterator itBegin, itEnd, it;
2022 
2023  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2024  {
2025  itBegin = nonuniqueUintIndex->begin();
2026  itEnd = nonuniqueUintIndex->upper_bound(input);
2027  }
2028  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2029  {
2030  itBegin = nonuniqueUintIndex->lower_bound(input);
2031  itEnd = nonuniqueUintIndex->end();
2032  }
2033  else
2034  {
2035  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2036  }
2037 
2038  // lower_bound: GTE
2039  // upper_bound: LT
2040  for (it=itBegin; it != itEnd; ++it)
2041  {
2042  if (op==OPERATOR_GT) // skip equal
2043  {
2044  if (it->first == input)
2045  {
2046  continue;
2047  }
2048 
2049  indexEntry_s entry;
2050  entry.rowid = it->second.rowid;
2051  entry.engineid = it->second.engineid;
2052  returnEntries->push_back(entry);
2053  }
2054  }
2055 
2056  if (op==OPERATOR_LTE) // need equal, too
2057  {
2058  pair<multimap<uint64_t, nonLockingIndexEntry_s>::iterator,
2059  multimap<uint64_t,
2060  nonLockingIndexEntry_s>::iterator> iteratorRange;
2061  iteratorRange = nonuniqueUintIndex->equal_range(input);
2062 
2063  for (it=iteratorRange.first; it != iteratorRange.second; ++it)
2064  {
2065  indexEntry_s entry;
2066  entry.rowid = it->second.rowid;
2067  entry.engineid = it->second.engineid;
2068  returnEntries->push_back(entry);
2069  }
2070  }
2071  }
2072  break;
2073 
2074  case unordereduint:
2075  {
2076  return;
2077  }
2078  break;
2079 
2080  default:
2081  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2082  }
2083 }
void Index::comparison ( bool  input,
operatortypes_e  op,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching <,>,<=, or >= expression

Parameters
inputvalue to compare
opoperator
returnEntriesmatching rows

Definition at line 2085 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquebool, nonuniqueBoolIndex, OPERATOR_GT, OPERATOR_GTE, OPERATOR_LT, OPERATOR_LTE, nonLockingIndexEntry_s::rowid, uniquebool, uniqueBoolIndex, and unorderedbool.

2087 {
2088  switch (indexmaptype)
2089  {
2090  case uniquebool:
2091  {
2092  uniqueBoolMap::iterator itBegin, itEnd, it;
2093 
2094  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2095  {
2096  itBegin = uniqueBoolIndex->begin();
2097  itEnd = uniqueBoolIndex->upper_bound(input);
2098  }
2099  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2100  {
2101  itBegin = uniqueBoolIndex->lower_bound(input);
2102  itEnd = uniqueBoolIndex->end();
2103  }
2104  else
2105  {
2106  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2107  }
2108 
2109  // lower_bound: GTE
2110  // upper_bound: LT
2111  for (it=itBegin; it != itEnd; ++it)
2112  {
2113  if (op==OPERATOR_GT) // skip equal
2114  {
2115  if (it->first == input)
2116  {
2117  continue;
2118  }
2119 
2120  indexEntry_s entry;
2121  entry.rowid = it->second.rowid;
2122  entry.engineid = it->second.engineid;
2123  returnEntries->push_back(entry);
2124  }
2125  }
2126 
2127  if (op==OPERATOR_LTE) // need equal, too
2128  {
2129  if (uniqueBoolIndex->count(input))
2130  {
2131  indexEntry_s entry;
2132  entry.rowid = uniqueBoolIndex->at(input).rowid;
2133  entry.engineid = uniqueBoolIndex->at(input).engineid;
2134  returnEntries->push_back(entry);
2135  }
2136  }
2137  }
2138  break;
2139 
2140  case nonuniquebool:
2141  {
2142  nonuniqueBoolMap::iterator itBegin, itEnd, it;
2143 
2144  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2145  {
2146  itBegin = nonuniqueBoolIndex->begin();
2147  itEnd = nonuniqueBoolIndex->upper_bound(input);
2148  }
2149  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2150  {
2151  itBegin = nonuniqueBoolIndex->lower_bound(input);
2152  itEnd = nonuniqueBoolIndex->end();
2153  }
2154  else
2155  {
2156  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2157  }
2158 
2159  // lower_bound: GTE
2160  // upper_bound: LT
2161  for (it=itBegin; it != itEnd; ++it)
2162  {
2163  if (op==OPERATOR_GT) // skip equal
2164  {
2165  if (it->first == input)
2166  {
2167  continue;
2168  }
2169 
2170  indexEntry_s entry;
2171  entry.rowid = it->second.rowid;
2172  entry.engineid = it->second.engineid;
2173  returnEntries->push_back(entry);
2174  }
2175  }
2176 
2177  if (op==OPERATOR_LTE) // need equal, too
2178  {
2179  pair<multimap<bool, nonLockingIndexEntry_s>::iterator,
2180  multimap<bool, nonLockingIndexEntry_s>::iterator> iteratorRange;
2181  iteratorRange = nonuniqueBoolIndex->equal_range(input);
2182 
2183  for (it=iteratorRange.first; it != iteratorRange.second; ++it)
2184  {
2185  indexEntry_s entry;
2186  entry.rowid = it->second.rowid;
2187  entry.engineid = it->second.engineid;
2188  returnEntries->push_back(entry);
2189  }
2190  }
2191  }
2192  break;
2193 
2194  case unorderedbool:
2195  {
2196  return;
2197  }
2198  break;
2199 
2200  default:
2201  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2202  }
2203 }
void Index::comparison ( long double  input,
operatortypes_e  op,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching <,>,<=, or >= expression

Parameters
inputvalue to compare
opoperator
returnEntriesmatching rows

Definition at line 2205 of file Index.cc.

References indexmaptype, logfile, nonuniquefloat, nonuniqueFloatIndex, OPERATOR_GT, OPERATOR_GTE, OPERATOR_LT, OPERATOR_LTE, uniquefloat, uniqueFloatIndex, and unorderedfloat.

2207 {
2208  switch (indexmaptype)
2209  {
2210  case uniquefloat:
2211  {
2212  uniqueFloatMap::iterator itBegin, itEnd, it;
2213 
2214  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2215  {
2216  itBegin = uniqueFloatIndex->begin();
2217  itEnd = uniqueFloatIndex->upper_bound(input);
2218  }
2219  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2220  {
2221  itBegin = uniqueFloatIndex->lower_bound(input);
2222  itEnd = uniqueFloatIndex->end();
2223  }
2224  else
2225  {
2226  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2227  }
2228 
2229  // lower_bound: GTE
2230  // upper_bound: LT
2231  for (it=itBegin; it != itEnd; ++it)
2232  {
2233  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2234  it->first==input) // skip equal
2235  {
2236  continue;
2237  }
2238 
2239  returnEntries->push_back({it->second.rowid, it->second.engineid});
2240  }
2241  }
2242  break;
2243 
2244  case nonuniquefloat:
2245  {
2246  nonuniqueFloatMap::iterator itBegin, itEnd, it;
2247 
2248  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2249  {
2250  itBegin = nonuniqueFloatIndex->begin();
2251  itEnd = nonuniqueFloatIndex->upper_bound(input);
2252  }
2253  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2254  {
2255  itBegin = nonuniqueFloatIndex->lower_bound(input);
2256  itEnd = nonuniqueFloatIndex->end();
2257  }
2258  else
2259  {
2260  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2261  }
2262 
2263  // lower_bound: GTE
2264  // upper_bound: LT
2265  for (it=itBegin; it != itEnd; ++it)
2266  {
2267  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2268  it->first==input) // skip equal
2269  {
2270  continue;
2271  }
2272 
2273  returnEntries->push_back({it->second.rowid, it->second.engineid});
2274  }
2275  }
2276  break;
2277 
2278  case unorderedfloat:
2279  {
2280  return;
2281  }
2282  break;
2283 
2284  default:
2285  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2286  }
2287 }
void Index::comparison ( char  input,
operatortypes_e  op,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching <,>,<=, or >= expression

Parameters
inputvalue to compare
opoperator
returnEntriesmatching rows

Definition at line 2289 of file Index.cc.

References indexmaptype, logfile, nonuniquechar, nonuniqueCharIndex, OPERATOR_GT, OPERATOR_GTE, OPERATOR_LT, OPERATOR_LTE, uniquechar, uniqueCharIndex, and unorderedchar.

2291 {
2292  switch (indexmaptype)
2293  {
2294  case uniquechar:
2295  {
2296  uniqueCharMap::iterator itBegin, itEnd, it;
2297 
2298  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2299  {
2300  itBegin = uniqueCharIndex->begin();
2301  itEnd = uniqueCharIndex->upper_bound(input);
2302  }
2303  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2304  {
2305  itBegin = uniqueCharIndex->lower_bound(input);
2306  itEnd = uniqueCharIndex->end();
2307  }
2308  else
2309  {
2310  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2311  }
2312 
2313  // lower_bound: GTE
2314  // upper_bound: LT
2315  for (it=itBegin; it != itEnd; ++it)
2316  {
2317  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2318  it->first==input) // skip equal
2319  {
2320  continue;
2321  }
2322 
2323  returnEntries->push_back({it->second.rowid, it->second.engineid});
2324  }
2325  }
2326  break;
2327 
2328  case nonuniquechar:
2329  {
2330  nonuniqueCharMap::iterator itBegin, itEnd, it;
2331 
2332  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2333  {
2334  itBegin = nonuniqueCharIndex->begin();
2335  itEnd = nonuniqueCharIndex->upper_bound(input);
2336  }
2337  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2338  {
2339  itBegin = nonuniqueCharIndex->lower_bound(input);
2340  itEnd = nonuniqueCharIndex->end();
2341  }
2342  else
2343  {
2344  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2345  }
2346 
2347  // lower_bound: GTE
2348  // upper_bound: LT
2349  for (it=itBegin; it != itEnd; ++it)
2350  {
2351  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2352  it->first==input) // skip equal
2353  {
2354  continue;
2355  }
2356 
2357  returnEntries->push_back({it->second.rowid, it->second.engineid});
2358  }
2359  }
2360  break;
2361 
2362  case unorderedchar:
2363  {
2364  return;
2365  }
2366  break;
2367 
2368  default:
2369  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2370  }
2371 }
void Index::comparison ( string *  input,
operatortypes_e  op,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching <,>,<=, or >= expression

Parameters
inputvalue to compare
opoperator
returnEntriesmatching rows

Definition at line 2374 of file Index.cc.

References indexmaptype, logfile, nonuniquecharx, nonuniqueStringIndex, nonuniquevarchar, OPERATOR_GT, OPERATOR_GTE, OPERATOR_LT, OPERATOR_LTE, trimspace(), uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, and unorderedvarchar.

2376 {
2377  trimspace(*input);
2378 
2379  switch (indexmaptype)
2380  {
2381  case uniquecharx:
2382  {
2383  uniqueStringMap::iterator itBegin, itEnd, it;
2384 
2385  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2386  {
2387  itBegin = uniqueStringIndex->begin();
2388  itEnd = uniqueStringIndex->upper_bound(*input);
2389  }
2390  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2391  {
2392  itBegin = uniqueStringIndex->lower_bound(*input);
2393  itEnd = uniqueStringIndex->end();
2394  }
2395  else
2396  {
2397  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2398  }
2399 
2400  // lower_bound: GTE
2401  // upper_bound: LT
2402  for (it=itBegin; it != itEnd; ++it)
2403  {
2404  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2405  it->first==*input) // skip equal
2406  {
2407  continue;
2408  }
2409 
2410  returnEntries->push_back({it->second.rowid, it->second.engineid});
2411  }
2412  }
2413  break;
2414 
2415  case nonuniquecharx:
2416  {
2417  nonuniqueStringMap::iterator itBegin, itEnd, it;
2418 
2419  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2420  {
2421  itBegin = nonuniqueStringIndex->begin();
2422  itEnd = nonuniqueStringIndex->upper_bound(*input);
2423  }
2424  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2425  {
2426  itBegin = nonuniqueStringIndex->lower_bound(*input);
2427  itEnd = nonuniqueStringIndex->end();
2428  }
2429  else
2430  {
2431  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2432  }
2433 
2434  // lower_bound: GTE
2435  // upper_bound: LT
2436  for (it=itBegin; it != itEnd; ++it)
2437  {
2438  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2439  it->first==*input) // skip equal
2440  {
2441  continue;
2442  }
2443 
2444  returnEntries->push_back({it->second.rowid, it->second.engineid});
2445  }
2446  }
2447  break;
2448 
2449  case unorderedcharx:
2450  {
2451  return;
2452  }
2453  break;
2454 
2455  case uniquevarchar:
2456  {
2457  uniqueStringMap::iterator itBegin, itEnd, it;
2458 
2459  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2460  {
2461  itBegin = uniqueStringIndex->begin();
2462  itEnd = uniqueStringIndex->upper_bound(*input);
2463  }
2464  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2465  {
2466  itBegin = uniqueStringIndex->lower_bound(*input);
2467  itEnd = uniqueStringIndex->end();
2468  }
2469  else
2470  {
2471  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2472  }
2473 
2474  // lower_bound: GTE
2475  // upper_bound: LT
2476  for (it=itBegin; it != itEnd; ++it)
2477  {
2478  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2479  it->first==*input) // skip equal
2480  {
2481  continue;
2482  }
2483 
2484  returnEntries->push_back({it->second.rowid, it->second.engineid});
2485  }
2486  }
2487  break;
2488 
2489  case nonuniquevarchar:
2490  {
2491  nonuniqueStringMap::iterator itBegin, itEnd, it;
2492 
2493  if (op==OPERATOR_LT || op==OPERATOR_LTE)
2494  {
2495  itBegin = nonuniqueStringIndex->begin();
2496  itEnd = nonuniqueStringIndex->upper_bound(*input);
2497  }
2498  else if (op==OPERATOR_GT || op==OPERATOR_GTE)
2499  {
2500  itBegin = nonuniqueStringIndex->lower_bound(*input);
2501  itEnd = nonuniqueStringIndex->end();
2502  }
2503  else
2504  {
2505  fprintf(logfile, "anomaly: %i %s %i\n", op, __FILE__, __LINE__);
2506  }
2507 
2508  // lower_bound: GTE
2509  // upper_bound: LT
2510  for (it=itBegin; it != itEnd; ++it)
2511  {
2512  if ((op==OPERATOR_GT || op==OPERATOR_LT) &&
2513  it->first==*input) // skip equal
2514  {
2515  continue;
2516  }
2517 
2518  returnEntries->push_back({it->second.rowid, it->second.engineid});
2519  }
2520  }
2521  break;
2522 
2523  case unorderedvarchar:
2524  {
2525  return;
2526  }
2527  break;
2528 
2529  default:
2530  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
2531  }
2532 }

Here is the call graph for this function:

void Index::deleteNonuniqueEntry ( int64_t  entry,
int64_t  rowid,
int64_t  engineid 
)

delete entry from non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4664 of file Index.cc.

References nonuniqueIntIndex.

Referenced by SubTransaction::processTransactionMessage().

4665 {
4666  pair<multimap<int64_t, nonLockingIndexEntry_s>::iterator,
4667  multimap<int64_t, nonLockingIndexEntry_s>::iterator> iteratorRange;
4668  nonuniqueIntMap::iterator it;
4669 
4670  iteratorRange = nonuniqueIntIndex->equal_range(entry);
4671 
4672  for (it=iteratorRange.first; it != iteratorRange.second; )
4673  {
4674  if (it->second.rowid==rowid && it->second.engineid==engineid)
4675  {
4676  nonuniqueIntIndex->erase(it++);
4677  }
4678  else
4679  {
4680  ++it;
4681  }
4682  }
4683 }

Here is the caller graph for this function:

void Index::deleteNonuniqueEntry ( uint64_t  entry,
int64_t  rowid,
int64_t  engineid 
)

delete entry from non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4685 of file Index.cc.

References nonuniqueUintIndex.

4687 {
4688  pair<multimap<uint64_t, nonLockingIndexEntry_s>::iterator,
4689  multimap<uint64_t, nonLockingIndexEntry_s>::iterator> iteratorRange;
4690  nonuniqueUintMap::iterator it;
4691 
4692  iteratorRange = nonuniqueUintIndex->equal_range(entry);
4693 
4694  for (it=iteratorRange.first; it != iteratorRange.second; )
4695  {
4696  if (it->second.rowid==rowid && it->second.engineid==engineid)
4697  {
4698  nonuniqueUintIndex->erase(it++);
4699  }
4700  else
4701  {
4702  ++it;
4703  }
4704  }
4705 }
void Index::deleteNonuniqueEntry ( bool  entry,
int64_t  rowid,
int64_t  engineid 
)

delete entry from non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4707 of file Index.cc.

References nonuniqueBoolIndex.

4708 {
4709  pair<multimap<bool, nonLockingIndexEntry_s>::iterator,
4710  multimap<bool, nonLockingIndexEntry_s>::iterator> iteratorRange;
4711  nonuniqueBoolMap::iterator it;
4712 
4713  iteratorRange = nonuniqueBoolIndex->equal_range(entry);
4714 
4715  for (it=iteratorRange.first; it != iteratorRange.second; )
4716  {
4717  if (it->second.rowid==rowid && it->second.engineid==engineid)
4718  {
4719  nonuniqueBoolIndex->erase(it++);
4720  }
4721  else
4722  {
4723  ++it;
4724  }
4725  }
4726 }
void Index::deleteNonuniqueEntry ( long double  entry,
int64_t  rowid,
int64_t  engineid 
)

delete entry from non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4728 of file Index.cc.

References nonuniqueFloatIndex.

4730 {
4731  pair<multimap<long double, nonLockingIndexEntry_s>::iterator,
4732  multimap<long double, nonLockingIndexEntry_s>::iterator> iteratorRange;
4733  nonuniqueFloatMap::iterator it;
4734 
4735  iteratorRange = nonuniqueFloatIndex->equal_range(entry);
4736 
4737  for (it=iteratorRange.first; it != iteratorRange.second; )
4738  {
4739  if (it->second.rowid==rowid && it->second.engineid==engineid)
4740  {
4741  nonuniqueFloatIndex->erase(it++);
4742  }
4743  else
4744  {
4745  ++it;
4746  }
4747  }
4748 }
void Index::deleteNonuniqueEntry ( char  entry,
int64_t  rowid,
int64_t  engineid 
)

delete entry from non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4750 of file Index.cc.

References nonuniqueCharIndex.

4751 {
4752  pair<multimap<char, nonLockingIndexEntry_s>::iterator,
4753  multimap<char, nonLockingIndexEntry_s>::iterator> iteratorRange;
4754  nonuniqueCharMap::iterator it;
4755 
4756  iteratorRange = nonuniqueCharIndex->equal_range(entry);
4757 
4758  for (it=iteratorRange.first; it != iteratorRange.second; )
4759  {
4760  if (it->second.rowid==rowid && it->second.engineid==engineid)
4761  {
4762  nonuniqueCharIndex->erase(it++);
4763  }
4764  else
4765  {
4766  ++it;
4767  }
4768  }
4769 }
void Index::deleteNonuniqueEntry ( string *  engry,
int64_t  rowid,
int64_t  engineid 
)

delete entry from non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4771 of file Index.cc.

References nonuniqueStringIndex, and trimspace().

4772 {
4773  trimspace(*entry);
4774 
4775  pair<multimap<string, nonLockingIndexEntry_s>::iterator,
4776  multimap<string, nonLockingIndexEntry_s>::iterator> iteratorRange;
4777  nonuniqueStringMap::iterator it;
4778 
4779  iteratorRange = nonuniqueStringIndex->equal_range(*entry);
4780 
4781  for (it=iteratorRange.first; it != iteratorRange.second; )
4782  {
4783  if (it->second.rowid==rowid && it->second.engineid==engineid)
4784  {
4785  nonuniqueStringIndex->erase(it++);
4786  }
4787  else
4788  {
4789  ++it;
4790  }
4791  }
4792 }

Here is the call graph for this function:

void Index::deleteNullEntry ( int64_t  rowid,
int64_t  engineid 
)

delete entry with NULL value

Parameters
rowidrowid
engineidengineid

Definition at line 4802 of file Index.cc.

References nulls.

Referenced by SubTransaction::processTransactionMessage().

4803 {
4804  vector<int64_t> v(2);
4805  v[0] = rowid;
4806  v[1] = engineid;
4807  nulls.erase(v);
4808 }

Here is the caller graph for this function:

void Index::deleteUniqueEntry ( int64_t  entry)

delete entry from unique index

Parameters
entryfield value

Definition at line 4810 of file Index.cc.

References indexmaptype, logfile, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

Referenced by SubTransaction::processTransactionMessage().

4811 {
4812  switch (indexmaptype)
4813  {
4814  case uniqueint: //uniqueIntIndex
4815  uniqueIntIndex->erase(entry);
4816  break;
4817 
4818  case unorderedint:
4819  unorderedIntIndex->erase(entry);
4820  break;
4821 
4822  default:
4823  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4824  __LINE__);
4825  }
4826 }

Here is the caller graph for this function:

void Index::deleteUniqueEntry ( uint64_t  entry)

delete entry from unique index

Parameters
entryfield value

Definition at line 4828 of file Index.cc.

References indexmaptype, logfile, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

4829 {
4830  switch (indexmaptype)
4831  {
4832  case uniqueuint: //uniqueIntIndex
4833  uniqueUintIndex->erase(entry);
4834  break;
4835 
4836  case unordereduint:
4837  unorderedUintIndex->erase(entry);
4838  break;
4839 
4840  default:
4841  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4842  __LINE__);
4843  }
4844 }
void Index::deleteUniqueEntry ( bool  entry)

delete entry from unique index

Parameters
entryfield value

Definition at line 4846 of file Index.cc.

References indexmaptype, logfile, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

4847 {
4848  switch (indexmaptype)
4849  {
4850  case uniquebool: //uniqueIntIndex
4851  uniqueBoolIndex->erase(entry);
4852  break;
4853 
4854  case unorderedbool:
4855  unorderedBoolIndex->erase(entry);
4856  break;
4857 
4858  default:
4859  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4860  __LINE__);
4861  }
4862 }
void Index::deleteUniqueEntry ( long double  entry)

delete entry from unique index

Parameters
entryfield value

Definition at line 4864 of file Index.cc.

References indexmaptype, logfile, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

4865 {
4866  switch (indexmaptype)
4867  {
4868  case uniquefloat: //uniqueIntIndex
4869  uniqueFloatIndex->erase(entry);
4870  break;
4871 
4872  case unorderedfloat:
4873  unorderedFloatIndex->erase(entry);
4874  break;
4875 
4876  default:
4877  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4878  __LINE__);
4879  }
4880 }
void Index::deleteUniqueEntry ( char  entry)

delete entry from unique index

Parameters
entryfield value

Definition at line 4882 of file Index.cc.

References indexmaptype, logfile, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

4883 {
4884  switch (indexmaptype)
4885  {
4886  case uniquechar: //uniqueIntIndex
4887  uniqueCharIndex->erase(entry);
4888  break;
4889 
4890  case unorderedchar:
4891  unorderedCharIndex->erase(entry);
4892  break;
4893 
4894  default:
4895  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4896  __LINE__);
4897  }
4898 }
void Index::deleteUniqueEntry ( string *  entry)

delete entry from unique index

Parameters
entryfield value

Definition at line 4900 of file Index.cc.

References indexmaptype, logfile, trimspace(), uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

4901 {
4902  trimspace(*entry);
4903 
4904  switch (indexmaptype)
4905  {
4906  case uniquecharx: //uniqueIntIndex
4907  uniqueStringIndex->erase(*entry);
4908  break;
4909 
4910  case unorderedcharx:
4911  unorderedStringIndex->erase(*entry);
4912  break;
4913 
4914  case uniquevarchar: //uniqueIntIndex
4915  uniqueStringIndex->erase(*entry);
4916  break;
4917 
4918  case unorderedvarchar:
4919  unorderedStringIndex->erase(*entry);
4920  break;
4921 
4922  default:
4923  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4924  __LINE__);
4925  }
4926 }

Here is the call graph for this function:

void Index::getall ( vector< indexEntry_s > *  returnEntries)

SELECT *.

Parameters
returnEntriesmatching rows

Definition at line 4947 of file Index.cc.

References getnotnulls(), and getnulls().

Referenced by SubTransaction::indexSearch().

4948 {
4949  getnotnulls(returnEntries);
4950  getnulls(returnEntries);
4951 }

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void Index::getequal ( input,
std::vector< indexEntry_s > *  returnEntries 
)
inline

return index entries matching equality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 112 of file Index.h.

References getequal_f().

Referenced by SubTransaction::indexSearch().

113  {
114  getequal_f(input, returnEntries);
115  }

Here is the call graph for this function:

Here is the caller graph for this function:

void Index::getequal_f ( int64_t  entry,
vector< indexEntry_s > *  returnEntries 
)

perform activity to check for equality

Parameters
entryfield value
returnEntriesmatchine rows

Definition at line 1140 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniqueint, nonuniqueIntIndex, nonLockingIndexEntry_s::rowid, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

Referenced by getequal(), and getin().

1141 {
1142  switch (indexmaptype)
1143  {
1144  case uniqueint:
1145  {
1146  if (uniqueIntIndex->count(input))
1147  {
1148  indexEntry_s entry;
1149  entry.rowid = uniqueIntIndex->at(input).rowid;
1150  entry.engineid = uniqueIntIndex->at(input).engineid;
1151  returnEntries->push_back(entry);
1152  }
1153  }
1154  break;
1155 
1156  case nonuniqueint:
1157  {
1158  pair<multimap<int64_t, nonLockingIndexEntry_s>::iterator,
1159  multimap<int64_t, nonLockingIndexEntry_s>::iterator> itRange;
1160  nonuniqueIntMap::iterator it;
1161 
1162  itRange = nonuniqueIntIndex->equal_range(input);
1163 
1164  for (it=itRange.first; it != itRange.second; ++it)
1165  {
1166  returnEntries->push_back(it->second);
1167  }
1168  }
1169  break;
1170 
1171  case unorderedint:
1172  {
1173  if (unorderedIntIndex->count(input))
1174  {
1175  indexEntry_s entry;
1176  entry.rowid = unorderedIntIndex->at(input).rowid;
1177  entry.engineid = unorderedIntIndex->at(input).engineid;
1178  returnEntries->push_back(entry);
1179  }
1180  }
1181  break;
1182 
1183  default:
1184  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1185  }
1186 }

Here is the caller graph for this function:

void Index::getequal_f ( uint64_t  entry,
vector< indexEntry_s > *  returnEntries 
)

perform activity to check for equality

Parameters
entryfield value
returnEntriesmatchine rows

Definition at line 1187 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniqueuint, nonuniqueUintIndex, nonLockingIndexEntry_s::rowid, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

1188 {
1189  switch (indexmaptype)
1190  {
1191  case uniqueuint:
1192  {
1193  if (uniqueUintIndex->count(input))
1194  {
1195  indexEntry_s entry;
1196  entry.rowid = uniqueUintIndex->at(input).rowid;
1197  entry.engineid = uniqueUintIndex->at(input).engineid;
1198  returnEntries->push_back(entry);
1199  }
1200  }
1201  break;
1202 
1203  case nonuniqueuint:
1204  {
1205  pair<multimap<uint64_t, nonLockingIndexEntry_s>::iterator,
1206  multimap<uint64_t, nonLockingIndexEntry_s>::iterator> itRange;
1207  nonuniqueUintMap::iterator it;
1208 
1209  itRange = nonuniqueUintIndex->equal_range(input);
1210 
1211  for (it=itRange.first; it != itRange.second; ++it)
1212  {
1213  returnEntries->push_back(it->second);
1214  }
1215  }
1216  break;
1217 
1218  case unordereduint:
1219  {
1220  if (unorderedUintIndex->count(input))
1221  {
1222  indexEntry_s entry;
1223  entry.rowid = unorderedUintIndex->at(input).rowid;
1224  entry.engineid = unorderedUintIndex->at(input).engineid;
1225  returnEntries->push_back(entry);
1226  }
1227  }
1228  break;
1229 
1230  default:
1231  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1232  }
1233 }
void Index::getequal_f ( bool  entry,
vector< indexEntry_s > *  returnEntries 
)

perform activity to check for equality

Parameters
entryfield value
returnEntriesmatchine rows

Definition at line 1235 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquebool, nonuniqueBoolIndex, nonLockingIndexEntry_s::rowid, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

1236 {
1237  switch (indexmaptype)
1238  {
1239  case uniquebool:
1240  {
1241  if (uniqueBoolIndex->count(input))
1242  {
1243  indexEntry_s entry;
1244  entry.rowid = uniqueBoolIndex->at(input).rowid;
1245  entry.engineid = uniqueBoolIndex->at(input).engineid;
1246  returnEntries->push_back(entry);
1247  }
1248  }
1249  break;
1250 
1251  case nonuniquebool:
1252  {
1253  pair<multimap<bool, nonLockingIndexEntry_s>::iterator,
1254  multimap<bool, nonLockingIndexEntry_s>::iterator> itRange;
1255  nonuniqueBoolMap::iterator it;
1256 
1257  itRange = nonuniqueBoolIndex->equal_range(input);
1258 
1259  for (it=itRange.first; it != itRange.second; ++it)
1260  {
1261  returnEntries->push_back(it->second);
1262  }
1263  }
1264  break;
1265 
1266  case unorderedbool:
1267  {
1268  if (unorderedBoolIndex->count(input))
1269  {
1270  indexEntry_s entry;
1271  entry.rowid = unorderedBoolIndex->at(input).rowid;
1272  entry.engineid = unorderedBoolIndex->at(input).engineid;
1273  returnEntries->push_back(entry);
1274  }
1275 
1276  }
1277  break;
1278 
1279  default:
1280  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1281  }
1282 }
void Index::getequal_f ( long double  entry,
vector< indexEntry_s > *  returnEntries 
)

perform activity to check for equality

Parameters
entryfield value
returnEntriesmatchine rows

Definition at line 1283 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquefloat, nonuniqueFloatIndex, nonLockingIndexEntry_s::rowid, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

1284 {
1285  switch (indexmaptype)
1286  {
1287  case uniquefloat:
1288  {
1289  if (uniqueFloatIndex->count(input))
1290  {
1291  indexEntry_s entry;
1292  entry.rowid = uniqueFloatIndex->at(input).rowid;
1293  entry.engineid = uniqueFloatIndex->at(input).engineid;
1294  returnEntries->push_back(entry);
1295  }
1296  }
1297  break;
1298 
1299  case nonuniquefloat:
1300  {
1301  pair<multimap<long double, nonLockingIndexEntry_s>::iterator,
1302  multimap<long double, nonLockingIndexEntry_s>::iterator> itRange;
1303  nonuniqueFloatMap::iterator it;
1304 
1305  itRange = nonuniqueFloatIndex->equal_range(input);
1306 
1307  for (it=itRange.first; it != itRange.second; ++it)
1308  {
1309  returnEntries->push_back(it->second);
1310  }
1311  }
1312  break;
1313 
1314  case unorderedfloat:
1315  {
1316  if (unorderedFloatIndex->count(input))
1317  {
1318  indexEntry_s entry;
1319  entry.rowid = unorderedFloatIndex->at(input).rowid;
1320  entry.engineid = unorderedFloatIndex->at(input).engineid;
1321  returnEntries->push_back(entry);
1322  }
1323 
1324  }
1325  break;
1326 
1327  default:
1328  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1329  }
1330 }
void Index::getequal_f ( char  entry,
vector< indexEntry_s > *  returnEntries 
)

perform activity to check for equality

Parameters
entryfield value
returnEntriesmatchine rows

Definition at line 1332 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquechar, nonuniqueCharIndex, nonLockingIndexEntry_s::rowid, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

1333 {
1334  switch (indexmaptype)
1335  {
1336  case uniquechar:
1337  {
1338  if (uniqueCharIndex->count(input))
1339  {
1340  indexEntry_s entry;
1341  entry.rowid = uniqueCharIndex->at(input).rowid;
1342  entry.engineid = uniqueCharIndex->at(input).engineid;
1343  returnEntries->push_back(entry);
1344  }
1345  }
1346  break;
1347 
1348  case nonuniquechar:
1349  {
1350  pair<multimap<char, nonLockingIndexEntry_s>::iterator,
1351  multimap<char, nonLockingIndexEntry_s>::iterator> itRange;
1352  nonuniqueCharMap::iterator it;
1353 
1354  itRange = nonuniqueCharIndex->equal_range(input);
1355 
1356  for (it=itRange.first; it != itRange.second; ++it)
1357  {
1358  returnEntries->push_back(it->second);
1359  }
1360  }
1361  break;
1362 
1363  case unorderedchar:
1364  {
1365  if (unorderedCharIndex->count(input))
1366  {
1367  indexEntry_s entry;
1368  entry.rowid = unorderedCharIndex->at(input).rowid;
1369  entry.engineid = unorderedCharIndex->at(input).engineid;
1370  returnEntries->push_back(entry);
1371  }
1372  }
1373  break;
1374 
1375  default:
1376  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1377  }
1378 }
void Index::getequal_f ( string  entry,
vector< indexEntry_s > *  returnEntries 
)

perform activity to check for equality

Parameters
entryfield value
returnEntriesmatchine rows

Definition at line 1380 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquecharx, nonuniqueStringIndex, nonuniquevarchar, nonLockingIndexEntry_s::rowid, trimspace(), uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

1381 {
1382  trimspace(input);
1383 
1384  switch (indexmaptype)
1385  {
1386  case uniquecharx:
1387  {
1388  if (uniqueStringIndex->count(input))
1389  {
1390  indexEntry_s entry;
1391  entry.rowid = uniqueStringIndex->at(input).rowid;
1392  entry.engineid = uniqueStringIndex->at(input).engineid;
1393  returnEntries->push_back(entry);
1394  }
1395  }
1396  break;
1397 
1398  case nonuniquecharx:
1399  {
1400  pair<multimap<string, nonLockingIndexEntry_s>::iterator,
1401  multimap<string, nonLockingIndexEntry_s>::iterator> itRange;
1402  nonuniqueStringMap::iterator it;
1403 
1404  itRange = nonuniqueStringIndex->equal_range(input);
1405 
1406  for (it=itRange.first; it != itRange.second; ++it)
1407  {
1408  returnEntries->push_back(it->second);
1409  }
1410  }
1411  break;
1412 
1413  case unorderedcharx:
1414  {
1415  if (unorderedStringIndex->count(input))
1416  {
1417  indexEntry_s entry;
1418  entry.rowid = unorderedStringIndex->at(input).rowid;
1419  entry.engineid = unorderedStringIndex->at(input).engineid;
1420  returnEntries->push_back(entry);
1421  }
1422  }
1423  break;
1424 
1425  case uniquevarchar:
1426  {
1427  if (uniqueStringIndex->count(input))
1428  {
1429  indexEntry_s entry;
1430  entry.rowid = uniqueStringIndex->at(input).rowid;
1431  entry.engineid = uniqueStringIndex->at(input).engineid;
1432  returnEntries->push_back(entry);
1433  }
1434  }
1435  break;
1436 
1437  case nonuniquevarchar:
1438  {
1439  pair<multimap<string, nonLockingIndexEntry_s>::iterator,
1440  multimap<string, nonLockingIndexEntry_s>::iterator> itRange;
1441  nonuniqueStringMap::iterator it;
1442 
1443  itRange = nonuniqueStringIndex->equal_range(input);
1444 
1445  for (it=itRange.first; it != itRange.second; ++it)
1446  {
1447  returnEntries->push_back(it->second);
1448  }
1449  }
1450  break;
1451 
1452  case unorderedvarchar:
1453  {
1454  if (unorderedStringIndex->count(input))
1455  {
1456  indexEntry_s entry;
1457  entry.rowid = unorderedStringIndex->at(input).rowid;
1458  entry.engineid = unorderedStringIndex->at(input).engineid;
1459  returnEntries->push_back(entry);
1460  }
1461  }
1462  break;
1463 
1464  default:
1465  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1466  }
1467 }

Here is the call graph for this function:

template<typename T >
void Index::getin ( input,
vector< indexEntry_s > *  returnEntries 
)
inline

return index entries matching IN expression

Parameters
inputlist of IN values to compare
returnEntriesmatching rows

Definition at line 124 of file Index.h.

References getequal_f().

Referenced by SubTransaction::indexSearch().

125  {
126  // input needs to be a vector of the appropriate type
127  for (size_t n=0; n < input->size(); n++)
128  {
129  getequal_f(input->at(n), returnEntries);
130  }
131  }

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T , class U , class V >
void Index::getIterators ( string *  regexStr,
mapPtr,
itBegin,
itEnd 
)
inline

set iterators part of regex query

Parameters
regexStrregex
mapPtrmap to search
itBeginbeginning iterator
itEndending iterator

Definition at line 1164 of file Index.h.

Referenced by regex().

1165  {
1166  if (!regexStr->size())
1167  {
1168  return;
1169  }
1170 
1171  string tmpStr = *regexStr;
1172 
1173  if (tmpStr[0]=='^')
1174  {
1175  tmpStr.erase(0, 1);
1176  }
1177 
1178  size_t n = tmpStr.find_first_of("[\\^$.|?*+()", 0);
1179 
1180  if (!n) // no beginning search string
1181  {
1182  *itBegin = mapPtr->begin();
1183  *itEnd = mapPtr->end();
1184  return;
1185  }
1186 
1187  string beginStr(tmpStr, 0, std::min(n, regexStr->size()));
1188  string endStr = beginStr;
1189 
1190  if (endStr[endStr.size()-1] == 255)
1191  {
1192  endStr.append(1, 1);
1193  }
1194  else
1195  {
1196  endStr[endStr.size()-1]++;
1197  }
1198 
1199  *itBegin = mapPtr->find(beginStr);
1200 
1201  if (*itBegin == mapPtr->end())
1202  {
1203  *itBegin = mapPtr->upper_bound(beginStr);
1204  }
1205 
1206  *itEnd = mapPtr->lower_bound(endStr);
1207  }

Here is the caller graph for this function:

void Index::getnotequal ( int64_t  input,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching inequality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 1469 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniqueint, nonuniqueIntIndex, nonLockingIndexEntry_s::rowid, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

Referenced by SubTransaction::indexSearch().

1470 {
1471  switch (indexmaptype)
1472  {
1473  case uniqueint:
1474  {
1475  uniqueIntMap::iterator it;
1476 
1477  for (it=uniqueIntIndex->begin(); it != uniqueIntIndex->end(); ++it)
1478  {
1479  if (it->first != input)
1480  {
1481  indexEntry_s entry;
1482  entry.rowid = it->second.rowid;
1483  entry.engineid = it->second.engineid;
1484  returnEntries->push_back(entry);
1485  }
1486  }
1487  }
1488  break;
1489 
1490  case nonuniqueint:
1491  {
1492  nonuniqueIntMap::iterator it;
1493 
1494  for (it=nonuniqueIntIndex->begin(); it != nonuniqueIntIndex->end(); ++it)
1495  {
1496  if (it->first != input)
1497  {
1498  returnEntries->push_back(it->second);
1499  }
1500  }
1501  }
1502  break;
1503 
1504  case unorderedint:
1505  {
1506  unorderedIntMap::iterator it;
1507 
1508  for (it=unorderedIntIndex->begin(); it != unorderedIntIndex->end(); ++it)
1509  {
1510  if (it->first != input)
1511  {
1512  indexEntry_s entry;
1513  entry.rowid = it->second.rowid;
1514  entry.engineid = it->second.engineid;
1515  returnEntries->push_back(entry);
1516  }
1517  }
1518  }
1519  break;
1520 
1521  default:
1522  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1523  }
1524 }

Here is the caller graph for this function:

void Index::getnotequal ( uint64_t  input,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching inequality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 1526 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniqueuint, nonuniqueUintIndex, nonLockingIndexEntry_s::rowid, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

1527 {
1528  switch (indexmaptype)
1529  {
1530  case uniqueuint:
1531  {
1532  uniqueUintMap::iterator it;
1533 
1534  for (it=uniqueUintIndex->begin(); it != uniqueUintIndex->end(); ++it)
1535  {
1536  if (it->first != input)
1537  {
1538  indexEntry_s entry;
1539  entry.rowid = it->second.rowid;
1540  entry.engineid = it->second.engineid;
1541  returnEntries->push_back(entry);
1542  }
1543  }
1544  }
1545  break;
1546 
1547  case nonuniqueuint:
1548  {
1549  nonuniqueUintMap::iterator it;
1550 
1551  for (it=nonuniqueUintIndex->begin(); it != nonuniqueUintIndex->end();
1552  ++it)
1553  {
1554  if (it->first != input)
1555  {
1556  returnEntries->push_back(it->second);
1557  }
1558  }
1559 
1560  }
1561  break;
1562 
1563  case unordereduint:
1564  {
1565  unorderedUintMap::iterator it;
1566 
1567  for (it=unorderedUintIndex->begin(); it != unorderedUintIndex->end();
1568  ++it)
1569  {
1570  if (it->first != input)
1571  {
1572  indexEntry_s entry;
1573  entry.rowid = it->second.rowid;
1574  entry.engineid = it->second.engineid;
1575  returnEntries->push_back(entry);
1576  }
1577  }
1578  }
1579  break;
1580 
1581  default:
1582  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1583  }
1584 }
void Index::getnotequal ( bool  input,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching inequality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 1586 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquebool, nonuniqueBoolIndex, nonLockingIndexEntry_s::rowid, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

1587 {
1588  switch (indexmaptype)
1589  {
1590  case uniquebool:
1591  {
1592  uniqueBoolMap::iterator it;
1593 
1594  for (it=uniqueBoolIndex->begin(); it != uniqueBoolIndex->end();
1595  ++it)
1596  {
1597  if (it->first != input)
1598  {
1599  indexEntry_s entry;
1600  entry.rowid = it->second.rowid;
1601  entry.engineid = it->second.engineid;
1602  returnEntries->push_back(entry);
1603  }
1604  }
1605  }
1606  break;
1607 
1608  case nonuniquebool:
1609  {
1610  nonuniqueBoolMap::iterator it;
1611 
1612  for (it=nonuniqueBoolIndex->begin(); it != nonuniqueBoolIndex->end();
1613  ++it)
1614  {
1615  if (it->first != input)
1616  {
1617  returnEntries->push_back(it->second);
1618  }
1619  }
1620 
1621  }
1622  break;
1623 
1624  case unorderedbool:
1625  {
1626  unorderedBoolMap::iterator it;
1627 
1628  for (it=unorderedBoolIndex->begin(); it != unorderedBoolIndex->end();
1629  ++it)
1630  {
1631  if (it->first != input)
1632  {
1633  indexEntry_s entry;
1634  entry.rowid = it->second.rowid;
1635  entry.engineid = it->second.engineid;
1636  returnEntries->push_back(entry);
1637  }
1638  }
1639  }
1640  break;
1641 
1642  default:
1643  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1644  }
1645 }
void Index::getnotequal ( long double  input,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching inequality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 1647 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquefloat, nonuniqueFloatIndex, nonLockingIndexEntry_s::rowid, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

1648 {
1649  switch (indexmaptype)
1650  {
1651  case uniquefloat:
1652  {
1653  uniqueFloatMap::iterator it;
1654 
1655  for (it=uniqueFloatIndex->begin(); it != uniqueFloatIndex->end(); ++it)
1656  {
1657  if (it->first != input)
1658  {
1659  indexEntry_s entry;
1660  entry.rowid = it->second.rowid;
1661  entry.engineid = it->second.engineid;
1662  returnEntries->push_back(entry);
1663  }
1664  }
1665  }
1666  break;
1667 
1668  case nonuniquefloat:
1669  {
1670  nonuniqueFloatMap::iterator it;
1671 
1672  for (it=nonuniqueFloatIndex->begin(); it != nonuniqueFloatIndex->end();
1673  ++it)
1674  {
1675  if (it->first != input)
1676  {
1677  returnEntries->push_back(it->second);
1678  }
1679  }
1680 
1681  }
1682  break;
1683 
1684  case unorderedfloat:
1685  {
1686  unorderedFloatMap::iterator it;
1687 
1688  for (it=unorderedFloatIndex->begin(); it != unorderedFloatIndex->end();
1689  ++it)
1690  {
1691  if (it->first != input)
1692  {
1693  indexEntry_s entry;
1694  entry.rowid = it->second.rowid;
1695  entry.engineid = it->second.engineid;
1696  returnEntries->push_back(entry);
1697  }
1698  }
1699  }
1700  break;
1701 
1702  default:
1703  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1704  }
1705 }
void Index::getnotequal ( char  input,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching inequality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 1707 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquechar, nonuniqueCharIndex, nonLockingIndexEntry_s::rowid, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

1708 {
1709  switch (indexmaptype)
1710  {
1711  case uniquechar:
1712  {
1713  uniqueCharMap::iterator it;
1714 
1715  for (it=uniqueCharIndex->begin(); it != uniqueCharIndex->end(); ++it)
1716  {
1717  if (it->first != input)
1718  {
1719  indexEntry_s entry;
1720  entry.rowid = it->second.rowid;
1721  entry.engineid = it->second.engineid;
1722  returnEntries->push_back(entry);
1723  }
1724  }
1725  }
1726  break;
1727 
1728  case nonuniquechar:
1729  {
1730  nonuniqueCharMap::iterator it;
1731 
1732  for (it=nonuniqueCharIndex->begin(); it != nonuniqueCharIndex->end();
1733  ++it)
1734  {
1735  if (it->first != input)
1736  {
1737  returnEntries->push_back(it->second);
1738  }
1739  }
1740 
1741  }
1742  break;
1743 
1744  case unorderedchar:
1745  {
1746  unorderedCharMap::iterator it;
1747 
1748  for (it=unorderedCharIndex->begin(); it != unorderedCharIndex->end();
1749  ++it)
1750  {
1751  if (it->first != input)
1752  {
1753  indexEntry_s entry;
1754  entry.rowid = it->second.rowid;
1755  entry.engineid = it->second.engineid;
1756  returnEntries->push_back(entry);
1757  }
1758  }
1759  }
1760  break;
1761 
1762  default:
1763  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1764  }
1765 }
void Index::getnotequal ( string  input,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching inequality expression

Parameters
inputvalue to compare
returnEntriesmatching rows

Definition at line 1767 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquecharx, nonuniqueStringIndex, nonuniquevarchar, nonLockingIndexEntry_s::rowid, trimspace(), uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

1768 {
1769  trimspace(input);
1770 
1771  switch (indexmaptype)
1772  {
1773  case uniquecharx:
1774  {
1775  uniqueStringMap::iterator it;
1776 
1777  for (it=uniqueStringIndex->begin(); it != uniqueStringIndex->end(); ++it)
1778  {
1779  if (it->first.compare(input))
1780  {
1781  indexEntry_s entry;
1782  entry.rowid = it->second.rowid;
1783  entry.engineid = it->second.engineid;
1784  returnEntries->push_back(entry);
1785  }
1786  }
1787  }
1788  break;
1789 
1790  case nonuniquecharx:
1791  {
1792  nonuniqueStringMap::iterator it;
1793 
1794  for (it=nonuniqueStringIndex->begin(); it != nonuniqueStringIndex->end();
1795  ++it)
1796  {
1797  if (it->first.compare(input))
1798  {
1799  returnEntries->push_back(it->second);
1800  }
1801  }
1802 
1803  }
1804  break;
1805 
1806  case unorderedcharx:
1807  {
1808  unorderedStringMap::iterator it;
1809 
1810  for (it=unorderedStringIndex->begin(); it != unorderedStringIndex->end();
1811  ++it)
1812  {
1813  if (it->first.compare(input))
1814  {
1815  indexEntry_s entry;
1816  entry.rowid = it->second.rowid;
1817  entry.engineid = it->second.engineid;
1818  returnEntries->push_back(entry);
1819  }
1820  }
1821  }
1822  break;
1823 
1824  case uniquevarchar:
1825  {
1826  uniqueStringMap::iterator it;
1827 
1828  for (it=uniqueStringIndex->begin(); it != uniqueStringIndex->end(); ++it)
1829  {
1830  if (it->first.compare(input))
1831  {
1832  indexEntry_s entry;
1833  entry.rowid = it->second.rowid;
1834  entry.engineid = it->second.engineid;
1835  returnEntries->push_back(entry);
1836  }
1837  }
1838  }
1839  break;
1840 
1841  case nonuniquevarchar:
1842  {
1843  nonuniqueStringMap::iterator it;
1844 
1845  for (it=nonuniqueStringIndex->begin(); it != nonuniqueStringIndex->end();
1846  ++it)
1847  {
1848  if (it->first.compare(input))
1849  {
1850  returnEntries->push_back(it->second);
1851  }
1852  }
1853 
1854  }
1855  break;
1856 
1857  case unorderedvarchar:
1858  {
1859  unorderedStringMap::iterator it;
1860 
1861  for (it=unorderedStringIndex->begin(); it != unorderedStringIndex->end();
1862  ++it)
1863  {
1864  if (it->first.compare(input))
1865  {
1866  indexEntry_s entry;
1867  entry.rowid = it->second.rowid;
1868  entry.engineid = it->second.engineid;
1869  returnEntries->push_back(entry);
1870  }
1871  }
1872  }
1873  break;
1874 
1875  default:
1876  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1877  }
1878 }

Here is the call graph for this function:

void Index::getnotin ( vector< int64_t > &  entries,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching NOT IN expression

Parameters
inputlist of NOT IN values to compare
returnEntriesmatching rows

Definition at line 3066 of file Index.cc.

References indexmaptype, logfile, nonuniqueint, nonuniqueIntIndex, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

Referenced by SubTransaction::indexSearch().

3068 {
3069  switch (indexmaptype)
3070  {
3071  case uniqueint:
3072  {
3073  uniqueIntMap::iterator it;
3074 
3075  for (it = uniqueIntIndex->begin(); it != uniqueIntIndex->end(); ++it)
3076  {
3077  bool isfound=false;
3078 
3079  for (size_t n=0; n < entries.size(); n++)
3080  {
3081  if (entries[n] == it->first)
3082  {
3083  isfound=true;
3084  break;
3085  }
3086  }
3087 
3088  if (isfound==false)
3089  {
3090  returnEntries->push_back({it->second.rowid,
3091  it->second.engineid});
3092  }
3093  }
3094  }
3095  break;
3096 
3097  case unorderedint:
3098  {
3099  unorderedIntMap::iterator it;
3100 
3101  for (it = unorderedIntIndex->begin(); it != unorderedIntIndex->end();
3102  ++it)
3103  {
3104  bool isfound=false;
3105 
3106  for (size_t n=0; n < entries.size(); n++)
3107  {
3108  if (entries[n] == it->first)
3109  {
3110  isfound=true;
3111  break;
3112  }
3113  }
3114 
3115  if (isfound==false)
3116  {
3117  returnEntries->push_back({it->second.rowid,
3118  it->second.engineid});
3119  }
3120  }
3121  }
3122  break;
3123 
3124  case nonuniqueint:
3125  {
3126  nonuniqueIntMap::iterator it;
3127 
3128  for (it = nonuniqueIntIndex->begin(); it != nonuniqueIntIndex->end();
3129  ++it)
3130  {
3131  bool isfound=false;
3132 
3133  for (size_t n=0; n < entries.size(); n++)
3134  {
3135  if (entries[n] == it->first)
3136  {
3137  isfound=true;
3138  break;
3139  }
3140  }
3141 
3142  if (isfound==false)
3143  {
3144  returnEntries->push_back({it->second.rowid,
3145  it->second.engineid});
3146  }
3147  }
3148  }
3149  break;
3150 
3151  default:
3152  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3153  }
3154 }

Here is the caller graph for this function:

void Index::getnotin ( vector< uint64_t > &  entries,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching NOT IN expression

Parameters
inputlist of NOT IN values to compare
returnEntriesmatching rows

Definition at line 3156 of file Index.cc.

References indexmaptype, logfile, nonuniqueuint, nonuniqueUintIndex, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

3158 {
3159  switch (indexmaptype)
3160  {
3161  case uniqueuint:
3162  {
3163  uniqueUintMap::iterator it;
3164 
3165  for (it = uniqueUintIndex->begin(); it != uniqueUintIndex->end(); ++it)
3166  {
3167  bool isfound=false;
3168 
3169  for (size_t n=0; n < entries.size(); n++)
3170  {
3171  if (entries[n] == it->first)
3172  {
3173  isfound=true;
3174  break;
3175  }
3176  }
3177 
3178  if (isfound==false)
3179  {
3180  returnEntries->push_back({it->second.rowid,
3181  it->second.engineid});
3182  }
3183  }
3184  }
3185  break;
3186 
3187  case unordereduint:
3188  {
3189  unorderedUintMap::iterator it;
3190 
3191  for (it = unorderedUintIndex->begin();
3192  it != unorderedUintIndex->end(); ++it)
3193  {
3194  bool isfound=false;
3195 
3196  for (size_t n=0; n < entries.size(); n++)
3197  {
3198  if (entries[n] == it->first)
3199  {
3200  isfound=true;
3201  break;
3202  }
3203  }
3204 
3205  if (isfound==false)
3206  {
3207  returnEntries->push_back({it->second.rowid,
3208  it->second.engineid});
3209  }
3210  }
3211  }
3212  break;
3213 
3214  case nonuniqueuint:
3215  {
3216  nonuniqueUintMap::iterator it;
3217 
3218  for (it = nonuniqueUintIndex->begin(); it != nonuniqueUintIndex->end();
3219  ++it)
3220  {
3221  bool isfound=false;
3222 
3223  for (size_t n=0; n < entries.size(); n++)
3224  {
3225  if (entries[n] == it->first)
3226  {
3227  isfound=true;
3228  break;
3229  }
3230  }
3231 
3232  if (isfound==false)
3233  {
3234  returnEntries->push_back({it->second.rowid,
3235  it->second.engineid});
3236  }
3237  }
3238  }
3239  break;
3240 
3241  default:
3242  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3243  }
3244 }
void Index::getnotin ( vector< bool > &  entries,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching NOT IN expression

Parameters
inputlist of NOT IN values to compare
returnEntriesmatching rows

Definition at line 3246 of file Index.cc.

References indexmaptype, logfile, nonuniquebool, nonuniqueBoolIndex, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

3248 {
3249  switch (indexmaptype)
3250  {
3251  case uniquebool:
3252  {
3253  uniqueBoolMap::iterator it;
3254 
3255  for (it = uniqueBoolIndex->begin(); it != uniqueBoolIndex->end(); ++it)
3256  {
3257  bool isfound=false;
3258 
3259  for (size_t n=0; n < entries.size(); n++)
3260  {
3261  if (entries[n] == it->first)
3262  {
3263  isfound=true;
3264  break;
3265  }
3266  }
3267 
3268  if (isfound==false)
3269  {
3270  returnEntries->push_back({it->second.rowid,
3271  it->second.engineid});
3272  }
3273  }
3274  }
3275  break;
3276 
3277  case unorderedbool:
3278  {
3279  unorderedBoolMap::iterator it;
3280 
3281  for (it = unorderedBoolIndex->begin();
3282  it != unorderedBoolIndex->end(); ++it)
3283  {
3284  bool isfound=false;
3285 
3286  for (size_t n=0; n < entries.size(); n++)
3287  {
3288  if (entries[n] == it->first)
3289  {
3290  isfound=true;
3291  break;
3292  }
3293  }
3294 
3295  if (isfound==false)
3296  {
3297  returnEntries->push_back({it->second.rowid,
3298  it->second.engineid});
3299  }
3300  }
3301  }
3302  break;
3303 
3304  case nonuniquebool:
3305  {
3306  nonuniqueBoolMap::iterator it;
3307 
3308  for (it = nonuniqueBoolIndex->begin();
3309  it != nonuniqueBoolIndex->end();++it)
3310  {
3311  bool isfound=false;
3312 
3313  for (size_t n=0; n < entries.size(); n++)
3314  {
3315  if (entries[n] == it->first)
3316  {
3317  isfound=true;
3318  break;
3319  }
3320  }
3321 
3322  if (isfound==false)
3323  {
3324  returnEntries->push_back({it->second.rowid,
3325  it->second.engineid});
3326  }
3327  }
3328  }
3329  break;
3330 
3331  default:
3332  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3333  }
3334 }
void Index::getnotin ( vector< long double > &  entries,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching NOT IN expression

Parameters
inputlist of NOT IN values to compare
returnEntriesmatching rows

Definition at line 3336 of file Index.cc.

References indexmaptype, logfile, nonuniquefloat, nonuniqueFloatIndex, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

3338 {
3339  switch (indexmaptype)
3340  {
3341  case uniquefloat:
3342  {
3343  uniqueFloatMap::iterator it;
3344 
3345  for (it = uniqueFloatIndex->begin(); it != uniqueFloatIndex->end(); ++it)
3346  {
3347  bool isfound=false;
3348 
3349  for (size_t n=0; n < entries.size(); n++)
3350  {
3351  if (entries[n] == it->first)
3352  {
3353  isfound=true;
3354  break;
3355  }
3356  }
3357 
3358  if (isfound==false)
3359  {
3360  returnEntries->push_back({it->second.rowid,
3361  it->second.engineid});
3362  }
3363  }
3364  }
3365  break;
3366 
3367  case unorderedfloat:
3368  {
3369  unorderedFloatMap::iterator it;
3370 
3371  for (it = unorderedFloatIndex->begin();
3372  it != unorderedFloatIndex->end(); ++it)
3373  {
3374  bool isfound=false;
3375 
3376  for (size_t n=0; n < entries.size(); n++)
3377  {
3378  if (entries[n] == it->first)
3379  {
3380  isfound=true;
3381  break;
3382  }
3383  }
3384 
3385  if (isfound==false)
3386  {
3387  returnEntries->push_back({it->second.rowid,
3388  it->second.engineid});
3389  }
3390  }
3391  }
3392  break;
3393 
3394  case nonuniquefloat:
3395  {
3396  nonuniqueFloatMap::iterator it;
3397 
3398  for (it = nonuniqueFloatIndex->begin();
3399  it != nonuniqueFloatIndex->end(); ++it)
3400  {
3401  bool isfound=false;
3402 
3403  for (size_t n=0; n < entries.size(); n++)
3404  {
3405  if (entries[n] == it->first)
3406  {
3407  isfound=true;
3408  break;
3409  }
3410  }
3411 
3412  if (isfound==false)
3413  {
3414  returnEntries->push_back({it->second.rowid,
3415  it->second.engineid});
3416  }
3417  }
3418  }
3419  break;
3420 
3421  default:
3422  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3423  }
3424 }
void Index::getnotin ( vector< char > &  entries,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching NOT IN expression

Parameters
inputlist of NOT IN values to compare
returnEntriesmatching rows

Definition at line 3426 of file Index.cc.

References indexmaptype, logfile, nonuniquechar, nonuniqueCharIndex, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

3428 {
3429  switch (indexmaptype)
3430  {
3431  case uniquechar:
3432  {
3433  uniqueCharMap::iterator it;
3434 
3435  for (it = uniqueCharIndex->begin(); it != uniqueCharIndex->end(); ++it)
3436  {
3437  bool isfound=false;
3438 
3439  for (size_t n=0; n < entries.size(); n++)
3440  {
3441  if (entries[n] == it->first)
3442  {
3443  isfound=true;
3444  break;
3445  }
3446  }
3447 
3448  if (isfound==false)
3449  {
3450  returnEntries->push_back({it->second.rowid,
3451  it->second.engineid});
3452  }
3453  }
3454  }
3455  break;
3456 
3457  case unorderedchar:
3458  {
3459  unorderedCharMap::iterator it;
3460 
3461  for (it = unorderedCharIndex->begin();
3462  it != unorderedCharIndex->end(); ++it)
3463  {
3464  bool isfound=false;
3465 
3466  for (size_t n=0; n < entries.size(); n++)
3467  {
3468  if (entries[n] == it->first)
3469  {
3470  isfound=true;
3471  break;
3472  }
3473  }
3474 
3475  if (isfound==false)
3476  {
3477  returnEntries->push_back({it->second.rowid,
3478  it->second.engineid});
3479  }
3480  }
3481  }
3482  break;
3483 
3484  case nonuniquechar:
3485  {
3486  nonuniqueCharMap::iterator it;
3487 
3488  for (it = nonuniqueCharIndex->begin();
3489  it != nonuniqueCharIndex->end(); ++it)
3490  {
3491  bool isfound=false;
3492 
3493  for (size_t n=0; n < entries.size(); n++)
3494  {
3495  if (entries[n] == it->first)
3496  {
3497  isfound=true;
3498  break;
3499  }
3500  }
3501 
3502  if (isfound==false)
3503  {
3504  returnEntries->push_back({it->second.rowid,
3505  it->second.engineid});
3506  }
3507  }
3508  }
3509  break;
3510 
3511  default:
3512  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3513  }
3514 }
void Index::getnotin ( vector< string > &  entries,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching NOT IN expression

Parameters
inputlist of NOT IN values to compare
returnEntriesmatching rows

Definition at line 3516 of file Index.cc.

References indexmaptype, logfile, nonuniquecharx, nonuniqueStringIndex, nonuniquevarchar, trimspace(), uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

3518 {
3519  switch (indexmaptype)
3520  {
3521  case uniquecharx:
3522  {
3523  uniqueStringMap::iterator it;
3524 
3525  for (it = uniqueStringIndex->begin();
3526  it != uniqueStringIndex->end(); ++it)
3527  {
3528  bool isfound=false;
3529 
3530  for (size_t n=0; n < entries.size(); n++)
3531  {
3532  trimspace(entries[n]);
3533 
3534  if (!entries[n].compare(it->first))
3535  {
3536  isfound=true;
3537  break;
3538  }
3539  }
3540 
3541  if (isfound==false)
3542  {
3543  returnEntries->push_back({it->second.rowid,
3544  it->second.engineid});
3545  }
3546  }
3547  }
3548  break;
3549 
3550  case unorderedcharx:
3551  {
3552  unorderedStringMap::iterator it;
3553 
3554  for (it = unorderedStringIndex->begin();
3555  it != unorderedStringIndex->end(); ++it)
3556  {
3557  bool isfound=false;
3558 
3559  for (size_t n=0; n < entries.size(); n++)
3560  {
3561  if (!entries[n].compare(it->first))
3562  {
3563  isfound=true;
3564  break;
3565  }
3566  }
3567 
3568  if (isfound==false)
3569  {
3570  returnEntries->push_back({it->second.rowid,
3571  it->second.engineid});
3572  }
3573  }
3574  }
3575  break;
3576 
3577  case nonuniquecharx:
3578  {
3579  nonuniqueStringMap::iterator it;
3580 
3581  for (it = nonuniqueStringIndex->begin();
3582  it != nonuniqueStringIndex->end(); ++it)
3583  {
3584  bool isfound=false;
3585 
3586  for (size_t n=0; n < entries.size(); n++)
3587  {
3588  trimspace(entries[n]);
3589 
3590  if (!entries[n].compare(it->first))
3591  {
3592  isfound=true;
3593  break;
3594  }
3595  }
3596 
3597  if (isfound==false)
3598  {
3599  returnEntries->push_back({it->second.rowid,
3600  it->second.engineid});
3601  }
3602  }
3603  }
3604  break;
3605 
3606  case uniquevarchar:
3607  {
3608  uniqueStringMap::iterator it;
3609 
3610  for (it = uniqueStringIndex->begin();
3611  it != uniqueStringIndex->end(); ++it)
3612  {
3613  bool isfound=false;
3614 
3615  for (size_t n=0; n < entries.size(); n++)
3616  {
3617  trimspace(entries[n]);
3618 
3619  if (!entries[n].compare(it->first))
3620  {
3621  isfound=true;
3622  break;
3623  }
3624  }
3625 
3626  if (isfound==false)
3627  {
3628  returnEntries->push_back({it->second.rowid,
3629  it->second.engineid});
3630  }
3631  }
3632  }
3633  break;
3634 
3635  case unorderedvarchar:
3636  {
3637  unorderedStringMap::iterator it;
3638 
3639  for (it = unorderedStringIndex->begin();
3640  it != unorderedStringIndex->end(); ++it)
3641  {
3642  bool isfound=false;
3643 
3644  for (size_t n=0; n < entries.size(); n++)
3645  {
3646  if (!entries[n].compare(it->first))
3647  {
3648  isfound=true;
3649  break;
3650  }
3651  }
3652 
3653  if (isfound==false)
3654  {
3655  returnEntries->push_back({it->second.rowid,
3656  it->second.engineid});
3657  }
3658  }
3659  }
3660  break;
3661 
3662  case nonuniquevarchar:
3663  {
3664  nonuniqueStringMap::iterator it;
3665 
3666  for (it = nonuniqueStringIndex->begin();
3667  it != nonuniqueStringIndex->end(); ++it)
3668  {
3669  bool isfound=false;
3670 
3671  for (size_t n=0; n < entries.size(); n++)
3672  {
3673  if (!entries[n].compare(it->first))
3674  {
3675  isfound=true;
3676  break;
3677  }
3678  }
3679 
3680  if (isfound==false)
3681  {
3682  returnEntries->push_back({it->second.rowid,
3683  it->second.engineid});
3684  }
3685  }
3686  }
3687  break;
3688 
3689  default:
3690  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3691  }
3692 }

Here is the call graph for this function:

void Index::getnotnulls ( vector< indexEntry_s > *  returnEntries)

return all non-NULL entries

Parameters
returnEntriesmatching rows

Definition at line 819 of file Index.cc.

References nonLockingIndexEntry_s::engineid, indexmaptype, logfile, nonuniquebool, nonuniqueBoolIndex, nonuniquechar, nonuniqueCharIndex, nonuniquecharx, nonuniquefloat, nonuniqueFloatIndex, nonuniqueint, nonuniqueIntIndex, nonuniqueStringIndex, nonuniqueuint, nonuniqueUintIndex, nonuniquevarchar, nonLockingIndexEntry_s::rowid, uniquebool, uniqueBoolIndex, uniquechar, uniqueCharIndex, uniquecharx, uniquefloat, uniqueFloatIndex, uniqueint, uniqueIntIndex, uniqueStringIndex, uniqueuint, uniqueUintIndex, uniquevarchar, unorderedbool, unorderedBoolIndex, unorderedchar, unorderedCharIndex, unorderedcharx, unorderedfloat, unorderedFloatIndex, unorderedint, unorderedIntIndex, unorderedStringIndex, unordereduint, unorderedUintIndex, and unorderedvarchar.

Referenced by getall(), and SubTransaction::indexSearch().

820 {
821  switch (indexmaptype)
822  {
823  case uniqueint:
824  {
825  uniqueIntMap::iterator it;
826 
827  for (it=uniqueIntIndex->begin(); it != uniqueIntIndex->end(); ++it)
828  {
829  indexEntry_s entry;
830  entry.rowid = it->second.rowid;
831  entry.engineid = it->second.engineid;
832  returnEntries->push_back(entry);
833  }
834  }
835  break;
836 
837  case nonuniqueint:
838  {
839  nonuniqueIntMap::iterator it;
840 
841  for (it=nonuniqueIntIndex->begin();
842  it != nonuniqueIntIndex->end(); ++it)
843  {
844  indexEntry_s entry;
845  entry.rowid = it->second.rowid;
846  entry.engineid = it->second.engineid;
847  returnEntries->push_back(entry);
848  }
849  }
850  break;
851 
852  case unorderedint:
853  {
854  unorderedIntMap::iterator it;
855 
856  for (it=unorderedIntIndex->begin(); it != unorderedIntIndex->end();
857  ++it)
858  {
859  indexEntry_s entry;
860  entry.rowid = it->second.rowid;
861  entry.engineid = it->second.engineid;
862  returnEntries->push_back(entry);
863  }
864  }
865  break;
866 
867  case uniqueuint:
868  {
869  uniqueUintMap::iterator it;
870 
871  for (it=uniqueUintIndex->begin(); it != uniqueUintIndex->end();
872  ++it)
873  {
874  indexEntry_s entry;
875  entry.rowid = it->second.rowid;
876  entry.engineid = it->second.engineid;
877  returnEntries->push_back(entry);
878  }
879  }
880  break;
881 
882  case nonuniqueuint:
883  {
884  nonuniqueUintMap::iterator it;
885 
886  for (it=nonuniqueUintIndex->begin();
887  it != nonuniqueUintIndex->end(); ++it)
888  {
889  indexEntry_s entry;
890  entry.rowid = it->second.rowid;
891  entry.engineid = it->second.engineid;
892  returnEntries->push_back(entry);
893  }
894  }
895  break;
896 
897  case unordereduint:
898  {
899  unorderedUintMap::iterator it;
900 
901  for (it=unorderedUintIndex->begin();
902  it != unorderedUintIndex->end(); ++it)
903  {
904  indexEntry_s entry;
905  entry.rowid = it->second.rowid;
906  entry.engineid = it->second.engineid;
907  returnEntries->push_back(entry);
908  }
909  }
910  break;
911 
912  case uniquebool:
913  {
914  uniqueBoolMap::iterator it;
915 
916  for (it=uniqueBoolIndex->begin();
917  it != uniqueBoolIndex->end(); ++it)
918  {
919  indexEntry_s entry;
920  entry.rowid = it->second.rowid;
921  entry.engineid = it->second.engineid;
922  returnEntries->push_back(entry);
923  }
924  }
925  break;
926 
927  case nonuniquebool:
928  {
929  nonuniqueBoolMap::iterator it;
930 
931  for (it=nonuniqueBoolIndex->begin();
932  it != nonuniqueBoolIndex->end(); ++it)
933  {
934  indexEntry_s entry;
935  entry.rowid = it->second.rowid;
936  entry.engineid = it->second.engineid;
937  returnEntries->push_back(entry);
938  }
939  }
940  break;
941 
942  case unorderedbool:
943  {
944  unorderedBoolMap::iterator it;
945 
946  for (it=unorderedBoolIndex->begin();
947  it != unorderedBoolIndex->end(); ++it)
948  {
949  indexEntry_s entry;
950  entry.rowid = it->second.rowid;
951  entry.engineid = it->second.engineid;
952  returnEntries->push_back(entry);
953  }
954  }
955  break;
956 
957  case uniquefloat:
958  {
959  uniqueFloatMap::iterator it;
960 
961  for (it=uniqueFloatIndex->begin();
962  it != uniqueFloatIndex->end(); ++it)
963  {
964  indexEntry_s entry;
965  entry.rowid = it->second.rowid;
966  entry.engineid = it->second.engineid;
967  returnEntries->push_back(entry);
968  }
969  }
970  break;
971 
972  case nonuniquefloat:
973  {
974  nonuniqueFloatMap::iterator it;
975 
976  for (it=nonuniqueFloatIndex->begin();
977  it != nonuniqueFloatIndex->end(); ++it)
978  {
979  indexEntry_s entry;
980  entry.rowid = it->second.rowid;
981  entry.engineid = it->second.engineid;
982  returnEntries->push_back(entry);
983  }
984  }
985  break;
986 
987  case unorderedfloat:
988  {
989  unorderedFloatMap::iterator it;
990 
991  for (it=unorderedFloatIndex->begin(); it != unorderedFloatIndex->end();
992  ++it)
993  {
994  indexEntry_s entry;
995  entry.rowid = it->second.rowid;
996  entry.engineid = it->second.engineid;
997  returnEntries->push_back(entry);
998  }
999  }
1000  break;
1001 
1002  case uniquechar:
1003  {
1004  uniqueCharMap::iterator it;
1005 
1006  for (it=uniqueCharIndex->begin(); it != uniqueCharIndex->end(); ++it)
1007  {
1008  indexEntry_s entry;
1009  entry.rowid = it->second.rowid;
1010  entry.engineid = it->second.engineid;
1011  returnEntries->push_back(entry);
1012  }
1013  }
1014  break;
1015 
1016  case nonuniquechar:
1017  {
1018  nonuniqueCharMap::iterator it;
1019 
1020  for (it=nonuniqueCharIndex->begin(); it != nonuniqueCharIndex->end();
1021  ++it)
1022  {
1023  indexEntry_s entry;
1024  entry.rowid = it->second.rowid;
1025  entry.engineid = it->second.engineid;
1026  returnEntries->push_back(entry);
1027  }
1028  }
1029  break;
1030 
1031  case unorderedchar:
1032  {
1033  unorderedCharMap::iterator it;
1034 
1035  for (it=unorderedCharIndex->begin(); it != unorderedCharIndex->end();
1036  ++it)
1037  {
1038  indexEntry_s entry;
1039  entry.rowid = it->second.rowid;
1040  entry.engineid = it->second.engineid;
1041  returnEntries->push_back(entry);
1042  }
1043  }
1044  break;
1045 
1046  case uniquecharx:
1047  {
1048  uniqueStringMap::iterator it;
1049 
1050  for (it=uniqueStringIndex->begin(); it != uniqueStringIndex->end(); ++it)
1051  {
1052  indexEntry_s entry;
1053  entry.rowid = it->second.rowid;
1054  entry.engineid = it->second.engineid;
1055  returnEntries->push_back(entry);
1056  }
1057  }
1058  break;
1059 
1060  case nonuniquecharx:
1061  {
1062  nonuniqueStringMap::iterator it;
1063 
1064  for (it=nonuniqueStringIndex->begin(); it != nonuniqueStringIndex->end();
1065  ++it)
1066  {
1067  indexEntry_s entry;
1068  entry.rowid = it->second.rowid;
1069  entry.engineid = it->second.engineid;
1070  returnEntries->push_back(entry);
1071  }
1072  }
1073  break;
1074 
1075  case unorderedcharx:
1076  {
1077  unorderedStringMap::iterator it;
1078 
1079  for (it=unorderedStringIndex->begin(); it != unorderedStringIndex->end();
1080  ++it)
1081  {
1082  indexEntry_s entry;
1083  entry.rowid = it->second.rowid;
1084  entry.engineid = it->second.engineid;
1085  returnEntries->push_back(entry);
1086  }
1087  }
1088  break;
1089 
1090  case uniquevarchar:
1091  {
1092  uniqueStringMap::iterator it;
1093 
1094  for (it=uniqueStringIndex->begin(); it != uniqueStringIndex->end(); ++it)
1095  {
1096  indexEntry_s entry;
1097  entry.rowid = it->second.rowid;
1098  entry.engineid = it->second.engineid;
1099  returnEntries->push_back(entry);
1100  }
1101  }
1102  break;
1103 
1104  case nonuniquevarchar:
1105  {
1106  nonuniqueStringMap::iterator it;
1107 
1108  for (it=nonuniqueStringIndex->begin(); it != nonuniqueStringIndex->end();
1109  ++it)
1110  {
1111  indexEntry_s entry;
1112  entry.rowid = it->second.rowid;
1113  entry.engineid = it->second.engineid;
1114  returnEntries->push_back(entry);
1115  }
1116  }
1117  break;
1118 
1119  case unorderedvarchar:
1120  {
1121  unorderedStringMap::iterator it;
1122 
1123  for (it=unorderedStringIndex->begin(); it != unorderedStringIndex->end();
1124  ++it)
1125  {
1126  indexEntry_s entry;
1127  entry.rowid = it->second.rowid;
1128  entry.engineid = it->second.engineid;
1129  returnEntries->push_back(entry);
1130  }
1131  }
1132  break;
1133 
1134  default:
1135  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
1136  }
1137 }

Here is the caller graph for this function:

void Index::getnulls ( vector< indexEntry_s > *  returnEntries)

return index entries matching IS NULL expression

Parameters
returnEntriesmatching rows

Definition at line 4928 of file Index.cc.

References nonLockingIndexEntry_s::engineid, notNull, nulls, and nonLockingIndexEntry_s::rowid.

Referenced by getall(), and SubTransaction::indexSearch().

4929 {
4930  if (notNull==true) // very easy
4931  {
4932  return;
4933  }
4934 
4935  boost::unordered_set< vector<int64_t> >::iterator nullsIterator;
4936  indexEntry_s entry;
4937 
4938  for (nullsIterator = nulls.begin(); nullsIterator != nulls.end();
4939  ++nullsIterator)
4940  {
4941  entry.rowid = nullsIterator->at(0);
4942  entry.engineid = nullsIterator->at(1);
4943  returnEntries->push_back(entry);
4944  }
4945 }

Here is the caller graph for this function:

int64_t Index::getprevioussubtransactionid ( fieldValue_s val)

return previous subtransactionid for field

part of synchronous replication

Parameters
valfield value
Returns

Definition at line 5695 of file Index.cc.

References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, fieldtype, FLOAT, fieldInput_u::floating, INT, fieldInput_u::integer, fieldValue_s::str, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.

Referenced by Engine::applyItem().

5696 {
5697  switch (fieldtype)
5698  {
5699  case INT:
5701  break;
5702 
5703  case UINT:
5705  break;
5706 
5707  case BOOL:
5709  break;
5710 
5711  case FLOAT:
5713  break;
5714 
5715  case CHAR:
5717  break;
5718 
5719  case CHARX:
5720  return getprevioussubtransactionid(val.str);
5721  break;
5722 
5723  case VARCHAR:
5724  return getprevioussubtransactionid(val.str);
5725  break;
5726 
5727  default:
5728  printf("%s %i anomaly fieldtype %i\n", __FILE__, __LINE__,
5729  fieldtype);
5730  }
5731 
5732  return -1;
5733 }

Here is the caller graph for this function:

int64_t Index::getprevioussubtransactionid ( int64_t  val)

Definition at line 5736 of file Index.cc.

References indexmaptype, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

5737 {
5738  switch (indexmaptype)
5739  {
5740  case uniqueint:
5741  return uniqueIntIndex->at(val).previoussubtransactionid;
5742  break;
5743 
5744  case unorderedint:
5745  return unorderedIntIndex->at(val).previoussubtransactionid;
5746  break;
5747 
5748  default:
5749  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5750  indexmaptype);
5751  }
5752 
5753  return -1;
5754 }
int64_t Index::getprevioussubtransactionid ( uint64_t  val)

Definition at line 5756 of file Index.cc.

References indexmaptype, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

5757 {
5758  switch (indexmaptype)
5759  {
5760  case uniqueuint:
5761  return uniqueUintIndex->at(val).previoussubtransactionid;
5762  break;
5763 
5764  case unordereduint:
5765  return unorderedUintIndex->at(val).previoussubtransactionid;
5766  break;
5767 
5768  default:
5769  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5770  indexmaptype);
5771  }
5772 
5773  return -1;
5774 }
int64_t Index::getprevioussubtransactionid ( bool  val)

Definition at line 5776 of file Index.cc.

References indexmaptype, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

5777 {
5778  switch (indexmaptype)
5779  {
5780  case uniquebool:
5781  return uniqueBoolIndex->at(val).previoussubtransactionid;
5782  break;
5783 
5784  case unorderedbool:
5785  return unorderedBoolIndex->at(val).previoussubtransactionid;
5786  break;
5787 
5788  default:
5789  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5790  indexmaptype);
5791  }
5792 
5793  return -1;
5794 }
int64_t Index::getprevioussubtransactionid ( long double  val)

Definition at line 5796 of file Index.cc.

References indexmaptype, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

5797 {
5798  switch (indexmaptype)
5799  {
5800  case uniquefloat:
5801  return uniqueFloatIndex->at(val).previoussubtransactionid;
5802  break;
5803 
5804  case unorderedfloat:
5805  return unorderedFloatIndex->at(val).previoussubtransactionid;
5806  break;
5807 
5808  default:
5809  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5810  indexmaptype);
5811  }
5812 
5813  return -1;
5814 }
int64_t Index::getprevioussubtransactionid ( char  val)

Definition at line 5816 of file Index.cc.

References indexmaptype, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

5817 {
5818  switch (indexmaptype)
5819  {
5820  case uniquechar:
5821  return uniqueCharIndex->at(val).previoussubtransactionid;
5822  break;
5823 
5824  case unorderedchar:
5825  return unorderedCharIndex->at(val).previoussubtransactionid;
5826  break;
5827 
5828  default:
5829  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5830  indexmaptype);
5831  }
5832 
5833  return -1;
5834 }
int64_t Index::getprevioussubtransactionid ( string &  val)

Definition at line 5836 of file Index.cc.

References indexmaptype, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

5837 {
5838  switch (indexmaptype)
5839  {
5840  case uniquecharx:
5841  return uniqueStringIndex->at(val).previoussubtransactionid;
5842  break;
5843 
5844  case unorderedcharx:
5845  return unorderedStringIndex->at(val).previoussubtransactionid;
5846  break;
5847 
5848  case uniquevarchar:
5849  return uniqueStringIndex->at(val).previoussubtransactionid;
5850  break;
5851 
5852  case unorderedvarchar:
5853  return unorderedStringIndex->at(val).previoussubtransactionid;
5854  break;
5855 
5856  default:
5857  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5858  indexmaptype);
5859  }
5860 
5861  return -1;
5862 }
void Index::insertNonuniqueEntry ( int64_t  entry,
int64_t  rowid,
int64_t  engineid 
)

insert entry into non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4610 of file Index.cc.

References nonLockingIndexEntry_s::engineid, nonuniqueIntIndex, and nonLockingIndexEntry_s::rowid.

Referenced by SubTransaction::processTransactionMessage().

4611 {
4612  nonLockingIndexEntry_s val = {};
4613  val.rowid = rowid;
4614  val.engineid = engineid;
4615  nonuniqueIntIndex->insert(pair<int64_t, nonLockingIndexEntry_s>(entry, val));
4616 }

Here is the caller graph for this function:

void Index::insertNonuniqueEntry ( uint64_t  entry,
int64_t  rowid,
int64_t  engineid 
)

insert entry into non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4618 of file Index.cc.

References nonLockingIndexEntry_s::engineid, nonuniqueUintIndex, and nonLockingIndexEntry_s::rowid.

4620 {
4621  nonLockingIndexEntry_s val = {};
4622  val.rowid = rowid;
4623  val.engineid = engineid;
4624  nonuniqueUintIndex->insert(pair<uint64_t,
4625  nonLockingIndexEntry_s>(entry, val));
4626 }
void Index::insertNonuniqueEntry ( bool  entry,
int64_t  rowid,
int64_t  engineid 
)

insert entry into non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4628 of file Index.cc.

References nonLockingIndexEntry_s::engineid, nonuniqueBoolIndex, and nonLockingIndexEntry_s::rowid.

4629 {
4630  nonLockingIndexEntry_s val = {};
4631  val.rowid = rowid;
4632  val.engineid = engineid;
4633  nonuniqueBoolIndex->insert(pair<bool, nonLockingIndexEntry_s>(entry, val));
4634 }
void Index::insertNonuniqueEntry ( long double  entry,
int64_t  rowid,
int64_t  engineid 
)

insert entry into non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4636 of file Index.cc.

References nonLockingIndexEntry_s::engineid, nonuniqueFloatIndex, and nonLockingIndexEntry_s::rowid.

4638 {
4639  nonLockingIndexEntry_s val = {};
4640  val.rowid = rowid;
4641  val.engineid = engineid;
4642  nonuniqueFloatIndex->insert(pair<long double,
4643  nonLockingIndexEntry_s>(entry, val));
4644 }
void Index::insertNonuniqueEntry ( char  entry,
int64_t  rowid,
int64_t  engineid 
)

insert entry into non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4646 of file Index.cc.

References nonLockingIndexEntry_s::engineid, nonuniqueCharIndex, and nonLockingIndexEntry_s::rowid.

4647 {
4648  nonLockingIndexEntry_s val = {};
4649  val.rowid = rowid;
4650  val.engineid = engineid;
4651  nonuniqueCharIndex->insert(pair<char, nonLockingIndexEntry_s>(entry, val));
4652 }
void Index::insertNonuniqueEntry ( string *  entry,
int64_t  rowid,
int64_t  engineid 
)

insert entry into non-unique index

Parameters
entryfield value
rowidrowid
engineidengineid

Definition at line 4654 of file Index.cc.

References nonLockingIndexEntry_s::engineid, nonuniqueStringIndex, nonLockingIndexEntry_s::rowid, and trimspace().

4655 {
4656  trimspace(*entry);
4657  nonLockingIndexEntry_s val = {};
4658  val.rowid = rowid;
4659  val.engineid = engineid;
4660  nonuniqueStringIndex->insert(pair<string,
4661  nonLockingIndexEntry_s>(*entry, val));
4662 }

Here is the call graph for this function:

void Index::insertNullEntry ( int64_t  rowid,
int64_t  engineid 
)

insert entry with NULL value

Parameters
rowidrowid
engineidengineid

Definition at line 4794 of file Index.cc.

References nulls.

Referenced by SubTransaction::processTransactionMessage().

4795 {
4796  vector<int64_t> v(2);
4797  v[0] = rowid;
4798  v[1] = engineid;
4799  nulls.insert(v);
4800 }

Here is the caller graph for this function:

void Index::like ( string &  likeStr,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching LIKE search

implemented by calling regex method

Parameters
likeStrLIKE operand
returnEntriesmatching rows

Definition at line 3050 of file Index.cc.

References like2Regex(), regex(), and trimspace().

Referenced by SubTransaction::indexSearch().

3051 {
3052  trimspace(likeStr);
3053  like2Regex(likeStr);
3054  regex(&likeStr, returnEntries);
3055 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Index::makeindex ( indextype_e  indextypearg,
fieldtype_e  fieldtypearg 
)

in lieu of constructor, creates Index object

Parameters
indextypeargindex type
fieldtypeargfield type

Definition at line 53 of file Index.cc.

References BOOL, boolIndexShadow, boolLockQueue, CHAR, charIndexShadow, charLockQueue, CHARX, fieldtype, FLOAT, floatIndexShadow, floatLockQueue, indexmaptype, indextype, INT, intIndexShadow, intLockQueue, isunique, logfile, maptype, NONE, NONUNIQUE, Nonunique, nonuniquebool, nonuniqueBoolIndex, nonuniquechar, nonuniqueCharIndex, nonuniquecharx, nonuniquefloat, nonuniqueFloatIndex, nonuniqueint, nonuniqueIntIndex, NONUNIQUENOTNULL, nonuniqueStringIndex, nonuniqueuint, nonuniqueUintIndex, nonuniquevarchar, notNull, stringIndexShadow, stringLockQueue, UINT, uintIndexShadow, uintLockQueue, UNIQUE, Unique, uniquebool, uniqueBoolIndex, uniquechar, uniqueCharIndex, uniquecharx, uniquefloat, uniqueFloatIndex, uniqueint, uniqueIntIndex, UNIQUENOTNULL, uniqueStringIndex, uniqueuint, uniqueUintIndex, uniquevarchar, UNORDERED, Unordered, unorderedbool, unorderedBoolIndex, unorderedchar, unorderedCharIndex, unorderedcharx, unorderedfloat, unorderedFloatIndex, unorderedint, unorderedIntIndex, UNORDEREDNOTNULL, unorderedStringIndex, unordereduint, unorderedUintIndex, unorderedvarchar, and VARCHAR.

Referenced by Field::Field().

54 {
55  indextype = indextypearg;
56  fieldtype = fieldtypearg;
57 
60  {
61  isunique=true;
62  }
63  else
64  {
65  isunique=false;
66  }
67 
70  {
71  notNull=true;
72  }
73  else
74  {
75  notNull=false;
76  }
77 
78  if (indextype==NONE)
79  {
80  return;
81  }
82 
83  // 0 unique 1 nonunique 2 unordered
85  {
86  maptype = Unique;
87  }
89  {
91  }
93  {
95  }
96 
97  switch (fieldtype)
98  {
99  case INT:
101  break;
102 
103  case UINT:
105  break;
106 
107  case BOOL:
109  break;
110 
111  case FLOAT:
113  break;
114 
115  case CHAR:
117  break;
118 
119  case CHARX:
121  break;
122 
123  case VARCHAR:
125  break;
126 
127  default:
128  fprintf(logfile, "anomaly %i %s %i\n", fieldtype, __FILE__, __LINE__);
129  }
130 
131  switch (indexmaptype)
132  {
133  case uniqueint:
135  intLockQueue = new boost::unordered_map<int64_t,
136  std::queue<lockQueueIndexEntry>>;
138  break;
139 
140  case nonuniqueint:
142  break;
143 
144  case unorderedint:
146  intLockQueue = new boost::unordered_map<int64_t,
147  std::queue<lockQueueIndexEntry>>;
149  break;
150 
151  case uniqueuint:
153  uintLockQueue = new boost::unordered_map<uint64_t,
154  std::queue<lockQueueIndexEntry>>;
156  break;
157 
158  case nonuniqueuint:
160  break;
161 
162  case unordereduint:
164  uintLockQueue = new boost::unordered_map<uint64_t,
165  std::queue<lockQueueIndexEntry>>;
167  break;
168 
169  case uniquebool:
171  boolLockQueue = new boost::unordered_map< bool,
172  std::queue<lockQueueIndexEntry> >;
174  break;
175 
176  case nonuniquebool:
178  break;
179 
180  case unorderedbool:
182  boolLockQueue = new boost::unordered_map<bool,
183  std::queue<lockQueueIndexEntry>>;
185  break;
186 
187  case uniquefloat:
189  floatLockQueue = new boost::unordered_map<long double,
190  std::queue<lockQueueIndexEntry>>;
192  break;
193 
194  case nonuniquefloat:
196  break;
197 
198  case unorderedfloat:
200  floatLockQueue = new boost::unordered_map<long double,
201  std::queue<lockQueueIndexEntry>>;
203  break;
204 
205  case uniquechar:
207  charLockQueue = new boost::unordered_map<char,
208  std::queue<lockQueueIndexEntry>>;
210  break;
211 
212  case nonuniquechar:
214  break;
215 
216  case unorderedchar:
218  charLockQueue = new boost::unordered_map<char,
219  std::queue<lockQueueIndexEntry>>;
221  break;
222 
223  case uniquecharx:
225  stringLockQueue = new boost::unordered_map<string,
226  std::queue<lockQueueIndexEntry>>;
228  break;
229 
230  case nonuniquecharx:
232  break;
233 
234  case unorderedcharx:
236  stringLockQueue = new boost::unordered_map<string,
237  std::queue<lockQueueIndexEntry> >;
239  break;
240 
241  case uniquevarchar:
243  stringLockQueue = new boost::unordered_map<string,
244  std::queue<lockQueueIndexEntry>>;
246  break;
247 
248  case nonuniquevarchar:
250  break;
251 
252  case unorderedvarchar:
254  stringLockQueue = new boost::unordered_map<string,
255  std::queue<lockQueueIndexEntry>>;
257  break;
258 
259  default:
260  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
261  }
262 }

Here is the caller graph for this function:

template<class T >
void Index::notbetween ( lower,
upper,
vector< indexEntry_s > *  returnEntries 
)
inline

return index entries matching NOT BETWEEN expression

NOT BETWEEN is implemented according to SQL-92 spec: "<fieldvalue> NOT BETWEEN lower and UPPER" is equivalent to: "<fieldvalue> < lower OR <fieldvalue> > upper"

Parameters
lowerlower range
upperupper range
returnEntriesmatching rows

Definition at line 328 of file Index.h.

References comparison(), OPERATOR_GT, and OPERATOR_LT.

Referenced by SubTransaction::indexSearch().

329  {
330  comparison(lower, OPERATOR_LT, returnEntries);
331  comparison(upper, OPERATOR_GT, returnEntries);
332  }

Here is the call graph for this function:

Here is the caller graph for this function:

void Index::notlike ( string &  likeStr,
vector< indexEntry_s > *  returnEntries 
)

return index entries maching NOT LIKE search

Parameters
likeStrNOT LIKE operand
returnEntriesmatching rows

Definition at line 3057 of file Index.cc.

References like2Regex(), regex(), and trimspace().

Referenced by SubTransaction::indexSearch().

3058 {
3059  trimspace(likeStr);
3060  like2Regex(likeStr);
3061  likeStr.insert(0, "^((?!");
3062  likeStr.append(").)*$");
3063  regex(&likeStr, returnEntries);
3064 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Index::regex ( string *  regexStr,
vector< indexEntry_s > *  returnEntries 
)

return index entries matching regex search

PCRE is regex library

Parameters
regexStrregular expression
returnEntriesmatching rows

Definition at line 2930 of file Index.cc.

References nonLockingIndexEntry_s::engineid, getIterators(), indexmaptype, logfile, nonuniquecharx, nonuniqueStringIndex, nonuniquevarchar, nonLockingIndexEntry_s::rowid, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

Referenced by SubTransaction::indexSearch(), like(), and notlike().

2931 {
2932  switch (indexmaptype)
2933  {
2934  case uniquecharx:
2935  {
2936  uniqueStringMap::iterator itBegin, itEnd, it;
2937  getIterators(regexStr, uniqueStringIndex, &itBegin, &itEnd);
2938  pcrecpp::RE re(*regexStr);
2939 
2940  for (it=itBegin; it != itEnd; ++it)
2941  {
2942  // regex search o yeah!
2943  if (re.FullMatch(it->first)==true)
2944  {
2945  indexEntry_s entry;
2946  entry.rowid = it->second.rowid;
2947  entry.engineid = it->second.engineid;
2948  returnEntries->push_back(entry);
2949  }
2950  }
2951  }
2952  break;
2953 
2954  case unorderedcharx:
2955  {
2956  unorderedStringMap::iterator it;
2957  pcrecpp::RE re(*regexStr);
2958 
2959  for (it = unorderedStringIndex->begin();
2960  it != unorderedStringIndex->end(); ++it)
2961  {
2962  // regex search o yeah!
2963  if (re.FullMatch(it->first)==true)
2964  {
2965  returnEntries->push_back({it->second.rowid,
2966  it->second.engineid});
2967  }
2968  }
2969  }
2970  break;
2971 
2972  case nonuniquecharx:
2973  {
2974  nonuniqueStringMap::iterator itBegin, itEnd, it;
2975  getIterators(regexStr, nonuniqueStringIndex, &itBegin, &itEnd);
2976  pcrecpp::RE re(*regexStr);
2977 
2978  for (it=itBegin; it != itEnd; ++it)
2979  {
2980  // regex search o yeah!
2981  if (re.FullMatch(it->first)==true)
2982  {
2983  returnEntries->push_back(it->second);
2984  }
2985  }
2986  }
2987  break;
2988 
2989  case uniquevarchar:
2990  {
2991  uniqueStringMap::iterator itBegin, itEnd, it;
2992  getIterators(regexStr, uniqueStringIndex, &itBegin, &itEnd);
2993  pcrecpp::RE re(*regexStr);
2994 
2995  for (it=itBegin; it != itEnd; ++it)
2996  {
2997  // regex search o yeah!
2998  if (re.FullMatch(it->first)==true)
2999  {
3000  indexEntry_s entry;
3001  entry.rowid = it->second.rowid;
3002  entry.engineid = it->second.engineid;
3003  returnEntries->push_back(entry);
3004  }
3005  }
3006  }
3007  break;
3008 
3009  case unorderedvarchar:
3010  {
3011  unorderedStringMap::iterator it;
3012  pcrecpp::RE re(*regexStr);
3013 
3014  for (it = unorderedStringIndex->begin();
3015  it != unorderedStringIndex->end(); ++it)
3016  {
3017  // regex search o yeah!
3018  if (re.FullMatch(it->first)==true)
3019  {
3020  returnEntries->push_back({it->second.rowid,
3021  it->second.engineid});
3022  }
3023  }
3024  }
3025  break;
3026 
3027  case nonuniquevarchar:
3028  {
3029  nonuniqueStringMap::iterator itBegin, itEnd, it;
3030  getIterators(regexStr, nonuniqueStringIndex, &itBegin, &itEnd);
3031  pcrecpp::RE re(*regexStr);
3032 
3033  for (it=itBegin; it != itEnd; ++it)
3034  {
3035  // regex search o yeah!
3036  if (re.FullMatch(it->first)==true)
3037  {
3038  returnEntries->push_back(it->second);
3039  }
3040  }
3041  }
3042  break;
3043 
3044  default:
3045  fprintf(logfile, "anomaly %i %s %i\n", indexmaptype, __FILE__, __LINE__);
3046  return;
3047  }
3048 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Index::replaceNonunique ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid,
int64_t  input 
)

replace index value in non-unique index

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4484 of file Index.cc.

References nonuniqueIntIndex.

Referenced by SubTransaction::processTransactionMessage().

4487 {
4488  pair<multimap<int64_t, nonLockingIndexEntry_s>::iterator,
4489  multimap<int64_t, nonLockingIndexEntry_s>::iterator> itRange;
4490  nonuniqueIntMap::iterator it;
4491  itRange = nonuniqueIntIndex->equal_range(input);
4492 
4493  for (it = itRange.first; it != itRange.second; ++it)
4494  {
4495  if (it->second.rowid==oldrowid && it->second.engineid==oldengineid)
4496  {
4497  it->second.rowid=newrowid;
4498  it->second.engineid=newengineid;
4499  }
4500  }
4501 }

Here is the caller graph for this function:

void Index::replaceNonunique ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid,
uint64_t  input 
)

replace index value in non-unique index

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4503 of file Index.cc.

References nonuniqueUintIndex.

4506 {
4507  pair<multimap<uint64_t, nonLockingIndexEntry_s>::iterator,
4508  multimap<uint64_t, nonLockingIndexEntry_s>::iterator> itRange;
4509  nonuniqueUintMap::iterator it;
4510  itRange = nonuniqueUintIndex->equal_range(input);
4511 
4512  for (it = itRange.first; it != itRange.second; ++it)
4513  {
4514  if (it->second.rowid==oldrowid && it->second.engineid==oldengineid)
4515  {
4516  it->second.rowid=newrowid;
4517  it->second.engineid=newengineid;
4518  }
4519  }
4520 }
void Index::replaceNonunique ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid,
bool  input 
)

replace index value in non-unique index

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4522 of file Index.cc.

References nonuniqueBoolIndex.

4524 {
4525  pair<multimap<bool, nonLockingIndexEntry_s>::iterator,
4526  multimap<bool, nonLockingIndexEntry_s>::iterator> itRange;
4527  nonuniqueBoolMap::iterator it;
4528  itRange = nonuniqueBoolIndex->equal_range(input);
4529 
4530  for (it = itRange.first; it != itRange.second; ++it)
4531  {
4532  if (it->second.rowid==oldrowid && it->second.engineid==oldengineid)
4533  {
4534  it->second.rowid=newrowid;
4535  it->second.engineid=newengineid;
4536  }
4537  }
4538 }
void Index::replaceNonunique ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid,
long double  input 
)

replace index value in non-unique index

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4540 of file Index.cc.

References nonuniqueFloatIndex.

4543 {
4544  pair<multimap<long double, nonLockingIndexEntry_s>::iterator,
4545  multimap<long double, nonLockingIndexEntry_s>::iterator> itRange;
4546  nonuniqueFloatMap::iterator it;
4547  itRange = nonuniqueFloatIndex->equal_range(input);
4548 
4549  for (it = itRange.first; it != itRange.second; ++it)
4550  {
4551  if (it->second.rowid==oldrowid && it->second.engineid==oldengineid)
4552  {
4553  it->second.rowid=newrowid;
4554  it->second.engineid=newengineid;
4555  }
4556  }
4557 }
void Index::replaceNonunique ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid,
char  input 
)

replace index value in non-unique index

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4559 of file Index.cc.

References nonuniqueCharIndex.

4561 {
4562  pair<multimap<char, nonLockingIndexEntry_s>::iterator,
4563  multimap<char, nonLockingIndexEntry_s>::iterator> itRange;
4564  nonuniqueCharMap::iterator it;
4565  itRange = nonuniqueCharIndex->equal_range(input);
4566 
4567  for (it = itRange.first; it != itRange.second; ++it)
4568  {
4569  if (it->second.rowid==oldrowid && it->second.engineid==oldengineid)
4570  {
4571  it->second.rowid=newrowid;
4572  it->second.engineid=newengineid;
4573  }
4574  }
4575 }
void Index::replaceNonunique ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid,
string &  input 
)

replace index value in non-unique index

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4577 of file Index.cc.

References nonuniqueStringIndex, and trimspace().

4580 {
4581  trimspace(input);
4582 
4583  pair<multimap<string, nonLockingIndexEntry_s>::iterator,
4584  multimap<string, nonLockingIndexEntry_s>::iterator> itRange;
4585  nonuniqueStringMap::iterator it;
4586  itRange = nonuniqueStringIndex->equal_range(input);
4587 
4588  for (it = itRange.first; it != itRange.second; ++it)
4589  {
4590  if (it->second.rowid==oldrowid && it->second.engineid==oldengineid)
4591  {
4592  it->second.rowid=newrowid;
4593  it->second.engineid=newengineid;
4594  }
4595  }
4596 }

Here is the call graph for this function:

void Index::replaceNull ( int64_t  oldrowid,
int64_t  oldengineid,
int64_t  newrowid,
int64_t  newengineid 
)

replace NULL entry

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
oldrowidrowid to replace
oldengineidengineid to replace
newrowidnew rowid
newengineidnew engineid

Definition at line 4598 of file Index.cc.

References nulls.

Referenced by SubTransaction::processTransactionMessage().

4600 {
4601  vector<int64_t> v(2);
4602  v[0] = oldrowid;
4603  v[1] = oldengineid;
4604  nulls.erase(v);
4605  v[0] = newrowid;
4606  v[1] = newengineid;
4607  nulls.insert(v);
4608 }

Here is the caller graph for this function:

void Index::replaceUnique ( int64_t  newrowid,
int64_t  newengineid,
int64_t  input 
)

replace index value

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4272 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, logfile, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

Referenced by SubTransaction::processTransactionMessage().

4273 {
4274  switch (indexmaptype)
4275  {
4276  case uniqueint:
4277  {
4278  lockingIndexEntry entry;
4279  entry.subtransactionid = 0;
4280  entry.rowid = newrowid;
4281  entry.engineid = newengineid;
4282 
4283  uniqueIntIndex->operator [](input) = entry;
4284  }
4285  break;
4286 
4287  case unorderedint:
4288  {
4289  lockingIndexEntry entry;
4290  entry.subtransactionid = 0;
4291  entry.rowid = newrowid;
4292  entry.engineid = newengineid;
4293 
4294  unorderedIntIndex->operator [](input) = entry;
4295  }
4296  break;
4297 
4298  default:
4299  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4300  __LINE__);
4301  }
4302 }

Here is the caller graph for this function:

void Index::replaceUnique ( int64_t  newrowid,
int64_t  newengineid,
uint64_t  input 
)

replace index value

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4303 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, logfile, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

4304 {
4305  switch (indexmaptype)
4306  {
4307  case uniqueuint:
4308  {
4309  lockingIndexEntry entry;
4310  entry.subtransactionid = 0;
4311  entry.rowid = newrowid;
4312  entry.engineid = newengineid;
4313 
4314  uniqueUintIndex->operator [](input) = entry;
4315  }
4316  break;
4317 
4318  case unordereduint:
4319  {
4320  lockingIndexEntry entry;
4321  entry.subtransactionid = 0;
4322  entry.rowid = newrowid;
4323  entry.engineid = newengineid;
4324 
4325  unorderedUintIndex->operator [](input) = entry;
4326  }
4327  break;
4328 
4329  default:
4330  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4331  __LINE__);
4332  }
4333 }
void Index::replaceUnique ( int64_t  newrowid,
int64_t  newengineid,
bool  input 
)

replace index value

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4334 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, logfile, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

4335 {
4336  switch (indexmaptype)
4337  {
4338  case uniquebool:
4339  {
4340  lockingIndexEntry entry;
4341  entry.subtransactionid = 0;
4342  entry.rowid = newrowid;
4343  entry.engineid = newengineid;
4344 
4345  uniqueBoolIndex->operator [](input) = entry;
4346  }
4347  break;
4348 
4349  case unorderedbool:
4350  {
4351  lockingIndexEntry entry;
4352  entry.subtransactionid = 0;
4353  entry.rowid = newrowid;
4354  entry.engineid = newengineid;
4355 
4356  unorderedBoolIndex->operator [](input) = entry;
4357  }
4358  break;
4359 
4360  default:
4361  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4362  __LINE__);
4363  }
4364 }
void Index::replaceUnique ( int64_t  newrowid,
int64_t  newengineid,
long double  input 
)

replace index value

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4365 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, logfile, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

4367 {
4368  switch (indexmaptype)
4369  {
4370  case uniquefloat:
4371  {
4372  lockingIndexEntry entry;
4373  entry.subtransactionid = 0;
4374  entry.rowid = newrowid;
4375  entry.engineid = newengineid;
4376 
4377  uniqueFloatIndex->operator [](input) = entry;
4378  }
4379  break;
4380 
4381  case unorderedfloat:
4382  {
4383  lockingIndexEntry entry;
4384  entry.subtransactionid = 0;
4385  entry.rowid = newrowid;
4386  entry.engineid = newengineid;
4387 
4388  unorderedFloatIndex->operator [](input) = entry;
4389  }
4390  break;
4391 
4392  default:
4393  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4394  __LINE__);
4395  }
4396 }
void Index::replaceUnique ( int64_t  newrowid,
int64_t  newengineid,
char  input 
)

replace index value

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4397 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, logfile, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

4398 {
4399  switch (indexmaptype)
4400  {
4401  case uniquechar:
4402  {
4403  lockingIndexEntry entry;
4404  entry.subtransactionid = 0;
4405  entry.rowid = newrowid;
4406  entry.engineid = newengineid;
4407 
4408  uniqueCharIndex->operator [](input) = entry;
4409  }
4410  break;
4411 
4412  case unorderedchar:
4413  {
4414  lockingIndexEntry entry;
4415  entry.subtransactionid = 0;
4416  entry.rowid = newrowid;
4417  entry.engineid = newengineid;
4418 
4419  unorderedCharIndex->operator [](input) = entry;
4420  }
4421  break;
4422 
4423  default:
4424  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4425  __LINE__);
4426  }
4427 }
void Index::replaceUnique ( int64_t  newrowid,
int64_t  newengineid,
string &  input 
)

replace index value

this activity points an existing index entry to a new row used when 1st field of a row is updated, as that activity is implemented as a DELETE then INSERT of the row

Parameters
newrowidnew rowid
newengineidnew engineid
inputfield value

Definition at line 4428 of file Index.cc.

References lockingIndexEntry::engineid, indexmaptype, logfile, lockingIndexEntry::rowid, lockingIndexEntry::subtransactionid, trimspace(), uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

4429 {
4430  trimspace(input);
4431 
4432  switch (indexmaptype)
4433  {
4434  case uniquecharx:
4435  {
4436  lockingIndexEntry entry;
4437  entry.subtransactionid = 0;
4438  entry.rowid = newrowid;
4439  entry.engineid = newengineid;
4440 
4441  uniqueStringIndex->operator [](input) = entry;
4442  }
4443  break;
4444 
4445  case unorderedcharx:
4446  {
4447  lockingIndexEntry entry;
4448  entry.subtransactionid = 0;
4449  entry.rowid = newrowid;
4450  entry.engineid = newengineid;
4451 
4452  unorderedStringIndex->operator [](input) = entry;
4453  }
4454  break;
4455 
4456  case uniquevarchar:
4457  {
4458  lockingIndexEntry entry;
4459  entry.subtransactionid = 0;
4460  entry.rowid = newrowid;
4461  entry.engineid = newengineid;
4462 
4463  uniqueStringIndex->operator [](input) = entry;
4464  }
4465  break;
4466 
4467  case unorderedvarchar:
4468  {
4469  lockingIndexEntry entry;
4470  entry.subtransactionid = 0;
4471  entry.rowid = newrowid;
4472  entry.engineid = newengineid;
4473 
4474  unorderedStringIndex->operator [](input) = entry;
4475  }
4476  break;
4477 
4478  default:
4479  fprintf(logfile, "anomaly: %i %s %i\n", indexmaptype, __FILE__,
4480  __LINE__);
4481  }
4482 }

Here is the call graph for this function:

void Index::rm ( fieldValue_s val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5541 of file Index.cc.

References BOOL, fieldInput_u::boolean, CHAR, fieldInput_u::character, CHARX, fieldtype, FLOAT, fieldInput_u::floating, INT, fieldInput_u::integer, fieldValue_s::str, UINT, fieldInput_u::uinteger, fieldValue_s::value, and VARCHAR.

Referenced by Engine::applyItem().

5542 {
5543  switch (fieldtype)
5544  {
5545  case INT:
5546  rm(val.value.integer);
5547  break;
5548 
5549  case UINT:
5550  rm(val.value.uinteger);
5551  break;
5552 
5553  case BOOL:
5554  rm(val.value.boolean);
5555  break;
5556 
5557  case FLOAT:
5558  rm(val.value.floating);
5559  break;
5560 
5561  case CHAR:
5562  rm(val.value.character);
5563  break;
5564 
5565  case CHARX:
5566  rm(val.str);
5567  break;
5568 
5569  case VARCHAR:
5570  rm(val.str);
5571  break;
5572 
5573  default:
5574  printf("%s %i anomaly fieldtype %i\n", __FILE__, __LINE__,
5575  fieldtype);
5576  }
5577 }

Here is the caller graph for this function:

void Index::rm ( int64_t  val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5579 of file Index.cc.

References indexmaptype, uniqueint, uniqueIntIndex, unorderedint, and unorderedIntIndex.

5580 {
5581  switch (indexmaptype)
5582  {
5583  case uniqueint:
5584  uniqueIntIndex->erase(val);
5585  break;
5586 
5587  case unorderedint:
5588  unorderedIntIndex->erase(val);
5589  break;
5590 
5591  default:
5592  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5593  indexmaptype);
5594  }
5595 }
void Index::rm ( uint64_t  val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5597 of file Index.cc.

References indexmaptype, uniqueuint, uniqueUintIndex, unordereduint, and unorderedUintIndex.

5598 {
5599  switch (indexmaptype)
5600  {
5601  case uniqueuint:
5602  uniqueUintIndex->erase(val);
5603  break;
5604 
5605  case unordereduint:
5606  unorderedUintIndex->erase(val);
5607  break;
5608 
5609  default:
5610  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5611  indexmaptype);
5612  }
5613 }
void Index::rm ( bool  val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5615 of file Index.cc.

References indexmaptype, uniquebool, uniqueBoolIndex, unorderedbool, and unorderedBoolIndex.

5616 {
5617  switch (indexmaptype)
5618  {
5619  case uniquebool:
5620  uniqueBoolIndex->erase(val);
5621  break;
5622 
5623  case unorderedbool:
5624  unorderedBoolIndex->erase(val);
5625  break;
5626 
5627  default:
5628  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5629  indexmaptype);
5630  }
5631 }
void Index::rm ( long double  val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5633 of file Index.cc.

References indexmaptype, uniquefloat, uniqueFloatIndex, unorderedfloat, and unorderedFloatIndex.

5634 {
5635  switch (indexmaptype)
5636  {
5637  case uniquefloat:
5638  uniqueFloatIndex->erase(val);
5639  break;
5640 
5641  case unorderedfloat:
5642  unorderedFloatIndex->erase(val);
5643  break;
5644 
5645  default:
5646  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5647  indexmaptype);
5648  }
5649 }
void Index::rm ( char  val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5651 of file Index.cc.

References indexmaptype, uniquechar, uniqueCharIndex, unorderedchar, and unorderedCharIndex.

5652 {
5653  switch (indexmaptype)
5654  {
5655  case uniquechar:
5656  uniqueCharIndex->erase(val);
5657  break;
5658 
5659  case unorderedchar:
5660  unorderedCharIndex->erase(val);
5661  break;
5662 
5663  default:
5664  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5665  indexmaptype);
5666  }
5667 }
void Index::rm ( string &  val)

delete entry as part of synchronous replication

Parameters
valfield value

Definition at line 5669 of file Index.cc.

References indexmaptype, uniquecharx, uniqueStringIndex, uniquevarchar, unorderedcharx, unorderedStringIndex, and unorderedvarchar.

5670 {
5671  switch (indexmaptype)
5672  {
5673  case uniquecharx:
5674  uniqueStringIndex->erase(val);
5675  break;
5676 
5677  case unorderedcharx:
5678  unorderedStringIndex->erase(val);
5679  break;
5680 
5681  case uniquevarchar:
5682  uniqueStringIndex->erase(val);
5683  break;
5684 
5685  case unorderedvarchar:
5686  unorderedStringIndex->erase(val);
5687  break;
5688 
5689  default:
5690  printf("%s %i anomaly indexmaptype %i\n", __FILE__, __LINE__,
5691  indexmaptype);
5692  }
5693 }

Friends And Related Function Documentation

friend class Field
friend

Definition at line 92 of file Index.h.

friend class SubTransaction
friend

Definition at line 93 of file Index.h.

friend class Transaction
friend

Definition at line 91 of file Index.h.

Member Data Documentation

unorderedBoolMap* Index::boolIndexShadow

Definition at line 1236 of file Index.h.

Referenced by makeindex().

boost::unordered_map< bool, std::queue<lockQueueIndexEntry> >* Index::boolLockQueue
unorderedCharMap* Index::charIndexShadow

Definition at line 1238 of file Index.h.

Referenced by makeindex().

boost::unordered_map< char, std::queue<lockQueueIndexEntry> >* Index::charLockQueue
unorderedFloatMap* Index::floatIndexShadow

Definition at line 1237 of file Index.h.

Referenced by makeindex().

boost::unordered_map< long double, std::queue<lockQueueIndexEntry> >* Index::floatLockQueue
indextype_e Index::indextype

Definition at line 1209 of file Index.h.

Referenced by Engine::applyItem(), Transaction::continueCommitTransaction(), and makeindex().

unorderedIntMap* Index::intIndexShadow

Definition at line 1234 of file Index.h.

Referenced by makeindex().

boost::unordered_map< int64_t, std::queue<lockQueueIndexEntry> >* Index::intLockQueue
maptype_e Index::maptype

Definition at line 1211 of file Index.h.

Referenced by makeindex().

bool Index::notNull

Definition at line 1212 of file Index.h.

Referenced by getnulls(), and makeindex().

boost::unordered_set< vector<int64_t> > Index::nulls

Definition at line 1258 of file Index.h.

Referenced by Engine::applyItem(), deleteNullEntry(), getnulls(), insertNullEntry(), and replaceNull().

unorderedStringMap* Index::stringIndexShadow

Definition at line 1239 of file Index.h.

Referenced by makeindex().

boost::unordered_map< std::string, std::queue<lockQueueIndexEntry> >* Index::stringLockQueue
unorderedUintMap* Index::uintIndexShadow

Definition at line 1235 of file Index.h.

Referenced by makeindex().

boost::unordered_map< uint64_t, std::queue<lockQueueIndexEntry> >* Index::uintLockQueue

The documentation for this class was generated from the following files: