OmniSciDB  a987f07e93
 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, Heavy.Client client1, String session1)
 

Private Attributes

String str
 
Heavy.Client client
 
String session
 

Detailed Description

Definition at line 238 of file LogRunner.java.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 250 of file LogRunner.java.

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

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

Member Data Documentation

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

Definition at line 240 of file LogRunner.java.

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

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

Definition at line 241 of file LogRunner.java.

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

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

Definition at line 239 of file LogRunner.java.

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


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