From 44bad3ba0e96ffcac93a7dff1516670f20cfe5b9 Mon Sep 17 00:00:00 2001 From: Abhishek Pal Date: Fri, 11 Oct 2024 20:29:59 +0530 Subject: [PATCH] Addressed checkstyle and RAT issues --- .../hadoop/ozone/conf/OzoneS3ConfigUtils.java | 21 +++++++++++++++++ .../om/ha/GrpcOMFailoverProxyProvider.java | 4 ++-- ...Utils.java => TestOzoneS3ConfigUtils.java} | 23 ++++++++++++++++++- .../hadoop/ozone/om/TestOzoneConfigUtil.java | 5 ---- 4 files changed, 45 insertions(+), 8 deletions(-) rename hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/{TestOzoneConfigUtils.java => TestOzoneS3ConfigUtils.java} (65%) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/conf/OzoneS3ConfigUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/conf/OzoneS3ConfigUtils.java index 68352cb6c33..952f4d0813b 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/conf/OzoneS3ConfigUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/conf/OzoneS3ConfigUtils.java @@ -1,3 +1,21 @@ +/* + * 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.hadoop.ozone.conf; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -16,6 +34,9 @@ import java.io.IOException; import java.util.Collection; +/** + * Config based utilities for Ozone S3 + */ public final class OzoneS3ConfigUtils { static final Logger LOG = LoggerFactory.getLogger(OzoneS3ConfigUtils.class); diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/GrpcOMFailoverProxyProvider.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/GrpcOMFailoverProxyProvider.java index 105e26e4c0c..f771f3b90cf 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/GrpcOMFailoverProxyProvider.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/ha/GrpcOMFailoverProxyProvider.java @@ -129,12 +129,12 @@ private T createOMProxy() throws IOException { } /** - * Get the protocol proxy for provided address + * Get the protocol proxy for provided address. * @param address An instance of {@link InetSocketAddress} which contains the address to connect * @return the proxy connection to the address and the set of methods supported by the server at the address * @throws IOException if any error occurs while trying to get the proxy */ - private T createOmProxy(InetSocketAddress address) throws IOException{ + private T createOmProxy(InetSocketAddress address) throws IOException { Configuration hadoopConf = LegacyHadoopConfigurationSource.asHadoopConfiguration(getConf()); diff --git a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/TestOzoneConfigUtils.java b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/TestOzoneS3ConfigUtils.java similarity index 65% rename from hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/TestOzoneConfigUtils.java rename to hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/TestOzoneS3ConfigUtils.java index 8b289c0a382..5d5541f01f1 100644 --- a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/TestOzoneConfigUtils.java +++ b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/conf/TestOzoneS3ConfigUtils.java @@ -1,3 +1,21 @@ +/* + * 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.hadoop.ozone.conf; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -9,7 +27,10 @@ import static org.assertj.core.api.Assertions.assertThat; -public class TestOzoneConfigUtils { +/** + * This class is to test S3 configuration based utils + */ +public class TestOzoneS3ConfigUtils { @Test public void testS3AdminExtraction() throws IOException { diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOzoneConfigUtil.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOzoneConfigUtil.java index a65042a904d..41d6c28e2b9 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOzoneConfigUtil.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOzoneConfigUtil.java @@ -20,15 +20,10 @@ import org.apache.hadoop.hdds.client.ECReplicationConfig; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.client.ReplicationConfig; -import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.proto.HddsProtos; -import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.io.IOException; -import java.util.Arrays; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when;