use of org.apache.asterix.experiment.action.base.IAction in project asterixdb by apache.
the class AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder method getSelectQuery.
private SequentialActionList getSelectQuery(boolean isIndexOnlyPlan) throws IOException {
//prepare radius and center point
int skipLineCount = SKIP_LINE_COUNT;
int lineCount = 0;
String line = null;
;
querySeed += SKIP_LINE_COUNT;
if (querySeed > MAX_QUERY_SEED) {
querySeed -= MAX_QUERY_SEED;
}
while (lineCount < skipLineCount) {
if ((line = br.readLine()) == null) {
//reopen file
br.close();
br = new BufferedReader(new FileReader(querySeedFilePath));
line = br.readLine();
}
lineCount++;
}
int beginIdx = line.indexOf("(", line.indexOf("point"));
int endIdx = line.indexOf(")", line.indexOf("point")) + 1;
String point = line.substring(beginIdx, endIdx);
//create action
SequentialActionList sAction = new SequentialActionList();
IAction queryAction = new TimedAction(new RunAQLStringAction(httpClient, restHost, restPort, getSelectQueryAQL(radiusType[radiusIter++ % radiusType.length], point, isIndexOnlyPlan), outputFos), outputFos);
sAction.add(queryAction);
return sAction;
}
use of org.apache.asterix.experiment.action.base.IAction in project asterixdb by apache.
the class AbstractSpatialIndexExperiment3SIdxCreateAndQueryBuilder method getJoinQuery.
private SequentialActionList getJoinQuery(boolean isIndexOnlyPlan) {
querySeed += SKIP_LINE_COUNT;
if (querySeed > MAX_QUERY_SEED) {
querySeed -= MAX_QUERY_SEED;
}
int lowId = querySeed * 10000 + 1;
int highId = (querySeed + JOIN_CANDIDATE_COUNT) * 10000 + 1;
//create action
SequentialActionList sAction = new SequentialActionList();
IAction queryAction = new TimedAction(new RunAQLStringAction(httpClient, restHost, restPort, getJoinQueryAQL(radiusType[radiusIter++ % (radiusType.length - 1)], lowId, highId, isIndexOnlyPlan), outputFos), outputFos);
sAction.add(queryAction);
return sAction;
}
Aggregations