|
50 | 50 |
|
51 | 51 | DECLARE_int32(request_timeout_ms); |
52 | 52 | DECLARE_string(bucket_size); |
53 | | -DEFINE_string(spark_conf, "", "The config file of Spark job"); |
54 | 53 | DECLARE_uint32(replica_num); |
55 | 54 |
|
56 | 55 | namespace openmldb { |
@@ -2442,7 +2441,7 @@ std::shared_ptr<hybridse::sdk::ResultSet> SQLClusterRouter::ExecuteSQL(const std |
2442 | 2441 | } else { |
2443 | 2442 | ::openmldb::taskmanager::JobInfo job_info; |
2444 | 2443 | std::map<std::string, std::string> config; |
2445 | | - ReadSparkConfFromFile(FLAGS_spark_conf, &config); |
| 2444 | + ReadSparkConfFromFile(options_.spark_conf_path, &config); |
2446 | 2445 | auto base_status = ExportOfflineData(sql, config, db, is_sync_job, offline_job_timeout, &job_info); |
2447 | 2446 | if (base_status.OK()) { |
2448 | 2447 | *status = {}; |
@@ -2473,7 +2472,7 @@ std::shared_ptr<hybridse::sdk::ResultSet> SQLClusterRouter::ExecuteSQL(const std |
2473 | 2472 | // Handle in cluster mode |
2474 | 2473 | ::openmldb::taskmanager::JobInfo job_info; |
2475 | 2474 | std::map<std::string, std::string> config; |
2476 | | - ReadSparkConfFromFile(FLAGS_spark_conf, &config); |
| 2475 | + ReadSparkConfFromFile(options_.spark_conf_path, &config); |
2477 | 2476 |
|
2478 | 2477 | ::openmldb::base::Status base_status; |
2479 | 2478 | if (is_online_mode) { |
@@ -2518,7 +2517,7 @@ std::shared_ptr<hybridse::sdk::ResultSet> SQLClusterRouter::ExecuteOfflineQuery( |
2518 | 2517 | bool is_sync_job, int job_timeout, |
2519 | 2518 | ::hybridse::sdk::Status* status) { |
2520 | 2519 | std::map<std::string, std::string> config; |
2521 | | - ReadSparkConfFromFile(FLAGS_spark_conf, &config); |
| 2520 | + ReadSparkConfFromFile(options_.spark_conf_path, &config); |
2522 | 2521 |
|
2523 | 2522 | if (is_sync_job) { |
2524 | 2523 | // Run offline sql and wait to get output |
@@ -3721,15 +3720,15 @@ std::shared_ptr<hybridse::sdk::ResultSet> SQLClusterRouter::ExecuteShowTableStat |
3721 | 3720 | return ResultSetSQL::MakeResultSet(GetTableStatusSchema(), data, status); |
3722 | 3721 | } |
3723 | 3722 |
|
3724 | | -void SQLClusterRouter::ReadSparkConfFromFile(std::string conf_file, std::map<std::string, std::string>* config) { |
3725 | | - if (!conf_file.empty()) { |
| 3723 | +void SQLClusterRouter::ReadSparkConfFromFile(std::string conf_file_path, std::map<std::string, std::string>* config) { |
| 3724 | + if (!conf_file_path.empty()) { |
3726 | 3725 | boost::property_tree::ptree pt; |
3727 | 3726 |
|
3728 | 3727 | try { |
3729 | | - boost::property_tree::ini_parser::read_ini(FLAGS_spark_conf, pt); |
3730 | | - LOG(INFO) << "Load Spark conf file: " << conf_file; |
| 3728 | + boost::property_tree::ini_parser::read_ini(conf_file_path, pt); |
| 3729 | + LOG(INFO) << "Load Spark conf file: " << conf_file_path; |
3731 | 3730 | } catch (...) { |
3732 | | - LOG(WARNING) << "Fail to load Spark conf file: " << conf_file; |
| 3731 | + LOG(WARNING) << "Fail to load Spark conf file: " << conf_file_path; |
3733 | 3732 | return; |
3734 | 3733 | } |
3735 | 3734 |
|
|
0 commit comments