当前位置: 首页>>代码示例>>Java>>正文


Java SecurityUtil.setTokenServiceUseIp方法代码示例

本文整理汇总了Java中org.apache.hadoop.security.SecurityUtil.setTokenServiceUseIp方法的典型用法代码示例。如果您正苦于以下问题:Java SecurityUtil.setTokenServiceUseIp方法的具体用法?Java SecurityUtil.setTokenServiceUseIp怎么用?Java SecurityUtil.setTokenServiceUseIp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.security.SecurityUtil的用法示例。


在下文中一共展示了SecurityUtil.setTokenServiceUseIp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: allocate

import org.apache.hadoop.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public synchronized Allocation allocate(
    ApplicationAttemptId applicationAttemptId, List<ResourceRequest> ask,
    List<ContainerId> release, 
    List<String> blacklistAdditions, List<String> blacklistRemovals) {
  List<ResourceRequest> askCopy = new ArrayList<ResourceRequest>();
  for (ResourceRequest req : ask) {
    ResourceRequest reqCopy = ResourceRequest.newInstance(req
        .getPriority(), req.getResourceName(), req.getCapability(), req
        .getNumContainers(), req.getRelaxLocality());
    askCopy.add(reqCopy);
  }
  SecurityUtil.setTokenServiceUseIp(false);
  lastAsk = ask;
  lastRelease = release;
  lastBlacklistAdditions = blacklistAdditions;
  lastBlacklistRemovals = blacklistRemovals;
  return super.allocate(
      applicationAttemptId, askCopy, release, 
      blacklistAdditions, blacklistRemovals);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestRMContainerAllocator.java

示例2: testWrappedFailoverProxyProvider

import org.apache.hadoop.security.SecurityUtil; //导入方法依赖的package包/类
/**
 * Test to verify legacy proxy providers are correctly wrapped.
 */
@Test
public void testWrappedFailoverProxyProvider() throws Exception {
  // setup the config with the dummy provider class
  Configuration config = new HdfsConfiguration(conf);
  String logicalName = HATestUtil.getLogicalHostname(cluster);
  HATestUtil.setFailoverConfigurations(cluster, config, logicalName);
  config.set(DFS_CLIENT_FAILOVER_PROXY_PROVIDER_KEY_PREFIX + "." + logicalName,
      DummyLegacyFailoverProxyProvider.class.getName());
  Path p = new Path("hdfs://" + logicalName + "/");

  // not to use IP address for token service
  SecurityUtil.setTokenServiceUseIp(false);

  // Logical URI should be used.
  assertTrue("Legacy proxy providers should use logical URI.",
      HAUtil.useLogicalUri(config, p.toUri()));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestDFSClientFailover.java

示例3: clearConfig

import org.apache.hadoop.security.SecurityUtil; //导入方法依赖的package包/类
@After
public void clearConfig() {
  SecurityUtil.setTokenServiceUseIp(true);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:TestDFSClientFailover.java


注:本文中的org.apache.hadoop.security.SecurityUtil.setTokenServiceUseIp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。