OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.logrunner.LogRunner.myThread Class Reference
+ Inheritance diagram for com.mapd.logrunner.LogRunner.myThread:
+ Collaboration diagram for com.mapd.logrunner.LogRunner.myThread:

Public Member Functions

void run ()
 

Package Functions

 myThread (String str1, OmniSci.Client client1, String session1)
 

Private Attributes

String str
 
OmniSci.Client client
 
String session
 

Detailed Description

Definition at line 241 of file LogRunner.java.

Constructor & Destructor Documentation

com.mapd.logrunner.LogRunner.myThread.myThread ( String  str1,
OmniSci.Client  client1,
String  session1 
)
inlinepackage

Member Function Documentation

void com.mapd.logrunner.LogRunner.myThread.run ( )
inline

Definition at line 253 of file LogRunner.java.

References com.mapd.logrunner.LogRunner.cpuMode, com.mapd.logrunner.LogRunner.gpuMode, i, Integer, setup.name, and com.mapd.logrunner.LogRunner.myThread.session.

253  {
254  int logStart = str.indexOf(']');
255  if (logStart != -1) {
256  String det = str.substring(logStart + 1).trim();
257  String header = str.substring(0, logStart).trim();
258 
259  String[] headDet = header.split(" .");
260  // logger.info("header "+ header + " count " + headDet.length + " detail " + det
261  // );
262  if (headDet.length != 4 || headDet[0].equals("Log")) {
263  return;
264  }
265  Integer pid = Integer.valueOf(headDet[2]);
266 
267  if (det.contains("sql_execute :")) {
268  logger.info("det " + det);
269  String sl[] = det.split(":query_str:");
270  logger.info("run query " + sl[1]);
271  try {
272  client.sql_execute(session, sl[1], true, null, -1, -1);
273  } catch (TOmniSciException ex1) {
274  logger.error(
275  "Failed to execute " + sl[1] + " exception " + ex1.getError_msg());
276  } catch (TException ex) {
277  logger.error("Failed to execute " + sl[1] + " exception " + ex.toString());
278  }
279  return;
280  }
281 
282  // get_result_row_for_pixel
283  // :5pFFQUCKs17GLHOqI7ykK09U8mX7GnLF:widget_id:3:pixel.x:396:pixel.y:53:column_format:1
284  //:PixelRadius:2:table_col_names::points,dest,conv_4326_900913_x(dest_lon) as
285  // x,conv_4326_900913_y(dest_lat) as y,arrdelay as size
286  if (det.contains("get_result_row_for_pixel :")) {
287  logger.info("det " + det);
288  String ss[] = det.split(":");
289  String sl[] = det.split(":table_col_names:");
290  logger.info("run get_result_for_pixel " + sl[1]);
291  Map<String, List<String>> tcn = new HashMap<String, List<String>>();
292 
293  String tn[] = sl[1].split(":");
294  for (int i = 0; i < tn.length; i++) {
295  String name[] = tn[i].split(",");
296  List<String> col = new ArrayList<String>();
297  for (int j = 1; j < name.length; j++) {
298  col.add(name[j]);
299  }
300  tcn.put(name[0], col);
301  }
302  try {
303  client.get_result_row_for_pixel(session,
304  Integer.parseInt(ss[3]),
305  new TPixel(Integer.parseInt(ss[5]), Integer.parseInt(ss[7])),
306  tcn,
307  Boolean.TRUE,
308  Integer.parseInt(ss[11]),
309  null);
310  } catch (TOmniSciException ex1) {
311  logger.error("Failed to execute get_result_row_for_pixel exception "
312  + ex1.getError_msg());
313  } catch (TException ex) {
314  logger.error("Failed to execute get_result_row_for_pixel exception "
315  + ex.toString());
316  }
317  return;
318  }
319 
320  if (det.contains("render_vega :")) {
321  logger.info("det " + det);
322  String ss[] = det.split(":");
323  String sl[] = det.split(":vega_json:");
324  json.put(pid, det.substring(det.indexOf("render_vega :") + 13, det.length()));
325  logger.info("JSON = " + sl[1]);
326  logger.info("widget = " + Integer.parseInt(ss[3]));
327  logger.info("compressionLevel = " + Integer.parseInt(ss[5]));
328  logger.info("run render_vega");
329  if (cpuMode) {
330  logger.info("In render: setting gpu mode as we were in CPU mode");
331  gpuMode = true;
332  cpuMode = false;
333  try {
334  client.set_execution_mode(session, TExecuteMode.GPU);
335  } catch (TException ex) {
336  logger.error("Failed to set_execution_mode exception " + ex.toString());
337  }
338  }
339  try {
340  TRenderResult fred = client.render_vega(session,
341  Integer.parseInt(ss[3]),
342  sl[1],
343  Integer.parseInt(ss[5]),
344  null);
345  if (false) {
346  try {
347  FileOutputStream fos;
348 
349  fos = new FileOutputStream("/tmp/png.png");
350 
351  fred.image.position(0);
352  byte[] tgxImageDataByte = new byte[fred.image.limit()];
353  fred.image.get(tgxImageDataByte);
354  fos.write(tgxImageDataByte);
355  fos.close();
356  } catch (FileNotFoundException ex) {
357  logger.error("Failed to create file exception " + ex.toString());
358  } catch (IOException ex) {
359  logger.error("Failed to create file exception " + ex.toString());
360  }
361  }
362 
363  } catch (TException ex) {
364  logger.error("Failed to execute render_vega exception " + ex.toString());
365  }
366  return;
367  }
368 
369  if (det.contains("User mapd sets CPU mode")) {
370  logger.info("Set cpu mode");
371  cpuMode = true;
372  gpuMode = false;
373  try {
374  client.set_execution_mode(session, TExecuteMode.CPU);
375  } catch (TException ex) {
376  logger.error("Failed to set_execution_mode exception " + ex.toString());
377  }
378  return;
379  }
380 
381  if (det.contains("User mapd sets GPU mode")) {
382  logger.info("Set gpu mode");
383  gpuMode = true;
384  cpuMode = false;
385  try {
386  client.set_execution_mode(session, TExecuteMode.GPU);
387  } catch (TException ex) {
388  logger.error(
389  "Failed to execute set_execution_mode exception " + ex.toString());
390  }
391  return;
392  }
393  }
394  }
string name
Definition: setup.in.py:72

