asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhub...@apache.org
Subject [1/2] asterixdb git commit: Enable Replication Tests on Multi-NC Setup
Date Fri, 02 Dec 2016 04:20:02 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 4c958b2de -> 2772f12ac


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.query.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.query.aql
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.query.aql
new file mode 100644
index 0000000..3d525f6
--- /dev/null
+++ b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.query.aql
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+/*
+ * Test case Name  : metadata_node_recovery.aql
+ * Description     : Check that metadata node failover is done correctly.
+                     The test goes as follows:
+                     start 2 nodes, create a dataset, kill metadata node
+                     and wait until the failover complete, verify the
+                     dataset still exists.
+ * Expected Result : Success
+ * Date            : January 6 2016
+ */
+
+use dataverse TinySocial;
+
+count(
+for $x in dataset Metadata.Dataset
+where $x.DatasetName ='FacebookUsers'
+return $x.DatasetName
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.sleep.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.sleep.aql
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.sleep.aql
deleted file mode 100644
index 51b0e76..0000000
--- a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.4.sleep.aql
+++ /dev/null
@@ -1 +0,0 @@
-60000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.5.txnqar.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.5.txnqar.aql
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.5.txnqar.aql
deleted file mode 100644
index ac1c593..0000000
--- a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/queries/failover/metadata_node/metadata_node.5.txnqar.aql
+++ /dev/null
@@ -1,32 +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.
- */
-/*
- * Test case Name  : metadata_node_recovery.aql
- * Description     : Check that metadata node failover is done correctly.
-                     The test goes as follows:
-                     start 2 nodes, create a dataset, kill metadata node
-                     and wait until the failover complete, verify the
-                     dataset still exists.
- * Expected Result : Success
- * Date            : January 6 2016
- */
-
-use dataverse TinySocial;
-
-for $x in dataset Metadata.Dataset where $x.DatasetName ='FacebookUsers' return $x.DatasetName;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.10.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.10.adm
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.10.adm
index 2c3c039..b155305 100644
--- a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.10.adm
+++ b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.10.adm
@@ -1,131 +1,10 @@
 {
-    "cc": {
-        "configUri": "http://10.10.0.2:19002/admin/cluster/cc/config",
-        "statsUri": "http://10.10.0.2:19002/admin/cluster/cc/stats",
-        "threadDumpUri": "http://10.10.0.2:19002/admin/cluster/cc/threaddump"
-    },
-    "config": {
-        "api.port": 19002,
-        "cluster.partitions": {
-            "0": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: asterix_nc1",
-            "1": "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: asterix_nc1",
-            "2": "ID:2, Original Node: asterix_nc2, IODevice: 0, Active Node: asterix_nc2",
-            "3": "ID:3, Original Node: asterix_nc2, IODevice: 1, Active Node: asterix_nc2"
-        },
-        "compiler.framesize": 131072,
-        "compiler.groupmemory": 33554432,
-        "compiler.joinmemory": 33554432,
-        "compiler.pregelix.home": "~/pregelix",
-        "compiler.sortmemory": 33554432,
-        "core.dump.paths": {
-            "asterix_nc1": "/home/vagrant/asterix/logs//asterix_nc1",
-            "asterix_nc2": "/home/vagrant/asterix/logs//asterix_nc2"
-        },
-        "feed.central.manager.port": 4500,
-        "feed.max.threshold.period": 5,
-        "feed.memory.available.wait.timeout": 10,
-        "feed.memory.global.budget": 67108864,
-        "feed.pending.work.threshold": 50,
-        "feed.port": 19003,
-        "instance.name": "asterix",
-        "log.level": "INFO",
-        "max.wait.active.cluster": 60,
-        "metadata.callback.port": 0,
-        "metadata.node": "asterix_nc1",
-        "metadata.partition": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node:
asterix_nc1",
-        "metadata.port": 0,
-        "metadata.registration.timeout.secs": 60,
-        "node.partitions": {
-            "asterix_nc1": [
-                "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: asterix_nc1",
-                "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: asterix_nc1"
-            ],
-            "asterix_nc2": [
-                "ID:2, Original Node: asterix_nc2, IODevice: 0, Active Node: asterix_nc2",
-                "ID:3, Original Node: asterix_nc2, IODevice: 1, Active Node: asterix_nc2"
-            ]
-        },
-        "node.stores": {
-            "asterix_nc1": [
-                "/home/vagrant/asterix/p1/storage",
-                "/home/vagrant/asterix/p2/storage"
-            ],
-            "asterix_nc2": [
-                "/home/vagrant/asterix/p1/storage",
-                "/home/vagrant/asterix/p2/storage"
-            ]
-        },
-        "plot.activate": false,
-        "storage.buffercache.maxopenfiles": 214748364,
-        "storage.buffercache.pagesize": 131072,
-        "storage.buffercache.size": 536870912,
-        "storage.lsm.bloomfilter.falsepositiverate": 0.01,
-        "storage.memorycomponent.globalbudget": 1073741824,
-        "storage.memorycomponent.numcomponents": 2,
-        "storage.memorycomponent.numpages": 256,
-        "storage.memorycomponent.pagesize": 131072,
-        "storage.metadata.memorycomponent.numpages": 64,
-        "transaction.log.dirs": {
-            "asterix_nc1": "/home/vagrant/asterix/tx_logs",
-            "asterix_nc2": "/home/vagrant/asterix/tx_logs"
-        },
-        "txn.commitprofiler.reportinterval": 5,
-        "txn.job.recovery.memorysize": 67108864,
-        "txn.lock.escalationthreshold": 1000,
-        "txn.lock.shrinktimer": 5000,
-        "txn.lock.timeout.sweepthreshold": 10000,
-        "txn.lock.timeout.waitthreshold": 60000,
-        "txn.log.buffer.numpages": 8,
-        "txn.log.buffer.pagesize": 524288,
-        "txn.log.checkpoint.history": 0,
-        "txn.log.checkpoint.lsnthreshold": 67108864,
-        "txn.log.checkpoint.pollfrequency": 120,
-        "txn.log.partitionsize": 2147483648,
-        "web.port": 19001,
-        "web.queryinterface.port": 19006,
-        "web.secondary.port": 19005
-    },
-    "diagnosticsUri": "http://10.10.0.2:19002/admin/diagnostics",
-    "fullShutdownUri": "http://10.10.0.2:19002/admin/shutdown?all=true",
     "metadata_node": "asterix_nc1",
-    "ncs": [
-        {
-            "configUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc1/config",
-            "node_id": "asterix_nc1",
-            "partitions": [
-                {
-                    "active": true,
-                    "partition_id": "partition_0"
-                },
-                {
-                    "active": true,
-                    "partition_id": "partition_1"
-                }
-            ],
-            "state": "ACTIVE",
-            "statsUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc1/stats",
-            "threadDumpUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc1/threaddump"
-        },
-        {
-            "configUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc2/config",
-            "node_id": "asterix_nc2",
-            "partitions": [
-                {
-                    "active": true,
-                    "partition_id": "partition_2"
-                },
-                {
-                    "active": true,
-                    "partition_id": "partition_3"
-                }
-            ],
-            "state": "ACTIVE",
-            "statsUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc2/stats",
-            "threadDumpUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc2/threaddump"
-        }
-    ],
-    "replicationUri": "http://10.10.0.2:19002/admin/cluster/replication",
-    "shutdownUri": "http://10.10.0.2:19002/admin/shutdown",
-    "state": "ACTIVE",
-    "versionUri": "http://10.10.0.2:19002/admin/version"
-}
+    "partitions": {
+        "0": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: asterix_nc1",
+        "1": "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: asterix_nc1",
+        "2": "ID:2, Original Node: asterix_nc2, IODevice: 0, Active Node: asterix_nc2",
+        "3": "ID:3, Original Node: asterix_nc2, IODevice: 1, Active Node: asterix_nc2"
+    },
+    "state": "ACTIVE"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.5.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.5.adm
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.5.adm
index 076c05b..6b31475 100644
--- a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.5.adm
+++ b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failback/node_failback/node_failback.cluster_state.5.adm
@@ -1,131 +1,10 @@
 {
-    "cc": {
-        "configUri": "http://10.10.0.2:19002/admin/cluster/cc/config",
-        "statsUri": "http://10.10.0.2:19002/admin/cluster/cc/stats",
-        "threadDumpUri": "http://10.10.0.2:19002/admin/cluster/cc/threaddump"
-    },
-    "config": {
-        "api.port": 19002,
-        "cluster.partitions": {
-            "0": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: asterix_nc2",
-            "1": "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: asterix_nc2",
-            "2": "ID:2, Original Node: asterix_nc2, IODevice: 0, Active Node: asterix_nc2",
-            "3": "ID:3, Original Node: asterix_nc2, IODevice: 1, Active Node: asterix_nc2"
-        },
-        "compiler.framesize": 131072,
-        "compiler.groupmemory": 33554432,
-        "compiler.joinmemory": 33554432,
-        "compiler.pregelix.home": "~/pregelix",
-        "compiler.sortmemory": 33554432,
-        "core.dump.paths": {
-            "asterix_nc1": "/home/vagrant/asterix/logs//asterix_nc1",
-            "asterix_nc2": "/home/vagrant/asterix/logs//asterix_nc2"
-        },
-        "feed.central.manager.port": 4500,
-        "feed.max.threshold.period": 5,
-        "feed.memory.available.wait.timeout": 10,
-        "feed.memory.global.budget": 67108864,
-        "feed.pending.work.threshold": 50,
-        "feed.port": 19003,
-        "instance.name": "asterix",
-        "log.level": "INFO",
-        "max.wait.active.cluster": 60,
-        "metadata.callback.port": 0,
-        "metadata.node": "asterix_nc1",
-        "metadata.partition": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node:
asterix_nc2",
-        "metadata.port": 0,
-        "metadata.registration.timeout.secs": 60,
-        "node.partitions": {
-            "asterix_nc1": [
-                "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: asterix_nc2",
-                "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: asterix_nc2"
-            ],
-            "asterix_nc2": [
-                "ID:2, Original Node: asterix_nc2, IODevice: 0, Active Node: asterix_nc2",
-                "ID:3, Original Node: asterix_nc2, IODevice: 1, Active Node: asterix_nc2"
-            ]
-        },
-        "node.stores": {
-            "asterix_nc1": [
-                "/home/vagrant/asterix/p1/storage",
-                "/home/vagrant/asterix/p2/storage"
-            ],
-            "asterix_nc2": [
-                "/home/vagrant/asterix/p1/storage",
-                "/home/vagrant/asterix/p2/storage"
-            ]
-        },
-        "plot.activate": false,
-        "storage.buffercache.maxopenfiles": 214748364,
-        "storage.buffercache.pagesize": 131072,
-        "storage.buffercache.size": 536870912,
-        "storage.lsm.bloomfilter.falsepositiverate": 0.01,
-        "storage.memorycomponent.globalbudget": 1073741824,
-        "storage.memorycomponent.numcomponents": 2,
-        "storage.memorycomponent.numpages": 256,
-        "storage.memorycomponent.pagesize": 131072,
-        "storage.metadata.memorycomponent.numpages": 64,
-        "transaction.log.dirs": {
-            "asterix_nc1": "/home/vagrant/asterix/tx_logs",
-            "asterix_nc2": "/home/vagrant/asterix/tx_logs"
-        },
-        "txn.commitprofiler.reportinterval": 5,
-        "txn.job.recovery.memorysize": 67108864,
-        "txn.lock.escalationthreshold": 1000,
-        "txn.lock.shrinktimer": 5000,
-        "txn.lock.timeout.sweepthreshold": 10000,
-        "txn.lock.timeout.waitthreshold": 60000,
-        "txn.log.buffer.numpages": 8,
-        "txn.log.buffer.pagesize": 524288,
-        "txn.log.checkpoint.history": 0,
-        "txn.log.checkpoint.lsnthreshold": 67108864,
-        "txn.log.checkpoint.pollfrequency": 120,
-        "txn.log.partitionsize": 2147483648,
-        "web.port": 19001,
-        "web.queryinterface.port": 19006,
-        "web.secondary.port": 19005
-    },
-    "diagnosticsUri": "http://10.10.0.2:19002/admin/diagnostics",
-    "fullShutdownUri": "http://10.10.0.2:19002/admin/shutdown?all=true",
     "metadata_node": "asterix_nc2",
-    "ncs": [
-        {
-            "configUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc1/config",
-            "node_id": "asterix_nc1",
-            "partitions": [
-                {
-                    "active": true,
-                    "partition_id": "partition_0"
-                },
-                {
-                    "active": true,
-                    "partition_id": "partition_1"
-                }
-            ],
-            "state": "FAILED",
-            "statsUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc1/stats",
-            "threadDumpUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc1/threaddump"
-        },
-        {
-            "configUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc2/config",
-            "node_id": "asterix_nc2",
-            "partitions": [
-                {
-                    "active": true,
-                    "partition_id": "partition_2"
-                },
-                {
-                    "active": true,
-                    "partition_id": "partition_3"
-                }
-            ],
-            "state": "ACTIVE",
-            "statsUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc2/stats",
-            "threadDumpUri": "http://10.10.0.2:19002/admin/cluster/node/asterix_nc2/threaddump"
-        }
-    ],
-    "replicationUri": "http://10.10.0.2:19002/admin/cluster/replication",
-    "shutdownUri": "http://10.10.0.2:19002/admin/shutdown",
-    "state": "ACTIVE",
-    "versionUri": "http://10.10.0.2:19002/admin/version"
-}
+    "partitions": {
+        "0": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: asterix_nc2",
+        "1": "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: asterix_nc2",
+        "2": "ID:2, Original Node: asterix_nc2, IODevice: 0, Active Node: asterix_nc2",
+        "3": "ID:3, Original Node: asterix_nc2, IODevice: 1, Active Node: asterix_nc2"
+    },
+    "state": "ACTIVE"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/bulkload/bulkload.5.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/bulkload/bulkload.5.aql
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/bulkload/bulkload.5.aql
new file mode 100644
index 0000000..9a03714
--- /dev/null
+++ b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/bulkload/bulkload.5.aql
@@ -0,0 +1 @@
+10
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/mem_component_recovery/mem_component_recovery.5.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/mem_component_recovery/mem_component_recovery.5.aql
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/mem_component_recovery/mem_component_recovery.5.aql
new file mode 100644
index 0000000..9a03714
--- /dev/null
+++ b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/mem_component_recovery/mem_component_recovery.5.aql
@@ -0,0 +1 @@
+10
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/metadata_node/metadata_node.4.aql
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/metadata_node/metadata_node.4.aql
b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/metadata_node/metadata_node.4.aql
new file mode 100644
index 0000000..56a6051
--- /dev/null
+++ b/asterixdb/asterix-installer/src/test/resources/integrationts/replication/results/failover/metadata_node/metadata_node.4.aql
@@ -0,0 +1 @@
+1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/util/ClusterStateManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/util/ClusterStateManager.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/util/ClusterStateManager.java
index 376c82a..9f2612f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/util/ClusterStateManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/util/ClusterStateManager.java
@@ -662,4 +662,12 @@ public class ClusterStateManager {
         }
         return stateDescription;
     }
