• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RegistryOperationsFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: run

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Override
public int run(String[] args) throws Exception {
  Preconditions.checkArgument(getConf() != null, "null configuration");
  registry = RegistryOperationsFactory.createInstance(
      new YarnConfiguration(getConf()));
  registry.start();
  if (args.length > 0) {
    if (args[0].equals("ls")) {
      return ls(args);
    } else if (args[0].equals("resolve")) {
      return resolve(args);
    } else if (args[0].equals("bind")) {
      return bind(args);
    } else if (args[0].equals("mknode")) {
      return mknode(args);
    } else if (args[0].equals("rm")) {
      return rm(args);
    }
  }
  return usageError("Invalid command: " + args[0], USAGE);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:22,代码来源:RegistryCli.java


示例2: Executor

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
public Executor(String instancName, String shellCommand, STARTType startType, String runningContainer,
                String localDir, String deployPath,
                String hadoopHome, String javaHome, String pythonHome, String dstPath, String portList, String shellArgs,
                String ExecShellStringPath, String applicationId, String supervisorLogviewPort, String nimbusThriftPort) {
    executorMeta = new ExecutorMeta(instancName, shellCommand, startType, runningContainer,
            localDir, deployPath, hadoopHome, javaHome, pythonHome, dstPath, portList, shellArgs,
            ExecShellStringPath, applicationId, supervisorLogviewPort, nimbusThriftPort);

    conf = new YarnConfiguration();
    Path yarnSite = new Path(hadoopHome + JOYConstants.YARN_SITE_PATH);
    conf.addResource(yarnSite);

    //get first log dir
    logDir = conf.get(JOYConstants.YARN_NM_LOG, JOYConstants.YARN_NM_LOG_DIR).split(JOYConstants.COMMA)[0] + JOYConstants.BACKLASH + applicationId + JOYConstants.BACKLASH + runningContainer;
    //Setup RegistryOperations
    registryOperations = RegistryOperationsFactory.createInstance(JOYConstants.YARN_REGISTRY, conf);
    try {
        setupInitialRegistryPaths();
    } catch (IOException e) {
        e.printStackTrace();
    }
    registryOperations.start();
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:24,代码来源:Executor.java


示例3: RegistryCli

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
public RegistryCli(PrintStream sysout, PrintStream syserr) {
  Configuration conf = new Configuration();
  super.setConf(conf);
  registry = RegistryOperationsFactory.createInstance(conf);
  registry.start();
  this.sysout = sysout;
  this.syserr = syserr;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:RegistryCli.java


示例4: testAnonReadAccess

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test
public void testAnonReadAccess() throws Throwable {
  RMRegistryOperationsService rmRegistryOperations =
      startRMRegistryOperations();
  describe(LOG, "testAnonReadAccess");
  RegistryOperations operations =
      RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
  addToTeardown(operations);
  operations.start();

  assertFalse("RegistrySecurity.isClientSASLEnabled()==true",
      RegistrySecurity.isClientSASLEnabled());
  operations.list(PATH_SYSTEM_SERVICES);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestSecureRMRegistryOperations.java


示例5: testAnonNoWriteAccess

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test
public void testAnonNoWriteAccess() throws Throwable {
  RMRegistryOperationsService rmRegistryOperations =
      startRMRegistryOperations();
  describe(LOG, "testAnonNoWriteAccess");
  RegistryOperations operations =
      RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
  addToTeardown(operations);
  operations.start();

  String servicePath = PATH_SYSTEM_SERVICES + "hdfs";
  expectMkNodeFailure(operations, servicePath);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestSecureRMRegistryOperations.java


示例6: testAnonNoWriteAccessOffRoot

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test
public void testAnonNoWriteAccessOffRoot() throws Throwable {
  RMRegistryOperationsService rmRegistryOperations =
      startRMRegistryOperations();
  describe(LOG, "testAnonNoWriteAccessOffRoot");
  RegistryOperations operations =
      RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
  addToTeardown(operations);
  operations.start();
  assertFalse("mknode(/)", operations.mknode("/", false));
  expectMkNodeFailure(operations, "/sub");
  expectDeleteFailure(operations, PATH_SYSTEM_SERVICES, true);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestSecureRMRegistryOperations.java


示例7: testAlicePathRestrictedAnonAccess

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test
public void testAlicePathRestrictedAnonAccess() throws Throwable {
  RMRegistryOperationsService rmRegistryOperations =
      startRMRegistryOperations();
  String aliceHome = rmRegistryOperations.initUserRegistry(ALICE);
  describe(LOG, "Creating anonymous accessor");
  RegistryOperations anonOperations =
      RegistryOperationsFactory.createAnonymousInstance(zkClientConf);
  addToTeardown(anonOperations);
  anonOperations.start();
  anonOperations.list(aliceHome);
  expectMkNodeFailure(anonOperations, aliceHome + "/anon");
  expectDeleteFailure(anonOperations, aliceHome, true);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestSecureRMRegistryOperations.java


示例8: testNoDigestAuthMissingId2

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test(expected = ServiceStateException.class)
public void testNoDigestAuthMissingId2() throws Throwable {
  zkClientConf.set(KEY_REGISTRY_CLIENT_AUTH, REGISTRY_CLIENT_AUTH_DIGEST);
  zkClientConf.set(KEY_REGISTRY_CLIENT_AUTHENTICATION_ID, "");
  zkClientConf.set(KEY_REGISTRY_CLIENT_AUTHENTICATION_PASSWORD, "pass");
  RegistryOperationsFactory.createInstance("DigestRegistryOperations",
      zkClientConf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestSecureRMRegistryOperations.java


示例9: testNoDigestAuthMissingPass2

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test(expected = ServiceStateException.class)
public void testNoDigestAuthMissingPass2() throws Throwable {
  zkClientConf.set(KEY_REGISTRY_CLIENT_AUTH, REGISTRY_CLIENT_AUTH_DIGEST);
  zkClientConf.set(KEY_REGISTRY_CLIENT_AUTHENTICATION_ID, "id");
  zkClientConf.set(KEY_REGISTRY_CLIENT_AUTHENTICATION_PASSWORD, "");
  RegistryOperationsFactory.createInstance("DigestRegistryOperations",
      zkClientConf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestSecureRMRegistryOperations.java


示例10: createRegistryOperationsInstance

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
private RegistryOperations createRegistryOperationsInstance() {
  if (registryOperations == null) {
    registryOperations = RegistryOperationsFactory.createInstance("YarnRegistry", conf);
    registryOperations.start();
  }
  return registryOperations;
}
 
开发者ID:intel-hadoop,项目名称:yacop,代码行数:8,代码来源:NRegistryOperator.java


示例11: testDigestAccess

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test
public void testDigestAccess() throws Throwable {
  RMRegistryOperationsService registryAdmin =
      startRMRegistryOperations();
  String id = "username";
  String pass = "password";
  registryAdmin.addWriteAccessor(id, pass);
  List<ACL> clientAcls = registryAdmin.getClientAcls();
  LOG.info("Client ACLS=\n{}", RegistrySecurity.aclsToString(clientAcls));

  String base = "/digested";
  registryAdmin.mknode(base, false);
  List<ACL> baseACLs = registryAdmin.zkGetACLS(base);
  String aclset = RegistrySecurity.aclsToString(baseACLs);
  LOG.info("Base ACLs=\n{}", aclset);
  ACL found = null;
  for (ACL acl : baseACLs) {
    if (ZookeeperConfigOptions.SCHEME_DIGEST.equals(acl.getId().getScheme())) {
      found = acl;
      break;
    }
  }
  assertNotNull("Did not find digest entry in ACLs " + aclset, found);
  zkClientConf.set(KEY_REGISTRY_USER_ACCOUNTS,
      "sasl:[email protected], sasl:other");
  RegistryOperations operations =
      RegistryOperationsFactory.createAuthenticatedInstance(zkClientConf,
          id,
          pass);
  addToTeardown(operations);
  operations.start();
  RegistryOperationsClient operationsClient =
      (RegistryOperationsClient) operations;
  List<ACL> digestClientACLs = operationsClient.getClientAcls();
  LOG.info("digest client ACLs=\n{}",
      RegistrySecurity.aclsToString(digestClientACLs));
  operations.stat(base);
  operations.mknode(base + "/subdir", false);
  ZKPathDumper pathDumper = registryAdmin.dumpPath(true);
  LOG.info(pathDumper.toString());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:42,代码来源:TestSecureRMRegistryOperations.java


示例12: testNoDigestAuthMissingId

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testNoDigestAuthMissingId() throws Throwable {
  RegistryOperationsFactory.createAuthenticatedInstance(zkClientConf,
      "",
      "pass");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:TestSecureRMRegistryOperations.java


示例13: testNoDigestAuthMissingPass

import org.apache.hadoop.registry.client.api.RegistryOperationsFactory; //导入依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testNoDigestAuthMissingPass() throws Throwable {
  RegistryOperationsFactory.createAuthenticatedInstance(zkClientConf,
      "id",
      "");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:TestSecureRMRegistryOperations.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParseHelper类代码示例发布时间:2022-05-23
下一篇:
Java SwiftInvalidResponseException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap