abdullah alamoudi has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1690

Change subject: Replace Algebricks Pair with Common's Pair
......................................................................

Replace Algebricks Pair with Common's Pair

Change-Id: I79061a62b520694bd8e59983fd53b4e93a6f5064
---
M asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
M 
asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
M asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADRuleSetFactory.java
M 
asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
M 
asterix-bad/src/main/java/org/apache/asterix/bad/metadata/BADMetadataExtension.java
M 
asterix-bad/src/main/java/org/apache/asterix/bad/rules/InsertBrokerNotifierForChannelRule.java
M asterix-bad/src/main/resources/lang-extension/lang.txt
7 files changed, 63 insertions(+), 62 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-bad 
refs/changes/90/1690/1

diff --git 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
index 1d46bc4..ac25ac7 100644
--- 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
+++ 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADLangExtension.java
@@ -35,8 +35,8 @@
 import org.apache.asterix.compiler.provider.SqlppCompilationProvider;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.metadata.MetadataTransactionContext;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.algebricks.common.utils.Pair;
 
 public class BADLangExtension implements ILangExtension {
 
@@ -67,7 +67,6 @@
     public ExtensionKind getExtensionKind() {
         return ExtensionKind.LANG;
     }
-
 
     public static Broker getBroker(MetadataTransactionContext mdTxnCtx, String 
dataverseName, String brokerName)
             throws AlgebricksException {
diff --git 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
index 20519dd..9a916ca 100644
--- 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
+++ 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADQueryTranslatorExtension.java
@@ -23,12 +23,12 @@
 import org.apache.asterix.app.cc.IStatementExecutorExtension;
 import org.apache.asterix.common.api.ExtensionId;
 import org.apache.asterix.translator.IStatementExecutorFactory;
-import org.apache.hyracks.algebricks.common.utils.Pair;
+import org.apache.commons.lang3.tuple.Pair;
 
 public class BADQueryTranslatorExtension implements 
IStatementExecutorExtension {
 
-    public static final ExtensionId BAD_QUERY_TRANSLATOR_EXTENSION_ID = new 
ExtensionId(
-            BADQueryTranslatorExtension.class.getSimpleName(), 0);
+    public static final ExtensionId BAD_QUERY_TRANSLATOR_EXTENSION_ID =
+            new ExtensionId(BADQueryTranslatorExtension.class.getSimpleName(), 
0);
 
     private static class LazyHolder {
         private static final IStatementExecutorFactory INSTANCE = new 
BADQueryTranslatorFactory();
diff --git 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADRuleSetFactory.java 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADRuleSetFactory.java
index 7e45fd6..6d42842 100644
--- 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADRuleSetFactory.java
+++ 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADRuleSetFactory.java
@@ -26,8 +26,8 @@
 import org.apache.asterix.compiler.provider.IRuleSetFactory;
 import org.apache.asterix.optimizer.base.RuleCollections;
 import org.apache.asterix.optimizer.rules.UnnestToDataScanRule;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.algebricks.common.utils.Pair;
 import 
org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController;
 import org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController;
 import org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
@@ -37,7 +37,8 @@
     @Override
     public List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> 
getLogicalRewrites()
             throws AlgebricksException {
-        List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> 
logicalRuleSet = DefaultRuleSetFactory.buildLogical();
+        List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> 
logicalRuleSet =
+                DefaultRuleSetFactory.buildLogical();
 
         List<IAlgebraicRewriteRule> normalizationCollection = 
RuleCollections.buildNormalizationRuleCollection();
         List<IAlgebraicRewriteRule> alteredNormalizationCollection = new 
ArrayList<>();
@@ -54,8 +55,8 @@
 
         //Find instances of the normalization collection and replace them with 
the new one
         SequentialOnceRuleController seqOnceCtrl = new 
SequentialOnceRuleController(true);
-        for (int i =0; i < logicalRuleSet.size(); i++){
-            List<IAlgebraicRewriteRule> collection = 
logicalRuleSet.get(i).second;
+        for (int i = 0; i < logicalRuleSet.size(); i++) {
+            List<IAlgebraicRewriteRule> collection = 
logicalRuleSet.get(i).getRight();
             if (collection.size() == normalizationCollection.size()) {
                 boolean isNormalizationCollection = true;
                 for (int j = 0; j < collection.size(); j++) {
@@ -67,7 +68,7 @@
                 }
                 if (isNormalizationCollection) {
                     //replace with the new collection
-                    logicalRuleSet.set(i, new Pair<>(seqOnceCtrl, 
alteredNormalizationCollection));
+                    logicalRuleSet.set(i, Pair.of(seqOnceCtrl, 
alteredNormalizationCollection));
                 }
             }
         }
diff --git 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
index ae6886a..492a98c 100644
--- 
a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
+++ 
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
@@ -59,8 +59,8 @@
 import org.apache.asterix.translator.IStatementExecutor;
 import org.apache.asterix.translator.IStatementExecutor.ResultDelivery;
 import org.apache.asterix.translator.IStatementExecutor.Stats;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.algebricks.common.utils.Pair;
 import org.apache.hyracks.api.client.IHyracksClientConnection;
 import org.apache.hyracks.api.dataset.IHyracksDataset;
 import org.apache.hyracks.api.dataset.ResultSetId;
@@ -87,7 +87,7 @@
             Expression period) {
         this.signature = signature;
         this.functionBody = functionBody;
-        this.paramList = new ArrayList<String>();
+        this.paramList = new ArrayList<>();
         for (VarIdentifier varId : parameterList) {
             this.paramList.add(varId.getValue());
         }
@@ -168,28 +168,29 @@
             throw new CompilationException("Procedure can only execute a 
single statement");
         }
         if (fStatements.get(0).getKind() == Statement.Kind.INSERT) {
-            return new Pair<>(((QueryTranslator) 
statementExecutor).handleInsertUpsertStatement(metadataProvider,
+            return Pair.of(
+                    ((QueryTranslator) 
statementExecutor).handleInsertUpsertStatement(metadataProvider,
                             fStatements.get(0), hcc, hdc, 
ResultDelivery.ASYNC, stats, true, null, null),
                     PrecompiledType.INSERT);
         } else if (fStatements.get(0).getKind() == Statement.Kind.QUERY) {
             Pair<JobSpecification, PrecompiledType> pair =
-                    new Pair<>(compileQueryJob(statementExecutor, 
metadataProvider, hcc, (Query) fStatements.get(0)),
+                    Pair.of(compileQueryJob(statementExecutor, 
metadataProvider, hcc, (Query) fStatements.get(0)),
                             PrecompiledType.QUERY);
             metadataProvider.getLocks().unlock();
             return pair;
         } else if (fStatements.get(0).getKind() == Statement.Kind.DELETE) {
             AqlDeleteRewriteVisitor visitor = new AqlDeleteRewriteVisitor();
             fStatements.get(0).accept(visitor, null);
-            return new Pair<>(((QueryTranslator) 
statementExecutor).handleDeleteStatement(metadataProvider,
+            return Pair.of(((QueryTranslator) 
statementExecutor).handleDeleteStatement(metadataProvider,
                     fStatements.get(0), hcc, true), PrecompiledType.DELETE);
-        }else{
+        } else {
             throw new CompilationException("Procedure can only execute a 
single delete, insert, or query");
         }
     }
 
     private void setupDistributedJob(EntityId entityId, JobSpecification 
jobSpec, IHyracksClientConnection hcc,
             PrecompiledJobEventListener listener, ResultSetId resultSetId, 
IHyracksDataset hdc, Stats stats)
-                    throws Exception {
+            throws Exception {
         JobId jobId = hcc.distributeJob(jobSpec);
         listener.storeDistributedInfo(jobId, null, new ResultReader(hdc, 
jobId, resultSetId));
     }
@@ -249,11 +250,11 @@
             // Now we subscribe
             if (listener == null) {
                 //TODO: Add datasets used by channel function
-                listener = new PrecompiledJobEventListener(entityId, 
procedureJobSpec.second, new ArrayList<>());
+                listener = new PrecompiledJobEventListener(entityId, 
procedureJobSpec.getRight(), new ArrayList<>());
                 
ActiveJobNotificationHandler.INSTANCE.registerListener(listener);
             }
-            setupDistributedJob(entityId, procedureJobSpec.first, hcc, 
listener, tempMdProvider.getResultSetId(), hdc,
-                    stats);
+            setupDistributedJob(entityId, procedureJobSpec.getLeft(), hcc, 
listener, tempMdProvider.getResultSetId(),
+                    hdc, stats);
 
             MetadataManager.INSTANCE.addEntity(mdTxnCtx, procedure);
             MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
diff --git 
a/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/BADMetadataExtension.java
 
b/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/BADMetadataExtension.java
index cd4470f..ee4afc1 100644
--- 
a/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/BADMetadataExtension.java
+++ 
b/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/BADMetadataExtension.java
@@ -36,14 +36,14 @@
 import 
org.apache.asterix.metadata.entitytupletranslators.MetadataTupleTranslatorProvider;
 import org.apache.asterix.metadata.utils.MetadataUtil;
 import org.apache.asterix.runtime.formats.NonTaggedDataFormat;
-import org.apache.hyracks.algebricks.common.utils.Pair;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.hyracks.api.application.INCServiceContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public class BADMetadataExtension implements IMetadataExtension {
 
-    public static final ExtensionId BAD_METADATA_EXTENSION_ID = new 
ExtensionId(
-            BADConstants.BAD_METADATA_EXTENSION_NAME, 0);
+    public static final ExtensionId BAD_METADATA_EXTENSION_ID =
+            new ExtensionId(BADConstants.BAD_METADATA_EXTENSION_NAME, 0);
     public static final Dataverse BAD_DATAVERSE = new 
Dataverse(BADConstants.BAD_DATAVERSE_NAME,
             NonTaggedDataFormat.class.getName(), MetadataUtil.PENDING_NO_OP);
 
diff --git 
a/asterix-bad/src/main/java/org/apache/asterix/bad/rules/InsertBrokerNotifierForChannelRule.java
 
b/asterix-bad/src/main/java/org/apache/asterix/bad/rules/InsertBrokerNotifierForChannelRule.java
index d83b606..f78fb93 100644
--- 
a/asterix-bad/src/main/java/org/apache/asterix/bad/rules/InsertBrokerNotifierForChannelRule.java
+++ 
b/asterix-bad/src/main/java/org/apache/asterix/bad/rules/InsertBrokerNotifierForChannelRule.java
@@ -33,8 +33,8 @@
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.commons.lang3.mutable.Mutable;
 import org.apache.commons.lang3.mutable.MutableObject;
+import org.apache.commons.lang3.tuple.MutablePair;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
-import org.apache.hyracks.algebricks.common.utils.Pair;
 import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
 import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
 import org.apache.hyracks.algebricks.core.algebra.base.ILogicalPlan;
@@ -112,7 +112,7 @@
         //Now we want to make sure and set the commit to be a nonsink commit
         ((CommitOperator) eOp.getDelegate()).setSink(false);
 
-        //Now we need to get the broker EndPoint 
+        //Now we need to get the broker EndPoint
         LogicalVariable brokerEndpointVar = context.newVar();
         AbstractLogicalOperator opAboveBrokersScan = findOp(op, "brokers");
         AssignOperator assignOp = 
createbrokerEndPointAssignOperator(brokerEndpointVar, opAboveBrokersScan);
@@ -126,8 +126,8 @@
         LogicalVariable subscriptionIdVar = 
subscriptionsScan.getVariables().get(0);
 
         //The channelExecutionTime is created just before the scan
-        LogicalVariable channelExecutionVar = ((AssignOperator) 
subscriptionsScan.getInputs().get(0).getValue())
-                .getVariables().get(0);
+        LogicalVariable channelExecutionVar =
+                ((AssignOperator) 
subscriptionsScan.getInputs().get(0).getValue()).getVariables().get(0);
 
         ProjectOperator badProject = (ProjectOperator) findOp(op, "project");
         badProject.getVariables().add(subscriptionIdVar);
@@ -147,18 +147,18 @@
     private DelegateOperator createNotifyBrokerPlan(LogicalVariable 
brokerEndpointVar,
             LogicalVariable subscriptionIdVar, LogicalVariable 
channelExecutionVar, IOptimizationContext context,
             ILogicalOperator eOp, DistributeResultOperator distributeOp, 
String channelDataverse, String channelName)
-                    throws AlgebricksException {
+            throws AlgebricksException {
         //create the Distinct Op
-        ArrayList<Mutable<ILogicalExpression>> expressions = new 
ArrayList<Mutable<ILogicalExpression>>();
+        ArrayList<Mutable<ILogicalExpression>> expressions = new ArrayList<>();
         VariableReferenceExpression vExpr = new 
VariableReferenceExpression(subscriptionIdVar);
         expressions.add(new MutableObject<ILogicalExpression>(vExpr));
         DistinctOperator distinctOp = new DistinctOperator(expressions);
 
         //create the GroupBy Op
         //And set the distinct as input
-        List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> groupByList = 
new ArrayList<Pair<LogicalVariable, Mutable<ILogicalExpression>>>();
-        List<Pair<LogicalVariable, Mutable<ILogicalExpression>>> 
groupByDecorList = new ArrayList<Pair<LogicalVariable, 
Mutable<ILogicalExpression>>>();
-        List<ILogicalPlan> nestedPlans = new ArrayList<ILogicalPlan>();
+        List<MutablePair<LogicalVariable, Mutable<ILogicalExpression>>> 
groupByList = new ArrayList<>();
+        List<MutablePair<LogicalVariable, Mutable<ILogicalExpression>>> 
groupByDecorList = new ArrayList<>();
+        List<ILogicalPlan> nestedPlans = new ArrayList<>();
 
         //create group by operator
         GroupByOperator groupbyOp = new GroupByOperator(groupByList, 
groupByDecorList, nestedPlans);
@@ -167,18 +167,18 @@
         groupbyOp.getInputs().add(new 
MutableObject<ILogicalOperator>(distinctOp));
 
         //create nested plan for subscription ids in group by
-        NestedTupleSourceOperator nestedTupleSourceOp = new 
NestedTupleSourceOperator(
-                new MutableObject<ILogicalOperator>(groupbyOp));
+        NestedTupleSourceOperator nestedTupleSourceOp =
+                new NestedTupleSourceOperator(new 
MutableObject<ILogicalOperator>(groupbyOp));
         //TODO: This is from translationcontext. It might be needed to make 
the variable exist outside of the subplan
         //LogicalVariable subscriptionListVar = context.newSubplanOutputVar();
         LogicalVariable subscriptionListVar = context.newVar();
-        List<LogicalVariable> aggVars = new ArrayList<LogicalVariable>();
+        List<LogicalVariable> aggVars = new ArrayList<>();
         aggVars.add(subscriptionListVar);
         AggregateFunctionCallExpression funAgg = 
BuiltinFunctions.makeAggregateFunctionExpression(
                 BuiltinFunctions.LISTIFY, new 
ArrayList<Mutable<ILogicalExpression>>());
         funAgg.getArguments()
                 .add(new MutableObject<ILogicalExpression>(new 
VariableReferenceExpression(subscriptionIdVar)));
-        List<Mutable<ILogicalExpression>> aggExpressions = new 
ArrayList<Mutable<ILogicalExpression>>();
+        List<Mutable<ILogicalExpression>> aggExpressions = new ArrayList<>();
         aggExpressions.add(new MutableObject<ILogicalExpression>(funAgg));
         AggregateOperator listifyOp = new AggregateOperator(aggVars, 
aggExpressions);
         listifyOp.getInputs().add(new 
MutableObject<ILogicalOperator>(nestedTupleSourceOp));
@@ -187,8 +187,8 @@
         nestedPlans.add(new ALogicalPlanImpl(new 
MutableObject<ILogicalOperator>(listifyOp)));
 
         //Create the NotifyBrokerOperator
-        NotifyBrokerOperator notifyBrokerOp = new 
NotifyBrokerOperator(brokerEndpointVar, subscriptionListVar,
-                channelExecutionVar);
+        NotifyBrokerOperator notifyBrokerOp =
+                new NotifyBrokerOperator(brokerEndpointVar, 
subscriptionListVar, channelExecutionVar);
         EntityId activeId = new EntityId(BADConstants.CHANNEL_EXTENSION_NAME, 
channelDataverse, channelName);
         NotifyBrokerPOperator notifyBrokerPOp = new 
NotifyBrokerPOperator(activeId);
         notifyBrokerOp.setPhysicalOperator(notifyBrokerPOp);
@@ -197,7 +197,7 @@
         extensionOp.getInputs().add(new 
MutableObject<ILogicalOperator>(groupbyOp));
 
         //Set the input for the brokerNotify as the replicate operator
-        distinctOp.getInputs().add(new MutableObject<ILogicalOperator>(eOp));
+        distinctOp.getInputs().add(new MutableObject<>(eOp));
 
         //compute environment bottom up
 
@@ -214,7 +214,7 @@
     @SuppressWarnings("unchecked")
     private AssignOperator createbrokerEndPointAssignOperator(LogicalVariable 
brokerEndpointVar,
             AbstractLogicalOperator opAboveBrokersScan) {
-        Mutable<ILogicalExpression> fieldRef = new 
MutableObject<ILogicalExpression>(
+        Mutable<ILogicalExpression> fieldRef = new MutableObject<>(
                 new ConstantExpression(new AsterixConstantValue(new 
AString(BADConstants.BrokerEndPoint))));
         DataSourceScanOperator brokerScan = null;
         int index = 0;
@@ -225,14 +225,14 @@
             }
             index++;
         }
-        Mutable<ILogicalExpression> varRef = new 
MutableObject<ILogicalExpression>(
-                new 
VariableReferenceExpression(brokerScan.getVariables().get(2)));
+        Mutable<ILogicalExpression> varRef =
+                new MutableObject<>(new 
VariableReferenceExpression(brokerScan.getVariables().get(2)));
 
         ScalarFunctionCallExpression fieldAccessByName = new 
ScalarFunctionCallExpression(
                 
FunctionUtil.getFunctionInfo(BuiltinFunctions.FIELD_ACCESS_BY_NAME), varRef, 
fieldRef);
-        ArrayList<LogicalVariable> varArray = new 
ArrayList<LogicalVariable>(1);
+        ArrayList<LogicalVariable> varArray = new ArrayList<>(1);
         varArray.add(brokerEndpointVar);
-        ArrayList<Mutable<ILogicalExpression>> exprArray = new 
ArrayList<Mutable<ILogicalExpression>>(1);
+        ArrayList<Mutable<ILogicalExpression>> exprArray = new ArrayList<>(1);
         exprArray.add(new 
MutableObject<ILogicalExpression>(fieldAccessByName));
 
         AssignOperator assignOp = new AssignOperator(varArray, exprArray);
@@ -257,8 +257,8 @@
                 if (isBrokerScan((AbstractLogicalOperator) subOp.getValue())) {
                     return op;
                 } else {
-                    AbstractLogicalOperator nestedOp = 
findOp((AbstractLogicalOperator) subOp.getValue(),
-                            lookingForString);
+                    AbstractLogicalOperator nestedOp =
+                            findOp((AbstractLogicalOperator) subOp.getValue(), 
lookingForString);
                     if (nestedOp != null) {
                         return nestedOp;
                     }
@@ -268,8 +268,8 @@
                 if (subOp.getValue().getOperatorTag() == 
LogicalOperatorTag.PROJECT) {
                     return (AbstractLogicalOperator) subOp.getValue();
                 } else {
-                    AbstractLogicalOperator nestedOp = 
findOp((AbstractLogicalOperator) subOp.getValue(),
-                            lookingForString);
+                    AbstractLogicalOperator nestedOp =
+                            findOp((AbstractLogicalOperator) subOp.getValue(), 
lookingForString);
                     if (nestedOp != null) {
                         return nestedOp;
                     }
@@ -280,8 +280,8 @@
                 if (isSubscriptionsScan((AbstractLogicalOperator) 
subOp.getValue(), lookingForString)) {
                     return (AbstractLogicalOperator) subOp.getValue();
                 } else {
-                    AbstractLogicalOperator nestedOp = 
findOp((AbstractLogicalOperator) subOp.getValue(),
-                            lookingForString);
+                    AbstractLogicalOperator nestedOp =
+                            findOp((AbstractLogicalOperator) subOp.getValue(), 
lookingForString);
                     if (nestedOp != null) {
                         return nestedOp;
                     }
diff --git a/asterix-bad/src/main/resources/lang-extension/lang.txt 
b/asterix-bad/src/main/resources/lang-extension/lang.txt
index adce6ed..69cff05 100644
--- a/asterix-bad/src/main/resources/lang-extension/lang.txt
+++ b/asterix-bad/src/main/resources/lang-extension/lang.txt
@@ -75,11 +75,11 @@
     before:
     after:    | "channel" pairId = QualifiedName() ifExists = IfExists()
       {
-        stmt = new ChannelDropStatement(pairId.first, pairId.second, ifExists);
+        stmt = new ChannelDropStatement(pairId.getLeft(), pairId.getRight(), 
ifExists);
       }
               | "broker" pairId = QualifiedName() ifExists = IfExists()
       {
-        stmt = new BrokerDropStatement(pairId.first, pairId.second, ifExists); 
+        stmt = new BrokerDropStatement(pairId.getLeft(), pairId.getRight(), 
ifExists); 
       }
               | "procedure" funcSig = FunctionSignature() ifExists = IfExists()
       {
@@ -94,7 +94,7 @@
 @new
 CreateChannelStatement ChannelSpecification() throws ParseException:
 {
-  Pair<Identifier,Identifier> nameComponents = null;
+  MutablePair<Identifier,Identifier> nameComponents = null;
   FunctionSignature appliedFunction = null;
   CreateChannelStatement ccs = null;
   String fqFunctionName = null;
@@ -107,8 +107,8 @@
     <USING> appliedFunction = FunctionSignature()
     "period" period = FunctionCallExpr() ("nondistributed" { distributed = 
false; })?
     {
-      ccs = new CreateChannelStatement(nameComponents.first,
-                                   nameComponents.second, appliedFunction, 
period, distributed);
+      ccs = new CreateChannelStatement(nameComponents.getLeft(),
+                                   nameComponents.getRight(), appliedFunction, 
period, distributed);
     }
   )
     {
@@ -182,7 +182,7 @@
 CreateBrokerStatement BrokerSpecification() throws ParseException:
 {
   CreateBrokerStatement cbs = null;
-  Pair<Identifier,Identifier> name = null;
+  MutablePair<Identifier,Identifier> name = null;
   String endPoint = null;
 }
 {
@@ -190,7 +190,7 @@
     "broker"  name = QualifiedName()
     <AT>  endPoint = StringLiteral()
     {
-      cbs = new CreateBrokerStatement(name.first, name.second,endPoint);
+      cbs = new CreateBrokerStatement(name.getLeft(), 
name.getRight(),endPoint);
     }
   )
     {
@@ -202,12 +202,12 @@
 Statement ChannelSubscriptionStatement() throws ParseException:
 {
   Statement stmt = null;
-  Pair<Identifier,Identifier> nameComponents = null;
+  MutablePair<Identifier,Identifier> nameComponents = null;
   List<Expression> argList = new ArrayList<Expression>();
   Expression tmp = null;
   String id = null;
   String subscriptionId = null;
-  Pair<Identifier,Identifier> brokerName = null;
+  MutablePair<Identifier,Identifier> brokerName = null;
 }
 {
   (
@@ -222,7 +222,7 @@
    }
    )*)? <RIGHTPAREN> <ON> brokerName = QualifiedName()
    {
-      stmt = new ChannelSubscribeStatement(nameComponents.first, 
nameComponents.second, argList, getVarCounter(), brokerName.first, 
brokerName.second, subscriptionId);
+      stmt = new ChannelSubscribeStatement(nameComponents.getLeft(), 
nameComponents.getRight(), argList, getVarCounter(), brokerName.getLeft(), 
brokerName.getRight(), subscriptionId);
    }
    | "unsubscribe" id = StringLiteral() <FROM> nameComponents = QualifiedName()
       {
@@ -231,7 +231,7 @@
         varExp.setVar(var);
         var.setValue("$subscriptionPlaceholder");
         getCurrentScope().addNewVarSymbolToScope(varExp.getVar());
-        stmt = new ChannelUnsubscribeStatement(varExp, nameComponents.first, 
nameComponents.second, id, getVarCounter());
+        stmt = new ChannelUnsubscribeStatement(varExp, 
nameComponents.getLeft(), nameComponents.getRight(), id, getVarCounter());
       }
      | "change" "subscription" subscriptionId = StringLiteral()  <ON> 
nameComponents = QualifiedName()
        <LEFTPAREN> (tmp = Expression()
@@ -245,7 +245,7 @@
        )*)? <RIGHTPAREN>
         <TO> brokerName = QualifiedName()
       {
-        stmt = new ChannelSubscribeStatement(nameComponents.first, 
nameComponents.second, argList, getVarCounter(), brokerName.first, 
brokerName.second, subscriptionId);
+        stmt = new ChannelSubscribeStatement(nameComponents.getLeft(), 
nameComponents.getRight(), argList, getVarCounter(), brokerName.getLeft(), 
brokerName.getRight(), subscriptionId);
       }
     )
     {

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1690
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79061a62b520694bd8e59983fd53b4e93a6f5064
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamou...@gmail.com>

Reply via email to