• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java HiveObjectPrivilege类的典型用法和代码示例

java 2次浏览

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

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

示例1: setUp

点赞 3

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Before
public void setUp() {
  databaseMapping = new DatabaseMappingImpl(metastoreMapping);
  database = new Database();
  database.setName(DB_NAME);
  partition = new Partition();
  partition.setDbName(DB_NAME);
  partitions = Lists.newArrayList(partition);
  index = new Index();
  index.setDbName(DB_NAME);
  hiveObjectRef = new HiveObjectRef();
  hiveObjectRef.setDbName(DB_NAME);
  hiveObjectRef.setObjectType(HiveObjectType.DATABASE);
  hiveObjectRef.setObjectName(DB_NAME);
  hiveObjectPrivileges = new ArrayList<>();
  HiveObjectPrivilege hiveObjectPrivilege = new HiveObjectPrivilege();
  hiveObjectPrivilege.setHiveObject(hiveObjectRef);
  hiveObjectPrivileges.add(hiveObjectPrivilege);
  partitionSpec = new PartitionSpec();
  partitionSpec.setDbName(DB_NAME);
  when(metastoreMapping.transformInboundDatabaseName(DB_NAME)).thenReturn(IN_DB_NAME);
  when(metastoreMapping.transformOutboundDatabaseName(DB_NAME)).thenReturn(OUT_DB_NAME);
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:24,
代码来源:DatabaseMappingImplTest.java

示例2: transformOutboundHiveObjectPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> transformOutboundHiveObjectPrivileges(List<HiveObjectPrivilege> privileges) {
  for (HiveObjectPrivilege privilege : privileges) {
    privilege.setHiveObject(transformOutboundHiveObjectRef(privilege.getHiveObject()));
  }
  return privileges;
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:8,
代码来源:DatabaseMappingImpl.java

示例3: transformInboundPrivilegeBag

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public PrivilegeBag transformInboundPrivilegeBag(PrivilegeBag privilegeBag) {
  if (privilegeBag.isSetPrivileges()) {
    for (HiveObjectPrivilege privilege : privilegeBag.getPrivileges()) {
      privilege.setHiveObject(transformInboundHiveObjectRef(privilege.getHiveObject()));
    }
  }
  return privilegeBag;
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:10,
代码来源:DatabaseMappingImpl.java

示例4: assertHiveObjectPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
private void assertHiveObjectPrivileges(List<HiveObjectPrivilege> result, String expectedDatabaseName) {
  assertThat(result, is(sameInstance(hiveObjectPrivileges)));
  HiveObjectPrivilege resultPrivilege = result.get(0);
  assertThat(resultPrivilege, is(sameInstance(hiveObjectPrivileges.get(0))));
  HiveObjectRef resultHiveObjectRef = resultPrivilege.getHiveObject();
  assertThat(resultHiveObjectRef, is(sameInstance(hiveObjectRef)));
  assertThat(resultHiveObjectRef.getDbName(), is(expectedDatabaseName));
  assertThat(resultHiveObjectRef.getObjectName(), is(expectedDatabaseName));
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:10,
代码来源:DatabaseMappingImplTest.java

示例5: hasPrivilegeToSetCleanAlert

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
public boolean hasPrivilegeToSetCleanAlert(String database, String table,
		String user) {
	HiveMetaStoreClient hiveClient = getHiveMetaStoreClient();
	HiveObjectRef hiveObject = new HiveObjectRef();
	hiveObject.setDbName(database);
	hiveObject.setObjectName(table);
	hiveObject.setObjectType(HiveObjectType.TABLE);
	List<HiveObjectPrivilege> privileges = new ArrayList<HiveObjectPrivilege>();
	try {
		privileges = hiveClient.list_privileges(user, PrincipalType.USER,
				hiveObject);
	} catch (Exception e) {
		logger.error("Error to get privileges:", e);
		return false;
	}
	for (HiveObjectPrivilege privilege : privileges) {
		String privilegeName = privilege.getGrantInfo().getPrivilege();
		if (privilegeName != null
				&& ("all".equalsIgnoreCase(privilegeName)
						|| "create".equalsIgnoreCase(privilegeName) || "ALTER"
							.equalsIgnoreCase(privilegeName))) {
			return true;
		}
	}

	return false;
}
 

开发者ID:Ctrip-DI,
项目名称:Hue-Ctrip-DI,
代码行数:28,
代码来源:HiveHelper.java

示例6: listPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> listPrivileges(final String principalName, final PrincipalType principalType, final HiveObjectRef hiveObject) throws MetaException, TException
{
    return withRetries("listPrivileges", new CallableWithMetastore<List<HiveObjectPrivilege>>() {
        @Override
        public List<HiveObjectPrivilege> call(final HiveMetastore client) throws TException
        {
            return client.listPrivileges(principalName, principalType, hiveObject);
        }
    });
}
 

开发者ID:facebookarchive,
项目名称:swift-hive-metastore,
代码行数:12,
代码来源:RetryingHiveMetastore.java

示例7: transformOutboundHiveObjectPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> transformOutboundHiveObjectPrivileges(List<HiveObjectPrivilege> privileges) {
  return privileges;
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:5,
代码来源:IdentityMapping.java

示例8: transformOutboundHiveObjectPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Test
public void transformOutboundHiveObjectPrivileges() throws Exception {
  List<HiveObjectPrivilege> hiveObjectPrivileges = new ArrayList<>();
  List<HiveObjectPrivilege> result = databaseMapping.transformOutboundHiveObjectPrivileges(hiveObjectPrivileges);
  assertThat(result, is(sameInstance(hiveObjectPrivileges)));
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:7,
代码来源:IdentityMappingTest.java

示例9: transformOutboundHiveObjectPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Test
public void transformOutboundHiveObjectPrivileges() throws Exception {
  List<HiveObjectPrivilege> result = databaseMapping.transformOutboundHiveObjectPrivileges(hiveObjectPrivileges);
  assertHiveObjectPrivileges(result, OUT_DB_NAME);
}
 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:6,
代码来源:DatabaseMappingImplTest.java

示例10: list_privileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<HiveObjectPrivilege> list_privileges(final String principalName, final PrincipalType principalType,
                                                 final HiveObjectRef hiveObject) throws TException {
    throw unimplemented("list_privileges", new Object[]{principalName, principalType, hiveObject});
}
 

开发者ID:Netflix,
项目名称:metacat,
代码行数:9,
代码来源:CatalogThriftHiveMetastore.java

示例11: list_privileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> list_privileges(String principalName,
                                                 PrincipalType principalType, HiveObjectRef hiveObject)
    throws MetaException, TException {
    return client.list_privileges(principalName, principalType, hiveObject);
}
 

开发者ID:facebookarchive,
项目名称:swift-hive-metastore,
代码行数:7,
代码来源:HiveMetaStoreClient.java

示例12: listPrivileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> listPrivileges(final String principalName, final PrincipalType principalType, final HiveObjectRef hiveObject) throws MetaException, TException
{
    throw new UnsupportedOperationException();
}
 

开发者ID:facebookarchive,
项目名称:swift-hive-metastore,
代码行数:6,
代码来源:AbstractMetastore.java

示例13: list_privileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> list_privileges(String principal_name, PrincipalType principal_type, HiveObjectRef hiveObject) throws MetaException, TException
{
    return delegate.listPrivileges(principal_name, principal_type, hiveObject);
}
 

开发者ID:facebookarchive,
项目名称:swift-hive-metastore,
代码行数:6,
代码来源:ThriftHiveMetastore.java

示例14: list_privileges

点赞 2

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
@Override
public List<HiveObjectPrivilege> list_privileges(String principal_name, PrincipalType principal_type, HiveObjectRef hiveObject) throws MetaException, TException
{
    throw new UnsupportedOperationException();
}
 

开发者ID:facebookarchive,
项目名称:swift-hive-metastore,
代码行数:6,
代码来源:AbstractLegacyMetastore.java

示例15: list_privileges

点赞 1

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
/**
 * @param principal_name
 * @param principal_type
 * @param hiveObject
 * @return list of privileges
 * @throws MetaException
 * @throws TException
 */
public List<HiveObjectPrivilege> list_privileges(String principal_name,
    PrincipalType principal_type, HiveObjectRef hiveObject)
    throws MetaException, TException;
 

开发者ID:facebookarchive,
项目名称:swift-hive-metastore,
代码行数:12,
代码来源:IMetaStoreClient.java

示例16: transformOutboundHiveObjectPrivileges

点赞 1

import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege; //导入依赖的package包/类
List<HiveObjectPrivilege> transformOutboundHiveObjectPrivileges(List<HiveObjectPrivilege> privileges); 

开发者ID:HotelsDotCom,
项目名称:waggle-dance,
代码行数:2,
代码来源:DatabaseMapping.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)