diff --git a/.github/workflows/ambari.yml b/.github/workflows/ambari.yml index b5ac9e1f..efb55370 100644 --- a/.github/workflows/ambari.yml +++ b/.github/workflows/ambari.yml @@ -27,10 +27,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 8 + java-version: 17 distribution: temurin cache: maven - name: Install Kerberos development libraries diff --git a/ambari-metrics-assembly/pom.xml b/ambari-metrics-assembly/pom.xml index 8f26a5e7..859016aa 100644 --- a/ambari-metrics-assembly/pom.xml +++ b/ambari-metrics-assembly/pom.xml @@ -964,7 +964,7 @@ ${collector.dir}/target/lib directory - phoenix*.jar,antlr*.jar,re2j*.jar,failureaccess*.jar,guava-28*.jar,stax2-api*.jar,woodstox-core*.jar,hadoop-annotations*.jar,hadoop-auth*.jar,hadoop-common*.jar,commons-configuration2*.jar,hadoop-yarn-api-*.jar,hadoop-yarn-client-*.jar,hadoop-yarn-common-*.jar,hadoop-yarn-registry-*.jar,hadoop-yarn-server-applicationhistoryservice-*.jar,hadoop-yarn-server-common-*.jar,hadoop-yarn-server-nodemanager-*.jar,hadoop-yarn-server-resourcemanager-*.jar,hadoop-yarn-server-timelineservice-*.jar,hadoop-yarn-server-web-proxy-*.jar + phoenix*.jar,antlr*.jar,re2j*.jar,failureaccess*.jar,guava-32*.jar,stax2-api*.jar,woodstox-core*.jar,hadoop-annotations*.jar,hadoop-auth*.jar,hadoop-common*.jar,commons-configuration2*.jar,hadoop-yarn-api-*.jar,hadoop-yarn-client-*.jar,hadoop-yarn-common-*.jar,hadoop-yarn-registry-*.jar,hadoop-yarn-server-applicationhistoryservice-*.jar,hadoop-yarn-server-common-*.jar,hadoop-yarn-server-nodemanager-*.jar,hadoop-yarn-server-resourcemanager-*.jar,hadoop-yarn-server-timelineservice-*.jar,hadoop-yarn-server-web-proxy-*.jar perm 644 diff --git a/ambari-metrics-common/pom.xml b/ambari-metrics-common/pom.xml index faedbf01..9d2eb5d1 100644 --- a/ambari-metrics-common/pom.xml +++ b/ambari-metrics-common/pom.xml @@ -31,7 +31,7 @@ maven-compiler-plugin - 3.2 + 3.5 org.vafer @@ -56,7 +56,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.1 + 3.5.1 @@ -103,7 +103,7 @@ com.google.guava guava - 28.0-jre + 32.1.3-jre org.apache.curator @@ -156,6 +156,11 @@ httpclient 4.5.2 + + javax.xml.bind + jaxb-api + 2.2.2 + junit junit diff --git a/ambari-metrics-flume-sink/pom.xml b/ambari-metrics-flume-sink/pom.xml index 6ac7f689..ff033e72 100644 --- a/ambari-metrics-flume-sink/pom.xml +++ b/ambari-metrics-flume-sink/pom.xml @@ -54,7 +54,7 @@ limitations under the License. maven-compiler-plugin - 3.2 + 3.5 com.github.goldin @@ -141,7 +141,7 @@ limitations under the License. com.google.guava guava - 18.0 + 32.1.3-jre diff --git a/ambari-metrics-hadoop-sink/pom.xml b/ambari-metrics-hadoop-sink/pom.xml index af23ccdb..91b9b782 100644 --- a/ambari-metrics-hadoop-sink/pom.xml +++ b/ambari-metrics-hadoop-sink/pom.xml @@ -60,7 +60,7 @@ limitations under the License. maven-compiler-plugin - 3.2 + 3.5 com.github.goldin diff --git a/ambari-metrics-host-aggregator/pom.xml b/ambari-metrics-host-aggregator/pom.xml index 5eadd9d8..6556e80c 100644 --- a/ambari-metrics-host-aggregator/pom.xml +++ b/ambari-metrics-host-aggregator/pom.xml @@ -41,7 +41,7 @@ com.google.guava guava - 18.0 + 32.1.3-jre org.apache.ambari @@ -145,7 +145,7 @@ org.apache.maven.plugins maven-shade-plugin - 1.6 + 3.5.1 false diff --git a/ambari-metrics-host-aggregator/src/test/java/org/apache/hadoop/metrics2/host/aggregator/AggregatorWebServiceTest.java b/ambari-metrics-host-aggregator/src/test/java/org/apache/hadoop/metrics2/host/aggregator/AggregatorWebServiceTest.java index 0f15c208..9125cb4d 100644 --- a/ambari-metrics-host-aggregator/src/test/java/org/apache/hadoop/metrics2/host/aggregator/AggregatorWebServiceTest.java +++ b/ambari-metrics-host-aggregator/src/test/java/org/apache/hadoop/metrics2/host/aggregator/AggregatorWebServiceTest.java @@ -31,16 +31,14 @@ import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; import org.junit.Test; - import javax.ws.rs.core.MediaType; import java.util.Collection; import java.util.Map; -import static org.junit.Assert.assertEquals; - public class AggregatorWebServiceTest extends JerseyTest { + public AggregatorWebServiceTest() { super(new WebAppDescriptor.Builder( "org.apache.hadoop.metrics2.host.aggregator") @@ -74,11 +72,9 @@ public void testWrongPath() { assertEquals(404, response.getStatus()); } - @Test public void testMetricsPost() { TimelineMetricsHolder timelineMetricsHolder = TimelineMetricsHolder.getInstance(); - timelineMetricsHolder.extractMetricsForAggregationPublishing(); timelineMetricsHolder.extractMetricsForRawPublishing(); diff --git a/ambari-metrics-host-monitoring/pom.xml b/ambari-metrics-host-monitoring/pom.xml index ac4e4075..1fee5090 100644 --- a/ambari-metrics-host-monitoring/pom.xml +++ b/ambari-metrics-host-monitoring/pom.xml @@ -53,7 +53,7 @@ maven-compiler-plugin - 3.2 + 3.5 org.codehaus.mojo diff --git a/ambari-metrics-kafka-sink/pom.xml b/ambari-metrics-kafka-sink/pom.xml index cd78b98e..8c73235a 100644 --- a/ambari-metrics-kafka-sink/pom.xml +++ b/ambari-metrics-kafka-sink/pom.xml @@ -72,7 +72,7 @@ limitations under the License. maven-compiler-plugin - 3.2 + 3.5 com.github.goldin diff --git a/ambari-metrics-storm-sink/pom.xml b/ambari-metrics-storm-sink/pom.xml index 58887df2..36e34088 100644 --- a/ambari-metrics-storm-sink/pom.xml +++ b/ambari-metrics-storm-sink/pom.xml @@ -38,7 +38,7 @@ limitations under the License. maven-compiler-plugin - 3.2 + 3.5 com.github.goldin @@ -54,7 +54,7 @@ limitations under the License. org.apache.maven.plugins maven-shade-plugin - 3.2.1 + 3.5.1 package diff --git a/ambari-metrics-timelineservice/pom.xml b/ambari-metrics-timelineservice/pom.xml index 1393492d..058f9145 100644 --- a/ambari-metrics-timelineservice/pom.xml +++ b/ambari-metrics-timelineservice/pom.xml @@ -57,7 +57,7 @@ maven-compiler-plugin - 3.2 + 3.5 org.codehaus.mojo @@ -216,7 +216,6 @@ true always - -XX:-UseSplitVerifier ${testcase.groups} @@ -524,7 +523,7 @@ com.google.guava guava - 28.0-jre + 32.1.3-jre commons-logging @@ -664,6 +663,12 @@ + + org.apache.hadoop + hadoop-yarn-server-applicationhistoryservice + ${hadoop.version} + + com.sun.jersey.jersey-test-framework diff --git a/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/webapp/TestTimelineWebServices.java b/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/webapp/TestTimelineWebServices.java index 3456af62..85cde513 100644 --- a/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/webapp/TestTimelineWebServices.java +++ b/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/webapp/TestTimelineWebServices.java @@ -25,8 +25,10 @@ import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics; import org.apache.ambari.metrics.core.timeline.TestTimelineMetricStore; import org.apache.ambari.metrics.core.timeline.TimelineMetricStore; +import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics; import org.apache.hadoop.yarn.webapp.GenericExceptionHandler; import org.apache.hadoop.yarn.webapp.YarnJacksonJaxbJsonProvider; + import org.junit.Test; import com.google.inject.Guice; @@ -75,24 +77,24 @@ protected Injector getInjector() { public TestTimelineWebServices() { super(new WebAppDescriptor.Builder( - "org.apache.ambari.metrics.webapp") - .contextListenerClass(GuiceServletConfig.class) - .filterClass(com.google.inject.servlet.GuiceFilter.class) - .contextPath("jersey-guice-filter") - .servletPath("/") - .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class)) - .build()); + "org.apache.ambari.metrics.webapp") + .contextListenerClass(GuiceServletConfig.class) + .filterClass(com.google.inject.servlet.GuiceFilter.class) + .contextPath("jersey-guice-filter") + .servletPath("/") + .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class)) + .build()); } @Test public void testAbout() throws Exception { WebResource r = resource(); ClientResponse response = r.path("ws").path("v1").path("timeline") - .accept(MediaType.APPLICATION_JSON) - .get(ClientResponse.class); + .accept(MediaType.APPLICATION_JSON) + .get(ClientResponse.class); assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType()); TimelineWebServices.AboutInfo about = - response.getEntity(TimelineWebServices.AboutInfo.class); + response.getEntity(TimelineWebServices.AboutInfo.class); Assert.assertNotNull(about); Assert.assertEquals("AMS API", about.getAbout()); } @@ -109,9 +111,9 @@ private static void verifyMetrics(TimelineMetrics metrics) { public void testGetMetrics() throws Exception { WebResource r = resource(); ClientResponse response = r.path("ws").path("v1").path("timeline") - .path("metrics").queryParam("metricNames", "cpu_user").queryParam("precision", "seconds") - .accept(MediaType.APPLICATION_JSON) - .get(ClientResponse.class); + .path("metrics").queryParam("metricNames", "cpu_user").queryParam("precision", "seconds") + .accept(MediaType.APPLICATION_JSON) + .get(ClientResponse.class); assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType()); verifyMetrics(response.getEntity(TimelineMetrics.class)); } diff --git a/pom.xml b/pom.xml index 8aadd332..e600d417 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,7 @@ https://repository.apache.org/service/local/staging/deploy/maven2 2.10.0 false + 2.41 1 @@ -133,7 +134,7 @@ com.google.guava guava - 28.0-jre + 32.1.3-jre @@ -169,9 +170,20 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19 + 3.2.5 ${skipSurefireTests} + + --add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/java.lang.reflect=ALL-UNNAMED + --add-opens java.management/java.lang.management=ALL-UNNAMED + --add-opens java.base/java.io=ALL-UNNAMED + --add-opens java.base/java.nio=ALL-UNNAMED + --add-opens java.base/java.util=ALL-UNNAMED + --add-opens java.base/java.util.regex=ALL-UNNAMED + --add-opens java.base/java.util.concurrent=ALL-UNNAMED + --add-opens java.base/java.net=ALL-UNNAMED + ${testcase.groups} @@ -179,10 +191,10 @@ maven-compiler-plugin - 3.2 + 3.5 - 1.8 - 1.8 + 17 + 17