热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

co.cask.cdap.proto.NamespaceConfig.getPrincipal()方法的使用及代码示例

本文整理了Java中co.cask.cdap.proto.NamespaceConfig.getPrincipal()方法的一些代码示例,展示了Namesp

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

NamespaceConfig.getPrincipal介绍

暂无

代码示例

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

@Override
public boolean apply(NamespaceMeta input) {
return principal.getName().equals(input.getConfig().getPrincipal());
}
});

代码示例来源:origin: caskdata/cdap

builder.append("='").append(namespaceConfig.getHiveDatabase()).append("', ");
if (namespaceConfig.getPrincipal() != null) {
builder.append(ArgumentName.PRINCIPAL);
builder.append("='").append(namespaceConfig.getPrincipal()).append("', ");

代码示例来源:origin: co.cask.cdap/cdap-cli

builder.append("='").append(namespaceConfig.getHiveDatabase()).append("', ");
if (namespaceConfig.getPrincipal() != null) {
builder.append(ArgumentName.PRINCIPAL);
builder.append("='").append(namespaceConfig.getPrincipal()).append("', ");

代码示例来源:origin: cdapio/cdap

/**
* Lists all namespaces
*
* @return a list of {@link NamespaceMeta} for all namespaces
*/
@Override
public List list() throws Exception {
List namespaces = nsStore.list();
final Principal principal = authenticationContext.getPrincipal();
//noinspection ConstantConditions
return AuthorizationUtil.isVisible(namespaces, authorizationEnforcer, principal,
NamespaceMeta::getNamespaceId,
input -> principal.getName().equals(input.getConfig().getPrincipal()));
}

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

"with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"namespace with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"again with an empty directory mapping and sufficient privileges for the user %s.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));

代码示例来源:origin: cdapio/cdap

@Nullable
@Override
public String getImpersonationPrincipal(NamespacedEntityId entityId) throws IOException {
entityId = getEffectiveEntity(entityId);
KerberosPrincipalId effectiveOwner = null;
if (!entityId.getEntityType().equals(EntityType.NAMESPACE)) {
effectiveOwner = ownerStore.getOwner(entityId);
}
// (CDAP-8176) Since no owner was found for the entity return namespace principal if present.
return effectiveOwner != null ? effectiveOwner.getPrincipal() : getNamespaceConfig(entityId).getPrincipal();
}

代码示例来源:origin: cdapio/cdap

if (namespaceMeta != null && principal.getName().equals(namespaceMeta.getConfig().getPrincipal())) {
return namespaceMeta;

代码示例来源:origin: cdapio/cdap

"with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"namespace with sufficient privileges for the user %s and then try creating a namespace.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));
"again with an empty directory mapping and sufficient privileges for the user %s.",
customNamespacedLocation.toString(), namespaceMeta.getNamespaceId(),
namespaceMeta.getConfig().getPrincipal()));

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

