HDFS-13796. Allow verbosity of InMemoryLevelDBAliasMapServer to be configurable.

This commit is contained in:
Virajith Jalaparti 2018-08-07 10:15:28 -07:00
parent 6ed8593d18
commit b1a59b1644
3 changed files with 18 additions and 1 deletions

View File

@ -96,6 +96,8 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
public static final int DFS_PROVIDED_ALIASMAP_INMEMORY_BATCH_SIZE_DEFAULT = 500;
public static final String DFS_PROVIDED_ALIASMAP_INMEMORY_ENABLED = "dfs.provided.aliasmap.inmemory.enabled";
public static final boolean DFS_PROVIDED_ALIASMAP_INMEMORY_ENABLED_DEFAULT = false;
public static final String DFS_PROVIDED_ALIASMAP_INMEMORY_SERVER_LOG = "dfs.provided.aliasmap.inmemory.server.log";
public static final boolean DFS_PROVIDED_ALIASMAP_INMEMORY_SERVER_LOG_DEFAULT = false;
public static final String DFS_DATANODE_BALANCE_BANDWIDTHPERSEC_KEY =
HdfsClientConfigKeys.DeprecatedKeys.DFS_DATANODE_BALANCE_BANDWIDTHPERSEC_KEY;

View File

@ -39,6 +39,8 @@
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_ADDRESS;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_ADDRESS_DEFAULT;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_BIND_HOST;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_SERVER_LOG;
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_PROVIDED_ALIASMAP_INMEMORY_SERVER_LOG_DEFAULT;
import static org.apache.hadoop.hdfs.DFSUtil.getBindAddress;
import static org.apache.hadoop.hdfs.protocol.proto.AliasMapProtocolProtos.*;
import static org.apache.hadoop.hdfs.server.aliasmap.InMemoryAliasMap.CheckedFunction2;
@ -87,13 +89,17 @@ public void start() throws IOException {
DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_ADDRESS_DEFAULT,
DFS_PROVIDED_ALIASMAP_INMEMORY_RPC_BIND_HOST);
boolean setVerbose = conf.getBoolean(
DFS_PROVIDED_ALIASMAP_INMEMORY_SERVER_LOG,
DFS_PROVIDED_ALIASMAP_INMEMORY_SERVER_LOG_DEFAULT);
aliasMapServer = new RPC.Builder(conf)
.setProtocol(AliasMapProtocolPB.class)
.setInstance(aliasMapProtocolService)
.setBindAddress(rpcAddress.getHostName())
.setPort(rpcAddress.getPort())
.setNumHandlers(1)
.setVerbose(true)
.setVerbose(setVerbose)
.build();
LOG.info("Starting InMemoryLevelDBAliasMapServer on {}", rpcAddress);

View File

@ -4867,6 +4867,15 @@
</description>
</property>
<property>
<name>dfs.provided.aliasmap.inmemory.server.log</name>
<value>false</value>
<description>
Ensures that InMemoryAliasMap server logs every call to it.
Set to false by default.
</description>
</property>
<property>
<name>dfs.provided.aliasmap.text.delimiter</name>
<value>,</value>