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


Java Service类代码示例

本文整理汇总了Java中org.apache.hadoop.security.authorize.Service的典型用法代码示例。如果您正苦于以下问题:Java Service类的具体用法?Java Service怎么用?Java Service使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Service类属于org.apache.hadoop.security.authorize包,在下文中一共展示了Service类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return new Service[] {
      new Service(
          YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONHISTORY_PROTOCOL,
          ApplicationHistoryProtocolPB.class)
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TimelinePolicyProvider.java

示例2: setupBeforeClass

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws Exception {
  TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  // register token type for protocol
  SecurityInfo.addInfo(AuthenticationProtos.AuthenticationService.getDescriptor().getName(),
    new SecurityInfo("hbase.test.kerberos.principal",
      AuthenticationProtos.TokenIdentifier.Kind.HBASE_AUTH_TOKEN));
  // security settings only added after startup so that ZK does not require SASL
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set("hadoop.security.authentication", "kerberos");
  conf.set("hbase.security.authentication", "kerberos");
  conf.setBoolean(HADOOP_SECURITY_AUTHORIZATION, true);
  server = new TokenServer(conf);
  serverThread = new Thread(server);
  Threads.setDaemonThreadRunning(serverThread, "TokenServer:"+server.getServerName().toString());
  // wait for startup
  while (!server.isStarted() && !server.isStopped()) {
    Thread.sleep(10);
  }
  server.rpcServer.refreshAuthManager(new PolicyProvider() {
    @Override
    public Service[] getServices() {
      return new Service [] {
        new Service("security.client.protocol.acl",
          AuthenticationProtos.AuthenticationService.BlockingInterface.class)};
    }
  });
  ZKClusterId.setClusterId(server.getZooKeeper(), clusterId);
  secretManager = (AuthenticationTokenSecretManager)server.getSecretManager();
  while(secretManager.getCurrentKey() == null) {
    Thread.sleep(1);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:TestTokenAuthentication.java

示例3: startRpcServer

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
protected void startRpcServer()
{
  Configuration conf = getConfig();
  LOG.info("Config: " + conf);
  LOG.info("Listener thread count " + listenerThreadCount);
  try {
    server = new RPC.Builder(conf).setProtocol(StreamingContainerUmbilicalProtocol.class).setInstance(this)
        .setBindAddress("0.0.0.0").setPort(0).setNumHandlers(listenerThreadCount).setSecretManager(tokenSecretManager)
        .setVerbose(false).build();

    // Enable service authorization?
    if (conf.getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        false)) {
      //refreshServiceAcls(conf, new MRAMPolicyProvider());
      server.refreshServiceAcl(conf, new PolicyProvider()
      {

        @Override
        public Service[] getServices()
        {
          return (new Service[]{
              new Service(StreamingContainerUmbilicalProtocol.class
                  .getName(), StreamingContainerUmbilicalProtocol.class)
          });
        }

      });
    }

    server.start();
    this.address = NetUtils.getConnectAddress(server);
    LOG.info("Container callback server listening at " + this.address);
  } catch (IOException e) {
    throw new YarnRuntimeException(e);
  }
}
 
开发者ID:apache,项目名称:apex-core,代码行数:38,代码来源:StreamingContainerParent.java

示例4: setUp

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  // register token type for protocol
  SecurityInfo.addInfo(AuthenticationProtos.AuthenticationService.getDescriptor().getName(),
    new SecurityInfo("hbase.test.kerberos.principal",
      AuthenticationProtos.TokenIdentifier.Kind.HBASE_AUTH_TOKEN));
  // security settings only added after startup so that ZK does not require SASL
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set("hadoop.security.authentication", "kerberos");
  conf.set("hbase.security.authentication", "kerberos");
  conf.setBoolean(HADOOP_SECURITY_AUTHORIZATION, true);
  conf.set(RpcServerFactory.CUSTOM_RPC_SERVER_IMPL_CONF_KEY, rpcServerImpl);
  server = new TokenServer(conf, TEST_UTIL);
  serverThread = new Thread(server);
  Threads.setDaemonThreadRunning(serverThread, "TokenServer:"+server.getServerName().toString());
  // wait for startup
  while (!server.isStarted() && !server.isStopped()) {
    Thread.sleep(10);
  }
  server.rpcServer.refreshAuthManager(new PolicyProvider() {
    @Override
    public Service[] getServices() {
      return new Service [] {
        new Service("security.client.protocol.acl",
          AuthenticationProtos.AuthenticationService.BlockingInterface.class)};
    }
  });
  ZKClusterId.setClusterId(server.getZooKeeper(), clusterId);
  secretManager = (AuthenticationTokenSecretManager)server.getSecretManager();
  while(secretManager.getCurrentKey() == null) {
    Thread.sleep(1);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:36,代码来源:TestTokenAuthentication.java

示例5: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return new Service[] { new Service(ACL_CONFIG, TestRpcService.class) };
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:5,代码来源:TestRPC.java

示例6: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return nodeManagerServices;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:NMPolicyProvider.java

示例7: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return resourceManagerServices;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:RMPolicyProvider.java

示例8: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return mrHSServices;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:ClientHSPolicyProvider.java

示例9: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return mapReduceApplicationMasterServices;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:MRAMPolicyProvider.java

示例10: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return hdfsServices;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:HDFSPolicyProvider.java

示例11: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return new Service[] { new Service(ACL_CONFIG, TestProtocol.class) };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:TestRPC.java

示例12: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return services;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:HBasePolicyProvider.java

示例13: getServices

import org.apache.hadoop.security.authorize.Service; //导入依赖的package包/类
@Override
public Service[] getServices() {
  return mapReduceServices;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:5,代码来源:MapReducePolicyProvider.java


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