asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject asterixdb git commit: [NO ISSUE][COMP] Set Default dataverse in MetadataProvider
Date Wed, 25 Oct 2017 04:24:46 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 62ee018ef -> 0292bdbbf


[NO ISSUE][COMP] Set Default dataverse in MetadataProvider

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- If MetadataProvider is created with null as the default
  dataverse, set it to the Builtin Default dataverse.

Change-Id: I652669c03f28fce84509c02c05374e2c39104d38
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2101
Reviewed-by: Michael Blow <mblow@apache.org>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


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

Branch: refs/heads/master
Commit: 0292bdbbfdf282ddd64c2ada72453e46bf1f8096
Parents: 62ee018
Author: Abdullah Alamoudi <bamousaa@gmail.com>
Authored: Tue Oct 24 19:20:50 2017 -0700
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Tue Oct 24 21:24:10 2017 -0700

----------------------------------------------------------------------
 .../asterix/metadata/declared/MetadataProvider.java       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0292bdbb/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
index d6a3f21..9271f33 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
@@ -62,6 +62,7 @@ import org.apache.asterix.formats.nontagged.LinearizeComparatorFactoryProvider;
 import org.apache.asterix.formats.nontagged.TypeTraitProvider;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.metadata.MetadataTransactionContext;
+import org.apache.asterix.metadata.bootstrap.MetadataBuiltinEntities;
 import org.apache.asterix.metadata.dataset.hints.DatasetHints.DatasetCardinalityHint;
 import org.apache.asterix.metadata.entities.Dataset;
 import org.apache.asterix.metadata.entities.DatasourceAdapter;
@@ -160,7 +161,7 @@ public class MetadataProvider implements IMetadataProvider<DataSourceId,
String>
 
     public MetadataProvider(ICcApplicationContext appCtx, Dataverse defaultDataverse) {
         this.appCtx = appCtx;
-        this.defaultDataverse = defaultDataverse;
+        this.defaultDataverse = defaultDataverse == null ? MetadataBuiltinEntities.DEFAULT_DATAVERSE
: defaultDataverse;
         this.storageComponentProvider = appCtx.getStorageComponentProvider();
         storageProperties = appCtx.getStorageProperties();
         locks = new LockList();
@@ -433,8 +434,11 @@ public class MetadataProvider implements IMetadataProvider<DataSourceId,
String>
             if (primaryIndex != null && (dataset.getDatasetType() != DatasetType.EXTERNAL))
{
                 isSecondary = !indexName.equals(primaryIndex.getIndexName());
             }
-            Index theIndex = isSecondary ? MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
-                    dataset.getDatasetName(), indexName) : primaryIndex;
+            Index theIndex =
+                    isSecondary
+                            ? MetadataManager.INSTANCE.getIndex(mdTxnCtx, dataset.getDataverseName(),
+                                    dataset.getDatasetName(), indexName)
+                            : primaryIndex;
             int numPrimaryKeys = dataset.getPrimaryKeys().size();
             RecordDescriptor outputRecDesc = JobGenHelper.mkRecordDescriptor(typeEnv, opSchema,
context);
             Pair<IFileSplitProvider, AlgebricksPartitionConstraint> spPc =


Mime
View raw message