OmniSciDB  085a039ca4
 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 242 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 254 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.

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

Member Data Documentation

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

Definition at line 244 of file LogRunner.java.

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

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

Definition at line 245 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(), 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(), and heavydb.thrift.Heavy.get_table_function_details_args.write().

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

Definition at line 243 of file LogRunner.java.

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


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