+
+    public synchronized JSONObject getClusterStateSummary() throws JSONException {
+        JSONObject stateDescription = new JSONObject();
+        stateDescription.put("state", state.name());
+        stateDescription.put("metadata_node", currentMetadataNode);
+        stateDescription.put("partitions", clusterPartitions);
+        return stateDescription;
+    }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
index 6ccc6d0..6646defb 100644
--- a/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
+++ b/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
@@ -72,8 +72,8 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
     private static final String STORAGE_METADATA_FILE_NAME_PREFIX = "." + StorageConstants.METADATA_ROOT;
     private static final long STORAGE_LOCAL_RESOURCE_ID = -4321;
     private static final int MAX_CACHED_RESOURCES = 1000;
-    private static final FilenameFilter METADATA_FILES_FILTER = (File dir, String name) ->
name.equalsIgnoreCase(
-            METADATA_FILE_NAME);
+    private static final FilenameFilter METADATA_FILES_FILTER = (File dir, String name) ->
name
+            .equalsIgnoreCase(METADATA_FILE_NAME);
     // Finals
     private final IIOManager ioManager;
     private final String[] mountPoints;
@@ -121,9 +121,9 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
     @Override
     public String toString() {
         StringBuilder aString = new StringBuilder().append(PersistentLocalResourceRepository.class.getSimpleName())
-                .append(Character.LINE_SEPARATOR).append(ioManager.getClass().getSimpleName()).append(':').append(
-                        Character.LINE_SEPARATOR).append(ioManager.toString()).append(Character.LINE_SEPARATOR).append(
-                                "Cached Resources:").append(Character.LINE_SEPARATOR);
+                .append(Character.LINE_SEPARATOR).append(ioManager.getClass().getSimpleName()).append(':')
+                .append(Character.LINE_SEPARATOR).append(ioManager.toString()).append(Character.LINE_SEPARATOR)
+                .append("Cached Resources:").append(Character.LINE_SEPARATOR);
         for (Entry<String, LocalResource> pair : resourceCache.asMap().entrySet())
{
             aString.append(pair.getKey()).append("->").append(pair.getValue()).append(Character.LINE_SEPARATOR);
         }
@@ -158,8 +158,7 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
 
             String storageRootDirPath;
             if (storageRootDirName.startsWith(File.separator)) {
-                storageRootDirPath = mountPoints[i]
-                        + storageRootDirName.substring(File.separator.length());
+                storageRootDirPath = mountPoints[i] + storageRootDirName.substring(File.separator.length());
             } else {
                 storageRootDirPath = mountPoints[i] + storageRootDirName;
             }
@@ -209,8 +208,7 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
 
         //if replication enabled, send resource metadata info to remote nodes
         if (isReplicationEnabled && resource.getId() != STORAGE_LOCAL_RESOURCE_ID)
{
-            String filePath = getFileName(resource.getPath(), resource.getId());
-            createReplicationJob(ReplicationOperation.REPLICATE, filePath);
+            createReplicationJob(ReplicationOperation.REPLICATE, resourceFile);
         }
     }
 
