Skip to content

Commit

Permalink
Add support for HCD 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
emerkle826 committed Nov 25, 2024
1 parent 6476187 commit a368051
Show file tree
Hide file tree
Showing 21 changed files with 1,897 additions and 44 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog for Management API, new PRs should update the `main / unreleased` sect
```

## unreleased
* [FEATURE] [#573](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/573) Add support for HCD 1.2

## v0.1.90 (2024-11-22)
* [FEATURE] [#566](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/566) Add listRoles and dropRole functionality to the REST interface
Expand Down
74 changes: 41 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,34 @@

The following versions of Cassandra and DSE are published to Docker and supported:

| Cassandra 4.0.x | Cassandra 4.1.x | Cassandra 5.0.x | DSE 6.8.x | DSE 6.9.x | HCD 1.0.x |
|-----------------| --------------- |-----------------|-----------|-----------| ----------|
| 4.0.0 | 4.1.0 | 5.0.1 | 6.8.25 | 6.9.0 | 1.0.0 |
| 4.0.1 | 4.1.1 | 5.0.2 | 6.8.26 | 6.9.1 | |
| 4.0.3 | 4.1.2 | | 6.8.28 | 6.9.2 | |
| 4.0.4 | 4.1.3 | | 6.8.29 | 6.9.3 | |
| 4.0.5 | 4.1.4 | | 6.8.30 | 6.9.4 | |
| 4.0.6 | 4.1.5 | | 6.8.31 | | |
| 4.0.7 | 4.1.6 | | 6.8.32 | | |
| 4.0.8 | 4.1.7 | | 6.8.33 | | |
| 4.0.9 | | | 6.8.34 | | |
| 4.0.10 | | | 6.8.35 | | |
| 4.0.11 | | | 6.8.36 | | |
| 4.0.12 | | | 6.8.37 | | |
| 4.0.13 | | | 6.8.38 | | |
| 4.0.14 | | | 6.8.39 | | |
| 4.0.15 | | | 6.8.40 | | |
| | | | 6.8.41 | | |
| | | | 6.8.42 | | |
| | | | 6.8.43 | | |
| | | | 6.8.44 | | |
| | | | 6.8.46 | | |
| | | | 6.8.47 | | |
| | | | 6.8.48 | | |
| | | | 6.8.49 | | |
| | | | 6.8.50 | | |
| | | | 6.8.51 | | |
| | | | 6.8.52 | | |
| Cassandra 4.0.x | Cassandra 4.1.x | Cassandra 5.0.x | DSE 6.8.x | DSE 6.9.x | HCD 1.0.x | HCD 1.2.x |
|---------------- | --------------- |---------------- |---------- |---------- | --------- | --------- |
| 4.0.0 | 4.1.0 | 5.0.1 | 6.8.25 | 6.9.0 | 1.0.0 | 1.2.0 |
| 4.0.1 | 4.1.1 | 5.0.2 | 6.8.26 | 6.9.1 | | |
| 4.0.3 | 4.1.2 | | 6.8.28 | 6.9.2 | | |
| 4.0.4 | 4.1.3 | | 6.8.29 | 6.9.3 | | |
| 4.0.5 | 4.1.4 | | 6.8.30 | 6.9.4 | | |
| 4.0.6 | 4.1.5 | | 6.8.31 | | | |
| 4.0.7 | 4.1.6 | | 6.8.32 | | | |
| 4.0.8 | 4.1.7 | | 6.8.33 | | | |
| 4.0.9 | | | 6.8.34 | | | |
| 4.0.10 | | | 6.8.35 | | | |
| 4.0.11 | | | 6.8.36 | | | |
| 4.0.12 | | | 6.8.37 | | | |
| 4.0.13 | | | 6.8.38 | | | |
| 4.0.14 | | | 6.8.39 | | | |
| 4.0.15 | | | 6.8.40 | | | |
| | | | 6.8.41 | | | |
| | | | 6.8.42 | | | |
| | | | 6.8.43 | | | |
| | | | 6.8.44 | | | |
| | | | 6.8.46 | | | |
| | | | 6.8.47 | | | |
| | | | 6.8.48 | | | |
| | | | 6.8.49 | | | |
| | | | 6.8.50 | | | |
| | | | 6.8.51 | | | |
| | | | 6.8.52 | | | |

- Apache Cassandra images are available in `linux/amd64` or `linux/arm64` formats. The DSE images are available only in the `linux/amd64` format.
- All images (with the exception of Cassandra 5.0) are available as an Ubuntu based image or a RedHat UBI 8 based image.
Expand Down Expand Up @@ -194,28 +194,36 @@ Example for DSE 6.9.0

** NOTE: The docker repo is not a typo, it really is `datastax/dse-mgmtapi-6_8` for 6.9 images

### Docker coordinates for HCD 1.0.x images
### Docker coordinates for HCD 1.0.x/1.2.x images

#### Ubuntu based images (HCD 1.0)
#### Ubuntu based images (HCD 1.0/1.2)

For all JDK 11 Ubuntu based HCD 1.0.x images, the Docker coordinates are as follows:
For all JDK 11 Ubuntu based HCD 1.0.x/1.2.x images, the Docker coordinates are as follows:

datastax/hcd:<version>

Example for HCD 1.0.0

datastax/hcd:1.0.0

#### RedHat UBI images (HCD 1.0)
Example for HCD 1.2.0

For all RedHat UBI based HCD 1.0.x images, the Docker coordinates are as follows:
datastax/hcd:1.2.0

#### RedHat UBI images (HCD 1.0/1.2)

For all RedHat UBI based HCD 1.0.x/1.2.x images, the Docker coordinates are as follows:

datastax/hcd:<version>-ubi

Example for HCD 1.0.0

datastax/hcd:1.0.0-ubi

Example for HCD 1.2.0

datastax/hcd:1.2.0-ubi

## Building

### Minimum Java Version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.cassandra.transport.messages.StartupMessage;
import org.apache.cassandra.transport.messages.SupportedMessage;
import org.apache.cassandra.utils.JVMStabilityInspector;
import org.apache.cassandra.utils.MonotonicClock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -283,7 +282,6 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> ou

promise = new VoidChannelPromise(ctx.channel(), false);

long approxStartTimeNanos = MonotonicClock.Global.approxTime.now();
Message.Response response =
Dispatcher.processRequest(
ctx.channel(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class CassandraMetricRegistryListener implements MetricRegistryListener {
private static final int MIN_DSE_PATCH_VERSION = 33;

private static final Pattern VERSION_PATTERN =
Pattern.compile("([1-9]\\d*)\\.(\\d+)\\.(\\d+)(?:-([a-zA-Z0-9]+))?");
Pattern.compile("([1-9]\\d*)\\.(\\d+)\\.(\\d+)(?:-([a-zA-Z0-9\\.]+))?");

private static final String SERVER_VERSION = FBUtilities.getReleaseVersionString();
private static final int SERVER_MAJOR_VERSION;
Expand Down
176 changes: 176 additions & 0 deletions management-api-agent-hcd-1.2.x/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.k8ssandra</groupId>
<artifactId>datastax-mgmtapi</artifactId>
<version>${revision}</version>
</parent>
<version>${revision}</version>
<artifactId>datastax-mgmtapi-agent-hcd-1.2.x</artifactId>
<repositories>
<repository>
<id>artifactory</id>
<url>https://repo.datastax.com/dse</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.k8ssandra</groupId>
<artifactId>datastax-mgmtapi-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.k8ssandra</groupId>
<artifactId>datastax-mgmtapi-agent-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${bytebuddy.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.k8ssandra</groupId>
<artifactId>datastax-mgmtapi-agent-common</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>dse-db-all</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.datastax.dse</groupId>
<artifactId>dse-db-all</artifactId>
<version>5.0.0-beta2.82a4ce1a2756</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>initialize</phase>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<dockerFileRoot>${basedir}</dockerFileRoot>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<outputDirectory/>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Premain-Class>com.datastax.mgmtapi.Agent</Premain-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright DataStax, Inc.
*
* Please see the included license file for details.
*/
package com.datastax.mgmtapi;

import com.datastax.mgmtapi.shim.CassandraAPIHcd;
import com.datastax.mgmtapi.shims.CassandraAPI;

public class CassandraAPIServiceProviderHcd implements CassandraAPIServiceProvider {

@Override
public CassandraAPI getCassandraAPI() {
return new CassandraAPIHcd();
}
}
Loading

0 comments on commit a368051

Please sign in to comment.