OmniSciDB  b28c0d5765
 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
 
void load_table_binary_columnar_polys (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 213 of file HeavyDBTestClient.java.

References Double.

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

213  {
214  TColumn tColumn = new TColumn();
215  tColumn.data = new TColumnData(
216  new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>());
217  tColumn.nulls = new ArrayList<>();
218  for (Object value : column) {
219  if (value instanceof Long) {
220  tColumn.data.int_col.add((Long) value);
221  } else if (value instanceof Double) {
222  tColumn.data.real_col.add((Double) value);
223  } else if (value instanceof String) {
224  tColumn.data.str_col.add((String) value);
225  } else if (value instanceof List) {
226  tColumn.data.arr_col.add(convertToTColumn((List<Object>) value));
227  } else {
228  throw new RuntimeException("Unexpected value type. Value: " + value);
229  }
230  tColumn.nulls.add(false);
231  }
232  return tColumn;
233  }
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 205 of file HeavyDBTestClient.java.

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

Referenced by com.mapd.tests.HeavyDBTestClient.load_table_binary_columnar(), and com.mapd.tests.HeavyDBTestClient.load_table_binary_columnar_polys().

205  {
206  List<TColumn> load_columns = new ArrayList<>();
207  for (List<Object> column : columns) {
208  load_columns.add(convertToTColumn(column));
209  }
210  return load_columns;
211  }
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 235 of file HeavyDBTestClient.java.

References com.mapd.tests.HeavyDBTestClient.client.

237  {
238  TSocket transport = new TSocket(host, port);
239  transport.open();
240  TProtocol protocol = new TBinaryProtocol(transport);
241  Heavy.Client client = new Heavy.Client(protocol);
242  HeavyDBTestClient session = new HeavyDBTestClient();
243  session.client = client;
244  session.sessionId = client.connect(user, password, db);
245  return session;
246  }
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 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  }
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(), 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  }

+ 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.load_table_binary_columnar_polys ( String  tableName,
List< List< Object >>  columns,
List< String >  columnNames 
) throws Exception
inline

Definition at line 197 of file HeavyDBTestClient.java.

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

199  {
200  List<TColumn> load_columns = convertToTColumns(columns);
201  client.load_table_binary_columnar_polys(
202  sessionId, tableName, load_columns, columnNames, true);
203  }
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

Definition at line 33 of file HeavyDBTestClient.java.

Referenced by com.mapd.tests.HeavyDBTestClient.create_dashboard(), com.mapd.tests.HeavyDBTestClient.delete_dashboard(), com.mapd.tests.HeavyDBTestClient.disconnect(), com.mapd.tests.HeavyDBTestClient.get_all_roles_for_user(), com.mapd.tests.HeavyDBTestClient.get_dashboard(), com.mapd.tests.HeavyDBTestClient.get_dashboards(), com.mapd.tests.HeavyDBTestClient.get_db_object_privs(), com.mapd.tests.HeavyDBTestClient.get_hardware_info(), com.mapd.tests.HeavyDBTestClient.get_memory(), com.mapd.tests.HeavyDBTestClient.get_queries_info(), com.mapd.tests.HeavyDBTestClient.get_roles(), com.mapd.tests.HeavyDBTestClient.get_server_status(), com.mapd.tests.HeavyDBTestClient.get_status(), com.mapd.tests.HeavyDBTestClient.get_table_details(), com.mapd.tests.HeavyDBTestClient.get_table_details_for_database(), com.mapd.tests.HeavyDBTestClient.get_tables_meta(), com.mapd.tests.HeavyDBTestClient.get_users(), com.mapd.tests.HeavyDBTestClient.import_geo_table(), com.mapd.tests.HeavyDBTestClient.import_table(), com.mapd.tests.HeavyDBTestClient.load_table(), com.mapd.tests.HeavyDBTestClient.load_table_binary(), com.mapd.tests.HeavyDBTestClient.load_table_binary_columnar(), com.mapd.tests.HeavyDBTestClient.load_table_binary_columnar_polys(), heavydb.thrift.ttypes.TKrb5Session.read(), com.mapd.tests.HeavyDBTestClient.replace_dashboard(), com.mapd.tests.HeavyDBTestClient.runSql(), com.mapd.tests.HeavyDBTestClient.sqlValidate(), and heavydb.thrift.ttypes.TKrb5Session.write().


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