@@ -222,9 +220,9 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
             resourceCache.invalidate(relativePath);
 
             //if replication enabled, delete resource from remote replicas
-            if (isReplicationEnabled && !resourceFile.getFile().getName().startsWith(
-                    STORAGE_METADATA_FILE_NAME_PREFIX)) {
-                createReplicationJob(ReplicationOperation.DELETE, resourceFile.getAbsolutePath());
+            if (isReplicationEnabled
+                    && !resourceFile.getFile().getName().startsWith(STORAGE_METADATA_FILE_NAME_PREFIX))
{
+                createReplicationJob(ReplicationOperation.DELETE, resourceFile);
             }
         } else {
             throw new HyracksDataException("Resource doesn't exist");
@@ -365,19 +363,20 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
         }
     }
 
-    private void createReplicationJob(ReplicationOperation operation, String filePath) throws
HyracksDataException {
+    private void createReplicationJob(ReplicationOperation operation, FileReference fileRef)
+            throws HyracksDataException {
         /**
          * Durable resources path format:
          * /partition/dataverse/idx/fileName
          * Temporary resources path format:
          * /partition/TEMP_DATASETS_STORAGE_FOLDER/dataverse/idx/fileName
          */
-        String[] fileNameTokens = filePath.split(File.separator);
+        String[] fileNameTokens = fileRef.getAbsolutePath().split(File.separator);
         String partitionDir = fileNameTokens[fileNameTokens.length - 4];
         //exclude temporary datasets resources
         if (!partitionDir.equals(StoragePathUtil.TEMP_DATASETS_STORAGE_FOLDER)) {
             filesToBeReplicated.clear();
-            filesToBeReplicated.add(filePath);
+            filesToBeReplicated.add(fileRef.getAbsolutePath());
             AsterixReplicationJob job = new AsterixReplicationJob(ReplicationJobType.METADATA,
operation,
                     ReplicationExecutionType.SYNC, filesToBeReplicated);
             try {
@@ -421,11 +420,9 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
      * @param ioDeviceId
      * @return A file reference to the storage metadata file.
      */
-    private static FileReference getStorageMetadataFile(IIOManager ioManager, String nodeId,
-            int ioDeviceId) {
+    private static FileReference getStorageMetadataFile(IIOManager ioManager, String nodeId,
int ioDeviceId) {
         String storageMetadataFileName = STORAGE_METADATA_DIRECTORY + File.separator + nodeId
+ "_" + "iodevice"
-                + ioDeviceId + File.separator
-                + STORAGE_METADATA_FILE_NAME_PREFIX;
+                + ioDeviceId + File.separator + STORAGE_METADATA_FILE_NAME_PREFIX;
         return new FileReference(ioManager.getIODevices().get(ioDeviceId), storageMetadataFileName);
     }
 
@@ -436,8 +433,7 @@ public class PersistentLocalResourceRepository implements ILocalResourceReposito
      * @return A file reference to the storage root directory if exists, otherwise null.
      * @throws HyracksDataException
      */
-    public static File getStorageRootDirectoryIfExists(IIOManager ioManager, String nodeId,
-            int ioDeviceId)
+    public static File getStorageRootDirectoryIfExists(IIOManager ioManager, String nodeId,
int ioDeviceId)
             throws HyracksDataException {
         File storageRootDir = null;
         FileReference storageMetadataFile = getStorageMetadataFile(ioManager, nodeId, ioDeviceId);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2772f12a/asterixdb/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index 8862644..ee5067d 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -60,7 +60,6 @@
     <failsafe.test.excludes>**/DmlRecoveryIT.java</failsafe.test.excludes>
     <cluster.test.excludes>**/AsterixClusterLifeCycleIT.java</cluster.test.excludes>
     <cluster.extest.excludes>**/ClusterExecutionIT.java</cluster.extest.excludes>
-    <replication.test.excludes>**/ReplicationIT.java</replication.test.excludes>
 
     <!-- Versions under dependencymanagement or used in many projects via properties -->
     <algebricks.version>0.2.18-SNAPSHOT</algebricks.version>
@@ -115,7 +114,6 @@
             <exclude>${failsafe.test.excludes}</exclude>
             <exclude>${cluster.test.excludes}</exclude>
             <exclude>${cluster.extest.excludes}</exclude>
-            <exclude>${replication.test.excludes}</exclude>
           </excludes>
         </configuration>
         <executions>


Mime
View raw message