Fixed an issue when trying to create NCs that share the same io devices.
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
index 272050f..fb87a8e1 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -1,5 +1,6 @@
package edu.uci.ics.asterix.api.common;
+import java.io.File;
import java.util.EnumSet;
import edu.uci.ics.asterix.common.config.GlobalConfig;
@@ -50,6 +51,8 @@
ncConfig1.datasetIPAddress = "127.0.0.1";
ncConfig1.resultHistorySize = 1000;
ncConfig1.nodeId = NC1_ID;
+ ncConfig1.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + "nc1/iodevice0" + ","
+ + System.getProperty("java.io.tmpdir") + File.separator + "nc1/iodevice1";
ncConfig1.appNCMainClass = NCApplicationEntryPoint.class.getName();
nc1 = new NodeControllerService(ncConfig1);
nc1.start();
@@ -62,6 +65,8 @@
ncConfig2.datasetIPAddress = "127.0.0.1";
ncConfig2.resultHistorySize = 1000;
ncConfig2.nodeId = NC2_ID;
+ ncConfig2.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + "nc2/iodevice0" + ","
+ + System.getProperty("java.io.tmpdir") + File.separator + "nc2/iodevice1";
ncConfig2.appNCMainClass = NCApplicationEntryPoint.class.getName();
nc2 = new NodeControllerService(ncConfig2);
nc2.start();
diff --git a/asterix-app/src/test/resources/logging.properties b/asterix-app/src/test/resources/logging.properties
index f04eb3de..e13e8e1 100644
--- a/asterix-app/src/test/resources/logging.properties
+++ b/asterix-app/src/test/resources/logging.properties
@@ -64,4 +64,4 @@
edu.uci.ics.asterix.test.level = INFO
#edu.uci.ics.asterix.level = FINE
#edu.uci.ics.hyracks.algebricks.level = FINE
-#edu.uci.ics.hyracks.level = INFO
+#edu.uci.ics.hyracks.level = INFO
\ No newline at end of file
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java
index deb51d0..e053989 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/api/IAsterixAppRuntimeContext.java
@@ -23,6 +23,8 @@
public ILSMIOOperationScheduler getLSMIOScheduler();
+ public int getMetaDataIODeviceId();
+
public ILSMMergePolicy getLSMMergePolicy();
public IBufferCache getBufferCache();
@@ -42,8 +44,7 @@
public void setShuttingdown(boolean b);
public void deinitialize() throws HyracksDataException;
-
+
public double getBloomFilterFalsePositiveRate();
-
}
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixClusterProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixClusterProperties.java
index 362774f..02ce474 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixClusterProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixClusterProperties.java
@@ -19,8 +19,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import edu.uci.ics.asterix.common.api.AsterixAppContextInfo;
-
public class AsterixClusterProperties {
private static final Logger LOGGER = Logger.getLogger(AsterixClusterProperties.class.getName());
diff --git a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
index acb1e6a..476899b 100644
--- a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
+++ b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
@@ -342,7 +342,8 @@
List<CompilationUnit> cUnits = testCaseCtx.getTestCase().getCompilationUnit();
for (CompilationUnit cUnit : cUnits) {
-
+ LOGGER.info("[TEST]: " + testCaseCtx.getTestCase().getFilePath() + "/" + cUnit.getName());
+
testFileCtxs = testCaseCtx.getTestFiles(cUnit);
expectedResultFileCtxs = testCaseCtx.getExpectedResultFiles(cUnit);
@@ -375,7 +376,8 @@
TestsUtils.runScriptAndCompareWithResult(testFile, new PrintWriter(System.err),
expectedResultFile, actualFile);
- LOGGER.info("[TEST]: " + testCaseCtx.getTestCase().getFilePath() + "/" + cUnit.getName() + " PASSED ");
+ LOGGER.info("[TEST]: " + testCaseCtx.getTestCase().getFilePath() + "/"
+ + cUnit.getName() + " PASSED ");
}
queryCount++;
break;
@@ -385,7 +387,7 @@
default:
throw new IllegalArgumentException("No statements of type " + ctx.getType());
}
-
+
} catch (Exception e) {
if (cUnit.getExpectedError().isEmpty()) {
throw new Exception("Test \"" + testFile + "\" FAILED!", e);
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
index dc42d06..a703896 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
@@ -38,8 +38,8 @@
private static final Logger LOGGER = Logger.getLogger(PersistentLocalResourceRepository.class.getName());
private final String[] mountPoints;
- private static final String ROOT_METADATA_DIRECTORY = "asterix_root_metadata/";
- private static final String ROOT_METADATA_FILE_NAME_PREFIX = ".asterix_root_metadata_";
+ private static final String ROOT_METADATA_DIRECTORY = "asterix_root_metadata";
+ private static final String ROOT_METADATA_FILE_NAME_PREFIX = ".asterix_root_metadata";
private static final long ROOT_LOCAL_RESOURCE_ID = -4321;
private static final String METADATA_FILE_NAME = ".metadata";
private Map<String, LocalResource> name2ResourceMap = new HashMap<String, LocalResource>();
@@ -72,11 +72,12 @@
if (isNewUniverse) {
//#. if the rootMetadataFile doesn't exist, create it and return.
for (int i = 0; i < numIODevices; i++) {
- String rootMetadataFileName = new String(mountPoints[i] + ROOT_METADATA_DIRECTORY
- + ROOT_METADATA_FILE_NAME_PREFIX + nodeId);
+ String rootMetadataFileName = new String(mountPoints[i] + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_"
+ + "iodevice" + i + File.separator + ROOT_METADATA_FILE_NAME_PREFIX);
File rootMetadataFile = new File(rootMetadataFileName);
- File rootMetadataDir = new File(mountPoints[i] + ROOT_METADATA_DIRECTORY);
+ File rootMetadataDir = new File(mountPoints[i] + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_"
+ + "iodevice" + i);
if (!rootMetadataDir.exists()) {
rootMetadataDir.mkdir();
if (LOGGER.isLoggable(Level.INFO)) {
@@ -117,8 +118,8 @@
};
for (int i = 0; i < numIODevices; i++) {
- String rootMetadataFileName = new String(mountPoints[i] + ROOT_METADATA_DIRECTORY
- + ROOT_METADATA_FILE_NAME_PREFIX + nodeId);
+ String rootMetadataFileName = new String(mountPoints[i] + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_"
+ + "iodevice" + i + File.separator + ROOT_METADATA_FILE_NAME_PREFIX);
File rootMetadataFile = new File(rootMetadataFileName);
//#. if the rootMetadataFile exists, read it and set this.rootDir.
LocalResource rootLocalResource = readLocalResource(rootMetadataFile);