Member Data Documentation

OmniSci.Client com.mapd.logrunner.LogRunner.myThread.client
private

Definition at line 243 of file LogRunner.java.

Referenced by com.mapd.logrunner.LogRunner.myThread.myThread().

String com.mapd.logrunner.LogRunner.myThread.session
private

Definition at line 244 of file LogRunner.java.

Referenced by com.mapd.logrunner.LogRunner.myThread.myThread(), omnisci.thrift.OmniSci.disconnect_args.read(), omnisci.thrift.OmniSci.switch_database_args.read(), omnisci.thrift.OmniSci.clone_session_args.read(), omnisci.thrift.OmniSci.get_server_status_args.read(), omnisci.thrift.OmniSci.get_status_args.read(), omnisci.thrift.OmniSci.get_hardware_info_args.read(), omnisci.thrift.OmniSci.get_tables_args.read(), omnisci.thrift.OmniSci.get_tables_for_database_args.read(), omnisci.thrift.OmniSci.get_physical_tables_args.read(), omnisci.thrift.OmniSci.get_views_args.read(), omnisci.thrift.OmniSci.get_tables_meta_args.read(), omnisci.thrift.OmniSci.get_table_details_args.read(), omnisci.thrift.OmniSci.get_table_details_for_database_args.read(), omnisci.thrift.OmniSci.get_internal_table_details_args.read(), omnisci.thrift.OmniSci.get_internal_table_details_for_database_args.read(), omnisci.thrift.OmniSci.get_users_args.read(), omnisci.thrift.OmniSci.get_databases_args.read(), omnisci.thrift.OmniSci.start_heap_profile_args.read(), omnisci.thrift.OmniSci.stop_heap_profile_args.read(), omnisci.thrift.OmniSci.get_heap_profile_args.read(), omnisci.thrift.OmniSci.get_memory_args.read(), omnisci.thrift.OmniSci.clear_cpu_memory_args.read(), omnisci.thrift.OmniSci.clear_gpu_memory_args.read(), omnisci.thrift.OmniSci.set_table_epoch_args.read(), omnisci.thrift.OmniSci.set_table_epoch_by_name_args.read(), omnisci.thrift.OmniSci.get_table_epoch_args.read(), omnisci.thrift.OmniSci.get_table_epoch_by_name_args.read(), omnisci.thrift.OmniSci.get_table_epochs_args.read(), omnisci.thrift.OmniSci.set_table_epochs_args.read(), omnisci.thrift.OmniSci.get_session_info_args.read(), omnisci.thrift.OmniSci.sql_execute_args.read(), omnisci.thrift.OmniSci.sql_execute_df_args.read(), omnisci.thrift.OmniSci.sql_execute_gdf_args.read(), omnisci.thrift.OmniSci.deallocate_df_args.read(), omnisci.thrift.OmniSci.sql_validate_args.read(), omnisci.thrift.OmniSci.get_completion_hints_args.read(), omnisci.thrift.OmniSci.set_execution_mode_args.read(), omnisci.thrift.OmniSci.render_vega_args.read(), omnisci.thrift.OmniSci.get_result_row_for_pixel_args.read(), omnisci.thrift.OmniSci.create_custom_expression_args.read(), omnisci.thrift.OmniSci.get_custom_expressions_args.read(), omnisci.thrift.OmniSci.update_custom_expression_args.read(), omnisci.thrift.OmniSci.delete_custom_expressions_args.read(), omnisci.thrift.OmniSci.get_dashboard_args.read(), omnisci.thrift.OmniSci.get_dashboards_args.read(), omnisci.thrift.OmniSci.create_dashboard_args.read(), omnisci.thrift.OmniSci.replace_dashboard_args.read(), omnisci.thrift.OmniSci.delete_dashboard_args.read(), omnisci.thrift.OmniSci.share_dashboards_args.read(), omnisci.thrift.OmniSci.delete_dashboards_args.read(), omnisci.thrift.OmniSci.share_dashboard_args.read(), omnisci.thrift.OmniSci.unshare_dashboard_args.read(), omnisci.thrift.OmniSci.unshare_dashboards_args.read(), omnisci.thrift.OmniSci.get_dashboard_grantees_args.read(), omnisci.thrift.OmniSci.get_link_view_args.read(), omnisci.thrift.OmniSci.create_link_args.read(), omnisci.thrift.OmniSci.load_table_binary_args.read(), omnisci.thrift.OmniSci.load_table_binary_columnar_args.read(), omnisci.thrift.OmniSci.load_table_binary_columnar_polys_args.read(), omnisci.thrift.OmniSci.load_table_binary_arrow_args.read(), omnisci.thrift.OmniSci.load_table_args.read(), omnisci.thrift.OmniSci.detect_column_types_args.read(), omnisci.thrift.OmniSci.create_table_args.read(), omnisci.thrift.OmniSci.import_table_args.read(), omnisci.thrift.OmniSci.import_geo_table_args.read(), omnisci.thrift.OmniSci.import_table_status_args.read(), omnisci.thrift.OmniSci.get_first_geo_file_in_archive_args.read(), omnisci.thrift.OmniSci.get_all_files_in_archive_args.read(), omnisci.thrift.OmniSci.get_layers_in_geo_file_args.read(), omnisci.thrift.OmniSci.query_get_outer_fragment_count_args.read(), omnisci.thrift.OmniSci.check_table_consistency_args.read(), omnisci.thrift.OmniSci.start_render_query_args.read(), omnisci.thrift.OmniSci.insert_data_args.read(), omnisci.thrift.OmniSci.checkpoint_args.read(), omnisci.thrift.OmniSci.get_roles_args.read(), omnisci.thrift.OmniSci.get_db_objects_for_grantee_args.read(), omnisci.thrift.OmniSci.get_db_object_privs_args.read(), omnisci.thrift.OmniSci.get_all_roles_for_user_args.read(), omnisci.thrift.OmniSci.has_role_args.read(), omnisci.thrift.OmniSci.has_object_privilege_args.read(), omnisci.thrift.OmniSci.set_license_key_args.read(), omnisci.thrift.OmniSci.get_license_claims_args.read(), omnisci.thrift.OmniSci.get_device_parameters_args.read(), omnisci.thrift.OmniSci.register_runtime_extension_functions_args.read(), com.mapd.logrunner.LogRunner.myThread.run(), omnisci.thrift.OmniSci.disconnect_args.write(), omnisci.thrift.OmniSci.switch_database_args.write(), omnisci.thrift.OmniSci.clone_session_args.write(), omnisci.thrift.OmniSci.get_server_status_args.write(), omnisci.thrift.OmniSci.get_status_args.write(), omnisci.thrift.OmniSci.get_hardware_info_args.write(), omnisci.thrift.OmniSci.get_tables_args.write(), omnisci.thrift.OmniSci.get_tables_for_database_args.write(), omnisci.thrift.OmniSci.get_physical_tables_args.write(), omnisci.thrift.OmniSci.get_views_args.write(), omnisci.thrift.OmniSci.get_tables_meta_args.write(), omnisci.thrift.OmniSci.get_table_details_args.write(), omnisci.thrift.OmniSci.get_table_details_for_database_args.write(), omnisci.thrift.OmniSci.get_internal_table_details_args.write(), omnisci.thrift.OmniSci.get_internal_table_details_for_database_args.write(), omnisci.thrift.OmniSci.get_users_args.write(), omnisci.thrift.OmniSci.get_databases_args.write(), omnisci.thrift.OmniSci.start_heap_profile_args.write(), omnisci.thrift.OmniSci.stop_heap_profile_args.write(), omnisci.thrift.OmniSci.get_heap_profile_args.write(), omnisci.thrift.OmniSci.get_memory_args.write(), omnisci.thrift.OmniSci.clear_cpu_memory_args.write(), omnisci.thrift.OmniSci.clear_gpu_memory_args.write(), omnisci.thrift.OmniSci.set_table_epoch_args.write(), omnisci.thrift.OmniSci.set_table_epoch_by_name_args.write(), omnisci.thrift.OmniSci.get_table_epoch_args.write(), omnisci.thrift.OmniSci.get_table_epoch_by_name_args.write(), omnisci.thrift.OmniSci.get_table_epochs_args.write(), omnisci.thrift.OmniSci.set_table_epochs_args.write(), omnisci.thrift.OmniSci.get_session_info_args.write(), omnisci.thrift.OmniSci.sql_execute_args.write(), omnisci.thrift.OmniSci.sql_execute_df_args.write(), omnisci.thrift.OmniSci.sql_execute_gdf_args.write(), omnisci.thrift.OmniSci.deallocate_df_args.write(), omnisci.thrift.OmniSci.sql_validate_args.write(), omnisci.thrift.OmniSci.get_completion_hints_args.write(), omnisci.thrift.OmniSci.set_execution_mode_args.write(), omnisci.thrift.OmniSci.render_vega_args.write(), omnisci.thrift.OmniSci.get_result_row_for_pixel_args.write(), omnisci.thrift.OmniSci.create_custom_expression_args.write(), omnisci.thrift.OmniSci.get_custom_expressions_args.write(), omnisci.thrift.OmniSci.update_custom_expression_args.write(), omnisci.thrift.OmniSci.delete_custom_expressions_args.write(), omnisci.thrift.OmniSci.get_dashboard_args.write(), omnisci.thrift.OmniSci.get_dashboards_args.write(), omnisci.thrift.OmniSci.create_dashboard_args.write(), omnisci.thrift.OmniSci.replace_dashboard_args.write(), omnisci.thrift.OmniSci.delete_dashboard_args.write(), omnisci.thrift.OmniSci.share_dashboards_args.write(), omnisci.thrift.OmniSci.delete_dashboards_args.write(), omnisci.thrift.OmniSci.share_dashboard_args.write(), omnisci.thrift.OmniSci.unshare_dashboard_args.write(), omnisci.thrift.OmniSci.unshare_dashboards_args.write(), omnisci.thrift.OmniSci.get_dashboard_grantees_args.write(), omnisci.thrift.OmniSci.get_link_view_args.write(), omnisci.thrift.OmniSci.create_link_args.write(), omnisci.thrift.OmniSci.load_table_binary_args.write(), omnisci.thrift.OmniSci.load_table_binary_columnar_args.write(), omnisci.thrift.OmniSci.load_table_binary_columnar_polys_args.write(), omnisci.thrift.OmniSci.load_table_binary_arrow_args.write(), omnisci.thrift.OmniSci.load_table_args.write(), omnisci.thrift.OmniSci.detect_column_types_args.write(), omnisci.thrift.OmniSci.create_table_args.write(), omnisci.thrift.OmniSci.import_table_args.write(), omnisci.thrift.OmniSci.import_geo_table_args.write(), omnisci.thrift.OmniSci.import_table_status_args.write(), omnisci.thrift.OmniSci.get_first_geo_file_in_archive_args.write(), omnisci.thrift.OmniSci.get_all_files_in_archive_args.write(), omnisci.thrift.OmniSci.get_layers_in_geo_file_args.write(), omnisci.thrift.OmniSci.query_get_outer_fragment_count_args.write(), omnisci.thrift.OmniSci.check_table_consistency_args.write(), omnisci.thrift.OmniSci.start_render_query_args.write(), omnisci.thrift.OmniSci.insert_data_args.write(), omnisci.thrift.OmniSci.checkpoint_args.write(), omnisci.thrift.OmniSci.get_roles_args.write(), omnisci.thrift.OmniSci.get_db_objects_for_grantee_args.write(), omnisci.thrift.OmniSci.get_db_object_privs_args.write(), omnisci.thrift.OmniSci.get_all_roles_for_user_args.write(), omnisci.thrift.OmniSci.has_role_args.write(), omnisci.thrift.OmniSci.has_object_privilege_args.write(), omnisci.thrift.OmniSci.set_license_key_args.write(), omnisci.thrift.OmniSci.get_license_claims_args.write(), omnisci.thrift.OmniSci.get_device_parameters_args.write(), and omnisci.thrift.OmniSci.register_runtime_extension_functions_args.write().

String com.mapd.logrunner.LogRunner.myThread.str
private

Definition at line 242 of file LogRunner.java.

Referenced by com.mapd.logrunner.LogRunner.myThread.myThread().


The documentation for this class was generated from the following file: