use of org.pentaho.di.trans.dataservice.clients.AnnotationsQueryService in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceTestController method executeSql.
public void executeSql() throws KettleException {
resetMetrics();
dataServiceExec = getNewDataServiceExecutor(true);
updateOptimizationImpact(dataServiceExec);
updateModel(dataServiceExec);
AnnotationsQueryService annotationsQuery = getAnnotationsQueryService();
Query query;
if (dataService.isStreaming()) {
XulRadio timeBasedRadio = (XulRadio) document.getElementById("time-based-radio");
IDataServiceClientService.StreamingMode windowMode = timeBasedRadio.isSelected() ? IDataServiceClientService.StreamingMode.TIME_BASED : IDataServiceClientService.StreamingMode.ROW_BASED;
model.setWindowMode(windowMode);
query = annotationsQuery.prepareQuery(model.getSql(), model.getWindowMode(), model.getWindowSize(), model.getWindowEvery(), model.getWindowLimit(), ImmutableMap.<String, String>of());
} else {
query = annotationsQuery.prepareQuery(model.getSql(), model.getMaxRows(), ImmutableMap.<String, String>of());
}
if (null != query) {
writeAnnotations(query);
handleCompletion(dataServiceExec);
} else {
callback.onLogChannelUpdate();
dataServiceExec.executeQuery(getDataServiceRowListener());
pollForCompletion(dataServiceExec);
}
}
Aggregations