asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject asterixdb-bad git commit: Remove explicit creation of metadata provider config
Date Tue, 15 Aug 2017 00:52:39 GMT
Repository: asterixdb-bad
Updated Branches:
  refs/heads/master 3292476e4 -> 432355a90


Remove explicit creation of metadata provider config

Change-Id: I230bf98b9a794480bbce6ec6d4511ce5deb5d07c


Project: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/commit/432355a9
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/tree/432355a9
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb-bad/diff/432355a9

Branch: refs/heads/master
Commit: 432355a902a6feee7688817e5456284c27cd30c2
Parents: 3292476
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Mon Aug 14 17:27:09 2017 -0700
Committer: Abdullah Alamoudi <bamousaa@gmail.com>
Committed: Mon Aug 14 17:27:09 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/asterix/bad/lang/BADStatementExecutor.java  | 2 +-
 .../apache/asterix/bad/lang/statement/ChannelDropStatement.java | 2 +-
 .../asterix/bad/lang/statement/ChannelSubscribeStatement.java   | 5 +----
 .../asterix/bad/lang/statement/ChannelUnsubscribeStatement.java | 2 +-
 .../asterix/bad/lang/statement/CreateChannelStatement.java      | 3 +--
 .../asterix/bad/lang/statement/CreateProcedureStatement.java    | 5 +----
 6 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/432355a9/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
index bc17a7d..56de450 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/BADStatementExecutor.java
@@ -58,7 +58,7 @@ public class BADStatementExecutor extends QueryTranslator {
         Identifier dvId = ((DataverseDropStatement) stmt).getDataverseName();
         List<Broker> brokers = BADLangExtension.getBrokers(mdTxnCtx, dvId.getValue());
         MetadataProvider tempMdProvider = new MetadataProvider(appCtx, metadataProvider.getDefaultDataverse());
-        tempMdProvider.setConfig(metadataProvider.getConfig());
+        tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
         for (Broker broker : brokers) {
             tempMdProvider.getLocks().reset();
             BrokerDropStatement drop = new BrokerDropStatement(dvId, new Identifier(broker.getBrokerName()),
false);

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/432355a9/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
index 907bd0e..7b676a7 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelDropStatement.java
@@ -120,7 +120,7 @@ public class ChannelDropStatement implements IExtensionStatement {
 
             //Create a metadata provider to use in nested jobs.
             MetadataProvider tempMdProvider = new MetadataProvider(appCtx, metadataProvider.getDefaultDataverse());
-            tempMdProvider.setConfig(metadataProvider.getConfig());
+            tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
             //Drop the Channel Datasets
             //TODO: Need to find some way to handle if this fails.
             //TODO: Prevent datasets for Channels from being dropped elsewhere

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/432355a9/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
index df8dab1..5460d3f 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelSubscribeStatement.java
@@ -182,13 +182,10 @@ public class ChannelSubscribeStatement implements IExtensionStatement
{
             }
             RecordConstructor recordCon = new RecordConstructor(fb);
             subscriptionTuple.setBody(recordCon);
-
             subscriptionTuple.setVarCounter(varCounter);
-
             MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
                     metadataProvider.getDefaultDataverse());
-            tempMdProvider.setConfig(metadataProvider.getConfig());
-
+            tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
             if (subscriptionId == null) {
                 //To create a new subscription
                 VariableExpr resultVar = new VariableExpr(new VarIdentifier("$result", 0));

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/432355a9/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
index 28d09df..100ff5f 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/ChannelUnsubscribeStatement.java
@@ -145,7 +145,7 @@ public class ChannelUnsubscribeStatement implements IExtensionStatement
{
             delete.accept(visitor, null);
             MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
                     metadataProvider.getDefaultDataverse());
-            tempMdProvider.setConfig(metadataProvider.getConfig());
+            tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
             ((QueryTranslator) statementExecutor).handleDeleteStatement(tempMdProvider, delete,
hcc, false);
             MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/432355a9/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
----------------------------------------------------------------------
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
index a43020f..83dd849 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
@@ -160,7 +160,6 @@ public class CreateChannelStatement implements IExtensionStatement {
         durationParser.parse(duration.toCharArray(), 0, duration.toCharArray().length, outputStream);
         this.resultsTableName = resultsTableName;
         this.subscriptionsTableName = subscriptionsTableName;
-
     }
 
     @Override
@@ -306,7 +305,7 @@ public class CreateChannelStatement implements IExtensionStatement {
             }
             MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
                     metadataProvider.getDefaultDataverse());
-            tempMdProvider.setConfig(metadataProvider.getConfig());
+            tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
             //Create Channel Datasets
             createDatasets(statementExecutor, subscriptionsName, resultsName, tempMdProvider,
hcc, hdc, dataverse);
             tempMdProvider.getLocks().reset();

http://git-wip-us.apache.org/repos/asf/asterixdb-bad/blob/432355a9/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
----------------------------------------------------------------------
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 1c497a8..e10fea9 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
@@ -226,14 +226,11 @@ public class CreateProcedureStatement implements IExtensionStatement
{
             if (alreadyActive) {
                 throw new AsterixException("Procedure " + signature.getName() + " is already
running");
             }
-
             procedure = new Procedure(dataverse, signature.getName(), signature.getArity(),
getParamList(),
                     Function.RETURNTYPE_VOID, getFunctionBody(), Function.LANGUAGE_AQL, duration);
-
             MetadataProvider tempMdProvider = new MetadataProvider(metadataProvider.getApplicationContext(),
                     metadataProvider.getDefaultDataverse());
-            tempMdProvider.setConfig(metadataProvider.getConfig());
-
+            tempMdProvider.getConfig().putAll(metadataProvider.getConfig());
             metadataProvider.setResultSetId(new ResultSetId(resultSetIdCounter++));
             boolean resultsAsync = resultDelivery == ResultDelivery.ASYNC || resultDelivery
== ResultDelivery.DEFERRED;
             metadataProvider.setResultAsyncMode(resultsAsync);


Mime
View raw message