OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.tests.HeavyDBTestClient Class Reference
+ Collaboration diagram for com.mapd.tests.HeavyDBTestClient:

Public Member Functions

TServerStatus get_server_status () throws TDBException, TException
 
List< TServerStatus > get_status () throws TDBException, TException
 
TClusterHardwareInfo get_hardware_info () throws TDBException, TException
 
List< TNodeMemoryInfo > get_memory (String memory_level) throws TDBException, TException
 
TTableDetails get_table_details (String table_name) throws Exception
 
TTableDetails get_table_details_for_database (String tableName, String databaseName) throws Exception
 
List< TTableMeta > get_tables_meta () throws TDBException, Exception
 
TQueryResult runSql (String sql) throws Exception
 
List< TColumnType > sqlValidate (String sql) throws Exception
 
int create_dashboard (String name) throws Exception
 
void replace_dashboard (int dashboard_id, java.lang.String name, java.lang.String new_owner) throws Exception
 
TDashboard get_dashboard (int id) throws Exception
 
void delete_dashboard (int id) throws Exception
 
List< TDashboard > get_dashboards () throws Exception
 
void import_table (String table_name, String file_name, TCopyParams copy_params) throws Exception
 
void import_geo_table (String table_name, String file_name, TCopyParams copy_params, java.util.List< TColumnType > row_desc, TCreateParams create_params) throws Exception
 
List< String > get_users () throws Exception
 
List< String > get_roles () throws Exception
 
List< TDBObject > get_db_object_privs (String objectName, TDBObjectType type) throws Exception
 
void disconnect () throws Exception
 
Collection< String > get_all_roles_for_user (String username) throws Exception
 
List< TQueryInfo > get_queries_info () throws Exception
 
void load_table (String tableName, List< List< String >> rows, List< String > columnNames) throws Exception
 
void load_table_binary (String tableName, List< List< Object >> rows, List< String > columnNames) throws Exception
 
void load_table_binary_columnar (String tableName, List< List< Object >> columns, List< String > columnNames) throws Exception
 

Static Public Member Functions

static HeavyDBTestClient getClient (String host, int port, String db, String user, String password) throws Exception
 

Package Attributes

Heavy.Client client
 
String sessionId
 

Private Member Functions

TDatum convertToTDatum (Object value)
 
List< TColumn > convertToTColumns (List< List< Object >> columns)
 
TColumn convertToTColumn (List< Object > column)
 

Detailed Description

Definition at line 31 of file HeavyDBTestClient.java.

Member Function Documentation

TColumn com.mapd.tests.HeavyDBTestClient.convertToTColumn ( List< Object >  column)
inlineprivate

Definition at line 205 of file HeavyDBTestClient.java.

References Double.

Referenced by com.mapd.tests.HeavyDBTestClient.convertToTColumns().

205  {
206  TColumn tColumn = new TColumn();
207  tColumn.data = new TColumnData(
208  new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>());
209  tColumn.nulls = new ArrayList<>();
210  for (Object value : column) {
211  if (value instanceof Long) {
212  tColumn.data.int_col.add((Long) value);
213  } else if (value instanceof Double) {
214  tColumn.data.real_col.add((Double) value);
215  } else if (value instanceof String) {
216  tColumn.data.str_col.add((String) value);
217  } else if (value instanceof List) {
218  tColumn.data.arr_col.add(convertToTColumn((List<Object>) value));
219  } else {
220  throw new RuntimeException("Unexpected value type. Value: " + value);
221  }
222  tColumn.nulls.add(false);
223  }
224  return tColumn;
225  }
TColumn convertToTColumn(List< Object > column)

+ Here is the caller graph for this function:

List<TColumn> com.mapd.tests.HeavyDBTestClient.convertToTColumns ( List< List< Object >>  columns)
inlineprivate

Definition at line 197 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.convertToTColumn().

Referenced by com.mapd.tests.HeavyDBTestClient.load_table_binary_columnar().

197  {
198  List<TColumn> load_columns = new ArrayList<>();
199  for (List<Object> column : columns) {
200  load_columns.add(convertToTColumn(column));
201  }
202  return load_columns;
203  }
TColumn convertToTColumn(List< Object > column)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TDatum com.mapd.tests.HeavyDBTestClient.convertToTDatum ( Object  value)
inlineprivate

Definition at line 171 of file HeavyDBTestClient.java.

References Double.

Referenced by com.mapd.tests.HeavyDBTestClient.load_table_binary().

