gpt4 book ai didi

org.apache.hadoop.security.WhitelistBasedResolver.getDefaultProperties()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 23:57:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.security.WhitelistBasedResolver.getDefaultProperties()方法的一些代码示例,展示了WhitelistBasedResolver.getDefaultProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WhitelistBasedResolver.getDefaultProperties()方法的具体详情如下:
包路径:org.apache.hadoop.security.WhitelistBasedResolver
类名称:WhitelistBasedResolver
方法名:getDefaultProperties

WhitelistBasedResolver.getDefaultProperties介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Identify the Sasl Properties to be used for a connection with a client.
 * @param clientAddress client's address
 * @return the sasl properties to be used for the connection.
 */
@Override
public Map<String, String> getServerProperties(InetAddress clientAddress) {
 if (clientAddress == null) {
  return saslProps;
 }
 return  whiteList.isIn(clientAddress.getHostAddress())?getDefaultProperties():saslProps;
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Identify the Sasl Properties to be used for a connection with a client.
 * @param clientAddress client's address
 * @return the sasl properties to be used for the connection.
 */
@Override
public Map<String, String> getServerProperties(InetAddress clientAddress) {
 if (clientAddress == null) {
  return saslProps;
 }
 return  whiteList.isIn(clientAddress.getHostAddress())?getDefaultProperties():saslProps;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Identify the Sasl Properties to be used for a connection with a client.
 * @param clientAddress client's address
 * @return the sasl properties to be used for the connection.
 */
@Override
public Map<String, String> getServerProperties(InetAddress clientAddress) {
 if (clientAddress == null) {
  return saslProps;
 }
 return  whiteList.isIn(clientAddress.getHostAddress())?getDefaultProperties():saslProps;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Identify the Sasl Properties to be used for a connection with a client.
 * @param clientAddress client's address
 * @return the sasl properties to be used for the connection.
 */
@Override
public Map<String, String> getServerProperties(InetAddress clientAddress) {
 if (clientAddress == null) {
  return saslProps;
 }
 return  whiteList.isIn(clientAddress.getHostAddress())?getDefaultProperties():saslProps;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Identify the Sasl Properties to be used for a connection with a client.
 * @param clientAddress client's address
 * @return the sasl properties to be used for the connection.
 */
@Override
public Map<String, String> getServerProperties(InetAddress clientAddress) {
 if (clientAddress == null) {
  return saslProps;
 }
 return  whiteList.isIn(clientAddress.getHostAddress())?getDefaultProperties():saslProps;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

public void testFixedVariableAndLocalWhiteList() throws IOException {
 String[] fixedIps = {"10.119.103.112", "10.221.102.0/23"};
 TestFileBasedIPList.createFileWithEntries ("fixedwhitelist.txt", fixedIps);
 String[] variableIps = {"10.222.0.0/16", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("variablewhitelist.txt", variableIps);
 Configuration conf = new Configuration();
 conf.set(WhitelistBasedResolver.HADOOP_SECURITY_SASL_FIXEDWHITELIST_FILE ,
   "fixedwhitelist.txt");
 conf.setBoolean(WhitelistBasedResolver.HADOOP_SECURITY_SASL_VARIABLEWHITELIST_ENABLE,
   true);
 conf.setLong(WhitelistBasedResolver.HADOOP_SECURITY_SASL_VARIABLEWHITELIST_CACHE_SECS,
   1);
 conf.set(WhitelistBasedResolver.HADOOP_SECURITY_SASL_VARIABLEWHITELIST_FILE ,
   "variablewhitelist.txt");
 WhitelistBasedResolver wqr = new WhitelistBasedResolver ();
 wqr.setConf(conf);
 assertEquals (wqr.getDefaultProperties(),
   wqr.getServerProperties(InetAddress.getByName("10.119.103.112")));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.119.103.113"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.221.103.121"));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.221.104.0"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.222.103.121"));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.223.104.0"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.113.221.221"));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.113.221.222"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("127.0.0.1"));
 TestFileBasedIPList.removeFile("fixedwhitelist.txt");
 TestFileBasedIPList.removeFile("variablewhitelist.txt");
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

public void testFixedVariableAndLocalWhiteList() throws IOException {
 String[] fixedIps = {"10.119.103.112", "10.221.102.0/23"};
 TestFileBasedIPList.createFileWithEntries ("fixedwhitelist.txt", fixedIps);
 String[] variableIps = {"10.222.0.0/16", "10.113.221.221"};
 TestFileBasedIPList.createFileWithEntries ("variablewhitelist.txt", variableIps);
 Configuration conf = new Configuration();
 conf.set(WhitelistBasedResolver.HADOOP_SECURITY_SASL_FIXEDWHITELIST_FILE ,
   "fixedwhitelist.txt");
 conf.setBoolean(WhitelistBasedResolver.HADOOP_SECURITY_SASL_VARIABLEWHITELIST_ENABLE,
   true);
 conf.setLong(WhitelistBasedResolver.HADOOP_SECURITY_SASL_VARIABLEWHITELIST_CACHE_SECS,
   1);
 conf.set(WhitelistBasedResolver.HADOOP_SECURITY_SASL_VARIABLEWHITELIST_FILE ,
   "variablewhitelist.txt");
 WhitelistBasedResolver wqr = new WhitelistBasedResolver ();
 wqr.setConf(conf);
 assertEquals (wqr.getDefaultProperties(),
   wqr.getServerProperties(InetAddress.getByName("10.119.103.112")));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.119.103.113"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.221.103.121"));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.221.104.0"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.222.103.121"));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.223.104.0"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.113.221.221"));
 assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.113.221.222"));
 assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("127.0.0.1"));
 TestFileBasedIPList.removeFile("fixedwhitelist.txt");
 TestFileBasedIPList.removeFile("variablewhitelist.txt");
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

wqr.setConf(conf);
assertEquals (wqr.getDefaultProperties(),
  wqr.getServerProperties(InetAddress.getByName("10.119.103.112")));
assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.221.103.121"));
assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.113.221.221"));
assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.113.221.222"));
assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("127.0.0.1"));;

代码示例来源:origin: ch.cern.hadoop/hadoop-common

wqr.setConf(conf);
assertEquals (wqr.getDefaultProperties(),
  wqr.getServerProperties(InetAddress.getByName("10.119.103.112")));
assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("10.221.103.121"));
assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.113.221.221"));
assertEquals (SASL_PRIVACY_PROPS, wqr.getServerProperties("10.113.221.222"));
assertEquals (wqr.getDefaultProperties(), wqr.getServerProperties("127.0.0.1"));;

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com