热门标签 | 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());

推荐阅读
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • Linux重启网络命令实例及关机和重启示例教程
    本文介绍了Linux系统中重启网络命令的实例,以及使用不同方式关机和重启系统的示例教程。包括使用图形界面和控制台访问系统的方法,以及使用shutdown命令进行系统关机和重启的句法和用法。 ... [详细]
  • 展开全部下面的代码是创建一个立方体Thisexamplescreatesanddisplaysasimplebox.#Thefirstlineloadstheinit_disp ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • Windows7 64位系统安装PLSQL Developer的步骤和注意事项
    本文介绍了在Windows7 64位系统上安装PLSQL Developer的步骤和注意事项。首先下载并安装PLSQL Developer,注意不要安装在默认目录下。然后下载Windows 32位的oracle instant client,并解压到指定路径。最后,按照自己的喜好对解压后的文件进行命名和压缩。 ... [详细]
  • Whatsthedifferencebetweento_aandto_ary?to_a和to_ary有什么区别? ... [详细]
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • 解决.net项目中未注册“microsoft.ACE.oledb.12.0”提供程序的方法
    在开发.net项目中,通过microsoft.ACE.oledb读取excel文件信息时,报错“未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序”。本文提供了解决这个问题的方法,包括错误描述和代码示例。通过注册提供程序和修改连接字符串,可以成功读取excel文件信息。 ... [详细]
  • 本文整理了Java面试中常见的问题及相关概念的解析,包括HashMap中为什么重写equals还要重写hashcode、map的分类和常见情况、final关键字的用法、Synchronized和lock的区别、volatile的介绍、Syncronized锁的作用、构造函数和构造函数重载的概念、方法覆盖和方法重载的区别、反射获取和设置对象私有字段的值的方法、通过反射创建对象的方式以及内部类的详解。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • t-io 2.0.0发布-法网天眼第一版的回顾和更新说明
    本文回顾了t-io 1.x版本的工程结构和性能数据,并介绍了t-io在码云上的成绩和用户反馈。同时,还提到了@openSeLi同学发布的t-io 30W长连接并发压力测试报告。最后,详细介绍了t-io 2.0.0版本的更新内容,包括更简洁的使用方式和内置的httpsession功能。 ... [详细]
  • 本文详细介绍了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社区 版权所有