171  {
172  TDatumVal tDatumVal = new TDatumVal();
173  if (value instanceof Long) {
174  tDatumVal.int_val = ((Long) value);
175  } else if (value instanceof Double) {
176  tDatumVal.real_val = ((Double) value);
177  } else if (value instanceof String) {
178  tDatumVal.str_val = ((String) value);
179  } else if (value instanceof List) {
180  tDatumVal.arr_val = new ArrayList<>();
181  for (Object arrayValue : ((List<Object>) value)) {
182  tDatumVal.arr_val.add(convertToTDatum(arrayValue));
183  }
184  } else {
185  throw new RuntimeException("Unexpected value type. Value: " + value);
186  }
187  return new TDatum(tDatumVal, false);
188  }

+ Here is the caller graph for this function:

int com.mapd.tests.HeavyDBTestClient.create_dashboard ( String  name) throws Exception
inline

Definition at line 73 of file HeavyDBTestClient.java.

References setup.name, and com.mapd.tests.HeavyDBTestClient.sessionId.

73  {
74  return client.create_dashboard(
75  sessionId, name, "STATE", name + "_hash", name + "_meta");
76  }
string name
Definition: setup.in.py:72
void com.mapd.tests.HeavyDBTestClient.delete_dashboard ( int  id) throws Exception
inline

Definition at line 95 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

95  {
96  client.delete_dashboard(sessionId, id);
97  }
void com.mapd.tests.HeavyDBTestClient.disconnect ( ) throws Exception
inline

Definition at line 130 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

130  {
131  client.disconnect(sessionId);
132  }
Collection<String> com.mapd.tests.HeavyDBTestClient.get_all_roles_for_user ( String  username) throws Exception
inline

Definition at line 134 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

134  {
135  List<String> roles = client.get_all_roles_for_user(sessionId, username);
136  return new HashSet<String>(roles);
137  }
TDashboard com.mapd.tests.HeavyDBTestClient.get_dashboard ( int  id) throws Exception
inline

Definition at line 90 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

90  {
91  TDashboard dashboard = client.get_dashboard(sessionId, id);
92  return dashboard;
93  }
List<TDashboard> com.mapd.tests.HeavyDBTestClient.get_dashboards ( ) throws Exception
inline

Definition at line 99 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

99  {
100  return client.get_dashboards(sessionId);
101  }
List<TDBObject> com.mapd.tests.HeavyDBTestClient.get_db_object_privs ( String  objectName,
TDBObjectType  type 
) throws Exception
inline

Definition at line 125 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId, and run_benchmark_import.type.

126  {
127  return client.get_db_object_privs(sessionId, objectName, type);
128  }
TClusterHardwareInfo com.mapd.tests.HeavyDBTestClient.get_hardware_info ( ) throws TDBException, TException
inline

Definition at line 43 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

43  {
44  return client.get_hardware_info(sessionId);
45  }
List<TNodeMemoryInfo> com.mapd.tests.HeavyDBTestClient.get_memory ( String  memory_level) throws TDBException, TException
inline

Definition at line 47 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

48  {
49  return client.get_memory(sessionId, memory_level);
50  }
List<TQueryInfo> com.mapd.tests.HeavyDBTestClient.get_queries_info ( ) throws Exception
inline

Definition at line 139 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

139  {
140  return client.get_queries_info(sessionId);
141  }
List<String> com.mapd.tests.HeavyDBTestClient.get_roles ( ) throws Exception
inline

Definition at line 121 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

121  {
122  return client.get_roles(sessionId);
123  }
TServerStatus com.mapd.tests.HeavyDBTestClient.get_server_status ( ) throws TDBException, TException
inline

Definition at line 35 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

35  {
36  return client.get_server_status(sessionId);
37  }
List<TServerStatus> com.mapd.tests.HeavyDBTestClient.get_status ( ) throws TDBException, TException
inline

Definition at line 39 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

39  {
40  return client.get_status(sessionId);
41  }
TTableDetails com.mapd.tests.HeavyDBTestClient.get_table_details ( String  table_name) throws Exception
inline

Definition at line 52 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

52  {
53  return client.get_table_details(sessionId, table_name);
54  }
TTableDetails com.mapd.tests.HeavyDBTestClient.get_table_details_for_database ( String  tableName,
String  databaseName 
) throws Exception
inline

Definition at line 56 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

57  {
58  return client.get_table_details_for_database(sessionId, tableName, databaseName);
59  }
List<TTableMeta> com.mapd.tests.HeavyDBTestClient.get_tables_meta ( ) throws TDBException, Exception
inline

Definition at line 61 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

61  {
62  return client.get_tables_meta(sessionId);
63  }
List<String> com.mapd.tests.HeavyDBTestClient.get_users ( ) throws Exception
inline

Definition at line 117 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

