1) fixed issue 506 (BetaBlocker) 2) configurable CC ports 3) cosmetic changes for indented output of describe -admin command
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>