Repository: asterixdb
Updated Branches:
  refs/heads/master 7ec813cc5 -> 0ff0d6cc9


[NO ISSUE][STO] Correct Metadata Datasets VBC Partitions

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

Details:
- Ensure metadata datasets number of VBCs is
  always one.

Change-Id: I3217129dcf250287f6ccdf3223fad00a6b2fd66f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2422
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: abdullah alamoudi <bamou...@gmail.com>


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

Branch: refs/heads/master
Commit: 0ff0d6cc9d3149b46d2d461d8cabd3622d537404
Parents: 7ec813c
Author: Murtadha Hubail <mhub...@apache.org>
Authored: Sat Feb 24 09:47:12 2018 +0300
Committer: Murtadha Hubail <mhub...@apache.org>
Committed: Mon Feb 26 14:43:01 2018 -0800

----------------------------------------------------------------------
 .../asterix/common/context/DatasetLifecycleManager.java     | 7 ++++++-
 .../common/metadata/MetadataIndexImmutableProperties.java   | 9 +++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0ff0d6cc/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
index 9de8f73..f25e4f6 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
@@ -18,6 +18,8 @@
  */
 package org.apache.asterix.common.context;
 
+import static 
org.apache.asterix.common.metadata.MetadataIndexImmutableProperties.METADATA_DATASETS_PARTITIONS;
+
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.ArrayList;
@@ -33,6 +35,7 @@ import org.apache.asterix.common.config.StorageProperties;
 import org.apache.asterix.common.dataflow.DatasetLocalResource;
 import org.apache.asterix.common.exceptions.ACIDException;
 import org.apache.asterix.common.ioopcallbacks.AbstractLSMIOOperationCallback;
+import org.apache.asterix.common.metadata.MetadataIndexImmutableProperties;
 import org.apache.asterix.common.replication.IReplicationStrategy;
 import org.apache.asterix.common.storage.DatasetResourceReference;
 import org.apache.asterix.common.storage.IIndexCheckpointManagerProvider;
@@ -237,8 +240,10 @@ public class DatasetLifecycleManager implements 
IDatasetLifecycleManager, ILifeC
             dsr = datasets.get(did);
             if (dsr == null) {
                 DatasetInfo dsInfo = new DatasetInfo(did);
+                int partitions = 
MetadataIndexImmutableProperties.isMetadataDataset(did) ? 
METADATA_DATASETS_PARTITIONS
+                        : numPartitions;
                 DatasetVirtualBufferCaches vbcs = new 
DatasetVirtualBufferCaches(did, storageProperties,
-                        memoryManager.getNumPages(did), numPartitions);
+                        memoryManager.getNumPages(did), partitions);
                 dsr = new DatasetResource(dsInfo, vbcs);
                 datasets.put(did, dsr);
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0ff0d6cc/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/metadata/MetadataIndexImmutableProperties.java
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/metadata/MetadataIndexImmutableProperties.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/metadata/MetadataIndexImmutableProperties.java
index 8b4c779..2d6bb17 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/metadata/MetadataIndexImmutableProperties.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/metadata/MetadataIndexImmutableProperties.java
@@ -19,13 +19,14 @@
 package org.apache.asterix.common.metadata;
 
 public class MetadataIndexImmutableProperties {
-    private final String indexName;
-    private final int datasetId;
-    private final long resourceId;
 
-    // TODO(till? should we reconsider these numbers?!)
     public static final int FIRST_AVAILABLE_EXTENSION_METADATA_DATASET_ID = 52;
     public static final int FIRST_AVAILABLE_USER_DATASET_ID = 100;
+    public static final int METADATA_DATASETS_PARTITIONS = 1;
+
+    private final String indexName;
+    private final int datasetId;
+    private final long resourceId;
 
     public MetadataIndexImmutableProperties(String indexName, int datasetId, 
long resourceId) {
         this.indexName = indexName;

Reply via email to