Skip to content

Commit

Permalink
Fix IT failure and format code
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <zaniu@amazon.com>
  • Loading branch information
zane-neo committed Dec 8, 2023
1 parent f73c9cf commit 35f0e67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.OpenSearchSecurityException;
Expand All @@ -28,7 +27,6 @@
import org.opensearch.rest.RestChannel;
import org.opensearch.rest.RestRequest;
import org.opensearch.sql.common.antlr.SyntaxCheckException;
import org.opensearch.sql.common.setting.Settings;
import org.opensearch.sql.datasources.exceptions.DataSourceClientException;
import org.opensearch.sql.exception.ExpressionEvaluationException;
import org.opensearch.sql.exception.QueryEngineException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.Locale;
import java.util.Optional;
import java.util.function.Supplier;

import org.opensearch.action.ActionRequest;
import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.HandledTransportAction;
Expand Down Expand Up @@ -61,7 +60,6 @@ public TransportPPLQueryAction(
NodeClient client,
ClusterService clusterService,
DataSourceServiceImpl dataSourceService,
Settings pluginSettings,
org.opensearch.common.settings.Settings clusterSettings) {
super(PPLQueryAction.NAME, transportService, actionFilters, TransportPPLQueryRequest::new);

Expand All @@ -78,7 +76,10 @@ public TransportPPLQueryAction(
this.pplEnabled =
() ->
MULTI_ALLOW_EXPLICIT_INDEX.get(clusterSettings)
&& (Boolean) pluginSettings.getSettingValue(Settings.Key.PPL_ENABLED);
&& (Boolean)
injector
.getInstance(org.opensearch.sql.common.setting.Settings.class)
.getSettingValue(Settings.Key.PPL_ENABLED);
}

/**
Expand All @@ -89,9 +90,10 @@ public TransportPPLQueryAction(
protected void doExecute(
Task task, ActionRequest request, ActionListener<TransportPPLQueryResponse> listener) {
if (!pplEnabled.get()) {
listener.onFailure(new IllegalAccessException(
"Either plugins.ppl.enabled or rest.action.multi.allow_explicit_index setting is"
+ " false"));
listener.onFailure(
new IllegalAccessException(
"Either plugins.ppl.enabled or rest.action.multi.allow_explicit_index setting is"
+ " false"));
return;
}
Metrics.getInstance().getNumericalMetric(MetricName.PPL_REQ_TOTAL).increment();
Expand Down

0 comments on commit 35f0e67

Please sign in to comment.