Rename SqlQueryManager getQuery to getQueryExecution
@@ -311,7 +311,7 @@ public class SqlQueryManager
{
requireNonNull(listener, "listener is null");
- getQuery(queryId).addOutputInfoListener(listener);
+ getQueryExecution(queryId).addOutputInfoListener(listener);
}
@Override
@@ -319,13 +319,13 @@ public class SqlQueryManager
{
requireNonNull(listener, "listener is null");
- getQuery(queryId).addStateChangeListener(listener);
+ getQueryExecution(queryId).addStateChangeListener(listener);
}
@Override
public ListenableFuture<QueryState> getStateChange(QueryId queryId, QueryState currentState)
{
- return tryGetQuery(queryId)
+ return tryGetQueryExecution(queryId)
.map(query -> query.getStateChange(currentState))
.orElseGet(() -> immediateFailedFuture(new NoSuchElementException()));
}
@@ -333,37 +333,37 @@ public class SqlQueryManager
@Override
public BasicQueryInfo getQueryInfo(QueryId queryId)
{
- return getQuery(queryId).getBasicQueryInfo();
+ return getQueryExecution(queryId).getBasicQueryInfo();
}
@Override
public QueryInfo getFullQueryInfo(QueryId queryId)
{
- return getQuery(queryId).getQueryInfo();
+ return getQueryExecution(queryId).getQueryInfo();
}
@Override
public Optional<ResourceGroupId> getQueryResourceGroup(QueryId queryId)
{
- return tryGetQuery(queryId)
+ return tryGetQueryExecution(queryId)
.flatMap(QueryExecution::getResourceGroup);
}
public Plan getQueryPlan(QueryId queryId)
{
- return getQuery(queryId).getQueryPlan();
+ return getQueryExecution(queryId).getQueryPlan();
}
@Override
public QueryState getQueryState(QueryId queryId)
{
- return getQuery(queryId).getState();
+ return getQueryExecution(queryId).getState();
}
@Override
public void recordHeartbeat(QueryId queryId)
{
- tryGetQuery(queryId)
+ tryGetQueryExecution(queryId)
.ifPresent(QueryExecution::recordHeartbeat);
}
@@ -549,7 +549,7 @@ public class SqlQueryManager
{
requireNonNull(cause, "cause is null");
- tryGetQuery(queryId)
+ tryGetQueryExecution(queryId)
.ifPresent(query -> query.fail(cause));
}
@@ -558,7 +558,7 @@ public class SqlQueryManager
{
log.debug("Cancel query %s", queryId);
- tryGetQuery(queryId)
+ tryGetQueryExecution(queryId)
.ifPresent(QueryExecution::cancelQuery);
}
@@ -569,7 +569,7 @@ public class SqlQueryManager
log.debug("Cancel stage %s", stageId);
- tryGetQuery(stageId.getQueryId())
+ tryGetQueryExecution(stageId.getQueryId())
.ifPresent(query -> query.cancelStage(stageId));
}
@@ -756,13 +756,13 @@ public class SqlQueryManager
}
}
- private QueryExecution getQuery(QueryId queryId)
+ private QueryExecution getQueryExecution(QueryId queryId)
{
- return tryGetQuery(queryId)
+ return tryGetQueryExecution(queryId)
.orElseThrow(NoSuchElementException::new);
}
- private Optional<QueryExecution> tryGetQuery(QueryId queryId)
+ private Optional<QueryExecution> tryGetQueryExecution(QueryId queryId)
{
requireNonNull(queryId, "queryId is null");
return Optional.ofNullable(queries.get(queryId));
