Skip to content

Commit 631b9b6

Browse files
committed
Fix checkstyle.
1 parent b77076a commit 631b9b6

File tree

5 files changed

+52
-4
lines changed

5 files changed

+52
-4
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeysPublic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ public class CommonConfigurationKeysPublic {
736736
*/
737737
public static final String HADOOP_RPC_PROTECTION =
738738
"hadoop.rpc.protection";
739-
public static String HADOOP_SECURITY_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY
739+
public static final String HADOOP_SECURITY_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY
740740
= "hadoop.security.sasl.CustomizedCallbackHandler.class";
741741
/** Class to override Sasl Properties for a connection */
742742
public static final String HADOOP_SECURITY_SASL_PROPS_RESOLVER_CLASS =

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/CustomizedCallbackHandler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public interface CustomizedCallbackHandler {
3737
class Cache {
3838
private static final Map<String, CustomizedCallbackHandler> MAP = new HashMap<>();
3939

40-
private static synchronized CustomizedCallbackHandler getSynchronously(String key, Configuration conf) {
40+
private static synchronized CustomizedCallbackHandler getSynchronously(
41+
String key, Configuration conf) {
4142
//check again synchronously
4243
final CustomizedCallbackHandler cached = MAP.get(key);
4344
if (cached != null) {
@@ -68,6 +69,8 @@ private static CustomizedCallbackHandler get(String key, Configuration conf) {
6869
public static synchronized void clear() {
6970
MAP.clear();
7071
}
72+
73+
private Cache() { }
7174
}
7275

7376
class DefaultHandler implements CustomizedCallbackHandler {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* Classes for hadoop security.
21+
*/
22+
package org.apache.hadoop.security;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* Classes for data transfer SASL implementation.
21+
*/
22+
package org.apache.hadoop.hdfs.protocol.datatransfer.sasl;

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/TestCustomizedCallbackHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.hadoop.hdfs.protocol.datatransfer.sasl;
1919

2020
import org.apache.hadoop.conf.Configuration;
21-
import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
2221
import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys;
2322
import org.apache.hadoop.hdfs.protocol.datatransfer.sasl.SaslDataTransferServer.SaslServerCallbackHandler;
2423
import org.apache.hadoop.security.CustomizedCallbackHandler;
@@ -35,6 +34,8 @@
3534
import java.util.List;
3635
import java.util.concurrent.atomic.AtomicReference;
3736

37+
import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY;
38+
3839
/** For testing {@link CustomizedCallbackHandler}. */
3940
public class TestCustomizedCallbackHandler {
4041
static final Logger LOG = LoggerFactory.getLogger(TestCustomizedCallbackHandler.class);
@@ -87,7 +88,7 @@ public void testCustomizedCallbackHandler() throws Exception {
8788
assertCallbacks(callbacks);
8889

8990
reset();
90-
conf.setClass(CommonConfigurationKeysPublic.HADOOP_SECURITY_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY,
91+
conf.setClass(HADOOP_SECURITY_SASL_CUSTOMIZEDCALLBACKHANDLER_CLASS_KEY,
9192
MyCallbackHandler.class, CustomizedCallbackHandler.class);
9293
new SaslRpcServer.SaslDigestCallbackHandler(null, null, conf).handle(callbacks);
9394
assertCallbacks(callbacks);

0 commit comments

Comments
 (0)