Merge commit '7de451f889af70ab1c2506e0b4e65f221affed35' from release-0.9.4-pre-rc
Change-Id: I7c3f093eed22f5f0eed753f037df309ee4677353
diff --git a/asterixdb/asterix-algebra/pom.xml b/asterixdb/asterix-algebra/pom.xml
index 79dc7bc..f3fdfc8 100644
--- a/asterixdb/asterix-algebra/pom.xml
+++ b/asterixdb/asterix-algebra/pom.xml
@@ -176,10 +176,6 @@
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
index 42e38f9..9e36ba9 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
@@ -70,7 +70,7 @@
import org.apache.asterix.om.constants.AsterixConstantValue;
import org.apache.asterix.om.functions.BuiltinFunctions;
import org.apache.asterix.om.types.BuiltinType;
-import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang3.NotImplementedException;
import org.apache.commons.lang3.mutable.Mutable;
import org.apache.commons.lang3.mutable.MutableObject;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
diff --git a/asterixdb/asterix-app/pom.xml b/asterixdb/asterix-app/pom.xml
index 52e3cc3..a39c366 100644
--- a/asterixdb/asterix-app/pom.xml
+++ b/asterixdb/asterix-app/pom.xml
@@ -558,10 +558,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
@@ -597,6 +593,7 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.asterix</groupId>
@@ -606,6 +603,7 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
diff --git a/asterixdb/asterix-app/src/main/resources/cc-rep.conf b/asterixdb/asterix-app/src/main/resources/cc-rep.conf
index 1f4e5a5..818b835 100644
--- a/asterixdb/asterix-app/src/main/resources/cc-rep.conf
+++ b/asterixdb/asterix-app/src/main/resources/cc-rep.conf
@@ -37,7 +37,6 @@
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
jvm.args=-Xmx4096m -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.subdir=test_storage
storage.memorycomponent.globalbudget = 1073741824
[cc]
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestTupleGenerator.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestTupleGenerator.java
index 54bdb1b..2f326d8 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestTupleGenerator.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestTupleGenerator.java
@@ -20,7 +20,7 @@
import java.util.Random;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.util.GrowableArray;
import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/LangExecutionUtil.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/LangExecutionUtil.java
index 9da0e66..cd270cd 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/LangExecutionUtil.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/runtime/LangExecutionUtil.java
@@ -31,14 +31,13 @@
import java.util.Collection;
import java.util.List;
-import org.apache.asterix.common.config.NodeProperties;
import org.apache.asterix.app.external.ExternalUDFLibrarian;
import org.apache.asterix.common.library.ILibraryManager;
import org.apache.asterix.common.utils.StorageConstants;
import org.apache.asterix.test.common.TestExecutor;
import org.apache.asterix.testframework.context.TestCaseContext;
-import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.SystemUtils;
import org.apache.hyracks.api.io.IODeviceHandle;
import org.apache.hyracks.control.nc.NodeControllerService;
import org.apache.hyracks.util.ThreadDumpUtil;
diff --git a/asterixdb/asterix-app/src/test/resources/cc-multipart.conf b/asterixdb/asterix-app/src/test/resources/cc-multipart.conf
index 5cf1bbe..9c64ab4 100644
--- a/asterixdb/asterix-app/src/test/resources/cc-multipart.conf
+++ b/asterixdb/asterix-app/src/test/resources/cc-multipart.conf
@@ -35,7 +35,6 @@
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
jvm.args=-Xmx4096m -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.subdir=test_storage
storage.buffercache.pagesize=32KB
storage.buffercache.size=48MB
storage.memorycomponent.globalbudget=512MB
diff --git a/asterixdb/asterix-app/src/test/resources/cc.conf b/asterixdb/asterix-app/src/test/resources/cc.conf
index 1c141f1..fc95dd4 100644
--- a/asterixdb/asterix-app/src/test/resources/cc.conf
+++ b/asterixdb/asterix-app/src/test/resources/cc.conf
@@ -35,7 +35,6 @@
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
jvm.args=-Xmx4096m -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.subdir=test_storage
storage.buffercache.pagesize=32KB
storage.buffercache.size=48MB
storage.memorycomponent.globalbudget=512MB
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.regexadm b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.regexadm
index 03eb4be..cc4c573 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.regexadm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.regexadm
@@ -13,7 +13,6 @@
"compiler\.sortmemory" : 327680,
"compiler\.textsearchmemory" : 163840,
"default\.dir" : "target/io/dir/asterixdb",
- "instance\.name" : "DEFAULT_INSTANCE",
"log\.level" : "INFO",
"max\.wait\.active\.cluster" : 60,
"messaging\.frame\.count" : 512,
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
index ae08a2b..dd7dfb7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
@@ -13,7 +13,6 @@
"compiler\.sortmemory" : 327680,
"compiler\.textsearchmemory" : 163840,
"default\.dir" : "target/io/dir/asterixdb",
- "instance\.name" : "DEFAULT_INSTANCE",
"log\.level" : "WARN",
"max\.wait\.active\.cluster" : 60,
"messaging\.frame\.count" : 512,
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
index fba43bb..71200c1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
@@ -13,7 +13,6 @@
"compiler\.sortmemory" : 327680,
"compiler\.textsearchmemory" : 163840,
"default\.dir" : "target/io/dir/asterixdb",
- "instance\.name" : "DEFAULT_INSTANCE",
"log\.level" : "WARN",
"max\.wait\.active\.cluster" : 60,
"messaging\.frame\.count" : 512,
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/MetadataProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/MetadataProperties.java
index 0b18f98..7325c98 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/MetadataProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/MetadataProperties.java
@@ -34,7 +34,6 @@
public class MetadataProperties extends AbstractProperties {
public enum Option implements IOption {
- INSTANCE_NAME(STRING, "DEFAULT_INSTANCE"),
METADATA_NODE(STRING, null),
METADATA_REGISTRATION_TIMEOUT_SECS(INTEGER, 60),
METADATA_LISTEN_PORT(INTEGER, 0),
@@ -56,8 +55,6 @@
@Override
public String description() {
switch (this) {
- case INSTANCE_NAME:
- return "The name of this cluster instance";
case METADATA_NODE:
return "the node which should serve as the metadata node";
case METADATA_REGISTRATION_TIMEOUT_SECS:
@@ -97,10 +94,6 @@
super(accessor);
}
- public String getInstanceName() {
- return accessor.getString(Option.INSTANCE_NAME);
- }
-
public String getMetadataNodeName() {
return accessor.getString(Option.METADATA_NODE);
}
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/NodeProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/NodeProperties.java
index 1443b8e..aaf6316 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/NodeProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/NodeProperties.java
@@ -43,7 +43,6 @@
appConfig -> FileUtil.joinPath(appConfig.getString(ControllerConfig.Option.DEFAULT_DIR), "txn-log"),
"The directory where transaction logs should be stored",
"<value of " + ControllerConfig.Option.DEFAULT_DIR.cmdline() + ">/txn-log"),
- STORAGE_SUBDIR(OptionTypes.STRING, "storage", "The subdirectory name under each iodevice used for storage"),
STARTING_PARTITION_ID(
OptionTypes.INTEGER,
-1,
@@ -116,8 +115,4 @@
public String getTxnLogDir() {
return accessor.getString(Option.TXN_LOG_DIR);
}
-
- public String getStorageSubdir() {
- return accessor.getString(Option.STORAGE_SUBDIR);
- }
}
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
index 9c002b5..3b6100c 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
@@ -18,10 +18,10 @@
*/
package org.apache.asterix.common.config;
-import static org.apache.asterix.common.config.NodeProperties.Option.STORAGE_SUBDIR;
+import static org.apache.asterix.common.utils.StorageConstants.STORAGE_ROOT_DIR_NAME;
import static org.apache.hyracks.control.common.controllers.NCConfig.Option.IODEVICES;
+import static org.apache.hyracks.util.file.FileUtil.joinPath;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -116,12 +116,11 @@
// Now we create an array of ClusterPartitions for all the partitions
// on this NC.
String[] iodevices = nodeCfg.getStringArray(IODEVICES);
- String storageSubdir = nodeCfg.getString(STORAGE_SUBDIR);
String[] nodeStores = new String[iodevices.length];
ClusterPartition[] nodePartitions = new ClusterPartition[iodevices.length];
for (int i = 0; i < nodePartitions.length; i++) {
- // Construct final storage path from iodevice dir + storage subdirs
- nodeStores[i] = iodevices[i] + File.separator + storageSubdir;
+ // Construct final storage path from iodevice dir
+ nodeStores[i] = joinPath(iodevices[i], STORAGE_ROOT_DIR_NAME);
// Create ClusterPartition instances for this NC.
ClusterPartition partition = new ClusterPartition(uniquePartitionId.getAndIncrement(), ncId, i);
ClusterPartition orig = clusterPartitions.put(partition.getPartitionId(), partition);
diff --git a/asterixdb/asterix-doc/src/site/markdown/ncservice.md b/asterixdb/asterix-doc/src/site/markdown/ncservice.md
index 9804c05..2b309ce 100644
--- a/asterixdb/asterix-doc/src/site/markdown/ncservice.md
+++ b/asterixdb/asterix-doc/src/site/markdown/ncservice.md
@@ -138,7 +138,6 @@
[nc]
app.class=org.apache.asterix.hyracks.bootstrap.NCApplicationEntryPoint
- storage.subdir=storage
address=127.0.0.1
command=asterixnc
@@ -270,6 +269,7 @@
| cc | cluster.topology | Sets the XML file that defines the cluster topology | <undefined> |
| cc | console.listen.address | Sets the listen address for the Cluster Controller | same as address |
| cc | console.listen.port | Sets the http port for the Cluster Controller) | 16001 |
+| cc | cores.multiplier | The factor to multiply by the number of cores to determine maximum query concurrent execution level | 3 |
| cc | heartbeat.max.misses | Sets the maximum number of missed heartbeats before a node is marked as dead | 5 |
| cc | heartbeat.period | Sets the time duration between two heartbeats from each node controller in milliseconds | 10000 |
| cc | job.history.size | Limits the number of historical jobs remembered by the system to the specified value | 10 |
@@ -324,14 +324,12 @@
| nc | result.ttl | Limits the amount of time results for asynchronous jobs should be retained by the system in milliseconds | 86400000 |
| nc | storage.buffercache.maxopenfiles | The maximum number of open files in the buffer cache | 2147483647 |
| nc | storage.buffercache.pagesize | The page size in bytes for pages in the buffer cache | 131072 (128 kB) |
-| nc | storage.buffercache.size | The size of memory allocated to the disk buffer cache. The value should be a multiple of the buffer cache page size. | 715915264 (682.75 MB) |
+| nc | storage.buffercache.size | The size of memory allocated to the disk buffer cache. The value should be a multiple of the buffer cache page size. | 1/4 of the JVM allocated memory |
| nc | storage.lsm.bloomfilter.falsepositiverate | The maximum acceptable false positive rate for bloom filters associated with LSM indexes | 0.01 |
-| nc | storage.memorycomponent.globalbudget | The size of memory allocated to the memory components. The value should be a multiple of the memory component page size | 715915264 (682.75 MB) |
+| nc | storage.memorycomponent.globalbudget | The size of memory allocated to the memory components. The value should be a multiple of the memory component page size | 1/4 of the JVM allocated memory |
| nc | storage.memorycomponent.numcomponents | The number of memory components to be used per lsm index | 2 |
-| nc | storage.memorycomponent.numpages | The number of pages to allocate for a memory component. This budget is shared by all the memory components of the primary index and all its secondary indexes across all I/O devices on a node. Note: in-memory components usually has fill factor of 75% since the pages are 75% full and the remaining 25% is un-utilized | 1/16th of the storage.memorycomponent.globalbudget value |
| nc | storage.memorycomponent.pagesize | The page size in bytes for pages allocated to memory components | 131072 (128 kB) |
-| nc | storage.metadata.memorycomponent.numpages | The number of pages to allocate for a metadata memory component | 1/64th of the storage.memorycomponent.globalbudget value or 256, whichever is larger |
-| nc | storage.subdir | The subdirectory name under each iodevice used for storage | storage |
+| nc | storage.metadata.memorycomponent.numpages | The number of pages to allocate for a metadata memory component | 8 |
| nc | txn.log.dir | The directory where transaction logs should be stored | ${java.io.tmpdir}/asterixdb/txn-log |
@@ -346,7 +344,6 @@
| common | compiler.parallelism | The degree of parallelism for query execution. Zero means to use the storage parallelism as the query execution parallelism, while other integer values dictate the number of query execution parallel partitions. The system will fall back to use the number of all available CPU cores in the cluster as the degree of parallelism if the number set by a user is too large or too small | 0 |
| common | compiler.sortmemory | The memory budget (in bytes) for a sort operator instance in a partition | 33554432 (32 MB) |
| common | compiler.textsearchmemory | The memory budget (in bytes) for an inverted-index-search operator instance in a partition | 33554432 (32 MB) |
-| common | instance.name | The name of this cluster instance | DEFAULT_INSTANCE |
| common | log.level | The logging level for master and slave processes | WARNING |
| common | max.wait.active.cluster | The max pending time (in seconds) for cluster startup. After the threshold, if the cluster still is not up and running, it is considered unavailable | 60 |
| common | messaging.frame.count | Number of reusable frames for NC to NC messaging | 512 |
@@ -360,6 +357,7 @@
| common | replication.log.buffer.pagesize | The size in bytes of each log buffer page | 131072 (128 kB) |
| common | replication.max.remote.recovery.attempts | The maximum number of times to attempt to recover from a replica on failure before giving up | 5 |
| common | replication.timeout | The time in seconds to timeout when trying to contact a replica, before assuming it is dead | 15 |
+| common | storage.max.active.writable.datasets | The maximum number of datasets that can be concurrently modified | 8 |
| common | txn.commitprofiler.enabled | Enable output of commit profiler logs | false |
| common | txn.commitprofiler.reportinterval | Interval (in seconds) to report commit profiler logs | 5 |
| common | txn.job.recovery.memorysize | The memory budget (in bytes) used for recovery | 67108864 (64 MB) |
diff --git a/asterixdb/asterix-lang-common/pom.xml b/asterixdb/asterix-lang-common/pom.xml
index 0fe7e6d..b20bd58 100644
--- a/asterixdb/asterix-lang-common/pom.xml
+++ b/asterixdb/asterix-lang-common/pom.xml
@@ -92,10 +92,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/AbstractAccessor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/AbstractAccessor.java
index eb35c9c..1cc2e50 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/AbstractAccessor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/AbstractAccessor.java
@@ -18,9 +18,10 @@
*/
package org.apache.asterix.lang.common.expression;
+import java.util.Objects;
+
import org.apache.asterix.lang.common.base.AbstractExpression;
import org.apache.asterix.lang.common.base.Expression;
-import org.apache.commons.lang.ObjectUtils;
public abstract class AbstractAccessor extends AbstractExpression {
protected Expression expr;
@@ -40,7 +41,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(expr);
+ return Objects.hashCode(expr);
}
@Override
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OrderedListTypeDefinition.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OrderedListTypeDefinition.java
index 7b04c7f..58d3756 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OrderedListTypeDefinition.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/OrderedListTypeDefinition.java
@@ -18,9 +18,10 @@
*/
package org.apache.asterix.lang.common.expression;
+import java.util.Objects;
+
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.commons.lang.ObjectUtils;
public class OrderedListTypeDefinition implements TypeExpression {
@@ -46,7 +47,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(itemTypeExpression);
+ return Objects.hashCode(itemTypeExpression);
}
@Override
@@ -58,6 +59,6 @@
return false;
}
OrderedListTypeDefinition target = (OrderedListTypeDefinition) object;
- return ObjectUtils.equals(itemTypeExpression, target.itemTypeExpression);
+ return Objects.equals(itemTypeExpression, target.itemTypeExpression);
}
}
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/TypeReferenceExpression.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/TypeReferenceExpression.java
index e87b2cc..8c1e5c6 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/TypeReferenceExpression.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/expression/TypeReferenceExpression.java
@@ -18,10 +18,11 @@
*/
package org.apache.asterix.lang.common.expression;
+import java.util.Objects;
+
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.lang.common.struct.Identifier;
import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
-import org.apache.commons.lang.ObjectUtils;
import org.apache.hyracks.algebricks.common.utils.Pair;
public class TypeReferenceExpression implements TypeExpression {
@@ -48,7 +49,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(ident);
+ return Objects.hashCode(ident);
}
@Override
@@ -60,6 +61,6 @@
return false;
}
TypeReferenceExpression target = (TypeReferenceExpression) object;
- return ObjectUtils.equals(ident, target.ident);
+ return Objects.equals(ident, target.ident);
}
}
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/DoubleLiteral.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/DoubleLiteral.java
index 5812b19..93d2517 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/DoubleLiteral.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/DoubleLiteral.java
@@ -18,8 +18,9 @@
*/
package org.apache.asterix.lang.common.literal;
+import java.util.Objects;
+
import org.apache.asterix.lang.common.base.Literal;
-import org.apache.commons.lang.ObjectUtils;
public class DoubleLiteral extends Literal {
private static final long serialVersionUID = -5685491458356989250L;
@@ -50,7 +51,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(value);
+ return Objects.hashCode(value);
}
@Override
@@ -62,7 +63,7 @@
return false;
}
DoubleLiteral target = (DoubleLiteral) object;
- return ObjectUtils.equals(value, target.value);
+ return Objects.equals(value, target.value);
}
@Override
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/FloatLiteral.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/FloatLiteral.java
index a3dfd6a..88dd4cd 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/FloatLiteral.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/FloatLiteral.java
@@ -18,8 +18,9 @@
*/
package org.apache.asterix.lang.common.literal;
+import java.util.Objects;
+
import org.apache.asterix.lang.common.base.Literal;
-import org.apache.commons.lang.ObjectUtils;
public class FloatLiteral extends Literal {
private static final long serialVersionUID = 3273563021227964396L;
@@ -46,7 +47,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(value);
+ return Objects.hashCode(value);
}
@Override
@@ -58,7 +59,7 @@
return false;
}
FloatLiteral target = (FloatLiteral) object;
- return ObjectUtils.equals(value, target.value);
+ return Objects.equals(value, target.value);
}
@Override
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/IntegerLiteral.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/IntegerLiteral.java
index a46a736..35c7d17 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/IntegerLiteral.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/IntegerLiteral.java
@@ -18,8 +18,9 @@
*/
package org.apache.asterix.lang.common.literal;
+import java.util.Objects;
+
import org.apache.asterix.lang.common.base.Literal;
-import org.apache.commons.lang.ObjectUtils;
public class IntegerLiteral extends Literal {
private static final long serialVersionUID = -8633520244871361967L;
@@ -46,7 +47,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(value);
+ return Objects.hashCode(value);
}
@Override
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/LongIntegerLiteral.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/LongIntegerLiteral.java
index 5e00cb8..c9e0b8c 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/LongIntegerLiteral.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/LongIntegerLiteral.java
@@ -18,8 +18,9 @@
*/
package org.apache.asterix.lang.common.literal;
+import java.util.Objects;
+
import org.apache.asterix.lang.common.base.Literal;
-import org.apache.commons.lang.ObjectUtils;
public class LongIntegerLiteral extends Literal {
private static final long serialVersionUID = -8633520244871361967L;
@@ -50,7 +51,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(value);
+ return Objects.hashCode(value);
}
@Override
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/StringLiteral.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/StringLiteral.java
index 9caad3e..b5ab9ec 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/StringLiteral.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/literal/StringLiteral.java
@@ -18,8 +18,9 @@
*/
package org.apache.asterix.lang.common.literal;
+import java.util.Objects;
+
import org.apache.asterix.lang.common.base.Literal;
-import org.apache.commons.lang.ObjectUtils;
public class StringLiteral extends Literal {
@@ -52,7 +53,7 @@
@Override
public int hashCode() {
- return ObjectUtils.hashCode(value);
+ return Objects.hashCode(value);
}
@Override
@@ -64,7 +65,7 @@
return false;
}
StringLiteral target = (StringLiteral) object;
- return ObjectUtils.equals(value, target.value);
+ return Objects.equals(value, target.value);
}
@Override
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/Identifier.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/Identifier.java
index b77fd94..1443833 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/Identifier.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/struct/Identifier.java
@@ -18,7 +18,7 @@
*/
package org.apache.asterix.lang.common.struct;
-import org.apache.commons.lang.ObjectUtils;
+import java.util.Objects;
public class Identifier {
protected String value;
@@ -53,11 +53,11 @@
return false;
}
Identifier target = (Identifier) o;
- return ObjectUtils.equals(value, target.value);
+ return Objects.equals(value, target.value);
}
@Override
public int hashCode() {
- return ObjectUtils.hashCode(value);
+ return Objects.hashCode(value);
}
}
diff --git a/asterixdb/asterix-metadata/pom.xml b/asterixdb/asterix-metadata/pom.xml
index 5f3df49..94c2668 100644
--- a/asterixdb/asterix-metadata/pom.xml
+++ b/asterixdb/asterix-metadata/pom.xml
@@ -104,10 +104,6 @@
<artifactId>algebricks-data</artifactId>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.hyracks</groupId>
<artifactId>algebricks-core</artifactId>
</dependency>
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java
index 91030bf..8fdcbbc 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/LoadableDataSource.java
@@ -30,7 +30,7 @@
import org.apache.asterix.om.types.ARecordType;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.IAType;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.common.utils.Pair;
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/RTreeResourceFactoryProvider.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/RTreeResourceFactoryProvider.java
index 5075adc..08f8b7d 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/RTreeResourceFactoryProvider.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/RTreeResourceFactoryProvider.java
@@ -37,7 +37,7 @@
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.IAType;
import org.apache.asterix.om.utils.NonTaggedFormatUtil;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.data.IBinaryComparatorFactoryProvider;
diff --git a/asterixdb/asterix-replication/pom.xml b/asterixdb/asterix-replication/pom.xml
index 787a0b4..c8a84ee 100644
--- a/asterixdb/asterix-replication/pom.xml
+++ b/asterixdb/asterix-replication/pom.xml
@@ -17,28 +17,6 @@
<properties>
<root.dir>${basedir}/..</root.dir>
</properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*.class</include>
- <include>**/*.txt</include>
- </includes>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <phase>package</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<dependencies>
<dependency>
<groupId>org.apache.asterix</groupId>
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
index 73d6705..8539fa4 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
@@ -462,8 +462,4 @@
});
}
- public String getStoragePathPrefix() {
- return appCtx.getNodeProperties().getStorageSubdir();
- }
-
}
diff --git a/asterixdb/asterix-server/src/main/opt/local/conf/cc.conf b/asterixdb/asterix-server/src/main/opt/local/conf/cc.conf
index cc2d9bd..6fc0579 100644
--- a/asterixdb/asterix-server/src/main/opt/local/conf/cc.conf
+++ b/asterixdb/asterix-server/src/main/opt/local/conf/cc.conf
@@ -30,7 +30,6 @@
${NC_BLUE_EXTRA}
[nc]
-storage.subdir=storage
address=127.0.0.1
command=${NC_COMMAND}
diff --git a/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf b/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
index 4658f1b..f3dcd63 100644
--- a/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
+++ b/asterixdb/asterix-server/src/test/resources/NCServiceExecutionIT/cc.conf
@@ -37,7 +37,6 @@
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
jvm.args=-Xmx4g -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.subdir=test_storage
storage.memorycomponent.globalbudget = 1073741824
[cc]
diff --git a/asterixdb/asterix-server/src/test/resources/NcLifecycleIT/cc.conf b/asterixdb/asterix-server/src/test/resources/NcLifecycleIT/cc.conf
index e34cf9e..dc80e56 100644
--- a/asterixdb/asterix-server/src/test/resources/NcLifecycleIT/cc.conf
+++ b/asterixdb/asterix-server/src/test/resources/NcLifecycleIT/cc.conf
@@ -36,7 +36,6 @@
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
jvm.args=-Xmx4096m -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.subdir=test_storage
storage.memorycomponent.globalbudget = 1073741824
[cc]
diff --git a/asterixdb/asterix-server/src/test/resources/ReplicationIT/cc.conf b/asterixdb/asterix-server/src/test/resources/ReplicationIT/cc.conf
index b36d41c..19e951f 100644
--- a/asterixdb/asterix-server/src/test/resources/ReplicationIT/cc.conf
+++ b/asterixdb/asterix-server/src/test/resources/ReplicationIT/cc.conf
@@ -37,7 +37,6 @@
command=asterixnc
app.class=org.apache.asterix.hyracks.bootstrap.NCApplication
jvm.args=-Xmx4096m -Dnode.Resolver="org.apache.asterix.external.util.IdentitiyResolverFactory"
-storage.subdir=test_storage
storage.memorycomponent.globalbudget = 1073741824
[cc]
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index cc08e96..f5ab359 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -532,7 +532,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
- <version>3.5</version>
+ <version>3.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
diff --git a/asterixdb/src/main/appended-resources/supplemental-models.xml b/asterixdb/src/main/appended-resources/supplemental-models.xml
index aa57859..fa00886 100644
--- a/asterixdb/src/main/appended-resources/supplemental-models.xml
+++ b/asterixdb/src/main/appended-resources/supplemental-models.xml
@@ -31,17 +31,17 @@
<project>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <name>SLF4J API Module</name>
- <organization>
- <name>QOS.ch</name>
- <url>http://www.qos.ch</url>
- </organization>
<licenses>
<license>
<name>an MIT-style license</name>
- <url>http://www.slf4j.org/license.html</url>
+ <url>https://raw.githubusercontent.com/qos-ch/slf4j/v_1.8.0-alpha2/LICENSE.txt</url>
</license>
</licenses>
+ <properties>
+ <license.ignoreMissingEmbeddedNotice>1.8.0-alpha2</license.ignoreMissingEmbeddedNotice>
+ <license.ignoreMissingEmbeddedLicense>1.8.0-alpha2</license.ignoreMissingEmbeddedLicense>
+ <license.ignoreLicenseOverride>1.8.0-alpha2</license.ignoreLicenseOverride>
+ </properties>
</project>
</supplement>
<supplement>
@@ -154,4 +154,79 @@
</licenses>
</project>
</supplement>
+ <supplement>
+ <project>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-all</artifactId>
+ <properties>
+ <!-- netty is ALv2, and does not contain any embedded LICENSE or NOTICE file -->
+ <license.ignoreMissingEmbeddedLicense>4.1.6.Final</license.ignoreMissingEmbeddedLicense>
+ <license.ignoreMissingEmbeddedNotice>4.1.6.Final</license.ignoreMissingEmbeddedNotice>
+ </properties>
+ </project>
+ </supplement>
+ <supplement>
+ <project>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <properties>
+ <!-- guava is ALv2, and does not contain any embedded LICENSE or NOTICE file -->
+ <license.ignoreMissingEmbeddedNotice>18.0</license.ignoreMissingEmbeddedNotice>
+ <license.ignoreMissingEmbeddedLicense>18.0</license.ignoreMissingEmbeddedLicense>
+ </properties>
+ </project>
+ </supplement>
+ <supplement>
+ <project>
+ <groupId>org.ini4j</groupId>
+ <artifactId>ini4j</artifactId>
+ <properties>
+ <!-- ini4j is ALv2, and does not contain any embedded LICENSE or NOTICE file -->
+ <license.ignoreMissingEmbeddedNotice>0.5.4</license.ignoreMissingEmbeddedNotice>
+ <license.ignoreMissingEmbeddedLicense>0.5.4</license.ignoreMissingEmbeddedLicense>
+ </properties>
+ </project>
+ </supplement>
+ <supplement>
+ <project>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ <properties>
+ <!-- args4j does not provide an embedded NOTICE file -->
+ <license.ignoreMissingEmbeddedNotice>2.33</license.ignoreMissingEmbeddedNotice>
+ </properties>
+ </project>
+ </supplement>
+ <supplement>
+ <project>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <properties>
+ <!-- jackson-annotation does not provide an embedded NOTICE file -->
+ <license.ignoreMissingEmbeddedNotice>2.8.4</license.ignoreMissingEmbeddedNotice>
+ </properties>
+ </project>
+ </supplement>
+ <supplement>
+ <project>
+ <groupId>com.esri.geometry</groupId>
+ <artifactId>esri-geometry-api</artifactId>
+ <properties>
+ <!-- esri is ALv2, and does not contain any embedded LICENSE or NOTICE file -->
+ <license.ignoreMissingEmbeddedLicense>2.0.0</license.ignoreMissingEmbeddedLicense>
+ <license.ignoreMissingEmbeddedNotice>2.0.0</license.ignoreMissingEmbeddedNotice>
+ </properties>
+ </project>
+ </supplement>
+ <supplement>
+ <project>
+ <groupId>it.unimi.dsi</groupId>
+ <artifactId>fastutil</artifactId>
+ <properties>
+ <!-- fastutil is ALv2, and does not contain any embedded LICENSE or NOTICE file -->
+ <license.ignoreMissingEmbeddedLicense>8.1.1</license.ignoreMissingEmbeddedLicense>
+ <license.ignoreMissingEmbeddedNotice>8.1.1</license.ignoreMissingEmbeddedNotice>
+ </properties>
+ </project>
+ </supplement>
</supplementalDataModels>
diff --git a/asterixdb/src/main/licenses/content/raw.githubusercontent.com_qos-ch_slf4j_v_1.8.0-alpha2_LICENSE.txt b/asterixdb/src/main/licenses/content/raw.githubusercontent.com_qos-ch_slf4j_v_1.8.0-alpha2_LICENSE.txt
new file mode 100644
index 0000000..744377c
--- /dev/null
+++ b/asterixdb/src/main/licenses/content/raw.githubusercontent.com_qos-ch_slf4j_v_1.8.0-alpha2_LICENSE.txt
@@ -0,0 +1,21 @@
+Copyright (c) 2004-2017 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
index 13e4504..889e140 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/CCConfig.java
@@ -163,7 +163,8 @@
return "A flag indicating if runtime should enforce frame writer protocol and detect "
+ "bad behaving operators";
case CORES_MULTIPLIER:
- return "Specifies the multiplier to use on the cluster available cores";
+ return "the factor to multiply by the number of cores to determine maximum query concurrent "
+ + "execution level";
case CONTROLLER_ID:
return "The 16-bit (0-65535) id of this Cluster Controller";
default:
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml
index 958d2ed..bc7e612 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/pom.xml
@@ -95,6 +95,11 @@
<artifactId>maven-compat</artifactId>
<version>3.3.9</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-util</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java
index 1b2961f..293c08c 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/DownloadLicensesMojo.java
@@ -63,7 +63,7 @@
String fileName = entry.getLicense().getContentFile(false);
doDownload(timeoutMillis, i, url, fileName);
});
- } catch (IOException | ProjectBuildingException e) {
+ } catch (ProjectBuildingException e) {
throw new MojoExecutionException("Unexpected exception: " + e, e);
}
}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java
index e8625fc..f61dadf 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/GenerateFileMojo.java
@@ -18,6 +18,11 @@
*/
package org.apache.hyracks.maven.license;
+import static org.apache.hyracks.maven.license.ProjectFlag.ALTERNATE_LICENSE_FILE;
+import static org.apache.hyracks.maven.license.ProjectFlag.ALTERNATE_NOTICE_FILE;
+import static org.apache.hyracks.maven.license.ProjectFlag.IGNORE_MISSING_EMBEDDED_LICENSE;
+import static org.apache.hyracks.maven.license.ProjectFlag.IGNORE_MISSING_EMBEDDED_NOTICE;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -116,6 +121,10 @@
persistLicenseMap();
buildNoticeProjectMap();
generateFiles();
+ if (seenWarning && failOnWarning) {
+ throw new MojoFailureException(
+ "'failOnWarning' enabled and warning(s) (or error(s)) occurred during execution; see output");
+ }
} catch (IOException | TemplateException | ProjectBuildingException e) {
throw new MojoExecutionException("Unexpected exception: " + e, e);
}
@@ -248,7 +257,9 @@
for (Project p : lps.getProjects()) {
String licenseText = p.getLicenseText();
if (licenseText == null) {
- getLog().warn("Using license other than from within artifact: " + p.gav());
+ warnUnlessFlag(p.gav(), IGNORE_MISSING_EMBEDDED_LICENSE,
+ "Using license other than from within artifact: " + p.gav() + " (" + lps.getLicense()
+ + ")");
licenseText = resolveLicenseContent(lps.getLicense(), false);
}
LicenseSpec spec = lps.getLicense();
@@ -307,18 +318,22 @@
}
private void resolveNoticeFiles() throws MojoExecutionException, IOException {
- resolveArtifactFiles("NOTICE", entry -> entry.getName().matches("(.*/|^)" + "NOTICE" + "(.txt)?"),
- Project::setNoticeText,
+ // TODO(mblow): this will match *any* NOTICE[.txt] file located within the artifact- this seems way too liberal
+ resolveArtifactFiles("NOTICE", IGNORE_MISSING_EMBEDDED_NOTICE, ALTERNATE_NOTICE_FILE,
+ entry -> entry.getName().matches("(.*/|^)" + "NOTICE" + "(.txt)?"), Project::setNoticeText,
text -> stripFoundationAssertionFromNotices ? FOUNDATION_PATTERN.matcher(text).replaceAll("") : text);
}
private void resolveLicenseFiles() throws MojoExecutionException, IOException {
- resolveArtifactFiles("LICENSE", entry -> entry.getName().matches("(.*/|^)" + "LICENSE" + "(.txt)?"),
- Project::setLicenseText, UnaryOperator.identity());
+ // TODO(mblow): this will match *any* LICENSE[.txt] file located within the artifact- this seems way too liberal
+ resolveArtifactFiles("LICENSE", IGNORE_MISSING_EMBEDDED_LICENSE, ALTERNATE_LICENSE_FILE,
+ entry -> entry.getName().matches("(.*/|^)" + "LICENSE" + "(.txt)?"), Project::setLicenseText,
+ UnaryOperator.identity());
}
- private void resolveArtifactFiles(final String name, Predicate<JarEntry> filter,
- BiConsumer<Project, String> consumer, UnaryOperator<String> contentTransformer)
+ private void resolveArtifactFiles(final String name, final ProjectFlag ignoreFlag,
+ final ProjectFlag alternateFilenameFlag, final Predicate<JarEntry> filter,
+ final BiConsumer<Project, String> consumer, final UnaryOperator<String> contentTransformer)
throws MojoExecutionException, IOException {
for (Project p : getProjects()) {
File artifactFile = new File(p.getArtifactPath());
@@ -328,10 +343,13 @@
getLog().info("Skipping unknown artifact file type: " + artifactFile);
continue;
}
+ String alternateFilename = (String) getProjectFlag(p.gav(), alternateFilenameFlag);
+ Predicate<JarEntry> finalFilter =
+ alternateFilename != null ? entry -> entry.getName().equals(alternateFilename) : filter;
try (JarFile jarFile = new JarFile(artifactFile)) {
- SortedMap<String, JarEntry> matches = gatherMatchingEntries(jarFile, filter);
+ SortedMap<String, JarEntry> matches = gatherMatchingEntries(jarFile, finalFilter);
if (matches.isEmpty()) {
- getLog().warn("No " + name + " file found for " + p.gav());
+ warnUnlessFlag(p, ignoreFlag, "No " + name + " file found for " + p.gav());
} else {
if (matches.size() > 1) {
getLog().warn("Multiple " + name + " files found for " + p.gav() + ": " + matches.keySet()
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java
index 97afffb..55987da 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseMojo.java
@@ -18,10 +18,15 @@
*/
package org.apache.hyracks.maven.license;
+import static org.apache.hyracks.maven.license.LicenseUtil.toGav;
+import static org.apache.hyracks.maven.license.ProjectFlag.IGNORE_LICENSE_OVERRIDE;
+
import java.io.File;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -33,6 +38,7 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
@@ -46,6 +52,7 @@
import org.apache.maven.model.Model;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
@@ -100,6 +107,12 @@
@Parameter(required = true)
protected File licenseDirectory;
+ @Parameter
+ protected File warningTouchFile;
+
+ @Parameter
+ protected boolean failOnWarning;
+
private Map<String, MavenProject> projectCache = new HashMap<>();
private Map<String, Model> supplementModels;
@@ -108,18 +121,111 @@
Map<String, LicenseSpec> urlToLicenseMap = new HashMap<>();
Map<String, LicensedProjects> licenseMap = new TreeMap<>();
+ private Map<Pair<String, ProjectFlag>, Object> projectFlags = new HashMap<>();
+
+ protected boolean seenWarning;
protected Map<String, LicensedProjects> getLicenseMap() {
return licenseMap;
}
- protected void init() throws MojoExecutionException, MalformedURLException, ProjectBuildingException {
+ protected void init() throws MojoExecutionException {
+ if (warningTouchFile != null) {
+ warningTouchFile.getParentFile().mkdirs();
+ }
+ interceptLogs();
excludedScopes.add("system");
excludePatterns = compileExcludePatterns();
supplementModels = SupplementalModelHelper.loadSupplements(getLog(), models);
buildUrlLicenseMap();
}
+ private void interceptLogs() {
+ final Log originalLog = getLog();
+ setLog(new Log() {
+ public boolean isDebugEnabled() {
+ return originalLog.isDebugEnabled();
+ }
+
+ public void debug(CharSequence charSequence) {
+ originalLog.debug(charSequence);
+ }
+
+ public void debug(CharSequence charSequence, Throwable throwable) {
+ originalLog.debug(charSequence, throwable);
+ }
+
+ public void debug(Throwable throwable) {
+ originalLog.debug(throwable);
+ }
+
+ public boolean isInfoEnabled() {
+ return originalLog.isInfoEnabled();
+ }
+
+ public void info(CharSequence charSequence) {
+ originalLog.info(charSequence);
+ }
+
+ public void info(CharSequence charSequence, Throwable throwable) {
+ originalLog.info(charSequence, throwable);
+ }
+
+ public void info(Throwable throwable) {
+ originalLog.info(throwable);
+ }
+
+ public boolean isWarnEnabled() {
+ return originalLog.isWarnEnabled();
+ }
+
+ public void warn(CharSequence charSequence) {
+ seenWarning();
+ originalLog.warn(charSequence);
+ }
+
+ public void warn(CharSequence charSequence, Throwable throwable) {
+ seenWarning();
+ originalLog.warn(charSequence, throwable);
+ }
+
+ public void warn(Throwable throwable) {
+ seenWarning();
+ originalLog.warn(throwable);
+ }
+
+ public boolean isErrorEnabled() {
+ return originalLog.isErrorEnabled();
+ }
+
+ public void error(CharSequence charSequence) {
+ seenWarning();
+ originalLog.error(charSequence);
+ }
+
+ public void error(CharSequence charSequence, Throwable throwable) {
+ seenWarning();
+ originalLog.error(charSequence, throwable);
+ }
+
+ public void error(Throwable throwable) {
+ seenWarning();
+ originalLog.error(throwable);
+ }
+
+ private void seenWarning() {
+ seenWarning = true;
+ if (warningTouchFile != null) {
+ try {
+ FileUtils.touch(warningTouchFile);
+ } catch (IOException e) {
+ originalLog.error("unable to touch " + warningTouchFile, e);
+ }
+ }
+ }
+ });
+ }
+
protected void addDependenciesToLicenseMap() throws ProjectBuildingException {
Map<MavenProject, List<Pair<String, String>>> dependencyLicenseMap = gatherDependencies();
dependencyLicenseMap.forEach((depProject, value) -> {
@@ -283,6 +389,7 @@
Model supplement = supplementModels
.get(SupplementalModelHelper.generateSupplementMapKey(depObj.getGroupId(), depObj.getArtifactId()));
+ registerVerified(depProj, supplement);
if (supplement != null) {
Model merged = SupplementalModelHelper.mergeModels(assembler, depProj.getModel(), supplement);
Set<String> origLicenses =
@@ -290,8 +397,8 @@
Set<String> newLicenses =
merged.getLicenses().stream().map(License::getUrl).collect(Collectors.toSet());
if (!origLicenses.equals(newLicenses)) {
- getLog().warn("license list for " + toGav(depProj) + " changed with supplemental model; was: "
- + origLicenses + ", now: " + newLicenses);
+ warnUnlessFlag(depProj, IGNORE_LICENSE_OVERRIDE, "license list for " + toGav(depProj)
+ + " changed with supplemental model; was: " + origLicenses + ", now: " + newLicenses);
}
depProj = new MavenProject(merged);
depProj.setArtifact(depObj);
@@ -303,8 +410,34 @@
return depProj;
}
- private String toGav(MavenProject dep) {
- return dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion();
+ protected void warnUnlessFlag(MavenProject depProj, ProjectFlag flag, String message) {
+ warnUnlessFlag(toGav(depProj), flag, message);
+ }
+
+ protected void warnUnlessFlag(Project depProj, ProjectFlag flag, String message) {
+ warnUnlessFlag(depProj.gav(), flag, message);
+ }
+
+ protected void warnUnlessFlag(String gav, ProjectFlag flag, String message) {
+ if (projectFlags.containsKey(Pair.of(gav, flag))) {
+ getLog().info(message);
+ } else {
+ getLog().warn(message);
+ }
+ }
+
+ public Map<Pair<String, ProjectFlag>, Object> getProjectFlags() {
+ return projectFlags;
+ }
+
+ public Object getProjectFlag(String gav, ProjectFlag flag) {
+ return projectFlags.get(Pair.of(gav, flag));
+ }
+
+ private void registerVerified(MavenProject depObj, Model supplement) {
+ if (supplement != null) {
+ Arrays.stream(ProjectFlag.values()).forEach(flag -> flag.visit(depObj, supplement.getProperties(), this));
+ }
}
protected List<Pattern> compileExcludePatterns() {
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java
index cd955d9..5ac2392 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseSpec.java
@@ -111,4 +111,7 @@
this.displayName = displayName;
}
+ public String toString() {
+ return getDisplayName() != null ? getDisplayName() : getUrl();
+ }
}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java
index 5ea768e..2a34fc7 100644
--- a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/LicenseUtil.java
@@ -30,6 +30,7 @@
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
+import org.apache.maven.project.MavenProject;
public class LicenseUtil {
@@ -145,4 +146,8 @@
}
return new ImmutablePair<>(freeSpaces, maxLineLength);
}
+
+ static String toGav(MavenProject dep) {
+ return dep.getGroupId() + ":" + dep.getArtifactId() + ":" + dep.getVersion();
+ }
}
diff --git a/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/ProjectFlag.java b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/ProjectFlag.java
new file mode 100644
index 0000000..28b3bbc
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-maven-plugins/license-automation-plugin/src/main/java/org/apache/hyracks/maven/license/ProjectFlag.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+package org.apache.hyracks.maven.license;
+
+import static org.apache.hyracks.maven.license.LicenseUtil.toGav;
+
+import java.util.Properties;
+import java.util.stream.Stream;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.hyracks.util.StringUtil;
+import org.apache.maven.project.MavenProject;
+
+enum ProjectFlag {
+ IGNORE_MISSING_EMBEDDED_LICENSE,
+ IGNORE_MISSING_EMBEDDED_NOTICE,
+ IGNORE_LICENSE_OVERRIDE,
+ ALTERNATE_LICENSE_FILE,
+ ALTERNATE_NOTICE_FILE;
+
+ String propName() {
+ return "license." + StringUtil.toCamelCase(name());
+ }
+
+ void visit(MavenProject depObj, Properties properties, LicenseMojo licenseMojo) {
+ String value = properties.getProperty(propName());
+ if (value == null) {
+ return;
+ }
+ switch (this) {
+ case IGNORE_MISSING_EMBEDDED_LICENSE:
+ case IGNORE_MISSING_EMBEDDED_NOTICE:
+ case IGNORE_LICENSE_OVERRIDE:
+ if (Stream.of(StringUtils.split(value, ",")).anyMatch(depObj.getVersion()::equals)) {
+ licenseMojo.getProjectFlags().put(Pair.of(toGav(depObj), this), Boolean.TRUE);
+ } else {
+ licenseMojo.getLog().info(propName() + " defined on versions that *do not* match: " + value
+ + " for " + toGav(depObj));
+ }
+ break;
+ case ALTERNATE_LICENSE_FILE:
+ case ALTERNATE_NOTICE_FILE:
+ for (String spec : StringUtils.split(value, ",")) {
+ String[] specSplit = StringUtils.split(spec, ":");
+ if (specSplit.length != 2) {
+ throw new IllegalArgumentException(spec);
+ }
+ if (specSplit[0].equals(depObj.getVersion())) {
+ licenseMojo.getProjectFlags().put(Pair.of(toGav(depObj), this), specSplit[1]);
+ }
+ }
+ break;
+ default:
+ throw new IllegalStateException("NYI: " + this);
+ }
+ }
+}
diff --git a/hyracks-fullstack/hyracks/pom.xml b/hyracks-fullstack/hyracks/pom.xml
index 8d6a45f..7bef19e 100644
--- a/hyracks-fullstack/hyracks/pom.xml
+++ b/hyracks-fullstack/hyracks/pom.xml
@@ -32,6 +32,11 @@
<build>
<pluginManagement>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.5.1</version>
+ </plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
diff --git a/hyracks-fullstack/pom.xml b/hyracks-fullstack/pom.xml
index 393119d..62407a4 100644
--- a/hyracks-fullstack/pom.xml
+++ b/hyracks-fullstack/pom.xml
@@ -128,11 +128,6 @@
<version>2.6</version>
</dependency>
<dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.4</version>