Skip to content

Commit a17a264

Browse files
shenshenglijoshelser
authored andcommitted
HBASE-25449 'dfs.client.read.shortcircuit' should not be set in hbase-default.xml
Signed-off-by: Josh Elser <[email protected]>
1 parent 1abacde commit a17a264

File tree

4 files changed

+103
-2
lines changed

4 files changed

+103
-2
lines changed

hbase-common/src/main/resources/hbase-default.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,15 +1437,15 @@ possible configurations would overwhelm and obscure the important.
14371437
</property>
14381438
<property>
14391439
<name>dfs.client.read.shortcircuit</name>
1440-
<value>false</value>
1440+
<value></value>
14411441
<description>
14421442
If set to true, this configuration parameter enables short-circuit local
14431443
reads.
14441444
</description>
14451445
</property>
14461446
<property>
14471447
<name>dfs.domain.socket.path</name>
1448-
<value>none</value>
1448+
<value></value>
14491449
<description>
14501450
This is a path to a UNIX domain socket that will be used for
14511451
communication between the DataNode and local HDFS clients, if

hbase-common/src/test/java/org/apache/hadoop/hbase/TestHBaseConfiguration.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,23 @@ public void testSecurityConfCaseInsensitive() {
115115
conf.set("hbase.security.authentication", "KERBeros");
116116
Assert.assertTrue(User.isHBaseSecurityEnabled(conf));
117117
}
118+
119+
@Test
120+
public void testGetConfigOfShortcircuitRead() throws Exception {
121+
Configuration conf = HBaseConfiguration.create();
122+
Configuration.addDefaultResource("hdfs-default.xml");
123+
assertEquals("hdfs-default.xml",
124+
conf.getPropertySources("dfs.client.read.shortcircuit")[0]);
125+
assertEquals("false", conf.get("dfs.client.read.shortcircuit"));
126+
assertNull(conf.get("dfs.domain.socket.path"));
127+
Configuration.addDefaultResource("hdfs-scr-enabled.xml");
128+
assertEquals("hdfs-scr-enabled.xml",
129+
conf.getPropertySources("dfs.client.read.shortcircuit")[0]);
130+
assertEquals("hdfs-scr-enabled.xml",
131+
conf.getPropertySources("dfs.domain.socket.path")[0]);
132+
assertEquals("true", conf.get("dfs.client.read.shortcircuit"));
133+
assertEquals("/var/lib/hadoop-hdfs/dn_socket", conf.get("dfs.domain.socket.path"));
134+
}
118135

119136
private static class ReflectiveCredentialProviderClient {
120137
public static final String HADOOP_CRED_PROVIDER_FACTORY_CLASS_NAME =
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3+
<!--
4+
/**
5+
* Licensed to the Apache Software Foundation (ASF) under one
6+
* or more contributor license agreements. See the NOTICE file
7+
* distributed with this work for additional information
8+
* regarding copyright ownership. The ASF licenses this file
9+
* to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance
11+
* with the License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
-->
22+
23+
<configuration>
24+
<property>
25+
<name>dfs.client.read.shortcircuit</name>
26+
<value>false</value>
27+
<description>
28+
If set to true, this configuration parameter enables short-circuit local
29+
reads.
30+
</description>
31+
</property>
32+
<property>
33+
<name>dfs.domain.socket.path</name>
34+
<value></value>
35+
<description>
36+
Optional. This is a path to a UNIX domain socket that will be used for
37+
communication between the DataNode and local HDFS clients.
38+
If the string "_PORT" is present in this path, it will be replaced by the
39+
TCP port of the DataNode.
40+
</description>
41+
</property>
42+
</configuration>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
3+
<!--
4+
/**
5+
* Licensed to the Apache Software Foundation (ASF) under one
6+
* or more contributor license agreements. See the NOTICE file
7+
* distributed with this work for additional information
8+
* regarding copyright ownership. The ASF licenses this file
9+
* to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance
11+
* with the License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS,
17+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
-->
22+
23+
<configuration>
24+
<property>
25+
<name>dfs.client.read.shortcircuit</name>
26+
<value>true</value>
27+
<description>
28+
If set to true, this configuration parameter enables short-circuit local
29+
reads.
30+
</description>
31+
</property>
32+
<property>
33+
<name>dfs.domain.socket.path</name>
34+
<value>/var/lib/hadoop-hdfs/dn_socket</value>
35+
<description>
36+
Optional. This is a path to a UNIX domain socket that will be used for
37+
communication between the DataNode and local HDFS clients.
38+
If the string "_PORT" is present in this path, it will be replaced by the
39+
TCP port of the DataNode.
40+
</description>
41+
</property>
42+
</configuration>

0 commit comments

Comments
 (0)