Merge branch 'master' of https://code.google.com/p/asterixdb
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 fb87a8e1..4046943 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
@@ -18,8 +18,7 @@
public class AsterixHyracksIntegrationUtil {
- public static final String NC1_ID = "nc1";
- public static final String NC2_ID = "nc2";
+ public static final String[] NC_IDS = { "nc1", "nc2" };
public static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
public static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
@@ -50,7 +49,7 @@
ncConfig1.dataIPAddress = "127.0.0.1";
ncConfig1.datasetIPAddress = "127.0.0.1";
ncConfig1.resultHistorySize = 1000;
- ncConfig1.nodeId = NC1_ID;
+ ncConfig1.nodeId = NC_IDS[0];
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();
@@ -64,7 +63,7 @@
ncConfig2.dataIPAddress = "127.0.0.1";
ncConfig2.datasetIPAddress = "127.0.0.1";
ncConfig2.resultHistorySize = 1000;
- ncConfig2.nodeId = NC2_ID;
+ ncConfig2.nodeId = NC_IDS[1];
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();
diff --git a/asterix-app/src/main/resources/asterix-build-configuration.xml b/asterix-app/src/main/resources/asterix-build-configuration.xml
index e85e56874..16042c1 100644
--- a/asterix-app/src/main/resources/asterix-build-configuration.xml
+++ b/asterix-app/src/main/resources/asterix-build-configuration.xml
@@ -8,6 +8,14 @@
<ncId>nc2</ncId>
<storeDirs>nc2data</storeDirs>
</store>
+ <transactionLogDir>
+ <ncId>nc1</ncId>
+ <txnLogDirPath>target/txnLogDir/nc1</txnLogDirPath>
+ </transactionLogDir>
+ <transactionLogDir>
+ <ncId>nc2</ncId>
+ <txnLogDirPath>target/txnLogDir/nc2</txnLogDirPath>
+ </transactionLogDir>
<property>
<name>log.level</name>
<value>WARNING</value>
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
index dfbd305..dd15d31 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
@@ -27,6 +27,8 @@
import org.junit.runners.Parameterized.Parameters;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
+import edu.uci.ics.asterix.common.config.AsterixPropertiesAccessor;
+import edu.uci.ics.asterix.common.config.AsterixTransactionProperties;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.test.aql.TestsUtils;
import edu.uci.ics.asterix.testframework.context.TestCaseContext;
@@ -44,6 +46,8 @@
private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
private static final String WEB_SERVER_PORT = "19002";
+ private static AsterixTransactionProperties txnProperties;
+
@BeforeClass
public static void setUp() throws Exception {
System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
@@ -51,13 +55,12 @@
File outdir = new File(PATH_ACTUAL);
outdir.mkdirs();
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
+ AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor();
+ txnProperties = new AsterixTransactionProperties(apa);
+
+ deleteTransactionLogs();
AsterixHyracksIntegrationUtil.init();
-
}
@AfterClass
@@ -74,9 +77,15 @@
TestsUtils.deleteRec(new File(d));
}
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
+ deleteTransactionLogs();
+ }
+
+ private static void deleteTransactionLogs() throws Exception {
+ for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) {
+ File log = new File(txnProperties.getLogDirectory(ncId));
+ if (log.exists()) {
+ FileUtils.deleteDirectory(log);
+ }
}
}
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index 0f1f8b5..b7ef7a8 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -22,6 +22,8 @@
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
import edu.uci.ics.asterix.api.java.AsterixJavaClient;
+import edu.uci.ics.asterix.common.config.AsterixPropertiesAccessor;
+import edu.uci.ics.asterix.common.config.AsterixTransactionProperties;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
import edu.uci.ics.asterix.external.dataset.adapter.FileSystemBasedAdapter;
@@ -49,6 +51,8 @@
private static final ArrayList<String> only = AsterixTestHelper.readFile(FILENAME_ONLY, PATH_BASE);
private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
+ private static AsterixTransactionProperties txnProperties;
+
@BeforeClass
public static void setUp() throws Exception {
// File outdir = new File(PATH_ACTUAL);
@@ -59,10 +63,10 @@
File outdir = new File(PATH_ACTUAL);
outdir.mkdirs();
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
+ AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor();
+ txnProperties = new AsterixTransactionProperties(apa);
+
+ deleteTransactionLogs();
AsterixHyracksIntegrationUtil.init();
// Set the node resolver to be the identity resolver that expects node names
@@ -71,6 +75,15 @@
IdentitiyResolverFactory.class.getName());
}
+ private static void deleteTransactionLogs() throws Exception {
+ for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) {
+ File log = new File(txnProperties.getLogDirectory(ncId));
+ if (log.exists()) {
+ FileUtils.deleteDirectory(log);
+ }
+ }
+ }
+
@AfterClass
public static void tearDown() throws Exception {
// _bootstrap.stop();
@@ -80,10 +93,7 @@
outdir.delete();
}
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
+ deleteTransactionLogs();
}
private static void suiteBuild(File dir, Collection<Object[]> testArgs, String path) {
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
index 2289484..559080c 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -13,6 +13,8 @@
import org.junit.runners.Parameterized.Parameters;
import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
+import edu.uci.ics.asterix.common.config.AsterixPropertiesAccessor;
+import edu.uci.ics.asterix.common.config.AsterixTransactionProperties;
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.external.dataset.adapter.FileSystemBasedAdapter;
import edu.uci.ics.asterix.external.util.IdentitiyResolverFactory;
@@ -30,6 +32,8 @@
private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml";
private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
+ private static AsterixTransactionProperties txnProperties;
+
@BeforeClass
public static void setUp() throws Exception {
System.setProperty(GlobalConfig.CONFIG_FILE_PROPERTY, TEST_CONFIG_FILE_NAME);
@@ -37,10 +41,10 @@
File outdir = new File(PATH_ACTUAL);
outdir.mkdirs();
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
+ AsterixPropertiesAccessor apa = new AsterixPropertiesAccessor();
+ txnProperties = new AsterixTransactionProperties(apa);
+
+ deleteTransactionLogs();
AsterixHyracksIntegrationUtil.init();
@@ -67,13 +71,19 @@
TestsUtils.deleteRec(new File(d));
}
- File log = new File("asterix_logs");
- if (log.exists()) {
- FileUtils.deleteDirectory(log);
- }
+ deleteTransactionLogs();
HDFSCluster.getInstance().cleanup();
}
+ private static void deleteTransactionLogs() throws Exception {
+ for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) {
+ File log = new File(txnProperties.getLogDirectory(ncId));
+ if (log.exists()) {
+ FileUtils.deleteDirectory(log);
+ }
+ }
+ }
+
@Parameters
public static Collection<Object[]> tests() throws Exception {
Collection<Object[]> testArgs = new ArrayList<Object[]>();
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixExternalProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixExternalProperties.java
index 6dd2ced..ff17ddf 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixExternalProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixExternalProperties.java
@@ -11,7 +11,7 @@
private static Level EXTERNAL_LOGLEVEL_DEFAULT = Level.WARNING;
private static final String EXTERNAL_APISERVER_KEY = "api.port";
- private static int EXTERNAL_APISERVER_DEFAULT = 19101;
+ private static int EXTERNAL_APISERVER_DEFAULT = 19002;
public AsterixExternalProperties(AsterixPropertiesAccessor accessor) {
super(accessor);
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixPropertiesAccessor.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixPropertiesAccessor.java
index d623ae5..5ffd9a2 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixPropertiesAccessor.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixPropertiesAccessor.java
@@ -19,6 +19,7 @@
import edu.uci.ics.asterix.common.configuration.Coredump;
import edu.uci.ics.asterix.common.configuration.Property;
import edu.uci.ics.asterix.common.configuration.Store;
+import edu.uci.ics.asterix.common.configuration.TransactionLogDir;
import edu.uci.ics.asterix.common.exceptions.AsterixException;
public class AsterixPropertiesAccessor {
@@ -29,6 +30,7 @@
private final Map<String, String[]> stores;
private final Map<String, String> coredumpConfig;
private final Map<String, Property> asterixConfigurationParams;
+ private final Map<String, String> transactionLogDirs;
public AsterixPropertiesAccessor() throws AsterixException {
String fileName = System.getProperty(GlobalConfig.CONFIG_FILE_PROPERTY);
@@ -70,6 +72,10 @@
for (Coredump cd : asterixConfiguration.getCoredump()) {
coredumpConfig.put(cd.getNcId(), cd.getCoredumpPath());
}
+ transactionLogDirs = new HashMap<String, String>();
+ for (TransactionLogDir txnLogDir : asterixConfiguration.getTransactionLogDir()) {
+ transactionLogDirs.put(txnLogDir.getNcId(), txnLogDir.getTxnLogDirPath());
+ }
}
@@ -93,6 +99,10 @@
return coredumpConfig.get(nodeId);
}
+ public String getTransactionLogDir(String nodeId) {
+ return transactionLogDirs.get(nodeId);
+ }
+
public <T> T getProperty(String property, T defaultValue, IPropertyInterpreter<T> interpreter) {
Property p = asterixConfigurationParams.get(property);
if (p == null) {
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java
index 0b6ea85..b3b5725 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixTransactionProperties.java
@@ -1,9 +1,7 @@
package edu.uci.ics.asterix.common.config;
public class AsterixTransactionProperties extends AbstractAsterixProperties {
- private static final String TXN_LOG_DIRECTORY_KEY = "txn.log.directory";
- private static final String TXN_LOG_DIRECTORY_DEFAULT = "asterix_logs/";
-
+
private static final String TXN_LOG_BUFFER_NUMPAGES_KEY = "txn.log.buffer.numpages";
private static int TXN_LOG_BUFFER_NUMPAGES_DEFAULT = 8;
@@ -12,7 +10,7 @@
private static final String TXN_LOG_PARTITIONSIZE_KEY = "txn.log.partitionsize";
private static final long TXN_LOG_PARTITIONSIZE_DEFAULT = (2 << 30); // 2GB
-
+
private static final String TXN_LOG_DISKSECTORSIZE_KEY = "txn.log.disksectorsize";
private static final int TXN_LOG_DISKSECTORSIZE_DEFAULT = 4096;
@@ -24,7 +22,7 @@
private static final String TXN_LOG_CHECKPOINT_POLLFREQUENCY_KEY = "txn.log.checkpoint.pollfrequency";
private static int TXN_LOG_CHECKPOINT_POLLFREQUENCY_DEFAULT = 120; // 120s
-
+
private static final String TXN_LOG_CHECKPOINT_HISTORY_KEY = "txn.log.checkpoint.history";
private static int TXN_LOG_CHECKPOINT_HISTORY_DEFAULT = 0;
@@ -33,24 +31,19 @@
private static final String TXN_LOCK_SHRINKTIMER_KEY = "txn.lock.shrinktimer";
private static int TXN_LOCK_SHRINKTIMER_DEFAULT = 5000; // 5s
-
+
private static final String TXN_LOCK_TIMEOUT_WAITTHRESHOLD_KEY = "txn.lock.timeout.waitthreshold";
private static final int TXN_LOCK_TIMEOUT_WAITTHRESHOLD_DEFAULT = 60000; // 60s
-
+
private static final String TXN_LOCK_TIMEOUT_SWEEPTHRESHOLD_KEY = "txn.lock.timeout.sweepthreshold";
private static final int TXN_LOCK_TIMEOUT_SWEEPTHRESHOLD_DEFAULT = 10000; // 10s
public AsterixTransactionProperties(AsterixPropertiesAccessor accessor) {
super(accessor);
}
-
- public String getLogDirectory() {
- String logDirectory = accessor.getProperty(TXN_LOG_DIRECTORY_KEY, TXN_LOG_DIRECTORY_DEFAULT,
- PropertyInterpreters.getStringPropertyInterpreter());
- if (!logDirectory.endsWith("/")) {
- logDirectory += "/";
- }
- return logDirectory;
+
+ public String getLogDirectory(String nodeId) {
+ return accessor.getTransactionLogDir(nodeId);
}
public int getLogBufferNumPages() {
@@ -67,7 +60,7 @@
return accessor.getProperty(TXN_LOG_PARTITIONSIZE_KEY, TXN_LOG_PARTITIONSIZE_DEFAULT,
PropertyInterpreters.getLongPropertyInterpreter());
}
-
+
public int getLogDiskSectorSize() {
return accessor.getProperty(TXN_LOG_DISKSECTORSIZE_KEY, TXN_LOG_DISKSECTORSIZE_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
@@ -92,7 +85,7 @@
return accessor.getProperty(TXN_LOG_CHECKPOINT_HISTORY_KEY, TXN_LOG_CHECKPOINT_HISTORY_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
}
-
+
public int getEntityToDatasetLockEscalationThreshold() {
return accessor.getProperty(TXN_LOCK_ESCALATIONTHRESHOLD_KEY, TXN_LOCK_ESCALATIONTHRESHOLD_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
@@ -102,12 +95,12 @@
return accessor.getProperty(TXN_LOCK_SHRINKTIMER_KEY, TXN_LOCK_SHRINKTIMER_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
}
-
+
public int getTimeoutWaitThreshold() {
return accessor.getProperty(TXN_LOCK_TIMEOUT_WAITTHRESHOLD_KEY, TXN_LOCK_TIMEOUT_WAITTHRESHOLD_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
}
-
+
public int getTimeoutSweepThreshold() {
return accessor.getProperty(TXN_LOCK_TIMEOUT_SWEEPTHRESHOLD_KEY, TXN_LOCK_TIMEOUT_SWEEPTHRESHOLD_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/LogManagerProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/LogManagerProperties.java
index 9387687..3e6ad99 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/LogManagerProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/transactions/LogManagerProperties.java
@@ -49,7 +49,7 @@
this.logPageSize = txnProperties.getLogBufferPageSize();
this.numLogPages = txnProperties.getLogBufferNumPages();
long logPartitionSize = txnProperties.getLogPartitionSize();
- this.logDir = txnProperties.getLogDirectory() + nodeId;
+ this.logDir = txnProperties.getLogDirectory(nodeId);
this.logFilePrefix = DEFAULT_LOG_FILE_PREFIX;
this.groupCommitWaitPeriod = txnProperties.getGroupCommitInterval();
diff --git a/asterix-common/src/main/resources/schema/asterix-conf.xsd b/asterix-common/src/main/resources/schema/asterix-conf.xsd
index 5aefdbd..f461723 100644
--- a/asterix-common/src/main/resources/schema/asterix-conf.xsd
+++ b/asterix-common/src/main/resources/schema/asterix-conf.xsd
@@ -13,6 +13,8 @@
<xs:element name="name" type="xs:string" />
<xs:element name="value" type="xs:string" />
<xs:element name="description" type="xs:string" />
+ <xs:element name="txnLogDirPath" type="xs:string" />
+
<!-- definition of complex elements -->
<xs:element name="store">
@@ -32,6 +34,15 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+
+ <xs:element name="transactionLogDir">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="mg:ncId" />
+ <xs:element ref="mg:txnLogDirPath" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
<xs:element name="property">
<xs:complexType>
@@ -50,6 +61,7 @@
<xs:element ref="mg:metadataNode" minOccurs="0"/>
<xs:element ref="mg:store" maxOccurs="unbounded" />
<xs:element ref="mg:coredump" maxOccurs="unbounded" />
+ <xs:element ref="mg:transactionLogDir" maxOccurs="unbounded"/>
<xs:element ref="mg:property" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
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 d13dd2e..a85df9e 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
@@ -181,7 +181,7 @@
public static InputStream executeQuery(String str) throws Exception {
InputStream resultStream = null;
- final String url = "http://localhost:19101/query";
+ final String url = "http://localhost:19002/query";
// Create an instance of HttpClient.
HttpClient client = new HttpClient();
@@ -215,7 +215,7 @@
// To execute Update statements
// Insert and Delete statements are executed here
public static void executeUpdate(String str) throws Exception {
- final String url = "http://localhost:19101/update";
+ final String url = "http://localhost:19002/update";
// Create an instance of HttpClient.
HttpClient client = new HttpClient();
@@ -247,7 +247,7 @@
// create dataverse statement
// create function statement
public static void executeDDL(String str) throws Exception {
- final String url = "http://localhost:19101/ddl";
+ final String url = "http://localhost:19002/ddl";
// Create an instance of HttpClient.
HttpClient client = new HttpClient();
@@ -364,4 +364,3 @@
}
}
}
-
diff --git a/asterix-events/src/main/resources/events/cc_start/cc_start.sh b/asterix-events/src/main/resources/events/cc_start/cc_start.sh
index 003d9cf..bbea4dc 100755
--- a/asterix-events/src/main/resources/events/cc_start/cc_start.sh
+++ b/asterix-events/src/main/resources/events/cc_start/cc_start.sh
@@ -3,4 +3,4 @@
mkdir -p $LOG_DIR
fi
cd $WORKING_DIR
-$ASTERIX_HOME/bin/asterixcc -client-net-ip-address $CLIENT_NET_IP -client-net-port 1098 -cluster-net-ip-address $CLUSTER_NET_IP -cluster-net-port 1099 -http-port 8888 &> $LOG_DIR/cc.log
+$ASTERIX_HOME/bin/asterixcc -client-net-ip-address $CLIENT_NET_IP -client-net-port $CLIENT_NET_PORT -cluster-net-ip-address $CLUSTER_NET_IP -cluster-net-port $CLUSTER_NET_PORT -http-port $HTTP_PORT &> $LOG_DIR/cc.log
diff --git a/asterix-events/src/main/resources/events/events.xml b/asterix-events/src/main/resources/events/events.xml
index f85e3ea1..068367e 100644
--- a/asterix-events/src/main/resources/events/events.xml
+++ b/asterix-events/src/main/resources/events/events.xml
@@ -70,6 +70,13 @@
<daemon>false</daemon>
</event>
<event>
+ <type>directory_copy</type>
+ <script>file/dir_copy.sh</script>
+ <description>Copies a directory (and its contents) from the remove file system to the local file system</description>
+ <args>destination_node destination_path local_source_path</args>
+ <daemon>false</daemon>
+ </event>
+ <event>
<type>file_delete</type>
<script>file/delete.sh</script>
<description>Deletes a file on the local file system to a remote node</description>
diff --git a/asterix-events/src/main/resources/events/file/dir_copy.sh b/asterix-events/src/main/resources/events/file/dir_copy.sh
new file mode 100755
index 0000000..6015dca
--- /dev/null
+++ b/asterix-events/src/main/resources/events/file/dir_copy.sh
@@ -0,0 +1,7 @@
+USERNAME=$1
+SRC_HOST=$2
+SRC_DIR=$3
+DEST_DIR=$4
+mkdir -p $DEST_DIR
+echo "scp -r $USERNAME@$SRC_HOST:$SRC_DIR $DEST_DIR"
+scp -r $USERNAME@$SRC_HOST:$SRC_DIR $DEST_DIR
diff --git a/asterix-events/src/main/resources/events/node_join/nc_join.sh b/asterix-events/src/main/resources/events/node_join/nc_join.sh
index d8bbbd2..efbfd40 100755
--- a/asterix-events/src/main/resources/events/node_join/nc_join.sh
+++ b/asterix-events/src/main/resources/events/node_join/nc_join.sh
@@ -6,4 +6,4 @@
mkdir -p $LOG_DIR
fi
cd $WORKING_DIR
-$ASTERIX_HOME/bin/asterixnc -node-id $NC_ID -cc-host $CC_HOST -cc-port 1099 -cluster-net-ip-address $IP_LOCATION -data-ip-address $IP_LOCATION -iodevices $IO_DEVICES -result-ip-address $IP_LOCATION &> $LOG_DIR/${NC_ID}.log
+$ASTERIX_HOME/bin/asterixnc -node-id $NC_ID -cc-host $CC_HOST -cc-port $CLUSTER_NET_PORT -cluster-net-ip-address $IP_LOCATION -data-ip-address $IP_LOCATION -iodevices $IO_DEVICES -result-ip-address $IP_LOCATION &> $LOG_DIR/${NC_ID}.log
diff --git a/asterix-events/src/main/resources/schema/cluster.xsd b/asterix-events/src/main/resources/schema/cluster.xsd
index 718d7b0..f0d5bd9 100644
--- a/asterix-events/src/main/resources/schema/cluster.xsd
+++ b/asterix-events/src/main/resources/schema/cluster.xsd
@@ -17,6 +17,10 @@
<xs:element name="iodevices" type="xs:string" />
<xs:element name="java_home" type="xs:string" />
<xs:element name="username" type="xs:string" />
+ <xs:element name="web_port" type="xs:string" />
+ <xs:element name="client_port" type="xs:integer" />
+ <xs:element name="cluster_port" type="xs:integer" />
+ <xs:element name="http_port" type="xs:integer" />
<!-- definition of complex elements -->
<xs:element name="working_dir">
@@ -36,6 +40,9 @@
<xs:element ref="cl:cluster_ip" />
<xs:element ref="cl:java_home" minOccurs="0" />
<xs:element ref="cl:log_dir" minOccurs="0" />
+ <xs:element ref="cl:client_port" />
+ <xs:element ref="cl:cluster_port" />
+ <xs:element ref="cl:http_port" />
</xs:sequence>
</xs:complexType>
</xs:element>
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java
index 7fc3884..91a7ee5 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java
@@ -52,6 +52,9 @@
case CONFIGURE:
cmd = new ConfigureCommand();
break;
+ case LOG:
+ cmd = new LogCommand();
+ break;
case SHUTDOWN:
cmd = new ShutdownCommand();
break;
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/HelpCommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/HelpCommand.java
index 3bc700d..76e40fa 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/HelpCommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/HelpCommand.java
@@ -58,6 +58,9 @@
case ALTER:
helpMessage = new AlterCommand().getUsageDescription();
break;
+ case LOG:
+ helpMessage = new LogCommand().getUsageDescription();
+ break;
default:
helpMessage = "Unknown command " + command;
}
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java
index 979c414..0b29850 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java
@@ -27,6 +27,7 @@
ALTER,
VALIDATE,
CONFIGURE,
+ LOG,
SHUTDOWN,
HELP
}
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/LogCommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/LogCommand.java
new file mode 100644
index 0000000..3f99ab0
--- /dev/null
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/LogCommand.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2009-2012 by The Regents of the University of California
+ * Licensed 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 from
+ *
+ * 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.
+ */
+package edu.uci.ics.asterix.installer.command;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.Date;
+
+import org.apache.commons.io.FileUtils;
+import org.kohsuke.args4j.Option;
+
+import edu.uci.ics.asterix.event.management.EventrixClient;
+import edu.uci.ics.asterix.event.schema.pattern.Patterns;
+import edu.uci.ics.asterix.installer.driver.InstallerDriver;
+import edu.uci.ics.asterix.installer.driver.InstallerUtil;
+import edu.uci.ics.asterix.installer.error.InstallerException;
+import edu.uci.ics.asterix.installer.events.PatternCreator;
+import edu.uci.ics.asterix.installer.model.AsterixInstance;
+import edu.uci.ics.asterix.installer.model.AsterixInstance.State;
+
+public class LogCommand extends AbstractCommand {
+
+ @Override
+ protected void execCommand() throws Exception {
+ InstallerDriver.initConfig(true);
+ String asterixInstanceName = ((LogConfig) config).name;
+ AsterixInstance instance = InstallerUtil.validateAsterixInstanceExists(asterixInstanceName, State.INACTIVE,
+ State.UNUSABLE, State.ACTIVE);
+ PatternCreator pc = new PatternCreator();
+ EventrixClient client = InstallerUtil.getEventrixClient(instance.getCluster());
+ String outputDir = ((LogConfig) config).outputDir == null ? InstallerDriver.getManagixHome() + File.separator + "logdump"
+ : ((LogConfig) config).outputDir;
+ File f = new File(outputDir);
+ String outputDirPath = f.getAbsolutePath();
+ if (!f.exists()) {
+ boolean success = f.mkdirs();
+ if (!success) {
+ throw new InstallerException("Unable to create output directory:" + outputDirPath);
+ }
+ }
+ Patterns transferLogPattern = pc.getGenerateLogPattern(asterixInstanceName, instance.getCluster(), outputDirPath);
+ client.submit(transferLogPattern);
+ File outputDirFile = new File(outputDirPath);
+ final String destFileName = "log_" + new Date().toString().replace(' ', '_') + ".zip";
+ File destFile = new File(outputDirFile, destFileName);
+ InstallerUtil.zipDir(outputDirFile, destFile);
+
+ String[] filesToDelete = outputDirFile.list(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return !name.equals(destFileName);
+ }
+
+ });
+ for (String fileS : filesToDelete) {
+ f = new File(outputDirFile, fileS);
+ if (f.isDirectory()) {
+ FileUtils.deleteDirectory(f);
+ } else {
+ f.delete();
+ }
+ }
+ LOGGER.info("Log zip archive created at " + destFile.getAbsolutePath());
+ }
+
+ @Override
+ protected CommandConfig getCommandConfig() {
+ return new LogConfig();
+ }
+
+ @Override
+ protected String getUsageDescription() {
+ return "\nCreates a tar ball containing log files corresponding to each worker node (NC) and the master (CC) for an ASTERIX instance"
+ + "\n\nAvailable arguments/options"
+ + "\n-n name of the ASTERIX instance. \n-d destination directory for producing the tar ball (defaults to) "
+ + InstallerDriver.getManagixHome();
+ }
+}
+
+class LogConfig extends CommandConfig {
+
+ @Option(name = "-n", required = true, usage = "Name of Asterix Instance")
+ public String name;
+
+ @Option(name = "-d", required = false, usage = "Destination directory for producing log tar ball")
+ public String outputDir;
+
+}
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
index a9ab53b..1c2ec0a 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
@@ -135,6 +135,8 @@
buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
buffer.append("configure" + ":" + " Configure the Asterix installer" + "\n");
+ buffer.append("log " + ":"
+ + " Produce a tar archive contianing log files from the master and worker nodes" + "\n");
buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
buffer.append("help " + ":" + " Provides usage description of a command" + "\n");
buffer.append("\nTo get more information about a command, use managix help -cmd <command>");
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerUtil.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerUtil.java
index abf0420..70f7142 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerUtil.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerUtil.java
@@ -48,11 +48,12 @@
import org.apache.commons.io.IOUtils;
import edu.uci.ics.asterix.common.configuration.AsterixConfiguration;
-import edu.uci.ics.asterix.common.configuration.Store;
import edu.uci.ics.asterix.common.configuration.Coredump;
+import edu.uci.ics.asterix.common.configuration.Store;
+import edu.uci.ics.asterix.common.configuration.TransactionLogDir;
import edu.uci.ics.asterix.event.driver.EventDriver;
-import edu.uci.ics.asterix.event.management.EventrixClient;
import edu.uci.ics.asterix.event.management.EventUtil;
+import edu.uci.ics.asterix.event.management.EventrixClient;
import edu.uci.ics.asterix.event.schema.cluster.Cluster;
import edu.uci.ics.asterix.event.schema.cluster.Env;
import edu.uci.ics.asterix.event.schema.cluster.Node;
@@ -69,6 +70,10 @@
public static final String TXN_LOG_DIR_KEY_SUFFIX = "txnLogDir";
public static final String ASTERIX_CONFIGURATION_FILE = "asterix-configuration.xml";
public static final String TXN_LOG_CONFIGURATION_FILE = "log.properties";
+ public static final int CLUSTER_NET_PORT_DEFAULT = 1098;
+ public static final int CLIENT_NET_PORT_DEFAULT = 1099;
+ public static final int HTTP_PORT_DEFAULT = 8888;
+ public static final int WEB_INTERFACE_PORT_DEFAULT = 19001;
public static AsterixInstance createAsterixInstance(String asterixInstanceName, Cluster cluster,
AsterixConfiguration asterixConfiguration) throws FileNotFoundException, IOException {
@@ -106,11 +111,23 @@
}
clusterProperties.add(new Property("ASTERIX_HOME", cluster.getWorkingDir().getDir() + File.separator
+ "asterix"));
- clusterProperties.add(new Property("CLUSTER_NET_IP", cluster.getMasterNode().getClusterIp()));
- clusterProperties.add(new Property("CLIENT_NET_IP", cluster.getMasterNode().getClientIp()));
clusterProperties.add(new Property("LOG_DIR", cluster.getLogDir()));
clusterProperties.add(new Property("JAVA_HOME", cluster.getJavaHome()));
clusterProperties.add(new Property("WORKING_DIR", cluster.getWorkingDir().getDir()));
+ clusterProperties.add(new Property("CLIENT_NET_IP", cluster.getMasterNode().getClientIp()));
+ clusterProperties.add(new Property("CLUSTER_NET_IP", cluster.getMasterNode().getClusterIp()));
+
+ int clusterNetPort = cluster.getMasterNode().getClusterPort() != null ? cluster.getMasterNode()
+ .getClusterPort().intValue() : CLUSTER_NET_PORT_DEFAULT;
+ int clientNetPort = cluster.getMasterNode().getClientPort() != null ? cluster.getMasterNode().getClientPort()
+ .intValue() : CLIENT_NET_PORT_DEFAULT;
+ int httpPort = cluster.getMasterNode().getHttpPort() != null ? cluster.getMasterNode().getHttpPort().intValue()
+ : HTTP_PORT_DEFAULT;
+
+ clusterProperties.add(new Property("CLIENT_NET_PORT", "" + clientNetPort));
+ clusterProperties.add(new Property("CLUSTER_NET_PORT", "" + clusterNetPort));
+ clusterProperties.add(new Property("HTTP_PORT", "" + httpPort));
+
cluster.setEnv(new Env(clusterProperties));
}
@@ -226,11 +243,17 @@
List<Coredump> coredump = new ArrayList<Coredump>();
String coredumpDir = null;
+ List<TransactionLogDir> txnLogDirs = new ArrayList<TransactionLogDir>();
+ String txnLogDir = null;
for (Node node : cluster.getNode()) {
coredumpDir = node.getLogDir() == null ? cluster.getLogDir() : node.getLogDir();
- coredump.add(new Coredump(asterixInstanceName + "_" + node.getId(), coredumpDir));
+ coredump.add(new Coredump(asterixInstanceName + "_" + node.getId(), coredumpDir + File.separator + asterixInstanceName + "_" + node.getId()));
+
+ txnLogDir = node.getTxnLogDir() == null ? cluster.getTxnLogDir() : node.getTxnLogDir();
+ txnLogDirs.add(new TransactionLogDir(asterixInstanceName + "_" + node.getId(), txnLogDir));
}
configuration.setCoredump(coredump);
+ configuration.setTransactionLogDir(txnLogDirs);
File asterixConfDir = new File(InstallerDriver.getAsterixDir() + File.separator + asterixInstanceName);
asterixConfDir.mkdirs();
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
index 0f382f9..7330c67 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
@@ -16,8 +16,10 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import edu.uci.ics.asterix.event.driver.EventDriver;
@@ -183,7 +185,7 @@
txnLogDir = node.getTxnLogDir() == null ? instance.getCluster().getTxnLogDir() : node.getTxnLogDir();
store = node.getStore() == null ? cluster.getStore() : node.getStore();
pargs = workingDir + " " + instance.getName() + " " + iodevices + " " + store + " "
- + BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + txnLogDir + " " + backupId + " " + backupDir
+ + BackupCommand.ASTERIX_ROOT_METADATA_DIR + " " + txnLogDir + " " + backupId + " " + backupDir
+ " " + "local" + " " + node.getId();
Event event = new Event("backup", nodeid, pargs);
patternList.add(new Pattern(null, 1, null, event));
@@ -479,4 +481,35 @@
return new Pattern(null, 1, null, event);
}
+ public Patterns getGenerateLogPattern(String asterixInstanceName, Cluster cluster, String outputDir) {
+ List<Pattern> patternList = new ArrayList<Pattern>();
+ Map<String,String> nodeLogs = new HashMap<String,String>();
+
+ String username = cluster.getUsername() == null ? System.getProperty("user.name") : cluster.getUsername();
+ String srcHost = cluster.getMasterNode().getClientIp();
+ Nodeid nodeid = new Nodeid(new Value(null, EventDriver.CLIENT_NODE.getId()));
+ String srcDir = cluster.getMasterNode().getLogDir() == null ? cluster.getLogDir() : cluster.getMasterNode()
+ .getLogDir();
+ String destDir = outputDir + File.separator + "cc";
+ String pargs = username + " " + srcHost + " " + srcDir + " " + destDir;
+ Event event = new Event("directory_copy", nodeid, pargs);
+ Pattern p = new Pattern(null, 1, null, event);
+ patternList.add(p);
+ nodeLogs.put(cluster.getMasterNode().getClusterIp(),srcDir);
+ for (Node node : cluster.getNode()) {
+ srcHost = node.getClusterIp();
+ srcDir = node.getLogDir() == null ? cluster.getLogDir() : node.getLogDir();
+ if(nodeLogs.get(node.getClusterIp()) != null && nodeLogs.get(node.getClusterIp()).equals(srcDir)){
+ continue;
+ }
+ destDir = outputDir + File.separator + node.getId();
+ pargs = username + " " + srcHost + " " + srcDir + " " + destDir;
+ event = new Event("directory_copy", nodeid, pargs);
+ p = new Pattern(null, 1, null, event);
+ patternList.add(p);
+ }
+ Patterns patterns = new Patterns(patternList);
+ return patterns;
+ }
+
}
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
index 9839b90..751cc36 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/AsterixInstance.java
@@ -19,6 +19,7 @@
import java.util.Date;
import java.util.List;
+import edu.uci.ics.asterix.common.config.AsterixExternalProperties;
import edu.uci.ics.asterix.common.configuration.AsterixConfiguration;
import edu.uci.ics.asterix.common.configuration.Property;
import edu.uci.ics.asterix.event.schema.cluster.Cluster;
@@ -26,9 +27,10 @@
public class AsterixInstance implements Serializable {
- private static final long serialVersionUID = 2874439550187520449L;
+ private static final long serialVersionUID = 1L;
-
+ private static final int WEB_INTERFACE_PORT_DEFAULT = 19001;
+
public enum State {
ACTIVE,
INACTIVE,
@@ -45,7 +47,6 @@
private final String metadataNodeId;
private final String asterixVersion;
private final List<BackupInfo> backupInfo;
- private final String webInterfaceUrl;
private AsterixRuntimeState runtimeState;
private State previousState;
@@ -60,7 +61,7 @@
this.asterixVersion = asterixVersion;
this.createdTimestamp = new Date();
this.backupInfo = new ArrayList<BackupInfo>();
- this.webInterfaceUrl = "http://" + cluster.getMasterNode().getClientIp() + ":" + 19001;
+
}
public Date getModifiedTimestamp() {
@@ -112,7 +113,8 @@
StringBuffer buffer = new StringBuffer();
buffer.append("Name:" + name + "\n");
buffer.append("Created:" + createdTimestamp + "\n");
- buffer.append("Web-Url:" + webInterfaceUrl + "\n");
+
+ buffer.append("Web-Url:" + getWebInterfaceUrl() + "\n");
buffer.append("State:" + state);
if (!state.equals(State.UNUSABLE) && stateChangeTimestamp != null) {
buffer.append(" (" + stateChangeTimestamp + ")" + "\n");
@@ -137,7 +139,13 @@
}
public String getWebInterfaceUrl() {
- return webInterfaceUrl;
+ int webPort = WEB_INTERFACE_PORT_DEFAULT;
+ for (Property p : asterixConfiguration.getProperty()) {
+ if (p.getName().equalsIgnoreCase("web.port")) {
+ webPort = Integer.parseInt(p.getValue());
+ }
+ }
+ return "http://" + cluster.getMasterNode().getClientIp() + ":" + webPort;
}
public AsterixRuntimeState getAsterixRuntimeState() {
@@ -170,12 +178,29 @@
buffer.append("\n");
buffer.append("Asterix Configuration\n");
+ int lenMax = 0;
for (Property property : asterixConfiguration.getProperty()) {
- buffer.append(property.getName() + ":" + property.getValue() + "\n");
+ int nextLen = property.getName().length();
+ if (nextLen > lenMax) {
+ lenMax = nextLen;
+ }
+ }
+ for (Property property : asterixConfiguration.getProperty()) {
+ buffer.append(property.getName() + getIndentation(property.getName(), lenMax) + ":" + property.getValue()
+ + "\n");
}
}
+ private String getIndentation(String name, int lenMax) {
+ int len = name.length();
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < lenMax - len; i++) {
+ buf.append(" ");
+ }
+ return buf.toString();
+ }
+
public State getPreviousState() {
return previousState;
}
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/EventList.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/EventList.java
index b605889..33f489e 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/EventList.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/model/EventList.java
@@ -28,6 +28,7 @@
FILE_TRANSFER,
FILE_CREATE,
DIRECTORY_TRANSFER,
+ DIRECTORY_COPY,
NODE_INFO
}
}
diff --git a/asterix-installer/src/main/resources/clusters/local/local.xml b/asterix-installer/src/main/resources/clusters/local/local.xml
index 0af8dfc..58d0f97 100644
--- a/asterix-installer/src/main/resources/clusters/local/local.xml
+++ b/asterix-installer/src/main/resources/clusters/local/local.xml
@@ -1,21 +1,24 @@
<cluster xmlns="cluster">
- <name>local</name>
- <working_dir>
- <dir>/tmp/asterix-installer</dir>
- <NFS>true</NFS>
- </working_dir>
- <log_dir>/tmp/asterix/logs</log_dir>
- <txn_log_dir>/tmp/asterix/logs</txn_log_dir>
- <iodevices>/tmp</iodevices>
- <store>asterix/storage</store>
- <java_home></java_home>
- <master_node>
- <id>master</id>
- <client_ip>127.0.0.1</client_ip>
- <cluster_ip>127.0.0.1</cluster_ip>
- </master_node>
- <node>
- <id>node1</id>
- <cluster_ip>127.0.0.1</cluster_ip>
- </node>
+ <name>local</name>
+ <working_dir>
+ <dir>/tmp/asterix-installer</dir>
+ <NFS>true</NFS>
+ </working_dir>
+ <log_dir>/tmp/asterix/logs</log_dir>
+ <txn_log_dir>/tmp/asterix/logs</txn_log_dir>
+ <iodevices>/tmp</iodevices>
+ <store>asterix/storage</store>
+ <java_home></java_home>
+ <master_node>
+ <id>master</id>
+ <client_ip>127.0.0.1</client_ip>
+ <cluster_ip>127.0.0.1</cluster_ip>
+ <cluster_port>1099</cluster_port>
+ <client_port>1098</client_port>
+ <http_port>8888</http_port>
+ </master_node>
+ <node>
+ <id>node1</id>
+ <cluster_ip>127.0.0.1</cluster_ip>
+ </node>
</cluster>
diff --git a/asterix-installer/src/main/resources/conf/asterix-configuration.xml b/asterix-installer/src/main/resources/conf/asterix-configuration.xml
index 8394a96..c9907e3 100644
--- a/asterix-installer/src/main/resources/conf/asterix-configuration.xml
+++ b/asterix-installer/src/main/resources/conf/asterix-configuration.xml
@@ -80,14 +80,6 @@
</property>
<property>
- <name>txn.log.directory</name>
- <value>asterix_logs/</value>
- <description>The directory location for transaction logs. (Default =
- "asterix_logs/")
- </description>
- </property>
-
- <property>
<name>txn.log.buffer.numpages</name>
<value>8</value>
<description>The number of in-memory log buffer pages. (Default = "8")
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 a8f129a..fd25f5a 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
@@ -64,7 +64,8 @@
}
private String prepareRootMetaDataFileName(String mountPoint, String nodeId, int ioDeviceId) {
- return mountPoint + ROOT_METADATA_DIRECTORY + "_" + nodeId + "_" + "iodevice" + ioDeviceId;
+ return mountPoint + File.separator + ROOT_METADATA_DIRECTORY + File.separator +
+ nodeId + "_" + "iodevice" + ioDeviceId;
}
public void initialize(String nodeId, String rootDir, boolean isNewUniverse, ResourceIdFactory resourceIdFactory)
@@ -82,7 +83,13 @@
File rootMetadataDir = new File(prepareRootMetaDataFileName(mountPoints[i], nodeId, i));
if (!rootMetadataDir.exists()) {
- rootMetadataDir.mkdir();
+ boolean success = rootMetadataDir.mkdirs();
+ if (!success) {
+ if (LOGGER.isLoggable(Level.SEVERE)) {
+ LOGGER.severe("Unable to create root metadata directory"
+ + rootMetadataDir.getAbsolutePath());
+ }
+ }
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("created the root-metadata-file's directory: " + rootMetadataDir.getAbsolutePath());
}