nizhikov commented on code in PR #13668:
URL: https://github.com/apache/ignite/pull/13668#discussion_r4244617088
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java:
##########
@@ -1019,6 +1026,23 @@ public boolean moduleEnabled() {
return indexingEnabled() || dfltQryEngine != null;
}
+ /**
+ * @param engineName Query engine name.
+ * @return {@code True} if a query engine with the given name can be
selected by the {@code QUERY_ENGINE} hint or
Review Comment:
Fixed in c7fae7f: the Javadoc now names the `queryEngine` connection
property.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java:
##########
@@ -198,6 +198,10 @@ public class GridQueryProcessor extends
GridProcessorAdapter {
Pattern.compile("QUERY_ENGINE[\\s]*\\([\\s]*'([a-z0-9]+)'[\\s]*\\)",
CASE_INSENSITIVE);
+ /** Error message for the features that require the H2 query engine when
it is not on the classpath. */
+ private static final String INDEXING_DISABLED_MSG = "Failed to execute
query because indexing is disabled " +
+ "(consider adding module " + INDEXING.module() + " to classpath or
moving it from 'optional' to 'libs' folder).";
Review Comment:
Fixed in c7fae7f.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java:
##########
@@ -562,9 +566,12 @@ private void initQueryEngines() throws
IgniteCheckedException {
// If indexing is disabled, try to find any query engine in
components.
if (!indexingEnabled()) {
for (GridComponent cmp : ctx.components()) {
- if (cmp instanceof QueryEngine) {
- qryEngines = new QueryEngine[] {(QueryEngine)cmp};
- dfltQryEngine = (QueryEngine)cmp;
+ if (cmp instanceof QueryEngine &&
((QueryEngine)cmp).config() != null) {
Review Comment:
Fixed in c7fae7f: `cmp instanceof QueryEngine qryEngine &&
qryEngine.config() != null`.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java:
##########
@@ -562,9 +566,12 @@ private void initQueryEngines() throws
IgniteCheckedException {
// If indexing is disabled, try to find any query engine in
components.
if (!indexingEnabled()) {
for (GridComponent cmp : ctx.components()) {
- if (cmp instanceof QueryEngine) {
- qryEngines = new QueryEngine[] {(QueryEngine)cmp};
- dfltQryEngine = (QueryEngine)cmp;
+ if (cmp instanceof QueryEngine &&
((QueryEngine)cmp).config() != null) {
+ QueryEngine qryEngine = (QueryEngine)cmp;
+
+ qryEngines = new QueryEngine[] {qryEngine};
+ this.qryEnginesCfg = new QueryEngineConfigurationEx[]
{qryEngine.config()};
Review Comment:
Fixed in c7fae7f.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java:
##########
@@ -1019,6 +1026,23 @@ public boolean moduleEnabled() {
return indexingEnabled() || dfltQryEngine != null;
}
+ /**
+ * @param engineName Query engine name.
+ * @return {@code True} if a query engine with the given name can be
selected by the {@code QUERY_ENGINE} hint or
+ * by the client connection property.
+ */
+ public boolean queryEngineConfigured(String engineName) {
+ if (qryEnginesCfg == null)
Review Comment:
Fixed in c7fae7f: the field is `@Nullable` now. It is never empty, only
`null`, so the null check stays.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryEngine.java:
##########
@@ -81,4 +81,9 @@ List<FieldsQueryCursor<List<?>>> queryBatched(
String qry,
List<Object[]> batchedParams
) throws IgniteSQLException;
+
+ /** @return Configuration of the engine. */
+ default QueryEngineConfigurationEx config() {
Review Comment:
Fixed in c7fae7f: `config()` is abstract and `@Nullable`, `NoOpQueryEngine`
overrides it explicitly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]