if (namespaceMeta != null && principal.getName().equals(namespaceMeta.getConfig().getPrincipal())) {
return namespaceMeta;

代码示例来源:origin: cdapio/cdap

@Nullable
@Override
public ImpersonationInfo getImpersonationInfo(NamespacedEntityId entityId) throws IOException {
entityId = getEffectiveEntity(entityId);
if (!entityId.getEntityType().equals(EntityType.NAMESPACE)) {
KerberosPrincipalId effectiveOwner = ownerStore.getOwner(entityId);
if (effectiveOwner != null) {
return new ImpersonationInfo(effectiveOwner.getPrincipal(),
SecurityUtil.getKeytabURIforPrincipal(effectiveOwner.getPrincipal(), cConf));
}
}
// (CDAP-8176) Since no owner was found for the entity return namespace principal if present.
NamespaceConfig nsCOnfig= getNamespaceConfig(entityId.getNamespaceId());
return nsConfig.getPrincipal() == null ? null : new ImpersonationInfo(nsConfig.getPrincipal(),
nsConfig.getKeytabURI());
}

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

String ownerPrincipal = metadata.getConfig().getPrincipal();
Principal requestingUser = authenticationContext.getPrincipal();
if (ownerPrincipal != null) {
String cOnfiguredPrincipal= metadata.getConfig().getPrincipal();
String cOnfiguredKeytabURI= metadata.getConfig().getKeytabURI();
if ((!Strings.isNullOrEmpty(configuredPrincipal) && Strings.isNullOrEmpty(configuredKeytabURI)) ||

代码示例来源:origin: cdapio/cdap

String ownerPrincipal = metadata.getConfig().getPrincipal();
Principal requestingUser = authenticationContext.getPrincipal();
if (ownerPrincipal != null) {
String cOnfiguredPrincipal= metadata.getConfig().getPrincipal();
String cOnfiguredKeytabURI= metadata.getConfig().getKeytabURI();
if ((!Strings.isNullOrEmpty(configuredPrincipal) && Strings.isNullOrEmpty(configuredKeytabURI)) ||

代码示例来源:origin: cdapio/cdap

/**
* Executes a program without blocking until its completion.
*/
public void execute(final ProgramId id, Map sysArgs, Map userArgs) throws Exception {
String originalUserId = SecurityRequestContext.getUserId();
try {
// if the program has a namespace user configured then set that user in the security request context.
// See: CDAP-7396
String nsPrincipal = namespaceQueryAdmin.get(id.getNamespaceId()).getConfig().getPrincipal();
if (nsPrincipal != null && SecurityUtil.isKerberosEnabled(cConf)) {
SecurityRequestContext.setUserId(new KerberosName(nsPrincipal).getServiceName());
}
lifecycleService.runInternal(id, userArgs, sysArgs, false);
} catch (ProgramNotFoundException | ApplicationNotFoundException e) {
throw new TaskExecutionException(String.format(UserMessages.getMessage(UserErrors.PROGRAM_NOT_FOUND), id),
e, false);
} finally {
SecurityRequestContext.setUserId(originalUserId);
}
}
}

代码示例来源:origin: co.cask.cdap/cdap-app-fabric

/**
* Executes a program without blocking until its completion.
*/
public void execute(final ProgramId id, Map sysArgs, Map userArgs) throws Exception {
String originalUserId = SecurityRequestContext.getUserId();
try {
// if the program has a namespace user configured then set that user in the security request context.
// See: CDAP-7396
String nsPrincipal = namespaceQueryAdmin.get(id.getNamespaceId()).getConfig().getPrincipal();
if (nsPrincipal != null && SecurityUtil.isKerberosEnabled(cConf)) {
SecurityRequestContext.setUserId(new KerberosName(nsPrincipal).getServiceName());
}
lifecycleService.runInternal(id, userArgs, sysArgs, false);
} catch (ProgramNotFoundException | ApplicationNotFoundException e) {
throw new TaskExecutionException(String.format(UserMessages.getMessage(UserErrors.PROGRAM_NOT_FOUND), id),
e, false);
} finally {
SecurityRequestContext.setUserId(originalUserId);
}
}
}

代码示例来源:origin: caskdata/cdap

public Builder(NamespaceMeta meta) {
this.name = meta.getName();
this.description = meta.getDescription();
NamespaceConfig cOnfig= meta.getConfig();
if (config != null) {
this.schedulerQueueName = config.getSchedulerQueueName();
this.rootDirectory = config.getRootDirectory();
this.hbaseNamespace = config.getHbaseNamespace();
this.hiveDatabase = config.getHiveDatabase();
this.principal = config.getPrincipal();
this.groupName = config.getGroupName();
this.keytabURIWithoutVersion = config.getKeytabURIWithoutVersion();
this.keytabURIVersion = config.getKeytabURIVersion();
this.exploreAsPrincipal = config.isExploreAsPrincipal();
}
}

代码示例来源:origin: co.cask.cdap/cdap-proto

public Builder(NamespaceMeta meta) {
this.name = meta.getName();
this.description = meta.getDescription();
NamespaceConfig cOnfig= meta.getConfig();
if (config != null) {
this.schedulerQueueName = config.getSchedulerQueueName();
this.rootDirectory = config.getRootDirectory();
this.hbaseNamespace = config.getHbaseNamespace();
this.hiveDatabase = config.getHiveDatabase();
this.principal = config.getPrincipal();
this.groupName = config.getGroupName();
this.keytabURIWithoutVersion = config.getKeytabURIWithoutVersion();
this.keytabURIVersion = config.getKeytabURIVersion();
this.exploreAsPrincipal = config.isExploreAsPrincipal();
}
}

代码示例来源:origin: cdapio/cdap

DatasetId datasetId = namespaceId.dataset("whom");
DatasetTypeId datasetTypeId = namespaceId.datasetType(KeyValueTable.class.getName());
String owner = appOwner != null ? appOwner : nsMeta.getConfig().getPrincipal();
KerberosPrincipalId principalId = new KerberosPrincipalId(owner);
Principal principal = new Principal(owner, Principal.PrincipalType.USER);

代码示例来源:origin: cdapio/cdap

impNsMeta.getName(), impNsMeta.getConfig().getPrincipal());

推荐阅读
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 闭包一直是Java社区中争论不断的话题,很多语言都支持闭包这个语言特性,闭包定义了一个依赖于外部环境的自由变量的函数,这个函数能够访问外部环境的变量。本文以JavaScript的一个闭包为例,介绍了闭包的定义和特性。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
author-avatar
沫雅mo_853
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有