diff --git a/.github/workflows/ambari.yml b/.github/workflows/ambari.yml index efb55370..b5ac9e1f 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 17 + - name: Set up JDK 8 uses: actions/setup-java@v3 with: - java-version: 17 + java-version: 8 distribution: temurin cache: maven - name: Install Kerberos development libraries diff --git a/ambari-metrics-assembly/pom.xml b/ambari-metrics-assembly/pom.xml index 859016aa..8f26a5e7 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-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 + 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 perm 644 diff --git a/ambari-metrics-common/pom.xml b/ambari-metrics-common/pom.xml index 9d2eb5d1..faedbf01 100644 --- a/ambari-metrics-common/pom.xml +++ b/ambari-metrics-common/pom.xml @@ -31,7 +31,7 @@ maven-compiler-plugin - 3.5 + 3.2 org.vafer @@ -56,7 +56,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.2.1 @@ -103,7 +103,7 @@ com.google.guava guava - 32.1.3-jre + 28.0-jre org.apache.curator @@ -156,11 +156,6 @@ 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 ff033e72..6ac7f689 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.5 + 3.2 com.github.goldin @@ -141,7 +141,7 @@ limitations under the License. com.google.guava guava - 32.1.3-jre + 18.0 diff --git a/ambari-metrics-hadoop-sink/pom.xml b/ambari-metrics-hadoop-sink/pom.xml index 91b9b782..af23ccdb 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.5 + 3.2 com.github.goldin diff --git a/ambari-metrics-host-aggregator/pom.xml b/ambari-metrics-host-aggregator/pom.xml index 6556e80c..5eadd9d8 100644 --- a/ambari-metrics-host-aggregator/pom.xml +++ b/ambari-metrics-host-aggregator/pom.xml @@ -41,7 +41,7 @@ com.google.guava guava - 32.1.3-jre + 18.0 org.apache.ambari @@ -145,7 +145,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 1.6 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 9125cb4d..0f15c208 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,14 +31,16 @@ 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 class AggregatorWebServiceTest extends JerseyTest { public AggregatorWebServiceTest() { super(new WebAppDescriptor.Builder( "org.apache.hadoop.metrics2.host.aggregator") @@ -72,9 +74,11 @@ 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 1fee5090..ac4e4075 100644 --- a/ambari-metrics-host-monitoring/pom.xml +++ b/ambari-metrics-host-monitoring/pom.xml @@ -53,7 +53,7 @@ maven-compiler-plugin - 3.5 + 3.2 org.codehaus.mojo diff --git a/ambari-metrics-kafka-sink/pom.xml b/ambari-metrics-kafka-sink/pom.xml index 8c73235a..cd78b98e 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.5 + 3.2 com.github.goldin diff --git a/ambari-metrics-storm-sink/pom.xml b/ambari-metrics-storm-sink/pom.xml index 36e34088..58887df2 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.5 + 3.2 com.github.goldin @@ -54,7 +54,7 @@ limitations under the License. org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.2.1 package diff --git a/ambari-metrics-timelineservice/pom.xml b/ambari-metrics-timelineservice/pom.xml index 2bfd9efb..2ae86dfa 100644 --- a/ambari-metrics-timelineservice/pom.xml +++ b/ambari-metrics-timelineservice/pom.xml @@ -57,7 +57,7 @@ maven-compiler-plugin - 3.5 + 3.2 org.codehaus.mojo @@ -216,6 +216,7 @@ true always + -XX:-UseSplitVerifier ${testcase.groups} @@ -527,7 +528,7 @@ com.google.guava guava - 32.1.3-jre + 28.0-jre commons-logging @@ -667,12 +668,6 @@ - - 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 85cde513..3456af62 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,10 +25,8 @@ 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; @@ -77,24 +75,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()); } @@ -111,9 +109,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 6c59b503..d36476ea 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,6 @@ https://repository.apache.org/service/local/staging/deploy/maven2 2.10.0 false - 2.41 1 @@ -132,7 +131,7 @@ com.google.guava guava - 32.1.3-jre + 28.0-jre @@ -168,20 +167,9 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 2.19 ${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} @@ -189,10 +177,10 @@ maven-compiler-plugin - 3.5 + 3.2 - 17 - 17 + 1.8 + 1.8