當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。