2 using System.Collections.Generic;
3 using System.Text.RegularExpressions;
41 string multi_head_ingestion_param;
43 if (multi_head_ingestion_param == null)
48 if (!is_multi_head_ingest_enabled)
56 string worker_urls_str;
57 system_properties.TryGetValue(
"conf.worker_http_server_urls", out worker_urls_str);
58 if ( worker_urls_str.Length > 0 )
63 string[] worker_url_lists = worker_urls_str.Split(
';');
67 for (
int i = 1; i < worker_url_lists.Length; ++i)
69 string url_list = worker_url_lists[i];
72 string[] urls = url_list.Split(
',');
74 bool matching_url_found =
false;
77 foreach (
string url_str
in urls)
84 matching_url_found = ip_regex.IsMatch(url_str);
86 matching_url_found =
true;
88 if (matching_url_found)
90 Uri url =
new Uri( url_str );
103 if (!matching_url_found)
110 string worker_ips_str, worker_ports_str;
115 if (worker_ips_str.Length == 0)
117 if (worker_ports_str.Length == 0)
123 string[] worker_ip_lists = worker_ips_str.Split(
';');
124 string[] worker_ports = worker_ports_str.Split(
';');
127 if (worker_ip_lists.Length != worker_ports.Length)
134 for (
int i = 1; i < worker_ip_lists.Length; ++i)
136 string ip_list = worker_ip_lists[i];
139 string[] ips = ip_list.Split(
',');
141 bool matching_ip_found =
false;
144 foreach (
string ip
in ips)
150 if (ip_regex != null)
151 matching_ip_found = ip_regex.IsMatch(ip);
153 matching_ip_found =
true;
155 if (matching_ip_found)
157 UriBuilder uri_builder =
new UriBuilder( db.
URL.Scheme,
158 ip, Int32.Parse(worker_ports[i]) );
159 Uri url = uri_builder.Uri;
172 if (!matching_ip_found)
const string CONF_ENABLE_WORKER_HTTP_SERVERS
Boolean value indicating whether the system is configured for multi-head ingestion.
A list of worker URLs to use for multi-head ingest.
A set of results returned by Kinetica.showSystemProperties(IDictionary<string, string>).
A map of server configuration parameters and version information.
Uri URL
URL for Kinetica Server (including "http:" and port)
const string CONF_WORKER_HTTP_SERVER_IPS
Semicolon (';') separated string of IP addresses of all the ingestion-enabled worker heads of the sys...
ShowSystemPropertiesResponse showSystemProperties(ShowSystemPropertiesRequest request_)
Returns server configuration and version related information to the caller.
WorkerList()
Creates an empty WorkerList that can be populated manually with worker URLs to support multi-head ing...
const string CONF_WORKER_HTTP_SERVER_PORTS
Semicolon (';') separated string of the port numbers of all the ingestion-enabled worker ranks of the...
IDictionary< string, string > property_map
A map of server configuration parameters and version information.
const string TRUE
Indicates that the system is configured for multi-head ingestion.
WorkerList(Kinetica db, Regex ip_regex=null)
Creates a WorkerList object and automatically populates it with the worker URLs from GPUdb to support...
API to talk to Kinetica Database