pyswordfish 3.0.4.0__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyswordfish-3.0.4.0.dist-info/METADATA +53 -0
- pyswordfish-3.0.4.0.dist-info/RECORD +644 -0
- pyswordfish-3.0.4.0.dist-info/WHEEL +5 -0
- pyswordfish-3.0.4.0.dist-info/top_level.txt +1 -0
- swordfish/__init__.py +102 -0
- swordfish/_config.py +901 -0
- swordfish/_connection.py +1418 -0
- swordfish/_core.py +17 -0
- swordfish/_engine.py +1456 -0
- swordfish/_enums.py +142 -0
- swordfish/_function_bindings.py +23594 -0
- swordfish/_function_tools.py +124 -0
- swordfish/_helper.py +57 -0
- swordfish/_runtime.py +158 -0
- swordfish/_sqlbuilder.py +549 -0
- swordfish/_streaming.py +333 -0
- swordfish/_swordfishcpp.cp312-win_amd64.pyd +0 -0
- swordfish/_swordfishcpp.pyi +4784 -0
- swordfish/_translator.py +580 -0
- swordfish/asset/dolphindb.dos +71 -0
- swordfish/asset/tzdb/Africa/Abidjan +0 -0
- swordfish/asset/tzdb/Africa/Accra +0 -0
- swordfish/asset/tzdb/Africa/Addis_Ababa +0 -0
- swordfish/asset/tzdb/Africa/Algiers +0 -0
- swordfish/asset/tzdb/Africa/Asmara +0 -0
- swordfish/asset/tzdb/Africa/Asmera +0 -0
- swordfish/asset/tzdb/Africa/Bamako +0 -0
- swordfish/asset/tzdb/Africa/Bangui +0 -0
- swordfish/asset/tzdb/Africa/Banjul +0 -0
- swordfish/asset/tzdb/Africa/Bissau +0 -0
- swordfish/asset/tzdb/Africa/Blantyre +0 -0
- swordfish/asset/tzdb/Africa/Brazzaville +0 -0
- swordfish/asset/tzdb/Africa/Bujumbura +0 -0
- swordfish/asset/tzdb/Africa/Cairo +0 -0
- swordfish/asset/tzdb/Africa/Casablanca +0 -0
- swordfish/asset/tzdb/Africa/Ceuta +0 -0
- swordfish/asset/tzdb/Africa/Conakry +0 -0
- swordfish/asset/tzdb/Africa/Dakar +0 -0
- swordfish/asset/tzdb/Africa/Dar_es_Salaam +0 -0
- swordfish/asset/tzdb/Africa/Djibouti +0 -0
- swordfish/asset/tzdb/Africa/Douala +0 -0
- swordfish/asset/tzdb/Africa/El_Aaiun +0 -0
- swordfish/asset/tzdb/Africa/Freetown +0 -0
- swordfish/asset/tzdb/Africa/Gaborone +0 -0
- swordfish/asset/tzdb/Africa/Harare +0 -0
- swordfish/asset/tzdb/Africa/Johannesburg +0 -0
- swordfish/asset/tzdb/Africa/Juba +0 -0
- swordfish/asset/tzdb/Africa/Kampala +0 -0
- swordfish/asset/tzdb/Africa/Khartoum +0 -0
- swordfish/asset/tzdb/Africa/Kigali +0 -0
- swordfish/asset/tzdb/Africa/Kinshasa +0 -0
- swordfish/asset/tzdb/Africa/Lagos +0 -0
- swordfish/asset/tzdb/Africa/Libreville +0 -0
- swordfish/asset/tzdb/Africa/Lome +0 -0
- swordfish/asset/tzdb/Africa/Luanda +0 -0
- swordfish/asset/tzdb/Africa/Lubumbashi +0 -0
- swordfish/asset/tzdb/Africa/Lusaka +0 -0
- swordfish/asset/tzdb/Africa/Malabo +0 -0
- swordfish/asset/tzdb/Africa/Maputo +0 -0
- swordfish/asset/tzdb/Africa/Maseru +0 -0
- swordfish/asset/tzdb/Africa/Mbabane +0 -0
- swordfish/asset/tzdb/Africa/Mogadishu +0 -0
- swordfish/asset/tzdb/Africa/Monrovia +0 -0
- swordfish/asset/tzdb/Africa/Nairobi +0 -0
- swordfish/asset/tzdb/Africa/Ndjamena +0 -0
- swordfish/asset/tzdb/Africa/Niamey +0 -0
- swordfish/asset/tzdb/Africa/Nouakchott +0 -0
- swordfish/asset/tzdb/Africa/Ouagadougou +0 -0
- swordfish/asset/tzdb/Africa/Porto-Novo +0 -0
- swordfish/asset/tzdb/Africa/Sao_Tome +0 -0
- swordfish/asset/tzdb/Africa/Timbuktu +0 -0
- swordfish/asset/tzdb/Africa/Tripoli +0 -0
- swordfish/asset/tzdb/Africa/Tunis +0 -0
- swordfish/asset/tzdb/Africa/Windhoek +0 -0
- swordfish/asset/tzdb/America/Adak +0 -0
- swordfish/asset/tzdb/America/Anchorage +0 -0
- swordfish/asset/tzdb/America/Anguilla +0 -0
- swordfish/asset/tzdb/America/Antigua +0 -0
- swordfish/asset/tzdb/America/Araguaina +0 -0
- swordfish/asset/tzdb/America/Argentina/Buenos_Aires +0 -0
- swordfish/asset/tzdb/America/Argentina/Catamarca +0 -0
- swordfish/asset/tzdb/America/Argentina/ComodRivadavia +0 -0
- swordfish/asset/tzdb/America/Argentina/Cordoba +0 -0
- swordfish/asset/tzdb/America/Argentina/Jujuy +0 -0
- swordfish/asset/tzdb/America/Argentina/La_Rioja +0 -0
- swordfish/asset/tzdb/America/Argentina/Mendoza +0 -0
- swordfish/asset/tzdb/America/Argentina/Rio_Gallegos +0 -0
- swordfish/asset/tzdb/America/Argentina/Salta +0 -0
- swordfish/asset/tzdb/America/Argentina/San_Juan +0 -0
- swordfish/asset/tzdb/America/Argentina/San_Luis +0 -0
- swordfish/asset/tzdb/America/Argentina/Tucuman +0 -0
- swordfish/asset/tzdb/America/Argentina/Ushuaia +0 -0
- swordfish/asset/tzdb/America/Aruba +0 -0
- swordfish/asset/tzdb/America/Asuncion +0 -0
- swordfish/asset/tzdb/America/Atikokan +0 -0
- swordfish/asset/tzdb/America/Atka +0 -0
- swordfish/asset/tzdb/America/Bahia +0 -0
- swordfish/asset/tzdb/America/Bahia_Banderas +0 -0
- swordfish/asset/tzdb/America/Barbados +0 -0
- swordfish/asset/tzdb/America/Belem +0 -0
- swordfish/asset/tzdb/America/Belize +0 -0
- swordfish/asset/tzdb/America/Blanc-Sablon +0 -0
- swordfish/asset/tzdb/America/Boa_Vista +0 -0
- swordfish/asset/tzdb/America/Bogota +0 -0
- swordfish/asset/tzdb/America/Boise +0 -0
- swordfish/asset/tzdb/America/Buenos_Aires +0 -0
- swordfish/asset/tzdb/America/Cambridge_Bay +0 -0
- swordfish/asset/tzdb/America/Campo_Grande +0 -0
- swordfish/asset/tzdb/America/Cancun +0 -0
- swordfish/asset/tzdb/America/Caracas +0 -0
- swordfish/asset/tzdb/America/Catamarca +0 -0
- swordfish/asset/tzdb/America/Cayenne +0 -0
- swordfish/asset/tzdb/America/Cayman +0 -0
- swordfish/asset/tzdb/America/Chicago +0 -0
- swordfish/asset/tzdb/America/Chihuahua +0 -0
- swordfish/asset/tzdb/America/Coral_Harbour +0 -0
- swordfish/asset/tzdb/America/Cordoba +0 -0
- swordfish/asset/tzdb/America/Costa_Rica +0 -0
- swordfish/asset/tzdb/America/Creston +0 -0
- swordfish/asset/tzdb/America/Cuiaba +0 -0
- swordfish/asset/tzdb/America/Curacao +0 -0
- swordfish/asset/tzdb/America/Danmarkshavn +0 -0
- swordfish/asset/tzdb/America/Dawson +0 -0
- swordfish/asset/tzdb/America/Dawson_Creek +0 -0
- swordfish/asset/tzdb/America/Denver +0 -0
- swordfish/asset/tzdb/America/Detroit +0 -0
- swordfish/asset/tzdb/America/Dominica +0 -0
- swordfish/asset/tzdb/America/Edmonton +0 -0
- swordfish/asset/tzdb/America/Eirunepe +0 -0
- swordfish/asset/tzdb/America/El_Salvador +0 -0
- swordfish/asset/tzdb/America/Ensenada +0 -0
- swordfish/asset/tzdb/America/Fort_Nelson +0 -0
- swordfish/asset/tzdb/America/Fort_Wayne +0 -0
- swordfish/asset/tzdb/America/Fortaleza +0 -0
- swordfish/asset/tzdb/America/Glace_Bay +0 -0
- swordfish/asset/tzdb/America/Godthab +0 -0
- swordfish/asset/tzdb/America/Goose_Bay +0 -0
- swordfish/asset/tzdb/America/Grand_Turk +0 -0
- swordfish/asset/tzdb/America/Grenada +0 -0
- swordfish/asset/tzdb/America/Guadeloupe +0 -0
- swordfish/asset/tzdb/America/Guatemala +0 -0
- swordfish/asset/tzdb/America/Guayaquil +0 -0
- swordfish/asset/tzdb/America/Guyana +0 -0
- swordfish/asset/tzdb/America/Halifax +0 -0
- swordfish/asset/tzdb/America/Havana +0 -0
- swordfish/asset/tzdb/America/Hermosillo +0 -0
- swordfish/asset/tzdb/America/Indiana/Indianapolis +0 -0
- swordfish/asset/tzdb/America/Indiana/Knox +0 -0
- swordfish/asset/tzdb/America/Indiana/Marengo +0 -0
- swordfish/asset/tzdb/America/Indiana/Petersburg +0 -0
- swordfish/asset/tzdb/America/Indiana/Tell_City +0 -0
- swordfish/asset/tzdb/America/Indiana/Vevay +0 -0
- swordfish/asset/tzdb/America/Indiana/Vincennes +0 -0
- swordfish/asset/tzdb/America/Indiana/Winamac +0 -0
- swordfish/asset/tzdb/America/Indianapolis +0 -0
- swordfish/asset/tzdb/America/Inuvik +0 -0
- swordfish/asset/tzdb/America/Iqaluit +0 -0
- swordfish/asset/tzdb/America/Jamaica +0 -0
- swordfish/asset/tzdb/America/Jujuy +0 -0
- swordfish/asset/tzdb/America/Juneau +0 -0
- swordfish/asset/tzdb/America/Kentucky/Louisville +0 -0
- swordfish/asset/tzdb/America/Kentucky/Monticello +0 -0
- swordfish/asset/tzdb/America/Knox_IN +0 -0
- swordfish/asset/tzdb/America/Kralendijk +0 -0
- swordfish/asset/tzdb/America/La_Paz +0 -0
- swordfish/asset/tzdb/America/Lima +0 -0
- swordfish/asset/tzdb/America/Los_Angeles +0 -0
- swordfish/asset/tzdb/America/Louisville +0 -0
- swordfish/asset/tzdb/America/Lower_Princes +0 -0
- swordfish/asset/tzdb/America/Maceio +0 -0
- swordfish/asset/tzdb/America/Managua +0 -0
- swordfish/asset/tzdb/America/Manaus +0 -0
- swordfish/asset/tzdb/America/Marigot +0 -0
- swordfish/asset/tzdb/America/Martinique +0 -0
- swordfish/asset/tzdb/America/Matamoros +0 -0
- swordfish/asset/tzdb/America/Mazatlan +0 -0
- swordfish/asset/tzdb/America/Mendoza +0 -0
- swordfish/asset/tzdb/America/Menominee +0 -0
- swordfish/asset/tzdb/America/Merida +0 -0
- swordfish/asset/tzdb/America/Metlakatla +0 -0
- swordfish/asset/tzdb/America/Mexico_City +0 -0
- swordfish/asset/tzdb/America/Miquelon +0 -0
- swordfish/asset/tzdb/America/Moncton +0 -0
- swordfish/asset/tzdb/America/Monterrey +0 -0
- swordfish/asset/tzdb/America/Montevideo +0 -0
- swordfish/asset/tzdb/America/Montreal +0 -0
- swordfish/asset/tzdb/America/Montserrat +0 -0
- swordfish/asset/tzdb/America/Nassau +0 -0
- swordfish/asset/tzdb/America/New_York +0 -0
- swordfish/asset/tzdb/America/Nipigon +0 -0
- swordfish/asset/tzdb/America/Nome +0 -0
- swordfish/asset/tzdb/America/Noronha +0 -0
- swordfish/asset/tzdb/America/North_Dakota/Beulah +0 -0
- swordfish/asset/tzdb/America/North_Dakota/Center +0 -0
- swordfish/asset/tzdb/America/North_Dakota/New_Salem +0 -0
- swordfish/asset/tzdb/America/Ojinaga +0 -0
- swordfish/asset/tzdb/America/Panama +0 -0
- swordfish/asset/tzdb/America/Pangnirtung +0 -0
- swordfish/asset/tzdb/America/Paramaribo +0 -0
- swordfish/asset/tzdb/America/Phoenix +0 -0
- swordfish/asset/tzdb/America/Port-au-Prince +0 -0
- swordfish/asset/tzdb/America/Port_of_Spain +0 -0
- swordfish/asset/tzdb/America/Porto_Acre +0 -0
- swordfish/asset/tzdb/America/Porto_Velho +0 -0
- swordfish/asset/tzdb/America/Puerto_Rico +0 -0
- swordfish/asset/tzdb/America/Punta_Arenas +0 -0
- swordfish/asset/tzdb/America/Rainy_River +0 -0
- swordfish/asset/tzdb/America/Rankin_Inlet +0 -0
- swordfish/asset/tzdb/America/Recife +0 -0
- swordfish/asset/tzdb/America/Regina +0 -0
- swordfish/asset/tzdb/America/Resolute +0 -0
- swordfish/asset/tzdb/America/Rio_Branco +0 -0
- swordfish/asset/tzdb/America/Rosario +0 -0
- swordfish/asset/tzdb/America/Santa_Isabel +0 -0
- swordfish/asset/tzdb/America/Santarem +0 -0
- swordfish/asset/tzdb/America/Santiago +0 -0
- swordfish/asset/tzdb/America/Santo_Domingo +0 -0
- swordfish/asset/tzdb/America/Sao_Paulo +0 -0
- swordfish/asset/tzdb/America/Scoresbysund +0 -0
- swordfish/asset/tzdb/America/Shiprock +0 -0
- swordfish/asset/tzdb/America/Sitka +0 -0
- swordfish/asset/tzdb/America/St_Barthelemy +0 -0
- swordfish/asset/tzdb/America/St_Johns +0 -0
- swordfish/asset/tzdb/America/St_Kitts +0 -0
- swordfish/asset/tzdb/America/St_Lucia +0 -0
- swordfish/asset/tzdb/America/St_Thomas +0 -0
- swordfish/asset/tzdb/America/St_Vincent +0 -0
- swordfish/asset/tzdb/America/Swift_Current +0 -0
- swordfish/asset/tzdb/America/Tegucigalpa +0 -0
- swordfish/asset/tzdb/America/Thule +0 -0
- swordfish/asset/tzdb/America/Thunder_Bay +0 -0
- swordfish/asset/tzdb/America/Tijuana +0 -0
- swordfish/asset/tzdb/America/Toronto +0 -0
- swordfish/asset/tzdb/America/Tortola +0 -0
- swordfish/asset/tzdb/America/Vancouver +0 -0
- swordfish/asset/tzdb/America/Virgin +0 -0
- swordfish/asset/tzdb/America/Whitehorse +0 -0
- swordfish/asset/tzdb/America/Winnipeg +0 -0
- swordfish/asset/tzdb/America/Yakutat +0 -0
- swordfish/asset/tzdb/America/Yellowknife +0 -0
- swordfish/asset/tzdb/Antarctica/Casey +0 -0
- swordfish/asset/tzdb/Antarctica/Davis +0 -0
- swordfish/asset/tzdb/Antarctica/DumontDUrville +0 -0
- swordfish/asset/tzdb/Antarctica/Macquarie +0 -0
- swordfish/asset/tzdb/Antarctica/Mawson +0 -0
- swordfish/asset/tzdb/Antarctica/McMurdo +0 -0
- swordfish/asset/tzdb/Antarctica/Palmer +0 -0
- swordfish/asset/tzdb/Antarctica/Rothera +0 -0
- swordfish/asset/tzdb/Antarctica/South_Pole +0 -0
- swordfish/asset/tzdb/Antarctica/Syowa +0 -0
- swordfish/asset/tzdb/Antarctica/Troll +0 -0
- swordfish/asset/tzdb/Antarctica/Vostok +0 -0
- swordfish/asset/tzdb/Arctic/Longyearbyen +0 -0
- swordfish/asset/tzdb/Asia/Aden +0 -0
- swordfish/asset/tzdb/Asia/Almaty +0 -0
- swordfish/asset/tzdb/Asia/Amman +0 -0
- swordfish/asset/tzdb/Asia/Anadyr +0 -0
- swordfish/asset/tzdb/Asia/Aqtau +0 -0
- swordfish/asset/tzdb/Asia/Aqtobe +0 -0
- swordfish/asset/tzdb/Asia/Ashgabat +0 -0
- swordfish/asset/tzdb/Asia/Ashkhabad +0 -0
- swordfish/asset/tzdb/Asia/Atyrau +0 -0
- swordfish/asset/tzdb/Asia/Baghdad +0 -0
- swordfish/asset/tzdb/Asia/Bahrain +0 -0
- swordfish/asset/tzdb/Asia/Baku +0 -0
- swordfish/asset/tzdb/Asia/Bangkok +0 -0
- swordfish/asset/tzdb/Asia/Barnaul +0 -0
- swordfish/asset/tzdb/Asia/Beirut +0 -0
- swordfish/asset/tzdb/Asia/Bishkek +0 -0
- swordfish/asset/tzdb/Asia/Brunei +0 -0
- swordfish/asset/tzdb/Asia/Calcutta +0 -0
- swordfish/asset/tzdb/Asia/Chita +0 -0
- swordfish/asset/tzdb/Asia/Choibalsan +0 -0
- swordfish/asset/tzdb/Asia/Chongqing +0 -0
- swordfish/asset/tzdb/Asia/Chungking +0 -0
- swordfish/asset/tzdb/Asia/Colombo +0 -0
- swordfish/asset/tzdb/Asia/Dacca +0 -0
- swordfish/asset/tzdb/Asia/Damascus +0 -0
- swordfish/asset/tzdb/Asia/Dhaka +0 -0
- swordfish/asset/tzdb/Asia/Dili +0 -0
- swordfish/asset/tzdb/Asia/Dubai +0 -0
- swordfish/asset/tzdb/Asia/Dushanbe +0 -0
- swordfish/asset/tzdb/Asia/Famagusta +0 -0
- swordfish/asset/tzdb/Asia/Gaza +0 -0
- swordfish/asset/tzdb/Asia/Harbin +0 -0
- swordfish/asset/tzdb/Asia/Hebron +0 -0
- swordfish/asset/tzdb/Asia/Ho_Chi_Minh +0 -0
- swordfish/asset/tzdb/Asia/Hong_Kong +0 -0
- swordfish/asset/tzdb/Asia/Hovd +0 -0
- swordfish/asset/tzdb/Asia/Irkutsk +0 -0
- swordfish/asset/tzdb/Asia/Istanbul +0 -0
- swordfish/asset/tzdb/Asia/Jakarta +0 -0
- swordfish/asset/tzdb/Asia/Jayapura +0 -0
- swordfish/asset/tzdb/Asia/Jerusalem +0 -0
- swordfish/asset/tzdb/Asia/Kabul +0 -0
- swordfish/asset/tzdb/Asia/Kamchatka +0 -0
- swordfish/asset/tzdb/Asia/Karachi +0 -0
- swordfish/asset/tzdb/Asia/Kashgar +0 -0
- swordfish/asset/tzdb/Asia/Kathmandu +0 -0
- swordfish/asset/tzdb/Asia/Katmandu +0 -0
- swordfish/asset/tzdb/Asia/Khandyga +0 -0
- swordfish/asset/tzdb/Asia/Kolkata +0 -0
- swordfish/asset/tzdb/Asia/Krasnoyarsk +0 -0
- swordfish/asset/tzdb/Asia/Kuala_Lumpur +0 -0
- swordfish/asset/tzdb/Asia/Kuching +0 -0
- swordfish/asset/tzdb/Asia/Kuwait +0 -0
- swordfish/asset/tzdb/Asia/Macao +0 -0
- swordfish/asset/tzdb/Asia/Macau +0 -0
- swordfish/asset/tzdb/Asia/Magadan +0 -0
- swordfish/asset/tzdb/Asia/Makassar +0 -0
- swordfish/asset/tzdb/Asia/Manila +0 -0
- swordfish/asset/tzdb/Asia/Muscat +0 -0
- swordfish/asset/tzdb/Asia/Nicosia +0 -0
- swordfish/asset/tzdb/Asia/Novokuznetsk +0 -0
- swordfish/asset/tzdb/Asia/Novosibirsk +0 -0
- swordfish/asset/tzdb/Asia/Omsk +0 -0
- swordfish/asset/tzdb/Asia/Oral +0 -0
- swordfish/asset/tzdb/Asia/Phnom_Penh +0 -0
- swordfish/asset/tzdb/Asia/Pontianak +0 -0
- swordfish/asset/tzdb/Asia/Pyongyang +0 -0
- swordfish/asset/tzdb/Asia/Qatar +0 -0
- swordfish/asset/tzdb/Asia/Qyzylorda +0 -0
- swordfish/asset/tzdb/Asia/Rangoon +0 -0
- swordfish/asset/tzdb/Asia/Riyadh +0 -0
- swordfish/asset/tzdb/Asia/Saigon +0 -0
- swordfish/asset/tzdb/Asia/Sakhalin +0 -0
- swordfish/asset/tzdb/Asia/Samarkand +0 -0
- swordfish/asset/tzdb/Asia/Seoul +0 -0
- swordfish/asset/tzdb/Asia/Shanghai +0 -0
- swordfish/asset/tzdb/Asia/Singapore +0 -0
- swordfish/asset/tzdb/Asia/Srednekolymsk +0 -0
- swordfish/asset/tzdb/Asia/Taipei +0 -0
- swordfish/asset/tzdb/Asia/Tashkent +0 -0
- swordfish/asset/tzdb/Asia/Tbilisi +0 -0
- swordfish/asset/tzdb/Asia/Tehran +0 -0
- swordfish/asset/tzdb/Asia/Tel_Aviv +0 -0
- swordfish/asset/tzdb/Asia/Thimbu +0 -0
- swordfish/asset/tzdb/Asia/Thimphu +0 -0
- swordfish/asset/tzdb/Asia/Tokyo +0 -0
- swordfish/asset/tzdb/Asia/Tomsk +0 -0
- swordfish/asset/tzdb/Asia/Ujung_Pandang +0 -0
- swordfish/asset/tzdb/Asia/Ulaanbaatar +0 -0
- swordfish/asset/tzdb/Asia/Ulan_Bator +0 -0
- swordfish/asset/tzdb/Asia/Urumqi +0 -0
- swordfish/asset/tzdb/Asia/Ust-Nera +0 -0
- swordfish/asset/tzdb/Asia/Vientiane +0 -0
- swordfish/asset/tzdb/Asia/Vladivostok +0 -0
- swordfish/asset/tzdb/Asia/Yakutsk +0 -0
- swordfish/asset/tzdb/Asia/Yangon +0 -0
- swordfish/asset/tzdb/Asia/Yekaterinburg +0 -0
- swordfish/asset/tzdb/Asia/Yerevan +0 -0
- swordfish/asset/tzdb/Atlantic/Azores +0 -0
- swordfish/asset/tzdb/Atlantic/Bermuda +0 -0
- swordfish/asset/tzdb/Atlantic/Canary +0 -0
- swordfish/asset/tzdb/Atlantic/Cape_Verde +0 -0
- swordfish/asset/tzdb/Atlantic/Faeroe +0 -0
- swordfish/asset/tzdb/Atlantic/Faroe +0 -0
- swordfish/asset/tzdb/Atlantic/Jan_Mayen +0 -0
- swordfish/asset/tzdb/Atlantic/Madeira +0 -0
- swordfish/asset/tzdb/Atlantic/Reykjavik +0 -0
- swordfish/asset/tzdb/Atlantic/South_Georgia +0 -0
- swordfish/asset/tzdb/Atlantic/St_Helena +0 -0
- swordfish/asset/tzdb/Atlantic/Stanley +0 -0
- swordfish/asset/tzdb/Australia/ACT +0 -0
- swordfish/asset/tzdb/Australia/Adelaide +0 -0
- swordfish/asset/tzdb/Australia/Brisbane +0 -0
- swordfish/asset/tzdb/Australia/Broken_Hill +0 -0
- swordfish/asset/tzdb/Australia/Canberra +0 -0
- swordfish/asset/tzdb/Australia/Currie +0 -0
- swordfish/asset/tzdb/Australia/Darwin +0 -0
- swordfish/asset/tzdb/Australia/Eucla +0 -0
- swordfish/asset/tzdb/Australia/Hobart +0 -0
- swordfish/asset/tzdb/Australia/LHI +0 -0
- swordfish/asset/tzdb/Australia/Lindeman +0 -0
- swordfish/asset/tzdb/Australia/Lord_Howe +0 -0
- swordfish/asset/tzdb/Australia/Melbourne +0 -0
- swordfish/asset/tzdb/Australia/NSW +0 -0
- swordfish/asset/tzdb/Australia/North +0 -0
- swordfish/asset/tzdb/Australia/Perth +0 -0
- swordfish/asset/tzdb/Australia/Queensland +0 -0
- swordfish/asset/tzdb/Australia/South +0 -0
- swordfish/asset/tzdb/Australia/Sydney +0 -0
- swordfish/asset/tzdb/Australia/Tasmania +0 -0
- swordfish/asset/tzdb/Australia/Victoria +0 -0
- swordfish/asset/tzdb/Australia/West +0 -0
- swordfish/asset/tzdb/Australia/Yancowinna +0 -0
- swordfish/asset/tzdb/Brazil/Acre +0 -0
- swordfish/asset/tzdb/Brazil/DeNoronha +0 -0
- swordfish/asset/tzdb/Brazil/East +0 -0
- swordfish/asset/tzdb/Brazil/West +0 -0
- swordfish/asset/tzdb/CET +0 -0
- swordfish/asset/tzdb/CST6CDT +0 -0
- swordfish/asset/tzdb/Canada/Atlantic +0 -0
- swordfish/asset/tzdb/Canada/Central +0 -0
- swordfish/asset/tzdb/Canada/Eastern +0 -0
- swordfish/asset/tzdb/Canada/Mountain +0 -0
- swordfish/asset/tzdb/Canada/Newfoundland +0 -0
- swordfish/asset/tzdb/Canada/Pacific +0 -0
- swordfish/asset/tzdb/Canada/Saskatchewan +0 -0
- swordfish/asset/tzdb/Canada/Yukon +0 -0
- swordfish/asset/tzdb/Chile/Continental +0 -0
- swordfish/asset/tzdb/Chile/EasterIsland +0 -0
- swordfish/asset/tzdb/Cuba +0 -0
- swordfish/asset/tzdb/EET +0 -0
- swordfish/asset/tzdb/EST +0 -0
- swordfish/asset/tzdb/EST5EDT +0 -0
- swordfish/asset/tzdb/Egypt +0 -0
- swordfish/asset/tzdb/Eire +0 -0
- swordfish/asset/tzdb/Etc/GMT +0 -0
- swordfish/asset/tzdb/Etc/GMT+0 +0 -0
- swordfish/asset/tzdb/Etc/GMT+1 +0 -0
- swordfish/asset/tzdb/Etc/GMT+10 +0 -0
- swordfish/asset/tzdb/Etc/GMT+11 +0 -0
- swordfish/asset/tzdb/Etc/GMT+12 +0 -0
- swordfish/asset/tzdb/Etc/GMT+2 +0 -0
- swordfish/asset/tzdb/Etc/GMT+3 +0 -0
- swordfish/asset/tzdb/Etc/GMT+4 +0 -0
- swordfish/asset/tzdb/Etc/GMT+5 +0 -0
- swordfish/asset/tzdb/Etc/GMT+6 +0 -0
- swordfish/asset/tzdb/Etc/GMT+7 +0 -0
- swordfish/asset/tzdb/Etc/GMT+8 +0 -0
- swordfish/asset/tzdb/Etc/GMT+9 +0 -0
- swordfish/asset/tzdb/Etc/GMT-0 +0 -0
- swordfish/asset/tzdb/Etc/GMT-1 +0 -0
- swordfish/asset/tzdb/Etc/GMT-10 +0 -0
- swordfish/asset/tzdb/Etc/GMT-11 +0 -0
- swordfish/asset/tzdb/Etc/GMT-12 +0 -0
- swordfish/asset/tzdb/Etc/GMT-13 +0 -0
- swordfish/asset/tzdb/Etc/GMT-14 +0 -0
- swordfish/asset/tzdb/Etc/GMT-2 +0 -0
- swordfish/asset/tzdb/Etc/GMT-3 +0 -0
- swordfish/asset/tzdb/Etc/GMT-4 +0 -0
- swordfish/asset/tzdb/Etc/GMT-5 +0 -0
- swordfish/asset/tzdb/Etc/GMT-6 +0 -0
- swordfish/asset/tzdb/Etc/GMT-7 +0 -0
- swordfish/asset/tzdb/Etc/GMT-8 +0 -0
- swordfish/asset/tzdb/Etc/GMT-9 +0 -0
- swordfish/asset/tzdb/Etc/GMT0 +0 -0
- swordfish/asset/tzdb/Etc/Greenwich +0 -0
- swordfish/asset/tzdb/Etc/UCT +0 -0
- swordfish/asset/tzdb/Etc/UTC +0 -0
- swordfish/asset/tzdb/Etc/Universal +0 -0
- swordfish/asset/tzdb/Etc/Zulu +0 -0
- swordfish/asset/tzdb/Europe/Amsterdam +0 -0
- swordfish/asset/tzdb/Europe/Andorra +0 -0
- swordfish/asset/tzdb/Europe/Astrakhan +0 -0
- swordfish/asset/tzdb/Europe/Athens +0 -0
- swordfish/asset/tzdb/Europe/Belfast +0 -0
- swordfish/asset/tzdb/Europe/Belgrade +0 -0
- swordfish/asset/tzdb/Europe/Berlin +0 -0
- swordfish/asset/tzdb/Europe/Bratislava +0 -0
- swordfish/asset/tzdb/Europe/Brussels +0 -0
- swordfish/asset/tzdb/Europe/Bucharest +0 -0
- swordfish/asset/tzdb/Europe/Budapest +0 -0
- swordfish/asset/tzdb/Europe/Busingen +0 -0
- swordfish/asset/tzdb/Europe/Chisinau +0 -0
- swordfish/asset/tzdb/Europe/Copenhagen +0 -0
- swordfish/asset/tzdb/Europe/Dublin +0 -0
- swordfish/asset/tzdb/Europe/Gibraltar +0 -0
- swordfish/asset/tzdb/Europe/Guernsey +0 -0
- swordfish/asset/tzdb/Europe/Helsinki +0 -0
- swordfish/asset/tzdb/Europe/Isle_of_Man +0 -0
- swordfish/asset/tzdb/Europe/Istanbul +0 -0
- swordfish/asset/tzdb/Europe/Jersey +0 -0
- swordfish/asset/tzdb/Europe/Kaliningrad +0 -0
- swordfish/asset/tzdb/Europe/Kiev +0 -0
- swordfish/asset/tzdb/Europe/Kirov +0 -0
- swordfish/asset/tzdb/Europe/Lisbon +0 -0
- swordfish/asset/tzdb/Europe/Ljubljana +0 -0
- swordfish/asset/tzdb/Europe/London +0 -0
- swordfish/asset/tzdb/Europe/Luxembourg +0 -0
- swordfish/asset/tzdb/Europe/Madrid +0 -0
- swordfish/asset/tzdb/Europe/Malta +0 -0
- swordfish/asset/tzdb/Europe/Mariehamn +0 -0
- swordfish/asset/tzdb/Europe/Minsk +0 -0
- swordfish/asset/tzdb/Europe/Monaco +0 -0
- swordfish/asset/tzdb/Europe/Moscow +0 -0
- swordfish/asset/tzdb/Europe/Nicosia +0 -0
- swordfish/asset/tzdb/Europe/Oslo +0 -0
- swordfish/asset/tzdb/Europe/Paris +0 -0
- swordfish/asset/tzdb/Europe/Podgorica +0 -0
- swordfish/asset/tzdb/Europe/Prague +0 -0
- swordfish/asset/tzdb/Europe/Riga +0 -0
- swordfish/asset/tzdb/Europe/Rome +0 -0
- swordfish/asset/tzdb/Europe/Samara +0 -0
- swordfish/asset/tzdb/Europe/San_Marino +0 -0
- swordfish/asset/tzdb/Europe/Sarajevo +0 -0
- swordfish/asset/tzdb/Europe/Saratov +0 -0
- swordfish/asset/tzdb/Europe/Simferopol +0 -0
- swordfish/asset/tzdb/Europe/Skopje +0 -0
- swordfish/asset/tzdb/Europe/Sofia +0 -0
- swordfish/asset/tzdb/Europe/Stockholm +0 -0
- swordfish/asset/tzdb/Europe/Tallinn +0 -0
- swordfish/asset/tzdb/Europe/Tirane +0 -0
- swordfish/asset/tzdb/Europe/Tiraspol +0 -0
- swordfish/asset/tzdb/Europe/Ulyanovsk +0 -0
- swordfish/asset/tzdb/Europe/Uzhgorod +0 -0
- swordfish/asset/tzdb/Europe/Vaduz +0 -0
- swordfish/asset/tzdb/Europe/Vatican +0 -0
- swordfish/asset/tzdb/Europe/Vienna +0 -0
- swordfish/asset/tzdb/Europe/Vilnius +0 -0
- swordfish/asset/tzdb/Europe/Volgograd +0 -0
- swordfish/asset/tzdb/Europe/Warsaw +0 -0
- swordfish/asset/tzdb/Europe/Zagreb +0 -0
- swordfish/asset/tzdb/Europe/Zaporozhye +0 -0
- swordfish/asset/tzdb/Europe/Zurich +0 -0
- swordfish/asset/tzdb/Factory +0 -0
- swordfish/asset/tzdb/GB +0 -0
- swordfish/asset/tzdb/GB-Eire +0 -0
- swordfish/asset/tzdb/GMT +0 -0
- swordfish/asset/tzdb/GMT+0 +0 -0
- swordfish/asset/tzdb/GMT-0 +0 -0
- swordfish/asset/tzdb/GMT0 +0 -0
- swordfish/asset/tzdb/Greenwich +0 -0
- swordfish/asset/tzdb/HST +0 -0
- swordfish/asset/tzdb/Hongkong +0 -0
- swordfish/asset/tzdb/Iceland +0 -0
- swordfish/asset/tzdb/Indian/Antananarivo +0 -0
- swordfish/asset/tzdb/Indian/Chagos +0 -0
- swordfish/asset/tzdb/Indian/Christmas +0 -0
- swordfish/asset/tzdb/Indian/Cocos +0 -0
- swordfish/asset/tzdb/Indian/Comoro +0 -0
- swordfish/asset/tzdb/Indian/Kerguelen +0 -0
- swordfish/asset/tzdb/Indian/Mahe +0 -0
- swordfish/asset/tzdb/Indian/Maldives +0 -0
- swordfish/asset/tzdb/Indian/Mauritius +0 -0
- swordfish/asset/tzdb/Indian/Mayotte +0 -0
- swordfish/asset/tzdb/Indian/Reunion +0 -0
- swordfish/asset/tzdb/Iran +0 -0
- swordfish/asset/tzdb/Israel +0 -0
- swordfish/asset/tzdb/Jamaica +0 -0
- swordfish/asset/tzdb/Japan +0 -0
- swordfish/asset/tzdb/Kwajalein +0 -0
- swordfish/asset/tzdb/Libya +0 -0
- swordfish/asset/tzdb/MET +0 -0
- swordfish/asset/tzdb/MST +0 -0
- swordfish/asset/tzdb/MST7MDT +0 -0
- swordfish/asset/tzdb/Mexico/BajaNorte +0 -0
- swordfish/asset/tzdb/Mexico/BajaSur +0 -0
- swordfish/asset/tzdb/Mexico/General +0 -0
- swordfish/asset/tzdb/NZ +0 -0
- swordfish/asset/tzdb/NZ-CHAT +0 -0
- swordfish/asset/tzdb/Navajo +0 -0
- swordfish/asset/tzdb/PRC +0 -0
- swordfish/asset/tzdb/PST8PDT +0 -0
- swordfish/asset/tzdb/Pacific/Apia +0 -0
- swordfish/asset/tzdb/Pacific/Auckland +0 -0
- swordfish/asset/tzdb/Pacific/Bougainville +0 -0
- swordfish/asset/tzdb/Pacific/Chatham +0 -0
- swordfish/asset/tzdb/Pacific/Chuuk +0 -0
- swordfish/asset/tzdb/Pacific/Easter +0 -0
- swordfish/asset/tzdb/Pacific/Efate +0 -0
- swordfish/asset/tzdb/Pacific/Enderbury +0 -0
- swordfish/asset/tzdb/Pacific/Fakaofo +0 -0
- swordfish/asset/tzdb/Pacific/Fiji +0 -0
- swordfish/asset/tzdb/Pacific/Funafuti +0 -0
- swordfish/asset/tzdb/Pacific/Galapagos +0 -0
- swordfish/asset/tzdb/Pacific/Gambier +0 -0
- swordfish/asset/tzdb/Pacific/Guadalcanal +0 -0
- swordfish/asset/tzdb/Pacific/Guam +0 -0
- swordfish/asset/tzdb/Pacific/Honolulu +0 -0
- swordfish/asset/tzdb/Pacific/Johnston +0 -0
- swordfish/asset/tzdb/Pacific/Kiritimati +0 -0
- swordfish/asset/tzdb/Pacific/Kosrae +0 -0
- swordfish/asset/tzdb/Pacific/Kwajalein +0 -0
- swordfish/asset/tzdb/Pacific/Majuro +0 -0
- swordfish/asset/tzdb/Pacific/Marquesas +0 -0
- swordfish/asset/tzdb/Pacific/Midway +0 -0
- swordfish/asset/tzdb/Pacific/Nauru +0 -0
- swordfish/asset/tzdb/Pacific/Niue +0 -0
- swordfish/asset/tzdb/Pacific/Norfolk +0 -0
- swordfish/asset/tzdb/Pacific/Noumea +0 -0
- swordfish/asset/tzdb/Pacific/Pago_Pago +0 -0
- swordfish/asset/tzdb/Pacific/Palau +0 -0
- swordfish/asset/tzdb/Pacific/Pitcairn +0 -0
- swordfish/asset/tzdb/Pacific/Pohnpei +0 -0
- swordfish/asset/tzdb/Pacific/Ponape +0 -0
- swordfish/asset/tzdb/Pacific/Port_Moresby +0 -0
- swordfish/asset/tzdb/Pacific/Rarotonga +0 -0
- swordfish/asset/tzdb/Pacific/Saipan +0 -0
- swordfish/asset/tzdb/Pacific/Samoa +0 -0
- swordfish/asset/tzdb/Pacific/Tahiti +0 -0
- swordfish/asset/tzdb/Pacific/Tarawa +0 -0
- swordfish/asset/tzdb/Pacific/Tongatapu +0 -0
- swordfish/asset/tzdb/Pacific/Truk +0 -0
- swordfish/asset/tzdb/Pacific/Wake +0 -0
- swordfish/asset/tzdb/Pacific/Wallis +0 -0
- swordfish/asset/tzdb/Pacific/Yap +0 -0
- swordfish/asset/tzdb/Poland +0 -0
- swordfish/asset/tzdb/Portugal +0 -0
- swordfish/asset/tzdb/ROC +0 -0
- swordfish/asset/tzdb/ROK +0 -0
- swordfish/asset/tzdb/Singapore +0 -0
- swordfish/asset/tzdb/Turkey +0 -0
- swordfish/asset/tzdb/UCT +0 -0
- swordfish/asset/tzdb/US/Alaska +0 -0
- swordfish/asset/tzdb/US/Aleutian +0 -0
- swordfish/asset/tzdb/US/Arizona +0 -0
- swordfish/asset/tzdb/US/Central +0 -0
- swordfish/asset/tzdb/US/East-Indiana +0 -0
- swordfish/asset/tzdb/US/Eastern +0 -0
- swordfish/asset/tzdb/US/Hawaii +0 -0
- swordfish/asset/tzdb/US/Indiana-Starke +0 -0
- swordfish/asset/tzdb/US/Michigan +0 -0
- swordfish/asset/tzdb/US/Mountain +0 -0
- swordfish/asset/tzdb/US/Pacific +0 -0
- swordfish/asset/tzdb/US/Samoa +0 -0
- swordfish/asset/tzdb/UTC +0 -0
- swordfish/asset/tzdb/Universal +0 -0
- swordfish/asset/tzdb/W-SU +0 -0
- swordfish/asset/tzdb/WET +0 -0
- swordfish/asset/tzdb/Zulu +0 -0
- swordfish/asset/tzdb/iso3166.tab +274 -0
- swordfish/asset/tzdb/leapseconds +61 -0
- swordfish/asset/tzdb/posixrules +0 -0
- swordfish/asset/tzdb/tzdata.zi +4150 -0
- swordfish/asset/tzdb/tzmap_gen.py +27 -0
- swordfish/asset/tzdb/tzmapping +501 -0
- swordfish/asset/tzdb/windowsZones.xml +781 -0
- swordfish/asset/tzdb/zone.tab +448 -0
- swordfish/asset/tzdb/zone1970.tab +382 -0
- swordfish/connection.py +33 -0
- swordfish/data.py +806 -0
- swordfish/engine.py +28 -0
- swordfish/enums.py +32 -0
- swordfish/function.py +3 -0
- swordfish/infos.py +53 -0
- swordfish/io.py +11 -0
- swordfish/libSwordfish.dll +0 -0
- swordfish/libclucene-contribs-lib.dll +0 -0
- swordfish/libclucene-core.dll +0 -0
- swordfish/libclucene-shared.dll +0 -0
- swordfish/libgcc_s_seh-1.dll +0 -0
- swordfish/libstdc++-6.dll +0 -0
- swordfish/libwinpthread-1.dll +0 -0
- swordfish/module.py +57 -0
- swordfish/plugins/__init__.py +17 -0
- swordfish/plugins/backtest/__init__.py +38 -0
- swordfish/plugins/backtest/backtest.py +4228 -0
- swordfish/plugins/backtest/translator.py +820 -0
- swordfish/plugins/matching_engine_simulator.py +247 -0
- swordfish/streaming.py +19 -0
- swordfish/tools.py +71 -0
- swordfish/types.py +30 -0
swordfish/_config.py
ADDED
|
@@ -0,0 +1,901 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import toml
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Type, TypeVar, Generic, Optional, Dict, List
|
|
6
|
+
from ._swordfishcpp import ( # type: ignore
|
|
7
|
+
sw_check,
|
|
8
|
+
sw_is_ce_edition,
|
|
9
|
+
_global_call,
|
|
10
|
+
Scalar,
|
|
11
|
+
ProgrammingError,
|
|
12
|
+
)
|
|
13
|
+
from .tools import get_random_available_port
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
ENV_NAME_HOME = "SWORDFISH_PYTHON_HOME_PATH"
|
|
17
|
+
ENV_NAME_CONFIG = "SWORDFISH_PYTHON_CONFIG_PATH"
|
|
18
|
+
ENV_NAME_LICENSE = "SWORDFISH_PYTHON_LICENSE_PATH"
|
|
19
|
+
ENV_NAME_HOST = "SWORDFISH_PYTHON_HOST"
|
|
20
|
+
ENV_NAME_PORT = "SWORDFISH_PYTHON_PORT"
|
|
21
|
+
ENV_NAME_ALIAS = "SWORDFISH_PYTHON_ALIAS"
|
|
22
|
+
ENV_NAME_EXTRA = "SWORDFISH_PYTHON_COMMAND"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _getenv(env_name: str):
|
|
26
|
+
val = os.getenv(env_name)
|
|
27
|
+
return val if val else None
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _get_absolute_path_env(env_name: str):
|
|
31
|
+
return Path(_getenv(env_name)).expanduser()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
T = TypeVar('T')
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ConfigDescriptor(Generic[T]):
|
|
38
|
+
"""
|
|
39
|
+
A descriptor for managing configuration values.
|
|
40
|
+
"""
|
|
41
|
+
config_name: str
|
|
42
|
+
"""
|
|
43
|
+
The name of the configuration.
|
|
44
|
+
"""
|
|
45
|
+
config_type: Type[T]
|
|
46
|
+
"""
|
|
47
|
+
The type of the configuration value.
|
|
48
|
+
"""
|
|
49
|
+
config_value: Optional[T]
|
|
50
|
+
"""
|
|
51
|
+
The current value of the configuration.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
def __init__(self, val_type: Type[T], default_value: Optional[T] = None):
|
|
55
|
+
self.init(val_type, default_value)
|
|
56
|
+
|
|
57
|
+
def init(self, val_type: Type[T], default_value: Optional[T] = None):
|
|
58
|
+
self.config_type = val_type
|
|
59
|
+
self.config_value = val_type(default_value) if default_value is not None else None
|
|
60
|
+
self.default_value = self.config_value
|
|
61
|
+
|
|
62
|
+
def __set_name__(self, owner: "Config", name):
|
|
63
|
+
self.name = name
|
|
64
|
+
owner.config_dict[name] = self
|
|
65
|
+
|
|
66
|
+
def __get__(self, instance, owner):
|
|
67
|
+
pass
|
|
68
|
+
|
|
69
|
+
def __set__(self, instance, value):
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
def get_value_str(self):
|
|
73
|
+
if self.config_value is None:
|
|
74
|
+
return None
|
|
75
|
+
if isinstance(self.config_value, bool):
|
|
76
|
+
return str(self.config_value).lower()
|
|
77
|
+
return str(self.config_value)
|
|
78
|
+
|
|
79
|
+
def is_default(self) -> bool:
|
|
80
|
+
"""
|
|
81
|
+
Checks if the configuration value matches the default value.
|
|
82
|
+
|
|
83
|
+
Returns
|
|
84
|
+
-------
|
|
85
|
+
bool
|
|
86
|
+
True if the current value is the default, False otherwise.
|
|
87
|
+
"""
|
|
88
|
+
return self.config_value == self.default_value
|
|
89
|
+
|
|
90
|
+
def _wrap_config_value(self, val: Scalar):
|
|
91
|
+
if val.is_null():
|
|
92
|
+
return None
|
|
93
|
+
if self.config_type is Path:
|
|
94
|
+
return Path(val.to_python())
|
|
95
|
+
return val.to_python()
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class StaticConfigDescriptor(ConfigDescriptor):
|
|
99
|
+
"""
|
|
100
|
+
A descriptor for handling static configuration values.
|
|
101
|
+
"""
|
|
102
|
+
def __get__(self, instance, owner):
|
|
103
|
+
if not sw_check():
|
|
104
|
+
return self.config_value if self.config_value is not None else None
|
|
105
|
+
val = _global_call("getConfig", self.name)
|
|
106
|
+
return self._wrap_config_value(val)
|
|
107
|
+
|
|
108
|
+
def __set__(self, instance, value):
|
|
109
|
+
if sw_check():
|
|
110
|
+
raise ProgrammingError("Cannot modify static configuration after initialization.")
|
|
111
|
+
if not isinstance(value, self.config_type) and value is not None:
|
|
112
|
+
self.config_value = self.config_type(value)
|
|
113
|
+
else:
|
|
114
|
+
self.config_value = value
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# class DynamicConfigDescriptor(ConfigDescriptor):
|
|
118
|
+
# def __get__(self, instance, owner):
|
|
119
|
+
# if not sw_check():
|
|
120
|
+
# return self.config_value if self.config_value is not None else None
|
|
121
|
+
# val = _global_call("getConfig", self.name)
|
|
122
|
+
# return self._wrap_config_value(val)
|
|
123
|
+
|
|
124
|
+
# def __set__(self, instance, value):
|
|
125
|
+
# if not isinstance(value, self.config_type) and value is not None:
|
|
126
|
+
# value = self.config_type(value)
|
|
127
|
+
# if sw_check():
|
|
128
|
+
# if isinstance(value, Path):
|
|
129
|
+
# value = str(value)
|
|
130
|
+
# set_dynamic_config(self.name, value)
|
|
131
|
+
# else:
|
|
132
|
+
# self.config_value = value
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class DynamicConfigDescriptor(StaticConfigDescriptor):
|
|
136
|
+
"""
|
|
137
|
+
A descriptor for dynamic configuration values.
|
|
138
|
+
|
|
139
|
+
Currently, dynamic configuration is not supported.
|
|
140
|
+
"""
|
|
141
|
+
pass
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class Config:
|
|
145
|
+
"""
|
|
146
|
+
A class that manages various configuration settings.
|
|
147
|
+
"""
|
|
148
|
+
config_dict: Dict[str, ConfigDescriptor] = dict()
|
|
149
|
+
"""
|
|
150
|
+
:meta hide-value:
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
dataSync: int = StaticConfigDescriptor(int, 1)
|
|
154
|
+
"""
|
|
155
|
+
:meta hide-value:
|
|
156
|
+
|
|
157
|
+
Whether database logs are forced to persist to disk before the transaction is
|
|
158
|
+
committed.
|
|
159
|
+
|
|
160
|
+
- If `dataSync=1` (default), the redo logs, data, and metadata are forced to
|
|
161
|
+
persist to disk.
|
|
162
|
+
- If `dataSync=0`, the operating system will decide when to write the log files
|
|
163
|
+
to disk.
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
decimalRoundingMode: str = StaticConfigDescriptor(str, "trunc")
|
|
167
|
+
"""
|
|
168
|
+
:meta hide-value:
|
|
169
|
+
|
|
170
|
+
Specifies the rounding mode for Decimal type. The default is `"trunc"`, meaning
|
|
171
|
+
the decimal part is truncated. Set it to `"round"` to round the decimal part.
|
|
172
|
+
It is applicable to the following conversion scenarios:
|
|
173
|
+
|
|
174
|
+
- Parsing floating-point numeric strings to DECIMAL type (e.g., loading files
|
|
175
|
+
with `loadText`).
|
|
176
|
+
- Converting floating-point numbers to Decimal type.
|
|
177
|
+
- Converting Decimal values to Integral type.
|
|
178
|
+
- Converting high-precision Decimal values to low-precision Decimal values.
|
|
179
|
+
|
|
180
|
+
Note
|
|
181
|
+
----
|
|
182
|
+
The rounding mode for the first case is rounding. For other scenarios,
|
|
183
|
+
truncation was used.
|
|
184
|
+
"""
|
|
185
|
+
|
|
186
|
+
enableChunkGranularityConfig: bool = StaticConfigDescriptor(bool, True)
|
|
187
|
+
"""
|
|
188
|
+
:meta hide-value:
|
|
189
|
+
|
|
190
|
+
Specifies the chunk granularity to determine the level of the lock of a
|
|
191
|
+
transaction. When writing to a chunk, the transaction locks it to prevent other
|
|
192
|
+
transactions from writing to it.
|
|
193
|
+
|
|
194
|
+
The default value is `True`. You can specify the chunk granularity with the
|
|
195
|
+
parameter `chunkGranularity` of function `database`.
|
|
196
|
+
|
|
197
|
+
If set to `False`, the chunk granularity is at the table level, i.e., each
|
|
198
|
+
tablet of a partition is a chunk. Concurrent writes to different tables in the
|
|
199
|
+
same partition are thus allowed.
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
enableConcurrentDimensionalTableWrite: bool = StaticConfigDescriptor(bool, False)
|
|
203
|
+
"""
|
|
204
|
+
:meta hide-value:
|
|
205
|
+
|
|
206
|
+
Whether to allow conducting concurrent write or update/delete on dimension
|
|
207
|
+
tables.
|
|
208
|
+
|
|
209
|
+
The default value is `False`, indicating concurrent write and update/delete is
|
|
210
|
+
disabled for dimension tables.
|
|
211
|
+
"""
|
|
212
|
+
|
|
213
|
+
enableDFS: bool = StaticConfigDescriptor(bool, False if sw_is_ce_edition() else True)
|
|
214
|
+
"""
|
|
215
|
+
:meta hide-value:
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
enableInsertStatementForDFSTable: bool = StaticConfigDescriptor(bool, True)
|
|
219
|
+
"""
|
|
220
|
+
:meta hide-value:
|
|
221
|
+
|
|
222
|
+
Whether to enable the insert into statement for DFS tables. The default value is
|
|
223
|
+
`True`.
|
|
224
|
+
"""
|
|
225
|
+
|
|
226
|
+
enableLocalDatabase: bool = StaticConfigDescriptor(bool, False)
|
|
227
|
+
"""
|
|
228
|
+
:meta hide-value:
|
|
229
|
+
|
|
230
|
+
Whether to enable the creation of a local database. The default value is `False`.
|
|
231
|
+
"""
|
|
232
|
+
|
|
233
|
+
home: Path = StaticConfigDescriptor(Path, None)
|
|
234
|
+
"""
|
|
235
|
+
:meta hide-value:
|
|
236
|
+
|
|
237
|
+
The DolphinDB home directory (`<HomeDir>`). It can only be specified in command
|
|
238
|
+
line.
|
|
239
|
+
"""
|
|
240
|
+
|
|
241
|
+
ignoreSpecialCharacterInPartitionId: bool = StaticConfigDescriptor(bool, False)
|
|
242
|
+
"""
|
|
243
|
+
:meta hide-value:
|
|
244
|
+
|
|
245
|
+
Whether to ignore ``":"`` and ``"."`` in partitioning columns when creating
|
|
246
|
+
partition directories for value-partitioned tables with partitioning columns of
|
|
247
|
+
STRING or SYMBOL type.
|
|
248
|
+
|
|
249
|
+
The default value is `False`. The "." and ":" will be included as part of the
|
|
250
|
+
path, which means data written to the ".a:bc." and "abc" partitions will be
|
|
251
|
+
separated into different paths.
|
|
252
|
+
|
|
253
|
+
If set to `True`, keys like ``".a:bc."`` and "abc" of the partitioning column
|
|
254
|
+
will map to the same directory path since ":" and "." are ignored. So data
|
|
255
|
+
written to partitions ".a:bc." and "abc" will both end up being stored under
|
|
256
|
+
"abc".
|
|
257
|
+
"""
|
|
258
|
+
|
|
259
|
+
init: Path = StaticConfigDescriptor(Path, None)
|
|
260
|
+
"""
|
|
261
|
+
:meta hide-value:
|
|
262
|
+
|
|
263
|
+
This file is executed when the system starts. The default file is `{package
|
|
264
|
+
install dir}/asset/dolphindb.dos`.
|
|
265
|
+
|
|
266
|
+
It usually contains definitions of system-level functions that are visible to
|
|
267
|
+
all users and cannot be overwritten.
|
|
268
|
+
"""
|
|
269
|
+
|
|
270
|
+
license: Path = StaticConfigDescriptor(Path, None)
|
|
271
|
+
"""
|
|
272
|
+
:meta hide-value:
|
|
273
|
+
"""
|
|
274
|
+
|
|
275
|
+
localSite: str = StaticConfigDescriptor(str, None)
|
|
276
|
+
"""
|
|
277
|
+
:meta hide-value:
|
|
278
|
+
|
|
279
|
+
The LAN information of the node, including host address, port number and alias
|
|
280
|
+
of the node, separated by ``":"``.
|
|
281
|
+
"""
|
|
282
|
+
|
|
283
|
+
logFile: Path = StaticConfigDescriptor(Path, None)
|
|
284
|
+
"""
|
|
285
|
+
:meta hide-value:
|
|
286
|
+
|
|
287
|
+
The path and name of the log file. It displays the Swordfish configuration
|
|
288
|
+
specifications, warnings, and error messages.
|
|
289
|
+
"""
|
|
290
|
+
|
|
291
|
+
logicOrIgnoreNull: bool = StaticConfigDescriptor(bool, False)
|
|
292
|
+
"""
|
|
293
|
+
:meta hide-value:
|
|
294
|
+
|
|
295
|
+
Whether function `or` ignores null values.
|
|
296
|
+
|
|
297
|
+
When set to False (default), it always returns NULL regardless of the value of
|
|
298
|
+
the other operand, which matches the behavior in prior versions.
|
|
299
|
+
|
|
300
|
+
When set to True:
|
|
301
|
+
|
|
302
|
+
- If the other operand is non-zero, it returns True.
|
|
303
|
+
- If the other operand is zero, it returns False.
|
|
304
|
+
- If the other operand is a null value, it returns NULL.
|
|
305
|
+
"""
|
|
306
|
+
|
|
307
|
+
logLevel: str = DynamicConfigDescriptor(str, "ERROR")
|
|
308
|
+
"""
|
|
309
|
+
:meta hide-value:
|
|
310
|
+
|
|
311
|
+
The level equal to and above which logs are printed to help users locate the
|
|
312
|
+
error message in the log. From the lowest to the highest level, the possible
|
|
313
|
+
values are `DEBUG`, `INFO`, `WARNING`, and `ERROR`. The default value is
|
|
314
|
+
`ERROR`.
|
|
315
|
+
"""
|
|
316
|
+
|
|
317
|
+
logRetentionTime: float = StaticConfigDescriptor(float, None)
|
|
318
|
+
"""
|
|
319
|
+
:meta hide-value:
|
|
320
|
+
|
|
321
|
+
To prevent excessive resource usage from old logs, the `logRetentionTime`
|
|
322
|
+
parameter can be used to specify the amount of time (in days) to keep a log file
|
|
323
|
+
before deleting it.
|
|
324
|
+
|
|
325
|
+
The default value is 30 (of floating-point data type). For example, 0.5 means
|
|
326
|
+
12 hours. If set to 0, log files are not deleted.
|
|
327
|
+
"""
|
|
328
|
+
|
|
329
|
+
marketHolidayDir: Path = StaticConfigDescriptor(Path, None)
|
|
330
|
+
"""
|
|
331
|
+
:meta hide-value:
|
|
332
|
+
|
|
333
|
+
The directory to the file of market holidays. Either an absolute or relative
|
|
334
|
+
directory can be specified.
|
|
335
|
+
|
|
336
|
+
The system searches the relative directory in the following order: home
|
|
337
|
+
directory of the node, the working directory of the node, and the directory with
|
|
338
|
+
the DolphinDB executable.
|
|
339
|
+
|
|
340
|
+
The default directory is `{package install dir}/asset/marketHoliday`. The file
|
|
341
|
+
must be a single-column CSV file with `Date` data. Based on the CSV files under
|
|
342
|
+
`marketHolidayDir`, a trading calendar is created with the file name as its
|
|
343
|
+
identifier.
|
|
344
|
+
|
|
345
|
+
Notes
|
|
346
|
+
-----
|
|
347
|
+
- Weekends are recognized as holidays by default; therefore, only weekday
|
|
348
|
+
holidays need to be filled in the file.
|
|
349
|
+
- It is recommended to name the file in Market Identifier Code, e.g.,
|
|
350
|
+
`"XNYS.csv"`.
|
|
351
|
+
"""
|
|
352
|
+
|
|
353
|
+
maxBlockSizeForReservedMemory: float = DynamicConfigDescriptor(float, None)
|
|
354
|
+
"""
|
|
355
|
+
:meta hide-value:
|
|
356
|
+
|
|
357
|
+
The maximum size (in units of KB) of the memory block that DolphinDB allocates
|
|
358
|
+
for each memory request when its available memory is less than `reservedMemSize`.
|
|
359
|
+
The default value is 64.
|
|
360
|
+
|
|
361
|
+
It is not recommended to set it too high as exceptions or crashes may occur if
|
|
362
|
+
there isn't enough memory left for critical database operations.
|
|
363
|
+
"""
|
|
364
|
+
|
|
365
|
+
maxConnections: int = DynamicConfigDescriptor(int, None)
|
|
366
|
+
"""
|
|
367
|
+
:meta hide-value:
|
|
368
|
+
|
|
369
|
+
The maximum number of connections to the local node.
|
|
370
|
+
"""
|
|
371
|
+
|
|
372
|
+
maxLogSize: int = StaticConfigDescriptor(int, None)
|
|
373
|
+
"""
|
|
374
|
+
:meta hide-value:
|
|
375
|
+
|
|
376
|
+
The system will archive the Swordfish log after it reaches the specified size
|
|
377
|
+
limit (in MB). The default value is 1024 and the minimum value is 100.
|
|
378
|
+
|
|
379
|
+
Upon reaching this limit, Swordfish automatically generates a new log with a
|
|
380
|
+
timestamp prefix in seconds. The prefix is in the format of `<date><seq>`, e.g.,
|
|
381
|
+
`20181109000`. `<seq>` has 3 digits and starts with `000`.
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
maxMemSize: float = DynamicConfigDescriptor(float, None)
|
|
385
|
+
"""
|
|
386
|
+
:meta hide-value:
|
|
387
|
+
|
|
388
|
+
The maximum memory (in units of GB) allocated to Swordfish. The default value is
|
|
389
|
+
0, meaning no limits on memory usage. The value of `maxMemSize` cannot exceed
|
|
390
|
+
the machine memory.
|
|
391
|
+
"""
|
|
392
|
+
|
|
393
|
+
maxPartitionNumPerQuery: int = DynamicConfigDescriptor(int, 65536)
|
|
394
|
+
"""
|
|
395
|
+
:meta hide-value:
|
|
396
|
+
|
|
397
|
+
The maximum number of partitions that a single query can search. The default
|
|
398
|
+
value is `65536`.
|
|
399
|
+
"""
|
|
400
|
+
|
|
401
|
+
maxPubConnections: int = StaticConfigDescriptor(int, 64)
|
|
402
|
+
"""
|
|
403
|
+
:meta hide-value:
|
|
404
|
+
|
|
405
|
+
The maximum number of subscriber nodes that the publisher node can connect to.
|
|
406
|
+
The default value is 64.
|
|
407
|
+
|
|
408
|
+
For the node to serve as a publisher, we must set `maxPubConnections > 0`.
|
|
409
|
+
"""
|
|
410
|
+
|
|
411
|
+
maxSubConnections: int = StaticConfigDescriptor(int, None)
|
|
412
|
+
"""
|
|
413
|
+
:meta hide-value:
|
|
414
|
+
|
|
415
|
+
The maximum number of publisher nodes that the subscriber node can connect to.
|
|
416
|
+
The default value is 64.
|
|
417
|
+
"""
|
|
418
|
+
|
|
419
|
+
maxSubQueueDepth: int = StaticConfigDescriptor(int, None)
|
|
420
|
+
"""
|
|
421
|
+
:meta hide-value:
|
|
422
|
+
|
|
423
|
+
The maximum depth (number of records) of a message queue on the subscriber node.
|
|
424
|
+
The default value is `10,000,000`.
|
|
425
|
+
"""
|
|
426
|
+
|
|
427
|
+
memLimitOfAllTempResults: float = DynamicConfigDescriptor(float, None)
|
|
428
|
+
"""
|
|
429
|
+
:meta hide-value:
|
|
430
|
+
|
|
431
|
+
The total memory limit (in GB) for all temporary results generated during SQL
|
|
432
|
+
distributed queries. The default value is `20% * maxMemSize`.
|
|
433
|
+
|
|
434
|
+
If the memory usage exceeds the limit, temporary results are spilled to disk.
|
|
435
|
+
"""
|
|
436
|
+
|
|
437
|
+
memLimitOfQueryResult: float = DynamicConfigDescriptor(float, None)
|
|
438
|
+
"""
|
|
439
|
+
:meta hide-value:
|
|
440
|
+
|
|
441
|
+
The memory limit for a query result. The default value is `min(50% * maxMemSize,
|
|
442
|
+
8G)`, and it must be smaller than `80% * maxMemSize`.
|
|
443
|
+
"""
|
|
444
|
+
|
|
445
|
+
memLimitOfTaskGroupResult: float = DynamicConfigDescriptor(float, None)
|
|
446
|
+
"""
|
|
447
|
+
:meta hide-value:
|
|
448
|
+
|
|
449
|
+
In the Map phase of MapReduce, a single query is divided into several tasks,
|
|
450
|
+
among which the remote tasks are sent to remote nodes in batches (task groups).
|
|
451
|
+
`memLimitOfTaskGroupResult` is used to set the memory limit of a task group sent
|
|
452
|
+
from the current node.
|
|
453
|
+
|
|
454
|
+
The default value is min(20% * `maxMemSize`, 2G), and it must be smaller than
|
|
455
|
+
50% * `maxMemSize`.
|
|
456
|
+
"""
|
|
457
|
+
|
|
458
|
+
moduleDir: Path = StaticConfigDescriptor(Path, None)
|
|
459
|
+
"""
|
|
460
|
+
:meta hide-value:
|
|
461
|
+
|
|
462
|
+
The directory for the module files. It can be an absolute path or a relative
|
|
463
|
+
directory, with `modules` as the default.
|
|
464
|
+
|
|
465
|
+
The system searches the relative directory `modules` in the following order:
|
|
466
|
+
home directory, the working directory, and the directory with the swordfish
|
|
467
|
+
package.
|
|
468
|
+
"""
|
|
469
|
+
|
|
470
|
+
newValuePartitionPolicy: str = StaticConfigDescriptor(str, "add")
|
|
471
|
+
"""
|
|
472
|
+
:meta hide-value:
|
|
473
|
+
|
|
474
|
+
How new data outside of existing VALUE partitions are handled in databases. It
|
|
475
|
+
can be "add", "skip", or "fail".
|
|
476
|
+
|
|
477
|
+
- `"add"` (default): Creates new VALUE partitions to add all data.
|
|
478
|
+
- `"skip"`: Appends data that belongs to existing VALUE partitions and ignores
|
|
479
|
+
out-of-scope data.
|
|
480
|
+
- `"fail"`: Throws exception if out-of-scope data is included. None of the data
|
|
481
|
+
will be written. In most cases, `"add"` is recommended.
|
|
482
|
+
"""
|
|
483
|
+
|
|
484
|
+
nullAsMinValueForComparison: bool = StaticConfigDescriptor(bool, None)
|
|
485
|
+
"""
|
|
486
|
+
:meta hide-value:
|
|
487
|
+
|
|
488
|
+
Whether a null value is treated as the minimum value in data comparison. The
|
|
489
|
+
default value is True.
|
|
490
|
+
|
|
491
|
+
If it is set to False, the result of comparison involving null values is NULL.
|
|
492
|
+
"""
|
|
493
|
+
|
|
494
|
+
OLAPCacheEngineSize: float = DynamicConfigDescriptor(float, 0.5)
|
|
495
|
+
"""
|
|
496
|
+
:meta hide-value:
|
|
497
|
+
|
|
498
|
+
The capacity of cache engine in units of GB. After cache engine is enabled, data
|
|
499
|
+
is not written to disk until data in cache exceeds 30% of
|
|
500
|
+
`OLAPCacheEngineSize`.
|
|
501
|
+
|
|
502
|
+
The default value is 0.5. To enable the cache engine, we must set
|
|
503
|
+
`OLAPCacheEngineSize` > 0 and `dataSync` = 1.
|
|
504
|
+
"""
|
|
505
|
+
|
|
506
|
+
parseDecimalAsFloatingNumber: bool = StaticConfigDescriptor(bool, None)
|
|
507
|
+
"""
|
|
508
|
+
:meta hide-value:
|
|
509
|
+
|
|
510
|
+
Whether decimal numbers are parsed to Double or Decimal64 type.
|
|
511
|
+
|
|
512
|
+
- If set to `True` (default), decimals are parsed to Double floating point
|
|
513
|
+
numbers.
|
|
514
|
+
- If set to `False`, decimals are parsed to Decimal64 fixed point numbers.
|
|
515
|
+
"""
|
|
516
|
+
|
|
517
|
+
persistenceDir: Path = StaticConfigDescriptor(Path, None)
|
|
518
|
+
"""
|
|
519
|
+
:meta hide-value:
|
|
520
|
+
|
|
521
|
+
The directory where shared stream tables are persisted to. To enable
|
|
522
|
+
persistence, `persistenceDir` must be specified.
|
|
523
|
+
"""
|
|
524
|
+
|
|
525
|
+
# recoveryWorkers: int = DynamicConfigDescriptor(int, None)
|
|
526
|
+
# """
|
|
527
|
+
# :meta hide-value:
|
|
528
|
+
# The number of workers that can be used to recover chunks synchronously in node
|
|
529
|
+
# recovery. The default value is 1.
|
|
530
|
+
|
|
531
|
+
# Notes
|
|
532
|
+
# -----
|
|
533
|
+
# If the number of existing threads is fewer than that of the newly configured
|
|
534
|
+
# threads, the system will create the missing threads. If it is larger, the
|
|
535
|
+
# system will block and reclaim the excess threads.
|
|
536
|
+
# There is no hard upper limit on `recoveryWorkers`, but it is subject to the
|
|
537
|
+
# constraints of the operating system.
|
|
538
|
+
# """
|
|
539
|
+
|
|
540
|
+
regularArrayMemoryLimit: float = StaticConfigDescriptor(float, None)
|
|
541
|
+
"""
|
|
542
|
+
:meta hide-value:
|
|
543
|
+
|
|
544
|
+
The limit on the maximum memory size (in MB) of a regular array. Its value must
|
|
545
|
+
be a power of 2. The default value is 2048 (MB).
|
|
546
|
+
|
|
547
|
+
The actual available memory is `min(regularArrayMemoryLimit, maxMemSize/2)`. If
|
|
548
|
+
the memory occupied by an array exceeds this limit, the system will create a big
|
|
549
|
+
array instead.
|
|
550
|
+
"""
|
|
551
|
+
|
|
552
|
+
removeSpecialCharInColumnName: bool = StaticConfigDescriptor(bool, False)
|
|
553
|
+
"""
|
|
554
|
+
:meta hide-value:
|
|
555
|
+
|
|
556
|
+
Whether to normalize column names.
|
|
557
|
+
|
|
558
|
+
- If set to `False` (default), column names can contain special characters
|
|
559
|
+
(except underscores) or start without letters.
|
|
560
|
+
- If set to `True`, column names are normalized.
|
|
561
|
+
"""
|
|
562
|
+
|
|
563
|
+
reservedMemSize: float = DynamicConfigDescriptor(float, None)
|
|
564
|
+
"""
|
|
565
|
+
:meta hide-value:
|
|
566
|
+
|
|
567
|
+
A positive number specified in units of GB. When the available memory in
|
|
568
|
+
Swordfish is less than `reservedMemSize`, Swordfish only allocates a memory
|
|
569
|
+
block of limited size (as specified by `maxBlockSizeForReservedMemory`) for each
|
|
570
|
+
memory request.
|
|
571
|
+
|
|
572
|
+
`reservedMemSize` is provided to restrict the memory allocation for each memory
|
|
573
|
+
request to improve the likelihood that there is enough memory for critical
|
|
574
|
+
operations that use a small amount of memory (error reporting, rollbacks, etc.).
|
|
575
|
+
|
|
576
|
+
For example, when data writes fail due to insufficient memory, the transactions
|
|
577
|
+
can be rolled back to guarantee data consistency. If the parameter is not
|
|
578
|
+
specified, the system sets `reservedMemSize` = 5% * `maxMemSize` and
|
|
579
|
+
`reservedMemSize` must be between 64MB and 1GB.
|
|
580
|
+
"""
|
|
581
|
+
|
|
582
|
+
stdoutLog: int = StaticConfigDescriptor(int, 1)
|
|
583
|
+
"""
|
|
584
|
+
:meta hide-value:
|
|
585
|
+
|
|
586
|
+
Where to output the system log. It can be:
|
|
587
|
+
|
|
588
|
+
- 0: dolphindb.log;
|
|
589
|
+
- 1 (default): stdout;
|
|
590
|
+
- 2: both stdout and dolphindb.log.
|
|
591
|
+
"""
|
|
592
|
+
|
|
593
|
+
# strictPermissionMode: bool = StaticConfigDescriptor(bool, True)
|
|
594
|
+
# """
|
|
595
|
+
# :meta hide-value:
|
|
596
|
+
# Whether to enable strict permission mode. The default value is True. Operations
|
|
597
|
+
# such as disk read/write are only allowed for administrators.
|
|
598
|
+
|
|
599
|
+
# Related functions include: `saveTextFile`, `saveAsNpy`, `backup`, `restore`,
|
|
600
|
+
# `restoreDB`, `restoreTable`, `backupDB`, `backupTable`, `migrate`, `file`,
|
|
601
|
+
# `files`, `writeObject`, `readObject`, `loadPlugin`, `close`, `fflush`,
|
|
602
|
+
# `mkdir`, `rmdir`, `rm`, `writeLog`, `run`, `runScript`, `test`, `saveTable`,
|
|
603
|
+
# `savePartition`, `saveDualPartition`, `saveDatabase`, `saveText`,
|
|
604
|
+
# `loadText`, `loadModule`, `saveModule`.
|
|
605
|
+
# """
|
|
606
|
+
|
|
607
|
+
subExecutors: int = StaticConfigDescriptor(int, 8)
|
|
608
|
+
"""
|
|
609
|
+
:meta hide-value:
|
|
610
|
+
|
|
611
|
+
The number of message processing threads in the subscriber node. Only when
|
|
612
|
+
subscription is enabled is this parameter relevant.
|
|
613
|
+
|
|
614
|
+
The default value is 8. If it is set to 0, it means the thread can conduct
|
|
615
|
+
message parsing and can also process messages.
|
|
616
|
+
"""
|
|
617
|
+
|
|
618
|
+
subThrottle: int = StaticConfigDescriptor(int, 1000)
|
|
619
|
+
"""
|
|
620
|
+
:meta hide-value:
|
|
621
|
+
|
|
622
|
+
A non-negative integer in milliseconds, indicating the interval at which the
|
|
623
|
+
system checks whether the `throttle` parameter in the `subscribe` function has
|
|
624
|
+
been reached.The default value is 1000.
|
|
625
|
+
|
|
626
|
+
If the interval specified by the `throttle` parameter in `subscribe` is less
|
|
627
|
+
than `subThrottle`, the `handler` parameter in `subscribe` will be triggered to
|
|
628
|
+
process messages at an interval of `subThrottle`.
|
|
629
|
+
|
|
630
|
+
To set `throttle` to less than 1 second, you need to modify the configuration
|
|
631
|
+
parameter `subThrottle` first. For example, to set `throttle = 0.001` (second),
|
|
632
|
+
please set `subThrottle = 1` first.
|
|
633
|
+
|
|
634
|
+
Notes
|
|
635
|
+
-----
|
|
636
|
+
This parameter is only valid if the parameter `batch_size` is specified in
|
|
637
|
+
function `subscribe`.
|
|
638
|
+
"""
|
|
639
|
+
|
|
640
|
+
tcpNoDelay: bool = StaticConfigDescriptor(bool, None)
|
|
641
|
+
"""
|
|
642
|
+
:meta hide-value:
|
|
643
|
+
|
|
644
|
+
Whether to enable the `TCP_NODELAY` socket option. The default value is False.
|
|
645
|
+
"""
|
|
646
|
+
|
|
647
|
+
tcpUserTimeout: int = StaticConfigDescriptor(int, None)
|
|
648
|
+
"""
|
|
649
|
+
:meta hide-value:
|
|
650
|
+
|
|
651
|
+
Set the socket option `TCP_USER_TIMEOUT`. The default value is 300000 (in ms).
|
|
652
|
+
"""
|
|
653
|
+
|
|
654
|
+
tempResultsSpillDir: Path = StaticConfigDescriptor(Path, None)
|
|
655
|
+
"""
|
|
656
|
+
:meta hide-value:
|
|
657
|
+
|
|
658
|
+
The directory for storing temporary results generated during distributed queries
|
|
659
|
+
when they exceed memory limits. The default directory is `<HomeDir>/tempResults`.
|
|
660
|
+
|
|
661
|
+
Temporary results exceeding the memory limit (specified by
|
|
662
|
+
`memLimitOfAllTempResults`) are spilled to the directory. Files are
|
|
663
|
+
automatically deleted after query completion.
|
|
664
|
+
|
|
665
|
+
Notes
|
|
666
|
+
-----
|
|
667
|
+
This directory is recreated after Swordfish initialization, deleting any
|
|
668
|
+
existing contents.
|
|
669
|
+
"""
|
|
670
|
+
|
|
671
|
+
TSDBCacheEngineSize: float = DynamicConfigDescriptor(float, 1)
|
|
672
|
+
"""
|
|
673
|
+
:meta hide-value:
|
|
674
|
+
|
|
675
|
+
A positive number indicating the capacity (in GB) of the TSDB cache engine. The
|
|
676
|
+
default value is 1.
|
|
677
|
+
|
|
678
|
+
The memory used by the cache engine may reach twice the set value as an extra
|
|
679
|
+
memoryblock will be allocated to cache the incoming data while data in the
|
|
680
|
+
original memory is being flushed to disk.
|
|
681
|
+
|
|
682
|
+
- If the flush process is not fast enough, the newly allocated memory may also
|
|
683
|
+
reach `TSDBCacheEngineSize` and thus block the writer thread.
|
|
684
|
+
- If the parameter is set too small, data in the cache engine may be flushed to
|
|
685
|
+
disk too frequently, thus affecting the write performance;
|
|
686
|
+
- If set too high, a large volume of cached data is not flushed to disk until it
|
|
687
|
+
reaches `TSDBCacheEngineSize` (or after 10 minutes).
|
|
688
|
+
- If power failure or shutdown occurs in such cases, numerous redo logs are to
|
|
689
|
+
be replayed when the system is restarting, causing a slow startup.
|
|
690
|
+
"""
|
|
691
|
+
|
|
692
|
+
tzdb: Path = StaticConfigDescriptor(Path, None)
|
|
693
|
+
"""
|
|
694
|
+
:meta hide-value:
|
|
695
|
+
|
|
696
|
+
The directory of the time zone database. The default value is `{package install
|
|
697
|
+
dir}/asset/tzdb`.
|
|
698
|
+
"""
|
|
699
|
+
|
|
700
|
+
warningMemSize: float = StaticConfigDescriptor(float, 20)
|
|
701
|
+
"""
|
|
702
|
+
:meta hide-value:
|
|
703
|
+
|
|
704
|
+
When memory usage exceeds `warningMemSize` (in units of GB), the system will
|
|
705
|
+
automatically clean up the cache of some databases to avoid OOM exceptions. The
|
|
706
|
+
default value is 20.
|
|
707
|
+
"""
|
|
708
|
+
|
|
709
|
+
workerNum: int = StaticConfigDescriptor(int, None)
|
|
710
|
+
"""
|
|
711
|
+
:meta hide-value:
|
|
712
|
+
|
|
713
|
+
The size of worker pool for regular interactive jobs. The default value is the
|
|
714
|
+
number of CPU cores.
|
|
715
|
+
"""
|
|
716
|
+
|
|
717
|
+
def __setitem__(self, key, value):
|
|
718
|
+
self.config_dict[key].__set__(self, value)
|
|
719
|
+
|
|
720
|
+
def __getitem__(self, key):
|
|
721
|
+
return self.config_dict[key].__get__(self, type(self))
|
|
722
|
+
|
|
723
|
+
def __str__(self):
|
|
724
|
+
max_len = (max([len(k) for k in self.config_dict]) // 5 + 1) * 5
|
|
725
|
+
str_list = [
|
|
726
|
+
f"{k.ljust(max_len)}: {str(v.__get__(self, type(self)))}" for k, v in self.config_dict.items()
|
|
727
|
+
]
|
|
728
|
+
return "\n".join(str_list)
|
|
729
|
+
|
|
730
|
+
def build(self):
|
|
731
|
+
"""Builds a list of command-line arguments based on the configuration.
|
|
732
|
+
|
|
733
|
+
Returns
|
|
734
|
+
-------
|
|
735
|
+
list
|
|
736
|
+
A list of command-line arguments.
|
|
737
|
+
"""
|
|
738
|
+
|
|
739
|
+
# step 1: config path [ENV_NAME_CONFIG, ENV_NAME_HOME, CWD]
|
|
740
|
+
config_search_path: List[Path] = []
|
|
741
|
+
if _getenv(ENV_NAME_CONFIG):
|
|
742
|
+
config_search_path.append(_get_absolute_path_env(ENV_NAME_CONFIG))
|
|
743
|
+
if _getenv(ENV_NAME_HOME):
|
|
744
|
+
config_search_path.append(_get_absolute_path_env(ENV_NAME_HOME))
|
|
745
|
+
config_search_path.append(Path(f"{os.getcwd()}"))
|
|
746
|
+
|
|
747
|
+
extra_config = None
|
|
748
|
+
|
|
749
|
+
for path in config_search_path:
|
|
750
|
+
file_path = path / "swordfish.toml" if path.is_dir() else path
|
|
751
|
+
if file_path.exists():
|
|
752
|
+
extra_config = self.read_config_from_toml(file_path)
|
|
753
|
+
break
|
|
754
|
+
|
|
755
|
+
# step 2: home path [ENV_NAME_HOME, config["home"], CWD]
|
|
756
|
+
home_search_path: List[Path] = []
|
|
757
|
+
if _getenv(ENV_NAME_HOME):
|
|
758
|
+
home_search_path.append(_get_absolute_path_env(ENV_NAME_HOME))
|
|
759
|
+
if not self.config_dict["home"].is_default():
|
|
760
|
+
home_search_path.append(self.home)
|
|
761
|
+
home_search_path.append(Path(f"{os.getcwd()}"))
|
|
762
|
+
|
|
763
|
+
assert len(home_search_path) > 0
|
|
764
|
+
self.home = home_search_path[0]
|
|
765
|
+
|
|
766
|
+
# step 3: license path [ENV_NAME_LICENSE, config["license"], home]
|
|
767
|
+
license_search_path: List[Path] = []
|
|
768
|
+
if _getenv(ENV_NAME_LICENSE):
|
|
769
|
+
license_search_path.append(_get_absolute_path_env(ENV_NAME_LICENSE))
|
|
770
|
+
if not self.config_dict["license"].is_default():
|
|
771
|
+
license_search_path.append(self.license)
|
|
772
|
+
license_search_path.append(self.home)
|
|
773
|
+
|
|
774
|
+
for path in license_search_path:
|
|
775
|
+
file_path = path / "dolphindb.lic" if path.is_dir() else path
|
|
776
|
+
if file_path.exists():
|
|
777
|
+
self.license = file_path
|
|
778
|
+
break
|
|
779
|
+
|
|
780
|
+
# step 4: localSite [ENV_NAME_HOST/PORT/ALIAS, config]
|
|
781
|
+
host = _getenv(ENV_NAME_HOST)
|
|
782
|
+
host = extra_config["host"] if host is None and extra_config else host
|
|
783
|
+
host = "0.0.0.0" if host is None else host
|
|
784
|
+
|
|
785
|
+
port = _getenv(ENV_NAME_PORT)
|
|
786
|
+
port = extra_config["port"] if port is None and extra_config else port
|
|
787
|
+
port = get_random_available_port() if port is None else port
|
|
788
|
+
|
|
789
|
+
alias = _getenv(ENV_NAME_ALIAS)
|
|
790
|
+
alias = extra_config["alias"] if alias is None and extra_config else alias
|
|
791
|
+
alias = "default" if alias is None else alias
|
|
792
|
+
|
|
793
|
+
if not sw_is_ce_edition():
|
|
794
|
+
config.localSite = f"{host}:{port}:{alias}"
|
|
795
|
+
|
|
796
|
+
# step 5: extra configs
|
|
797
|
+
args = []
|
|
798
|
+
if _getenv(ENV_NAME_EXTRA):
|
|
799
|
+
args = [v.strip() for v in _getenv(ENV_NAME_EXTRA).split(" ")]
|
|
800
|
+
|
|
801
|
+
if self.config_dict["init"].is_default():
|
|
802
|
+
self.config_dict["init"].init(Path, Path(__file__).parent / "asset" / "dolphindb.dos")
|
|
803
|
+
if self.config_dict["logFile"].is_default():
|
|
804
|
+
self.config_dict["logFile"].init(Path, "dolphindb.log")
|
|
805
|
+
if self.config_dict["marketHolidayDir"].is_default():
|
|
806
|
+
self.config_dict["marketHolidayDir"].init(Path, Path(__file__).parent / "asset" / "marketHoliday")
|
|
807
|
+
if self.config_dict["moduleDir"].is_default():
|
|
808
|
+
self.config_dict["moduleDir"].init(Path, Path(__file__).parent / "asset" / "modules")
|
|
809
|
+
if self.config_dict["tempResultsSpillDir"].is_default():
|
|
810
|
+
self.config_dict["tempResultsSpillDir"].init(Path, "tempResults")
|
|
811
|
+
if self.config_dict["persistenceDir"].is_default():
|
|
812
|
+
self.config_dict["persistenceDir"].init(Path, "persistenceDir")
|
|
813
|
+
if self.config_dict["tzdb"].is_default() and sys.platform.startswith("win"):
|
|
814
|
+
self.config_dict["tzdb"].init(Path, Path(__file__).parent / "asset" / "tzdb")
|
|
815
|
+
|
|
816
|
+
res_list = []
|
|
817
|
+
for name, item in self.config_dict.items():
|
|
818
|
+
value = item.get_value_str()
|
|
819
|
+
if value is not None:
|
|
820
|
+
res_list += [f"-{name}", value]
|
|
821
|
+
return args + res_list
|
|
822
|
+
|
|
823
|
+
def read_config_from_toml(self, file_path: Path):
|
|
824
|
+
def _set_config(_configs: dict, config_name: str, k1: str, k2: str):
|
|
825
|
+
val = _configs.get(k1, dict()).get(k2, None)
|
|
826
|
+
if val is not None:
|
|
827
|
+
setattr(self, config_name, val)
|
|
828
|
+
|
|
829
|
+
configs = toml.load(file_path)
|
|
830
|
+
|
|
831
|
+
_set_config(configs, "home", "initial", "home")
|
|
832
|
+
host = configs.get("initial", dict()).get("host", None)
|
|
833
|
+
port = configs.get("initial", dict()).get("port", None)
|
|
834
|
+
alias = configs.get("initial", dict()).get("alias", None)
|
|
835
|
+
|
|
836
|
+
classify = "initial"
|
|
837
|
+
_set_config(configs, "init", classify, "init")
|
|
838
|
+
_set_config(configs, "license", classify, "license")
|
|
839
|
+
_set_config(configs, "marketHolidayDir", classify, "marketHolidayDir")
|
|
840
|
+
_set_config(configs, "moduleDir", classify, "moduleDir")
|
|
841
|
+
_set_config(configs, "tzdb", classify, "tzdb")
|
|
842
|
+
|
|
843
|
+
classify = "logging"
|
|
844
|
+
_set_config(configs, "stdoutLog", classify, "stdoutLog")
|
|
845
|
+
_set_config(configs, "logFile", classify, "logFile")
|
|
846
|
+
_set_config(configs, "logLevel", classify, "logLevel")
|
|
847
|
+
_set_config(configs, "logRetentionTime", classify, "logRetentionTime")
|
|
848
|
+
_set_config(configs, "maxLogSize", classify, "maxLogSize")
|
|
849
|
+
|
|
850
|
+
classify = "network"
|
|
851
|
+
_set_config(configs, "maxConnections", classify, "maxConnections")
|
|
852
|
+
_set_config(configs, "tcpNoDelay", classify, "tcpNoDelay")
|
|
853
|
+
_set_config(configs, "tcpUserTimeout", classify, "tcpUserTimeout")
|
|
854
|
+
|
|
855
|
+
classify = "behavior"
|
|
856
|
+
_set_config(configs, "decimalRoundingMode", classify, "decimalRoundingMode")
|
|
857
|
+
_set_config(configs, "ignoreSpecialCharacterInPartitionId", classify, "ignoreSpecialCharacterInPartitionId")
|
|
858
|
+
_set_config(configs, "logicOrIgnoreNull", classify, "logicOrIgnoreNull")
|
|
859
|
+
_set_config(configs, "nullAsMinValueForComparison", classify, "nullAsMinValueForComparison")
|
|
860
|
+
_set_config(configs, "parseDecimalAsFloatingNumber", classify, "parseDecimalAsFloatingNumber")
|
|
861
|
+
_set_config(configs, "removeSpecialCharInColumnName", classify, "removeSpecialCharInColumnName")
|
|
862
|
+
|
|
863
|
+
classify = "caching"
|
|
864
|
+
_set_config(configs, "OLAPCacheEngineSize", classify, "OLAPCacheEngineSize")
|
|
865
|
+
_set_config(configs, "TSDBCacheEngineSize", classify, "TSDBCacheEngineSize")
|
|
866
|
+
|
|
867
|
+
classify = "concurrency"
|
|
868
|
+
_set_config(configs, "workerNum", classify, "workerNum")
|
|
869
|
+
|
|
870
|
+
classify = "resource"
|
|
871
|
+
_set_config(configs, "dataSync", classify, "dataSync")
|
|
872
|
+
_set_config(configs, "maxBlockSizeForReservedMemory", classify, "maxBlockSizeForReservedMemory")
|
|
873
|
+
_set_config(configs, "maxMemSize", classify, "maxMemSize")
|
|
874
|
+
_set_config(configs, "regularArrayMemoryLimit", classify, "regularArrayMemoryLimit")
|
|
875
|
+
_set_config(configs, "reservedMemSize", classify, "reservedMemSize")
|
|
876
|
+
_set_config(configs, "warningMemSize", classify, "warningMemSize")
|
|
877
|
+
_set_config(configs, "maxPartitionNumPerQuery", classify, "maxPartitionNumPerQuery")
|
|
878
|
+
_set_config(configs, "memLimitOfAllTempResults", classify, "memLimitOfAllTempResults")
|
|
879
|
+
_set_config(configs, "memLimitOfQueryResult", classify, "memLimitOfQueryResult")
|
|
880
|
+
_set_config(configs, "memLimitOfTaskGroupResult", classify, "memLimitOfTaskGroupResult")
|
|
881
|
+
_set_config(configs, "tempResultsSpillDir", classify, "tempResultsSpillDir")
|
|
882
|
+
|
|
883
|
+
classify = "storage"
|
|
884
|
+
_set_config(configs, "newValuePartitionPolicy", classify, "newValuePartitionPolicy")
|
|
885
|
+
|
|
886
|
+
classify = "streaming"
|
|
887
|
+
_set_config(configs, "maxPubConnections", classify, "maxPubConnections")
|
|
888
|
+
_set_config(configs, "maxSubConnections", classify, "maxSubConnections")
|
|
889
|
+
_set_config(configs, "maxSubQueueDepth", classify, "maxSubQueueDepth")
|
|
890
|
+
_set_config(configs, "persistenceDir", classify, "persistenceDir")
|
|
891
|
+
_set_config(configs, "subExecutors", classify, "subExecutors")
|
|
892
|
+
_set_config(configs, "subThrottle", classify, "subThrottle")
|
|
893
|
+
|
|
894
|
+
return {
|
|
895
|
+
"host": host,
|
|
896
|
+
"port": port,
|
|
897
|
+
"alias": alias,
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
config = Config()
|