本文整理了Java中org.apache.hadoop.hive.metastore.api.Partition.setPrivileges()
方法的一些代码示例,展示了Partition.setPrivileges()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Partition.setPrivileges()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Partition
类名称:Partition
方法名:setPrivileges
暂无
代码示例来源:origin: apache/hive
@Override
public List<Partition> getPartitionsWithAuth(String catName, String dbName, String tblName,
short max, String userName, List<String> groupNames)
throws MetaException, InvalidObjectException {
boolean success = false;
QueryWrapper queryWrapper = new QueryWrapper();
try {
openTransaction();
List<MPartition> mparts = listMPartitions(catName, dbName, tblName, max, queryWrapper);
List<Partition> parts = new ArrayList<>(mparts.size());
if (CollectionUtils.isNotEmpty(mparts)) {
for (MPartition mpart : mparts) {
MTable mtbl = mpart.getTable();
Partition part = convertToPart(mpart);
parts.add(part);
if ("TRUE".equalsIgnoreCase(mtbl.getParameters().get("PARTITION_LEVEL_PRIVILEGE"))) {
String partName = Warehouse.makePartName(this.convertToFieldSchemas(mtbl
.getPartitionKeys()), part.getValues());
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(catName, dbName,
tblName, partName, userName, groupNames);
part.setPrivileges(partAuth);
}
}
}
success = commitTransaction();
return parts;
} finally {
rollbackAndCleanup(success, queryWrapper);
}
}
代码示例来源:origin: apache/hive
PrincipalPrivilegeSet partAuth = getPartitionPrivilegeSet(catName, db_name,
tbl_name, partName, userName, groupNames);
part.setPrivileges(partAuth);
代码示例来源:origin: apache/hive
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(catName, dbName,
tblName, partName, user_name, group_names);
part.setPrivileges(partAuth);
代码示例来源:origin: apache/hive
PrincipalPrivilegeSet privs =
getPartitionPrivilegeSet(catName, dbName, tblName, partName, userName, groupNames);
part.setPrivileges(privs);
partitions.add(part);
count++;
代码示例来源:origin: apache/hive
@Override
public List<Partition> getPartitionsWithAuth(String catName, String dbName, String tblName,
short maxParts, String userName, List<String> groupNames)
throws MetaException, NoSuchObjectException, InvalidObjectException {
catName = StringUtils.normalizeIdentifier(catName);
dbName = StringUtils.normalizeIdentifier(dbName);
tblName = StringUtils.normalizeIdentifier(tblName);
if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction())) {
return rawStore.getPartitionsWithAuth(catName, dbName, tblName, maxParts, userName, groupNames);
}
Table table = sharedCache.getTableFromCache(catName, dbName, tblName);
if (table == null) {
// The table is not yet loaded in cache
return rawStore.getPartitionsWithAuth(catName, dbName, tblName, maxParts, userName, groupNames);
}
List<Partition> partitions = new ArrayList<>();
int count = 0;
for (Partition part : sharedCache.listCachedPartitions(catName, dbName, tblName, maxParts)) {
if (maxParts == -1 || count < maxParts) {
String partName = Warehouse.makePartName(table.getPartitionKeys(), part.getValues());
PrincipalPrivilegeSet privs = getPartitionPrivilegeSet(catName, dbName, tblName, partName,
userName, groupNames);
part.setPrivileges(privs);
partitions.add(part);
count++;
}
}
return partitions;
}
代码示例来源:origin: apache/hive
@Override
public Partition getPartitionWithAuth(String catName, String dbName, String tblName,
List<String> partVals, String userName, List<String> groupNames)
throws MetaException, NoSuchObjectException, InvalidObjectException {
catName = StringUtils.normalizeIdentifier(catName);
dbName = StringUtils.normalizeIdentifier(dbName);
tblName = StringUtils.normalizeIdentifier(tblName);
if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction())) {
return rawStore.getPartitionWithAuth(catName, dbName, tblName, partVals, userName, groupNames);
}
Table table = sharedCache.getTableFromCache(catName, dbName, tblName);
if (table == null) {
// The table is not yet loaded in cache
return rawStore.getPartitionWithAuth(catName, dbName, tblName, partVals, userName, groupNames);
}
Partition p = sharedCache.getPartitionFromCache(catName, dbName, tblName, partVals);
if (p != null) {
String partName = Warehouse.makePartName(table.getPartitionKeys(), partVals);
PrincipalPrivilegeSet privs = getPartitionPrivilegeSet(catName, dbName, tblName, partName,
userName, groupNames);
p.setPrivileges(privs);
}
return p;
}
代码示例来源:origin: apache/hive
unsetPrivileges();
} else {
setPrivileges((PrincipalPrivilegeSet)value);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, userName, groupNames);
part.setPrivileges(partAuth);
代码示例来源:origin: org.apache.hadoop.hive/hive-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, userName, groupNames);
part.setPrivileges(partAuth);
代码示例来源:origin: edu.berkeley.cs.shark/hive-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, userName, groupNames);
part.setPrivileges(partAuth);
代码示例来源:origin: org.spark-project.hive/hive-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, userName, groupNames);
part.setPrivileges(partAuth);
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
@Override
public List<Partition> getPartitionsWithAuth(String catName, String dbName, String tblName,
short max, String userName, List<String> groupNames)
throws MetaException, InvalidObjectException {
boolean success = false;
QueryWrapper queryWrapper = new QueryWrapper();
try {
openTransaction();
List<MPartition> mparts = listMPartitions(catName, dbName, tblName, max, queryWrapper);
List<Partition> parts = new ArrayList<>(mparts.size());
if (CollectionUtils.isNotEmpty(mparts)) {
for (MPartition mpart : mparts) {
MTable mtbl = mpart.getTable();
Partition part = convertToPart(mpart);
parts.add(part);
if ("TRUE".equalsIgnoreCase(mtbl.getParameters().get("PARTITION_LEVEL_PRIVILEGE"))) {
String partName = Warehouse.makePartName(this.convertToFieldSchemas(mtbl
.getPartitionKeys()), part.getValues());
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(catName, dbName,
tblName, partName, userName, groupNames);
part.setPrivileges(partAuth);
}
}
}
success = commitTransaction();
return parts;
} finally {
rollbackAndCleanup(success, queryWrapper);
}
}
代码示例来源:origin: org.spark-project.hive/hive-metastore
PrincipalPrivilegeSet partAuth = getPartitionPrivilegeSet(db_name,
tbl_name, partName, userName, groupNames);
part.setPrivileges(partAuth);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, user_name, group_names);
part.setPrivileges(partAuth);
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(catName, dbName,
tblName, partName, user_name, group_names);
part.setPrivileges(partAuth);
代码示例来源:origin: edu.berkeley.cs.shark/hive-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, user_name, group_names);
part.setPrivileges(partAuth);
代码示例来源:origin: org.spark-project.hive/hive-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, user_name, group_names);
part.setPrivileges(partAuth);
代码示例来源:origin: org.apache.hadoop.hive/hive-metastore
PrincipalPrivilegeSet partAuth = this.getPartitionPrivilegeSet(dbName,
tblName, partName, user_name, group_names);
part.setPrivileges(partAuth);
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
@Override
public List<Partition> getPartitionsWithAuth(String catName, String dbName, String tblName,
short maxParts, String userName, List<String> groupNames)
throws MetaException, NoSuchObjectException, InvalidObjectException {
catName = StringUtils.normalizeIdentifier(catName);
dbName = StringUtils.normalizeIdentifier(dbName);
tblName = StringUtils.normalizeIdentifier(tblName);
if (!shouldCacheTable(catName, dbName, tblName)) {
return rawStore.getPartitionsWithAuth(catName, dbName, tblName, maxParts, userName, groupNames);
}
Table table = sharedCache.getTableFromCache(catName, dbName, tblName);
if (table == null) {
// The table is not yet loaded in cache
return rawStore.getPartitionsWithAuth(catName, dbName, tblName, maxParts, userName, groupNames);
}
List<Partition> partitions = new ArrayList<>();
int count = 0;
for (Partition part : sharedCache.listCachedPartitions(catName, dbName, tblName, maxParts)) {
if (maxParts == -1 || count < maxParts) {
String partName = Warehouse.makePartName(table.getPartitionKeys(), part.getValues());
PrincipalPrivilegeSet privs = getPartitionPrivilegeSet(catName, dbName, tblName, partName,
userName, groupNames);
part.setPrivileges(privs);
partitions.add(part);
count++;
}
}
return partitions;
}
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
@Override
public Partition getPartitionWithAuth(String catName, String dbName, String tblName,
List<String> partVals, String userName, List<String> groupNames)
throws MetaException, NoSuchObjectException, InvalidObjectException {
catName = StringUtils.normalizeIdentifier(catName);
dbName = StringUtils.normalizeIdentifier(dbName);
tblName = StringUtils.normalizeIdentifier(tblName);
if (!shouldCacheTable(catName, dbName, tblName)) {
return rawStore.getPartitionWithAuth(catName, dbName, tblName, partVals, userName, groupNames);
}
Table table = sharedCache.getTableFromCache(catName, dbName, tblName);
if (table == null) {
// The table is not yet loaded in cache
return rawStore.getPartitionWithAuth(catName, dbName, tblName, partVals, userName, groupNames);
}
Partition p = sharedCache.getPartitionFromCache(catName, dbName, tblName, partVals);
if (p != null) {
String partName = Warehouse.makePartName(table.getPartitionKeys(), partVals);
PrincipalPrivilegeSet privs = getPartitionPrivilegeSet(catName, dbName, tblName, partName,
userName, groupNames);
p.setPrivileges(privs);
}
return p;
}
内容来源于网络,如有侵权,请联系作者删除!