| 1 | /* |
| 2 | * Legal Notice |
| 3 | * |
| 4 | * This document and associated source code (the "Work") is a part of a |
| 5 | * benchmark specification maintained by the TPC. |
| 6 | * |
| 7 | * The TPC reserves all right, title, and interest to the Work as provided |
| 8 | * under U.S. and international laws, including without limitation all patent |
| 9 | * and trademark rights therein. |
| 10 | * |
| 11 | * No Warranty |
| 12 | * |
| 13 | * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION |
| 14 | * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE |
| 15 | * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER |
| 16 | * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
| 17 | * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES, |
| 18 | * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR |
| 19 | * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF |
| 20 | * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE. |
| 21 | * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, |
| 22 | * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT |
| 23 | * WITH REGARD TO THE WORK. |
| 24 | * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO |
| 25 | * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE |
| 26 | * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS |
| 27 | * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, |
| 28 | * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, |
| 29 | * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT |
| 30 | * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD |
| 31 | * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. |
| 32 | * |
| 33 | * Contributors |
| 34 | * - Sergey Vasilevskiy |
| 35 | */ |
| 36 | |
| 37 | /* |
| 38 | * Miscellaneous constants used throughout EGenLoader. |
| 39 | */ |
| 40 | #ifndef MISC_CONSTS_H |
| 41 | #define MISC_CONSTS_H |
| 42 | |
| 43 | #include "EGenStandardTypes.h" |
| 44 | |
| 45 | namespace TPCE { |
| 46 | |
| 47 | static const TIdent iDefaultStartFromCustomer = 1; |
| 48 | |
| 49 | // Minimum number of customers in a database. |
| 50 | // Broker-Volume transations requires 40 broker names as input, |
| 51 | // which translates into minimum 4000 customers in a database. |
| 52 | // |
| 53 | const TIdent iDefaultCustomerCount = 5000; |
| 54 | |
| 55 | const TIdent iBrokersDiv = 100; // by what number to divide the customer count to get the broker count |
| 56 | |
| 57 | // Number of customers in default load unit. |
| 58 | // Note: this value must not be changed. EGen code depends |
| 59 | // on load unit consisting of exactly 1000 customers. |
| 60 | // |
| 61 | const TIdent iDefaultLoadUnitSize = 1000; |
| 62 | |
| 63 | // Base counts for scaling companines and securities. |
| 64 | // |
| 65 | const int iBaseCompanyCount = 5000; // number of base companies in the flat file |
| 66 | const int iBaseCompanyCompetitorCount = 3 * iBaseCompanyCount; // number of base company competitor rows |
| 67 | const int iOneLoadUnitCompanyCount = 500; |
| 68 | const int iOneLoadUnitSecurityCount = 685; |
| 69 | const int iOneLoadUnitCompanyCompetitorCount = 3 * iOneLoadUnitCompanyCount; |
| 70 | |
| 71 | // Number by which all IDENT_T columns (C_ID, CA_ID, etc.) are shifted. |
| 72 | // |
| 73 | const TIdent iTIdentShift = INT64_CONST(4300000000); // 4.3 billion |
| 74 | |
| 75 | // Number by which all TRADE_T columns (T_ID, TH_T_ID, etc.) are shifted. |
| 76 | // |
| 77 | const TTrade iTTradeShift = INT64_CONST(200000000000000); // 200 trillion (2 * 10^14) |
| 78 | |
| 79 | const int iMaxHostname = 64; |
| 80 | const int iMaxDBName = 64; |
| 81 | const int iMaxPath = 512; |
| 82 | |
| 83 | // NOTE: Changing the initial trade populate base date |
| 84 | // can break code used in CCETxnInputGenerator for generating |
| 85 | // Trade-Lookup data. |
| 86 | const INT16 InitialTradePopulationBaseYear = 2005; |
| 87 | const UINT16 InitialTradePopulationBaseMonth = 1; |
| 88 | const UINT16 InitialTradePopulationBaseDay = 3; |
| 89 | const UINT16 InitialTradePopulationBaseHour = 9; |
| 90 | const UINT16 InitialTradePopulationBaseMinute = 0; |
| 91 | const UINT16 InitialTradePopulationBaseSecond = 0; |
| 92 | const UINT32 InitialTradePopulationBaseFraction = 0; |
| 93 | |
| 94 | // At what trade count multiple to abort trades. |
| 95 | // One trade in every iAboutTrade block is aborted (trade id is thrown out). |
| 96 | // NOTE: this really is 10 * Trade-Order mix percentage! |
| 97 | // |
| 98 | const int iAbortTrade = 101; |
| 99 | |
| 100 | // Used at load and run time to determine which intial trades |
| 101 | // simulate rollback by "aborting" - I.e. used to skip over a |
| 102 | // trade ID. |
| 103 | const int iAbortedTradeModFactor = 51; |
| 104 | |
| 105 | // Start date for DAILY_MARKET and FINANCIAL. |
| 106 | // |
| 107 | const int iDailyMarketBaseYear = 2000; |
| 108 | const int iDailyMarketBaseMonth = 1; |
| 109 | const int iDailyMarketBaseDay = 3; |
| 110 | const int iDailyMarketBaseHour = 0; |
| 111 | const int iDailyMarketBaseMinute = 0; |
| 112 | const int iDailyMarketBaseSecond = 0; |
| 113 | const int iDailyMarketBaseMsec = 0; |
| 114 | |
| 115 | // Range of financial rows to return from Security Detail |
| 116 | const int iSecurityDetailMinRows = 5; |
| 117 | const int iSecurityDetailMaxRows = 20; // max_fin_len |
| 118 | |
| 119 | // Trade-Lookup constants |
| 120 | const INT32 TradeLookupMaxTradeHistoryRowsReturned = |
| 121 | 3; // Based on the maximum number of status changes a trade can go through. |
| 122 | const INT32 TradeLookupMaxRows = 20; // Max number of rows for the frames |
| 123 | const INT32 TradeLookupFrame1MaxRows = TradeLookupMaxRows; |
| 124 | const INT32 TradeLookupFrame2MaxRows = TradeLookupMaxRows; |
| 125 | const INT32 TradeLookupFrame3MaxRows = TradeLookupMaxRows; |
| 126 | const INT32 TradeLookupFrame4MaxRows = TradeLookupMaxRows; |
| 127 | |
| 128 | // Trade-Update constants |
| 129 | const INT32 TradeUpdateMaxTradeHistoryRowsReturned = |
| 130 | 3; // Based on the maximum number of status changes a trade can go through. |
| 131 | const INT32 TradeUpdateMaxRows = 20; // Max number of rows for the frames |
| 132 | const INT32 TradeUpdateFrame1MaxRows = TradeUpdateMaxRows; |
| 133 | const INT32 TradeUpdateFrame2MaxRows = TradeUpdateMaxRows; |
| 134 | const INT32 TradeUpdateFrame3MaxRows = TradeUpdateMaxRows; |
| 135 | |
| 136 | // These two arrays are used for platform independence |
| 137 | const char UpperCaseLetters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; |
| 138 | const char LowerCaseLetters[] = "abcdefghijklmnopqrstuvwxyz" ; |
| 139 | const char Numerals[] = "0123456789" ; |
| 140 | const int MaxLowerCaseLetters = sizeof(LowerCaseLetters) - 1; |
| 141 | |
| 142 | // |
| 143 | // Constants for non-uniform distribution of various transaction parameters. |
| 144 | // |
| 145 | |
| 146 | // Trade Lookup |
| 147 | const INT32 TradeLookupAValueForTradeIDGenFrame1 = 65535; |
| 148 | const INT32 TradeLookupSValueForTradeIDGenFrame1 = 7; |
| 149 | const INT32 TradeLookupAValueForTimeGenFrame2 = 4095; |
| 150 | const INT32 TradeLookupSValueForTimeGenFrame2 = 16; |
| 151 | const INT32 TradeLookupAValueForSymbolFrame3 = 0; |
| 152 | const INT32 TradeLookupSValueForSymbolFrame3 = 0; |
| 153 | const INT32 TradeLookupAValueForTimeGenFrame3 = 4095; |
| 154 | const INT32 TradeLookupSValueForTimeGenFrame3 = 16; |
| 155 | const INT32 TradeLookupAValueForTimeGenFrame4 = 4095; |
| 156 | const INT32 TradeLookupSValueForTimeGenFrame4 = 16; |
| 157 | // Trade Update |
| 158 | const INT32 TradeUpdateAValueForTradeIDGenFrame1 = 65535; |
| 159 | const INT32 TradeUpdateSValueForTradeIDGenFrame1 = 7; |
| 160 | const INT32 TradeUpdateAValueForTimeGenFrame2 = 4095; |
| 161 | const INT32 TradeUpdateSValueForTimeGenFrame2 = 16; |
| 162 | const INT32 TradeUpdateAValueForSymbolFrame3 = 0; |
| 163 | const INT32 TradeUpdateSValueForSymbolFrame3 = 0; |
| 164 | const INT32 TradeUpdateAValueForTimeGenFrame3 = 4095; |
| 165 | const INT32 TradeUpdateSValueForTimeGenFrame3 = 16; |
| 166 | |
| 167 | } // namespace TPCE |
| 168 | |
| 169 | #endif // MISC_CONSTS_H |
| 170 | |