16 package com.mapd.tests;
18 import com.omnisci.thrift.server.OmniSci;
19 import com.omnisci.thrift.server.TClusterHardwareInfo;
20 import com.omnisci.thrift.server.TColumnType;
21 import com.omnisci.thrift.server.TCopyParams;
22 import com.omnisci.thrift.server.TCreateParams;
23 import com.omnisci.thrift.server.TDBObject;
24 import com.omnisci.thrift.server.TDBObjectType;
25 import com.omnisci.thrift.server.TDashboard;
26 import com.omnisci.thrift.server.TNodeMemoryInfo;
27 import com.omnisci.thrift.server.TOmniSciException;
28 import com.omnisci.thrift.server.TQueryResult;
29 import com.omnisci.thrift.server.TServerStatus;
30 import com.omnisci.thrift.server.TTableDetails;
31 import com.omnisci.thrift.server.TTableMeta;
33 import org.apache.thrift.TException;
34 import org.apache.thrift.protocol.TBinaryProtocol;
35 import org.apache.thrift.protocol.TProtocol;
36 import org.apache.thrift.transport.TSocket;
38 import java.util.Collection;
39 import java.util.HashSet;
40 import java.util.List;
47 return client.get_server_status(
sessionId);
50 public List<TServerStatus>
get_status() throws TOmniSciException, TException {
55 return client.get_hardware_info(
sessionId);
58 public List<TNodeMemoryInfo>
get_memory(String memory_level)
59 throws TOmniSciException, TException {
60 return client.get_memory(
sessionId, memory_level);
64 return client.get_table_details(
sessionId, table_name);
71 public TQueryResult
runSql(String sql)
throws Exception {
72 return client.sql_execute(
sessionId, sql,
true, null, -1, -1);
75 public List<TColumnType>
sqlValidate(String sql)
throws Exception {
76 return client.sql_validate(
sessionId, sql);
80 return client.create_dashboard(
85 int dashboard_id, java.lang.String
name, java.lang.String new_owner)
97 TDashboard dashboard = client.get_dashboard(
sessionId, id);
109 public void import_table(String table_name, String file_name, TCopyParams copy_params)
111 client.import_table(
sessionId, table_name, file_name, copy_params);
116 TCopyParams copy_params,
117 java.util.List<TColumnType> row_desc,
118 TCreateParams create_params)
throws Exception {
119 client.import_geo_table(
120 sessionId, table_name, file_name, copy_params, row_desc, create_params);
133 return client.get_db_object_privs(
sessionId, objectName,
type);
141 List<String> roles = client.get_all_roles_for_user(
sessionId, username);
142 return new HashSet<String>(roles);
146 String host,
int port, String db, String user, String password)
148 TSocket transport =
new TSocket(host, port);
150 TProtocol protocol =
new TBinaryProtocol(transport);
151 OmniSci.Client
client =
new OmniSci.Client(protocol);
154 session.sessionId = client.connect(user, password, db);
List< TNodeMemoryInfo > get_memory(String memory_level)
TTableDetails get_table_details(String table_name)
List< TTableMeta > get_tables_meta()
void import_table(String table_name, String file_name, TCopyParams copy_params)
TDashboard get_dashboard(int id)
List< String > get_roles()
List< String > get_users()
List< TServerStatus > get_status()
void replace_dashboard(int dashboard_id, java.lang.String name, java.lang.String new_owner)
Collection< String > get_all_roles_for_user(String username)
static MapdTestClient getClient(String host, int port, String db, String user, String password)
List< TColumnType > sqlValidate(String sql)
void import_geo_table(String table_name, String file_name, TCopyParams copy_params, java.util.List< TColumnType > row_desc, TCreateParams create_params)
TQueryResult runSql(String sql)
List< TDBObject > get_db_object_privs(String objectName, TDBObjectType type)
void delete_dashboard(int id)
TServerStatus get_server_status()
int create_dashboard(String name)
TClusterHardwareInfo get_hardware_info()
List< TDashboard > get_dashboards()