Murtadha Hubail has submitted this change and it was merged. Change subject: [NO ISSUE][OTH] Remove Deprecated IStatementExecutorContext ......................................................................
[NO ISSUE][OTH] Remove Deprecated IStatementExecutorContext - user model changes: no - storage format changes: no - interface changes: yes Details: - IStatementExecutorContext was derecated and replaced by IRequestTracker. - This change removes the deprecated IStatementExecutorContext. Change-Id: If591454c91e79f6965aca21554f3d2e7a0189278 Reviewed-on: https://asterix-gerrit.ics.uci.edu/3176 Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Contrib: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Reviewed-by: Michael Blow <mb...@apache.org> --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java D asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutorContext.java D asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/NoOpStatementExecutorContext.java M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ActiveRequestsRequest.java M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ExecuteStatementRequestMessage.java M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java 6 files changed, 3 insertions(+), 126 deletions(-) Approvals: Jenkins: Verified; No violations found; ; Verified Michael Blow: Looks good to me, approved diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java index a37f802..15267aa 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/algebra/extension/ExtensionStatement.java @@ -22,7 +22,6 @@ import org.apache.asterix.metadata.declared.MetadataProvider; import org.apache.asterix.translator.IRequestParameters; import org.apache.asterix.translator.IStatementExecutor; -import org.apache.asterix.translator.IStatementExecutorContext; import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException; import org.apache.hyracks.api.client.IHyracksClientConnection; import org.apache.hyracks.api.exceptions.HyracksDataException; @@ -46,11 +45,10 @@ * @param requestParameters * @param metadataProvider * @param resultSetId - * @param executorCtx * @throws HyracksDataException * @throws AlgebricksException */ public abstract void handle(IHyracksClientConnection hcc, IStatementExecutor statementExecutor, - IRequestParameters requestParameters, MetadataProvider metadataProvider, int resultSetId, - IStatementExecutorContext executorCtx) throws HyracksDataException, AlgebricksException; + IRequestParameters requestParameters, MetadataProvider metadataProvider, int resultSetId) + throws HyracksDataException, AlgebricksException; } \ No newline at end of file diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutorContext.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutorContext.java deleted file mode 100644 index 9648036..0000000 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/IStatementExecutorContext.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.asterix.translator; - -import java.util.Map; - -import org.apache.asterix.common.api.IClientRequest; - -/** - * @deprecated (use IRequestTracker) - */ -@Deprecated -public interface IStatementExecutorContext { - - /** - * Gets the client request from the user-provided client context id. - * - * @param clientContextId, - * a user provided client context id. - * @return the client request - */ - IClientRequest get(String clientContextId); - - /** - * Puts a client context id for a statement and the corresponding request. - * - * @param clientContextId, - * a user provided client context id. - * @param req, - * the Hyracks job id of class {@link org.apache.hyracks.api.job.JobId}. - */ - void put(String clientContextId, IClientRequest req); - - /** - * Removes the information about the query corresponding to a user-provided client context id. - * - * @param clientContextId, - * a user provided client context id. - */ - IClientRequest remove(String clientContextId); - - /** - * @return The currently running requests - */ - Map<String, IClientRequest> getRunningRequests(); -} diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/NoOpStatementExecutorContext.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/NoOpStatementExecutorContext.java deleted file mode 100644 index a2a7906..0000000 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/NoOpStatementExecutorContext.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.asterix.translator; - -import java.util.Collections; -import java.util.Map; - -import org.apache.asterix.common.api.IClientRequest; - -public class NoOpStatementExecutorContext implements IStatementExecutorContext { - - public static final NoOpStatementExecutorContext INSTANCE = new NoOpStatementExecutorContext(); - - private NoOpStatementExecutorContext() { - } - - @Override - public IClientRequest get(String clientContextId) { - return null; - } - - @Override - public void put(String clientContextId, IClientRequest req) { - // Dummy for when a statement doesn't support cancellation - } - - @Override - public IClientRequest remove(String clientContextId) { - return null; - } - - @Override - public Map<String, IClientRequest> getRunningRequests() { - return Collections.emptyMap(); - } -} diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ActiveRequestsRequest.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ActiveRequestsRequest.java index 3ae18a7..551073b 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ActiveRequestsRequest.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ActiveRequestsRequest.java @@ -23,11 +23,8 @@ import org.apache.asterix.common.api.IClientRequest; import org.apache.asterix.common.dataflow.ICcApplicationContext; import org.apache.asterix.common.messaging.api.ICcAddressedMessage; -import org.apache.asterix.hyracks.bootstrap.CCApplication; import org.apache.asterix.messaging.CCMessageBroker; -import org.apache.asterix.translator.IStatementExecutorContext; import org.apache.hyracks.api.exceptions.HyracksDataException; -import org.apache.hyracks.control.cc.ClusterControllerService; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ExecuteStatementRequestMessage.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ExecuteStatementRequestMessage.java index fdc4432..a89728c 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ExecuteStatementRequestMessage.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/ExecuteStatementRequestMessage.java @@ -48,7 +48,6 @@ import org.apache.asterix.om.base.IAObject; import org.apache.asterix.translator.IRequestParameters; import org.apache.asterix.translator.IStatementExecutor; -import org.apache.asterix.translator.IStatementExecutorContext; import org.apache.asterix.translator.IStatementExecutorFactory; import org.apache.asterix.translator.ResultProperties; import org.apache.asterix.translator.SessionConfig; diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java index 2a1ed4f..df285c6 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java @@ -162,7 +162,6 @@ import org.apache.asterix.translator.ExecutionPlansHtmlPrintUtil; import org.apache.asterix.translator.IRequestParameters; import org.apache.asterix.translator.IStatementExecutor; -import org.apache.asterix.translator.NoOpStatementExecutorContext; import org.apache.asterix.translator.SessionConfig; import org.apache.asterix.translator.SessionOutput; import org.apache.asterix.translator.TypeTranslator; @@ -401,9 +400,8 @@ // No op break; case EXTENSION: - //TODO remove deprecated statement executor context ((ExtensionStatement) stmt).handle(hcc, this, requestParameters, metadataProvider, - resultSetIdCounter, NoOpStatementExecutorContext.INSTANCE); + resultSetIdCounter); break; default: throw new CompilationException(ErrorCode.COMPILATION_ILLEGAL_STATE, stmt.getSourceLocation(), -- To view, visit https://asterix-gerrit.ics.uci.edu/3176 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: If591454c91e79f6965aca21554f3d2e7a0189278 Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Murtadha Hubail <mhub...@apache.org> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Gerrit-Reviewer: Michael Blow <mb...@apache.org> Gerrit-Reviewer: Murtadha Hubail <mhub...@apache.org> Gerrit-Reviewer: Till Westmann <ti...@apache.org>