Addressed code review comments.
diff --git a/asterix-app/src/test/resources/logging.properties b/asterix-app/src/test/resources/logging.properties
index e13e8e1..f04eb3de 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
\ No newline at end of file
+#edu.uci.ics.hyracks.level = INFO
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java
index d0f6040..a057f91 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/dataflow/IAsterixApplicationContextInfo.java
@@ -19,13 +19,15 @@
import edu.uci.ics.hyracks.storage.common.IStorageManagerInterface;
/**
- * Provides methods for obtaining the IIndexRegistryProvider, IStorageManager and
+ * Provides methods for obtaining the IIndexLifecycleManagerProvider, IStorageManagerInterface and
* ICCApplicationContext implementation.
*/
public interface IAsterixApplicationContextInfo {
/**
+ * Returns an instance of the implementation for IIndexLifecycleManagerProvider.
*
+ * @return IIndexLifecycleManagerProvider implementation instance
*/
public IIndexLifecycleManagerProvider getIndexLifecycleManagerProvider();
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 476899b..acb1e6a 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,8 +342,7 @@
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);
@@ -376,8 +375,7 @@
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;
@@ -387,7 +385,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-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
index 41a9230b..422fdfd 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
@@ -73,6 +73,7 @@
import edu.uci.ics.hyracks.storage.am.common.api.IIndexLifecycleManager;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrameFactory;
import edu.uci.ics.hyracks.storage.am.common.frames.LIFOMetaDataFrameFactory;
+import edu.uci.ics.hyracks.storage.am.common.util.IndexFileNameUtil;
import edu.uci.ics.hyracks.storage.am.lsm.btree.impls.LSMBTree;
import edu.uci.ics.hyracks.storage.am.lsm.btree.util.LSMBTreeUtils;
import edu.uci.ics.hyracks.storage.am.lsm.common.api.IInMemoryBufferCache;
@@ -333,8 +334,9 @@
}
private static void enlistMetadataDataset(IMetadataIndex index, boolean create) throws Exception {
- String filePath = metadataStore + File.separator + index.getFileNameRelativePath() + File.separator
- + "device_id_" + runtimeContext.getMetaDataIODeviceId();
+ String filePath = IndexFileNameUtil.prepareFileName(
+ metadataStore + File.separator + index.getFileNameRelativePath(),
+ runtimeContext.getMetaDataIODeviceId());
FileReference file = new FileReference(new File(filePath));
IInMemoryBufferCache memBufferCache = new InMemoryBufferCache(new HeapBufferAllocator(), DEFAULT_MEM_PAGE_SIZE,
DEFAULT_MEM_NUM_PAGES, new TransientFileMapManager());
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixClusterProperties.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixClusterProperties.java
index c3ae656..bc2a6af 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixClusterProperties.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/AsterixClusterProperties.java
@@ -19,6 +19,10 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+/**
+ * A holder class for properties related to the Asterix cluster.
+ */
+
public class AsterixClusterProperties {
private static final Logger LOGGER = Logger.getLogger(AsterixClusterProperties.class.getName());
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 a703896..2361bac 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
@@ -63,6 +63,10 @@
}
}
+ private String prepareRootMetaDataFileName(String mountPoint, String nodeId, int ioDeviceId) {
+ return mountPoint + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_" + "iodevice" + ioDeviceId;
+ }
+
public void initialize(String nodeId, String rootDir, boolean isNewUniverse, ResourceIdFactory resourceIdFactory)
throws HyracksDataException {
if (LOGGER.isLoggable(Level.INFO)) {
@@ -72,12 +76,11 @@
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 + "_" + nodeId + "_"
- + "iodevice" + i + File.separator + ROOT_METADATA_FILE_NAME_PREFIX);
+ String rootMetadataFileName = prepareRootMetaDataFileName(mountPoints[i], nodeId, i) + File.separator
+ + ROOT_METADATA_FILE_NAME_PREFIX;
File rootMetadataFile = new File(rootMetadataFileName);
- File rootMetadataDir = new File(mountPoints[i] + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_"
- + "iodevice" + i);
+ File rootMetadataDir = new File(prepareRootMetaDataFileName(mountPoints[i], nodeId, i));
if (!rootMetadataDir.exists()) {
rootMetadataDir.mkdir();
if (LOGGER.isLoggable(Level.INFO)) {
@@ -118,8 +121,8 @@
};
for (int i = 0; i < numIODevices; i++) {
- String rootMetadataFileName = new String(mountPoints[i] + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_"
- + "iodevice" + i + File.separator + ROOT_METADATA_FILE_NAME_PREFIX);
+ String rootMetadataFileName = prepareRootMetaDataFileName(mountPoints[i], nodeId, 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);