Hi
I have several questions need to consult:
Whether a cube dimension is defined when the need to query the field must also
be defined by them, so that the query will be faster
2 cube dimensions define the maximum number of suitable
3 restful interface issues:
E.g:
GET / tables_and_columns
Request Parameters
project - required string The project to load tables
How to pass in these parameters? This is my simple code:
public static List<JobInfo> listAllTables() {
ArrayList<JobInfo> jobList = new ArrayList<JobInfo>();
HttpPost request = new HttpPost(KYLIN_JOB_SERVER_URL +
"/api/tables_and_columns");
try {
HttpClient httpClient = HttpClients.createDefault();
request.addHeader("Content-Type", "application/json");
String basicAuth
=DatatypeConverter.printBase64Binary(("ADMIN" + ":" +
"KYLIN").getBytes());
request.addHeader("Authorization", "Basic " +
basicAuth);
List<NameValuePair> params = new
ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("project_Name",
"learn_kylin"));
request.setEntity(new UrlEncodedFormEntity(params,HTTP.UTF_8));
//request.addHeader("project", "learn_kylin");
HttpResponse response = httpClient.execute(request);
System.out.println("response.getStatusLine().getStatusCode():"+response.getStatusLine().getStatusCode());
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error
code : " + response.getStatusLine().getStatusCode());
}
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
byte[] responseBody = IOUtils.toByteArray(is);
String json = new String(responseBody);
log.debug(json);
System.out.println("json:"+json);
// ObjectMapper om = new ObjectMapper();
// jobList.addAll((List<JobInfo>) om.readValue(json, new
TypeReference<List<JobInfo>>() {
// }));
} catch (Throwable t) {
t.printStackTrace();
} finally {
request.releaseConnection();
}
return jobList;
}
Thanks