This is an automated email from the ASF dual-hosted git repository.
ifesdjeen pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new 0dc5bd5 Changes required for Harry build
0dc5bd5 is described below
commit 0dc5bd51f5ff36434bf7b5244242977ecbb47e39
Author: Alex Petrov <[email protected]>
AuthorDate: Thu Sep 3 16:00:31 2020 +0200
Changes required for Harry build
Patch by Alex Petrov; reviewed by Marcus Eriksson for CASSANDRA-16102
---
build-shaded-dtest-jar.sh | 38 ++++++
build.xml | 2 +-
lib/snakeyaml-1.11.jar | Bin 270552 -> 0 bytes
lib/snakeyaml-1.23.jar | Bin 0 -> 301298 bytes
relocate-dependencies.pom | 132 +++++++++++++++++++++
.../cassandra/config/YamlConfigurationLoader.java | 23 ++--
6 files changed, 186 insertions(+), 9 deletions(-)
diff --git a/build-shaded-dtest-jar.sh b/build-shaded-dtest-jar.sh
new file mode 100755
index 0000000..efedcaa
--- /dev/null
+++ b/build-shaded-dtest-jar.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+set -xe
+
+# Cassandra version that is specified in build.xml
+CASSANDRA_VERSION=$1
+# In-JVM dtest version that is specified in relocate-dependencies.pom
+DTEST_VERSION=$2
+ARTIFACT_NAME=cassandra-dtest
+REPO_DIR=~/.m2/repository
+
+ant clean
+ant dtest-jar
+
+# Install the version that will be shaded
+mvn install:install-file \
+ -Dfile=./build/dtest-${CASSANDRA_VERSION}.jar \
+ -DgroupId=org.apache.cassandra \
+ -DartifactId=${ARTIFACT_NAME}-local \
+ -Dversion=${DTEST_VERSION} \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DlocalRepositoryPath=${REPO_DIR}
+
+# Create shaded artifact
+mvn -f relocate-dependencies.pom package -DskipTests -nsu
+
+# Deploy shaded artifact
+mvn install:install-file \
+ -Dfile=./target/${ARTIFACT_NAME}-shaded-${DTEST_VERSION}.jar \
+ -DgroupId=org.apache.cassandra \
+ -DartifactId=${ARTIFACT_NAME}-shaded \
+ -Dversion=${DTEST_VERSION} \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DlocalRepositoryPath=${REPO_DIR}
+
+set +xe
diff --git a/build.xml b/build.xml
index e77dd0b..8c9c49d 100644
--- a/build.xml
+++ b/build.xml
@@ -583,7 +583,7 @@
<dependency groupId="com.boundary" artifactId="high-scale-lib"
version="1.0.6"/>
<dependency groupId="com.github.jbellis" artifactId="jamm"
version="${jamm.version}"/>
- <dependency groupId="org.yaml" artifactId="snakeyaml"
version="1.11"/>
+ <dependency groupId="org.yaml" artifactId="snakeyaml"
version="1.23"/>
<dependency groupId="junit" artifactId="junit" version="4.12" />
<dependency groupId="org.mockito" artifactId="mockito-core"
version="3.2.4" />
<dependency groupId="org.quicktheories" artifactId="quicktheories"
version="0.25" />
diff --git a/lib/snakeyaml-1.11.jar b/lib/snakeyaml-1.11.jar
deleted file mode 100644
index 3e237cd..0000000
Binary files a/lib/snakeyaml-1.11.jar and /dev/null differ
diff --git a/lib/snakeyaml-1.23.jar b/lib/snakeyaml-1.23.jar
new file mode 100644
index 0000000..adcef4f
Binary files /dev/null and b/lib/snakeyaml-1.23.jar differ
diff --git a/relocate-dependencies.pom b/relocate-dependencies.pom
new file mode 100644
index 0000000..0e5eabc
--- /dev/null
+++ b/relocate-dependencies.pom
@@ -0,0 +1,132 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.cassandra</groupId>
+ <artifactId>cassandra-dtest-shaded</artifactId>
+ <version>4.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>Cassandra in-jvm dtests shaded jar</name>
+
+ <properties>
+ <project.type>library</project.type>
+ <java.version>1.8</java.version>
+ <test.source.directory>src/test/unit/java</test.source.directory>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <junit.version>4.12</junit.version>
+ <maven.compiler.source>${java.version}</maven.compiler.source>
+ <maven.compiler.target>${java.version}</maven.compiler.target>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.cassandra</groupId>
+ <artifactId>cassandra-dtest-local</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <testSourceDirectory>${test.source.directory}</testSourceDirectory>
+
+ <plugins>
+ <!-- generate a shaded JAR -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>3.2.1</version>
+
+ <configuration>
+ <createSourcesJar>false</createSourcesJar>
+
+ <artifactSet>
+ <includes>
+
<include>org.apache.cassandra:cassandra-dtest-local</include>
+ </includes>
+ </artifactSet>
+
+ <relocations>
+ <relocation>
+ <pattern>io.netty</pattern>
+
<shadedPattern>relocated.shaded.io.netty</shadedPattern>
+ </relocation>
+
+ <relocation>
+ <pattern>com.google</pattern>
+
<shadedPattern>relocated.shaded.com.google</shadedPattern>
+ </relocation>
+
+ <relocation>
+ <pattern>com.datastax</pattern>
+
<shadedPattern>relocated.shaded.com.datastax</shadedPattern>
+ </relocation>
+ </relocations>
+
+ <filters>
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>**/Log4j2Plugins.dat</exclude>
+ </excludes>
+ </filter>
+
+ <filter>
+ <artifact>io.netty:netty-*</artifact>
+ <excludes>
+ <exclude>META-INF/maven/</exclude>
+
<exclude>META-INF/io.netty.versions.properties</exclude>
+ </excludes>
+ </filter>
+
+ <filter>
+ <artifact>com.google.guava:guava</artifact>
+ <excludes>
+ <exclude>META-INF/maven/</exclude>
+ </excludes>
+ </filter>
+
+ <filter>
+ <artifact>com.google.guava:failureaccess</artifact>
+ <excludes>
+ <exclude>META-INF/maven/</exclude>
+ </excludes>
+ </filter>
+
+ <filter>
+
<artifact>com.datastax.cassandra:cassandra-driver-core</artifact>
+ <excludes>
+ <exclude>META-INF/maven/</exclude>
+ </excludes>
+ </filter>
+
+ </filters>
+ </configuration>
+
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+
+ </configuration>
+ </execution>
+ </executions>
+
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
index ca5e41a..08dfd4c 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -22,7 +22,9 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.annotation.Annotation;
import java.net.URL;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -146,11 +148,12 @@ public class YamlConfigurationLoader implements
ConfigurationLoader
@Override
protected List<Object> createDefaultList(int initSize)
{
+
return Lists.newCopyOnWriteArrayList();
}
@Override
- protected Map<Object, Object> createDefaultMap()
+ protected Map<Object, Object> createDefaultMap(int initSize)
{
return Maps.newConcurrentMap();
}
@@ -160,12 +163,6 @@ public class YamlConfigurationLoader implements
ConfigurationLoader
{
return Sets.newConcurrentHashSet();
}
-
- @Override
- protected Set<Object> createDefaultSet()
- {
- return Sets.newConcurrentHashSet();
- }
}
private Config loadConfig(Yaml yaml, byte[] configBytes)
@@ -192,7 +189,7 @@ public class YamlConfigurationLoader implements
ConfigurationLoader
}
@Override
- public Property getProperty(Class<? extends Object> type, String name)
throws IntrospectionException
+ public Property getProperty(Class<? extends Object> type, String name)
{
final Property result = super.getProperty(type, name);
@@ -224,6 +221,16 @@ public class YamlConfigurationLoader implements
ConfigurationLoader
{
return result.get(object);
}
+
+ public List<Annotation> getAnnotations()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public <A extends Annotation> A getAnnotation(Class<A> aClass)
+ {
+ return null;
+ }
};
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]