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
45namespace TPCE {
46
47static 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//
53const TIdent iDefaultCustomerCount = 5000;
54
55const 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//
61const TIdent iDefaultLoadUnitSize = 1000;
62
63// Base counts for scaling companines and securities.
64//
65const int iBaseCompanyCount = 5000; // number of base companies in the flat file
66const int iBaseCompanyCompetitorCount = 3 * iBaseCompanyCount; // number of base company competitor rows
67const int iOneLoadUnitCompanyCount = 500;
68const int iOneLoadUnitSecurityCount = 685;
69const int iOneLoadUnitCompanyCompetitorCount = 3 * iOneLoadUnitCompanyCount;
70
71// Number by which all IDENT_T columns (C_ID, CA_ID, etc.) are shifted.
72//
73const 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//
77const TTrade iTTradeShift = INT64_CONST(200000000000000); // 200 trillion (2 * 10^14)
78
79const int iMaxHostname = 64;
80const int iMaxDBName = 64;
81const 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.
86const INT16 InitialTradePopulationBaseYear = 2005;
87const UINT16 InitialTradePopulationBaseMonth = 1;
88const UINT16 InitialTradePopulationBaseDay = 3;
89const UINT16 InitialTradePopulationBaseHour = 9;
90const UINT16 InitialTradePopulationBaseMinute = 0;
91const UINT16 InitialTradePopulationBaseSecond = 0;
92const 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//
98const 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.
103const int iAbortedTradeModFactor = 51;
104
105// Start date for DAILY_MARKET and FINANCIAL.
106//
107const int iDailyMarketBaseYear = 2000;
108const int iDailyMarketBaseMonth = 1;
109const int iDailyMarketBaseDay = 3;
110const int iDailyMarketBaseHour = 0;
111const int iDailyMarketBaseMinute = 0;
112const int iDailyMarketBaseSecond = 0;
113const int iDailyMarketBaseMsec = 0;
114
115// Range of financial rows to return from Security Detail
116const int iSecurityDetailMinRows = 5;
117const int iSecurityDetailMaxRows = 20; // max_fin_len
118
119// Trade-Lookup constants
120const INT32 TradeLookupMaxTradeHistoryRowsReturned =
121 3; // Based on the maximum number of status changes a trade can go through.
122const INT32 TradeLookupMaxRows = 20; // Max number of rows for the frames
123const INT32 TradeLookupFrame1MaxRows = TradeLookupMaxRows;
124const INT32 TradeLookupFrame2MaxRows = TradeLookupMaxRows;
125const INT32 TradeLookupFrame3MaxRows = TradeLookupMaxRows;
126const INT32 TradeLookupFrame4MaxRows = TradeLookupMaxRows;
127
128// Trade-Update constants
129const INT32 TradeUpdateMaxTradeHistoryRowsReturned =
130 3; // Based on the maximum number of status changes a trade can go through.
131const INT32 TradeUpdateMaxRows = 20; // Max number of rows for the frames
132const INT32 TradeUpdateFrame1MaxRows = TradeUpdateMaxRows;
133const INT32 TradeUpdateFrame2MaxRows = TradeUpdateMaxRows;
134const INT32 TradeUpdateFrame3MaxRows = TradeUpdateMaxRows;
135
136// These two arrays are used for platform independence
137const char UpperCaseLetters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
138const char LowerCaseLetters[] = "abcdefghijklmnopqrstuvwxyz";
139const char Numerals[] = "0123456789";
140const int MaxLowerCaseLetters = sizeof(LowerCaseLetters) - 1;
141
142//
143// Constants for non-uniform distribution of various transaction parameters.
144//
145
146// Trade Lookup
147const INT32 TradeLookupAValueForTradeIDGenFrame1 = 65535;
148const INT32 TradeLookupSValueForTradeIDGenFrame1 = 7;
149const INT32 TradeLookupAValueForTimeGenFrame2 = 4095;
150const INT32 TradeLookupSValueForTimeGenFrame2 = 16;
151const INT32 TradeLookupAValueForSymbolFrame3 = 0;
152const INT32 TradeLookupSValueForSymbolFrame3 = 0;
153const INT32 TradeLookupAValueForTimeGenFrame3 = 4095;
154const INT32 TradeLookupSValueForTimeGenFrame3 = 16;
155const INT32 TradeLookupAValueForTimeGenFrame4 = 4095;
156const INT32 TradeLookupSValueForTimeGenFrame4 = 16;
157// Trade Update
158const INT32 TradeUpdateAValueForTradeIDGenFrame1 = 65535;
159const INT32 TradeUpdateSValueForTradeIDGenFrame1 = 7;
160const INT32 TradeUpdateAValueForTimeGenFrame2 = 4095;
161const INT32 TradeUpdateSValueForTimeGenFrame2 = 16;
162const INT32 TradeUpdateAValueForSymbolFrame3 = 0;
163const INT32 TradeUpdateSValueForSymbolFrame3 = 0;
164const INT32 TradeUpdateAValueForTimeGenFrame3 = 4095;
165const INT32 TradeUpdateSValueForTimeGenFrame3 = 16;
166
167} // namespace TPCE
168
169#endif // MISC_CONSTS_H
170