117  {
118  return client.get_users(sessionId);
119  }
static HeavyDBTestClient com.mapd.tests.HeavyDBTestClient.getClient ( String  host,
int  port,
String  db,
String  user,
String  password 
) throws Exception
inlinestatic

Definition at line 227 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.client.

229  {
230  TSocket transport = new TSocket(host, port);
231  transport.open();
232  TProtocol protocol = new TBinaryProtocol(transport);
233  Heavy.Client client = new Heavy.Client(protocol);
234  HeavyDBTestClient session = new HeavyDBTestClient();
235  session.client = client;
236  session.sessionId = client.connect(user, password, db);
237  return session;
238  }
void com.mapd.tests.HeavyDBTestClient.import_geo_table ( String  table_name,
String  file_name,
TCopyParams  copy_params,
java.util.List< TColumnType >  row_desc,
TCreateParams  create_params 
) throws Exception
inline

Definition at line 108 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

112  {
113  client.import_geo_table(
114  sessionId, table_name, file_name, copy_params, row_desc, create_params);
115  }
void com.mapd.tests.HeavyDBTestClient.import_table ( String  table_name,
String  file_name,
TCopyParams  copy_params 
) throws Exception
inline

Definition at line 103 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

104  {
105  client.import_table(sessionId, table_name, file_name, copy_params);
106  }
void com.mapd.tests.HeavyDBTestClient.load_table ( String  tableName,
List< List< String >>  rows,
List< String >  columnNames 
) throws Exception
inline

Definition at line 143 of file HeavyDBTestClient.java.

References report.rows, and com.mapd.tests.HeavyDBTestClient.sessionId.

145  {
146  List<TStringRow> load_rows = new ArrayList<>();
147  for (List<String> row : rows) {
148  TStringRow tStringRow = new TStringRow(new ArrayList<>());
149  for (String value : row) {
150  tStringRow.cols.add(new TStringValue(value, false));
151  }
152  load_rows.add(tStringRow);
153  }
154  client.load_table(sessionId, tableName, load_rows, columnNames);
155  }
tuple rows
Definition: report.py:114
void com.mapd.tests.HeavyDBTestClient.load_table_binary ( String  tableName,
List< List< Object >>  rows,
List< String >  columnNames 
) throws Exception
inline

Definition at line 157 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.convertToTDatum(), report.rows, and com.mapd.tests.HeavyDBTestClient.sessionId.

159  {
160  List<TRow> load_rows = new ArrayList<>();
161  for (List<Object> row : rows) {
162  TRow tRow = new TRow(new ArrayList<>());
163  for (Object value : row) {
164  tRow.cols.add(convertToTDatum(value));
165  }
166  load_rows.add(tRow);
167  }
168  client.load_table_binary(sessionId, tableName, load_rows, columnNames);
169  }
tuple rows
Definition: report.py:114

+ Here is the call graph for this function:

void com.mapd.tests.HeavyDBTestClient.load_table_binary_columnar ( String  tableName,
List< List< Object >>  columns,
List< String >  columnNames 
) throws Exception
inline

Definition at line 190 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.convertToTColumns(), and com.mapd.tests.HeavyDBTestClient.sessionId.

192  {
193  List<TColumn> load_columns = convertToTColumns(columns);
194  client.load_table_binary_columnar(sessionId, tableName, load_columns, columnNames);
195  }
List< TColumn > convertToTColumns(List< List< Object >> columns)

+ Here is the call graph for this function:

void com.mapd.tests.HeavyDBTestClient.replace_dashboard ( int  dashboard_id,
java.lang.String  name,
java.lang.String  new_owner 
) throws Exception
inline

Definition at line 78 of file HeavyDBTestClient.java.

References setup.name, and com.mapd.tests.HeavyDBTestClient.sessionId.

80  {
81  client.replace_dashboard(sessionId,
82  dashboard_id,
83  name,
84  new_owner,
85  "STATE",
86  name + "_hash",
87  name + "_meta");
88  }
string name
Definition: setup.in.py:72
TQueryResult com.mapd.tests.HeavyDBTestClient.runSql ( String  sql) throws Exception
inline

Definition at line 65 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

65  {
66  return client.sql_execute(sessionId, sql, true, null, -1, -1);
67  }
List<TColumnType> com.mapd.tests.HeavyDBTestClient.sqlValidate ( String  sql) throws Exception
inline

Definition at line 69 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.sessionId.

69  {
70  return client.sql_validate(sessionId, sql);
71  }

Member Data Documentation

Heavy.Client com.mapd.tests.HeavyDBTestClient.client
package

Definition at line 32 of file HeavyDBTestClient.java.

Referenced by com.mapd.tests.HeavyDBTestClient.getClient().

String com.mapd.tests.HeavyDBTestClient.sessionId
package

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