本文整理汇总了Java中com.jcabi.aspects.Loggable类的典型用法代码示例。如果您正苦于以下问题:Java Loggable类的具体用法?Java Loggable怎么用?Java Loggable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Loggable类属于com.jcabi.aspects包,在下文中一共展示了Loggable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exchange_partition
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public Partition exchange_partition(
Map<String, String> partitionSpecs,
String source_db,
String source_table_name,
String dest_db,
String dest_table_name)
throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException, TException {
DatabaseMapping mapping = checkWritePermissions(source_db);
mapping.checkWritePermissions(dest_db);
Partition result = mapping.getClient().exchange_partition(partitionSpecs,
mapping.transformInboundDatabaseName(source_db), source_table_name,
mapping.transformInboundDatabaseName(dest_db), dest_table_name);
return mapping.transformOutboundPartition(result);
}
示例2: exchange_partitions
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public List<Partition> exchange_partitions(
Map<String, String> partitionSpecs,
String source_db,
String source_table_name,
String dest_db,
String dest_table_name)
throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException, TException {
DatabaseMapping mapping = checkWritePermissions(source_db);
mapping.checkWritePermissions(dest_db);
List<Partition> result = mapping.getClient().exchange_partitions(partitionSpecs,
mapping.transformInboundDatabaseName(source_db), source_table_name,
mapping.transformInboundDatabaseName(dest_db), dest_table_name);
return mapping.transformOutboundPartitions(result);
}
示例3: grant_privileges
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public boolean grant_privileges(PrivilegeBag privileges) throws MetaException, TException {
if (privileges.isSetPrivileges() && !privileges.getPrivileges().isEmpty()) {
DatabaseMapping mapping = databaseMappingService
.databaseMapping(privileges.getPrivileges().get(0).getHiveObject().getDbName());
for (HiveObjectPrivilege privilege : privileges.getPrivileges()) {
HiveObjectRef obj = privilege.getHiveObject();
mapping.checkWritePermissions(obj.getDbName());
if (obj.getObjectType() == HiveObjectType.DATABASE) {
mapping.checkWritePermissions(obj.getObjectName());
}
}
return mapping.getClient().grant_privileges(mapping.transformInboundPrivilegeBag(privileges));
}
return false;
}
示例4: revoke_privileges
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public boolean revoke_privileges(PrivilegeBag privileges) throws MetaException, TException {
if (privileges.isSetPrivileges() && !privileges.getPrivileges().isEmpty()) {
DatabaseMapping mapping = databaseMappingService
.databaseMapping(privileges.getPrivileges().get(0).getHiveObject().getDbName());
for (HiveObjectPrivilege privilege : privileges.getPrivileges()) {
HiveObjectRef obj = privilege.getHiveObject();
mapping.checkWritePermissions(obj.getDbName());
if (obj.getObjectType() == HiveObjectType.DATABASE) {
mapping.checkWritePermissions(obj.getObjectName());
}
}
return mapping.getClient().revoke_privileges(mapping.transformInboundPrivilegeBag(privileges));
}
return false;
}
示例5: grant_revoke_privileges
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilegeRequest request)
throws MetaException, TException {
PrivilegeBag privilegesBag = request.getPrivileges();
if (privilegesBag.isSetPrivileges() && !privilegesBag.getPrivileges().isEmpty()) {
DatabaseMapping mapping = databaseMappingService
.databaseMapping(privilegesBag.getPrivileges().get(0).getHiveObject().getDbName());
for (HiveObjectPrivilege privilege : privilegesBag.getPrivileges()) {
HiveObjectRef obj = privilege.getHiveObject();
checkWritePermissions(obj.getDbName());
if (obj.getObjectType() == HiveObjectType.DATABASE) {
checkWritePermissions(obj.getObjectName());
}
}
return mapping.getClient().grant_revoke_privileges(mapping.transformInboundGrantRevokePrivilegesRequest(request));
}
return getPrimaryClient().grant_revoke_privileges(request);
}
示例6: create_database
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public void create_database(Database database)
throws AlreadyExistsException, InvalidObjectException, MetaException, TException {
DatabaseMapping mapping = databaseMappingService.primaryDatabaseMapping();
mapping.createDatabase(mapping.transformInboundDatabase(database));
}
示例7: alter_database
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public void alter_database(String dbname, Database db) throws MetaException, NoSuchObjectException, TException {
DatabaseMapping mapping = checkWritePermissions(dbname);
mapping.checkWritePermissions(db.getName());
mapping.getClient().alter_database(mapping.transformInboundDatabaseName(dbname),
mapping.transformInboundDatabase(db));
}
示例8: alter_partitions_with_environment_context
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public void alter_partitions_with_environment_context(
String db_name,
String tbl_name,
List<Partition> new_parts,
EnvironmentContext environment_context)
throws InvalidOperationException, MetaException, TException {
DatabaseMapping mapping = checkWritePermissions(db_name);
mapping.getClient().alter_partitions_with_environment_context(mapping.transformInboundDatabaseName(db_name),
tbl_name, new_parts, environment_context);
}
示例9: get_fields
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public List<FieldSchema> get_fields(String db_name, String table_name)
throws MetaException, UnknownTableException, UnknownDBException, TException {
DatabaseMapping mapping = databaseMappingService.databaseMapping(db_name);
return mapping.getClient().get_fields(mapping.transformInboundDatabaseName(db_name), table_name);
}
示例10: get_table_objects_by_name_req
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public GetTablesResult get_table_objects_by_name_req(GetTablesRequest req)
throws MetaException, InvalidOperationException, UnknownDBException, TException {
DatabaseMapping mapping = databaseMappingService.databaseMapping(req.getDbName());
GetTablesResult result = mapping
.getClient()
.get_table_objects_by_name_req(mapping.transformInboundGetTablesRequest(req));
return mapping.transformOutboundGetTablesResult(result);
}
示例11: create_table
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public void create_table(Table tbl)
throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
DatabaseMapping mapping = checkWritePermissions(tbl.getDbName());
mapping.getClient().create_table(mapping.transformInboundTable(tbl));
}
示例12: create_table_with_environment_context
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public void create_table_with_environment_context(Table tbl, EnvironmentContext environment_context)
throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
DatabaseMapping mapping = checkWritePermissions(tbl.getDbName());
mapping.getClient().create_table_with_environment_context(mapping.transformInboundTable(tbl), environment_context);
}
示例13: get_table
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public Table get_table(String dbname, String tbl_name) throws MetaException, NoSuchObjectException, TException {
DatabaseMapping mapping = databaseMappingService.databaseMapping(dbname);
return mapping
.transformOutboundTable(mapping.getClient().get_table(mapping.transformInboundDatabaseName(dbname), tbl_name));
}
示例14: get_table_objects_by_name
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public List<Table> get_table_objects_by_name(String dbname, List<String> tbl_names)
throws MetaException, InvalidOperationException, UnknownDBException, TException {
DatabaseMapping mapping = databaseMappingService.databaseMapping(dbname);
List<Table> tables = mapping.getClient().get_table_objects_by_name(mapping.transformInboundDatabaseName(dbname),
tbl_names);
List<Table> outboundTables = new ArrayList<>(tables.size());
for (Table table : tables) {
outboundTables.add(mapping.transformOutboundTable(table));
}
return outboundTables;
}
示例15: get_table_names_by_filter
import com.jcabi.aspects.Loggable; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public List<String> get_table_names_by_filter(String dbname, String filter, short max_tables)
throws MetaException, InvalidOperationException, UnknownDBException, TException {
DatabaseMapping mapping = databaseMappingService.databaseMapping(dbname);
return mapping.getClient().get_table_names_by_filter(mapping.transformInboundDatabaseName(dbname), filter,
max_tables);
}