• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InvalidObjectException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dropPartitionsCoreNoTxn

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
private List<Partition> dropPartitionsCoreNoTxn(
        final RawStore ms, final Table tbl, final List<List<String>> partsValues)
        throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException {
    final List<Partition> deletedPartitions = new ArrayList<Partition>();
    Partition part = null;
    final String dbName = tbl.getDbName();
    final String tblName = tbl.getTableName();

    for (List<String> partValues : partsValues) {
        part = ms.getPartition(dbName, tblName, partValues);
        if (part == null) {
            throw new NoSuchObjectException("Partition doesn't exist. "
                    + partValues);
        }
        if (!ms.dropPartition(dbName, tblName, partValues)) {
            throw new MetaException("Unable to drop partition");
        }
        deletedPartitions.add(part);
    }
    return deletedPartitions;
}
 
开发者ID:Netflix,项目名称:metacat,代码行数:22,代码来源:MetacatHMSHandler.java


示例2: getPartitionsWithAuth

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Override
public List<Partition> getPartitionsWithAuth(String dbName, String tblName,
    short maxParts, String userName, List<String> groupNames)
    throws MetaException, InvalidObjectException {
  if (filterTables(dbName, Lists.newArrayList(tblName)).isEmpty()) {
    throw new MetaException(getNoAccessMessageForTable(dbName, tblName));
  }
  return super.getPartitionsWithAuth(dbName, tblName, maxParts, userName,
      groupNames);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:11,代码来源:AuthorizingObjectStoreV2.java


示例3: create_table

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void create_table()
  throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
  Table table = new Table();
  table.setDbName(DB_P);
  Table inboundTable = new Table();
  inboundTable.setDbName("inbound");
  when(primaryMapping.transformInboundTable(table)).thenReturn(inboundTable);
  handler.create_table(table);
  verify(primaryMapping).checkWritePermissions(DB_P);
  verify(primaryClient).create_table(inboundTable);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:13,代码来源:FederatedHMSHandlerTest.java


示例4: create_table_with_environment_context

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void create_table_with_environment_context()
  throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
  EnvironmentContext environmentContext = new EnvironmentContext();
  Table table = new Table();
  table.setDbName(DB_P);
  Table inboundTable = new Table();
  inboundTable.setDbName("inbound");
  when(primaryMapping.transformInboundTable(table)).thenReturn(inboundTable);
  handler.create_table_with_environment_context(table, environmentContext);
  verify(primaryMapping).checkWritePermissions(DB_P);
  verify(primaryClient).create_table_with_environment_context(inboundTable, environmentContext);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:14,代码来源:FederatedHMSHandlerTest.java


示例5: add_partition

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void add_partition() throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  Partition newPartition = new Partition();
  newPartition.setDbName(DB_P);
  Partition inbound = new Partition();
  Partition outbound = new Partition();
  when(primaryMapping.transformInboundPartition(newPartition)).thenReturn(inbound);
  when(primaryClient.add_partition(inbound)).thenReturn(inbound);
  when(primaryMapping.transformOutboundPartition(inbound)).thenReturn(outbound);
  Partition result = handler.add_partition(newPartition);
  assertThat(result, is(outbound));
  verify(primaryMapping).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:14,代码来源:FederatedHMSHandlerTest.java


示例6: add_partition_with_environment_context

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void add_partition_with_environment_context()
  throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  EnvironmentContext environmentContext = new EnvironmentContext();
  Partition newPartition = new Partition();
  newPartition.setDbName(DB_P);
  Partition inbound = new Partition();
  Partition outbound = new Partition();
  when(primaryMapping.transformInboundPartition(newPartition)).thenReturn(inbound);
  when(primaryClient.add_partition_with_environment_context(inbound, environmentContext)).thenReturn(inbound);
  when(primaryMapping.transformOutboundPartition(inbound)).thenReturn(outbound);
  Partition result = handler.add_partition_with_environment_context(newPartition, environmentContext);
  assertThat(result, is(outbound));
  verify(primaryMapping).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:16,代码来源:FederatedHMSHandlerTest.java


示例7: add_partitions

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void add_partitions() throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  Partition newPartition1 = new Partition();
  newPartition1.setDbName(DB_P);
  Partition newPartition2 = new Partition();
  newPartition2.setDbName(DB_P);
  List<Partition> inbound = Lists.newArrayList(new Partition());
  List<Partition> partitions = Lists.newArrayList(newPartition1, newPartition2);
  when(primaryMapping.transformInboundPartitions(partitions)).thenReturn(inbound);
  when(primaryClient.add_partitions(inbound)).thenReturn(2);
  int result = handler.add_partitions(partitions);
  assertThat(result, is(2));
  verify(primaryMapping, times(2)).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:15,代码来源:FederatedHMSHandlerTest.java


示例8: add_partitions_pspec

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void add_partitions_pspec() throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  PartitionSpec newPartitionPSpec1 = new PartitionSpec();
  newPartitionPSpec1.setDbName(DB_P);
  PartitionSpec newPartitionPspec2 = new PartitionSpec();
  newPartitionPspec2.setDbName(DB_P);
  List<PartitionSpec> inbound = Lists.newArrayList(new PartitionSpec());
  List<PartitionSpec> partitionsPspec = Lists.newArrayList(newPartitionPSpec1, newPartitionPspec2);
  when(primaryMapping.transformInboundPartitionSpecs(partitionsPspec)).thenReturn(inbound);
  when(primaryClient.add_partitions_pspec(inbound)).thenReturn(2);
  int result = handler.add_partitions_pspec(partitionsPspec);
  assertThat(result, is(2));
  verify(primaryMapping, times(2)).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:15,代码来源:FederatedHMSHandlerTest.java


示例9: append_partition

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void append_partition() throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  Partition inbound = new Partition();
  Partition outbound = new Partition();
  List<String> partVals = Lists.newArrayList();
  when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound");
  when(primaryClient.append_partition("inbound", "table1", partVals)).thenReturn(inbound);
  when(primaryMapping.transformOutboundPartition(inbound)).thenReturn(outbound);
  Partition result = handler.append_partition(DB_P, "table1", partVals);
  assertThat(result, is(outbound));
  verify(primaryMapping).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:13,代码来源:FederatedHMSHandlerTest.java


示例10: add_partitions_req

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void add_partitions_req() throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  Partition newPartition1 = new Partition();
  newPartition1.setDbName(DB_P);
  Partition newPartition2 = new Partition();
  newPartition2.setDbName(DB_P);
  List<Partition> partitions = Lists.newArrayList(newPartition1, newPartition2);
  AddPartitionsRequest request = new AddPartitionsRequest();
  request.setDbName(DB_P);
  request.setParts(partitions);
  AddPartitionsRequest inbound = new AddPartitionsRequest();
  AddPartitionsResult addPartitionResult = new AddPartitionsResult();
  AddPartitionsResult outbound = new AddPartitionsResult();
  when(primaryMapping.transformInboundAddPartitionsRequest(request)).thenReturn(inbound);
  when(primaryClient.add_partitions_req(inbound)).thenReturn(addPartitionResult);
  when(primaryMapping.transformOutboundAddPartitionsResult(addPartitionResult)).thenReturn(outbound);

  AddPartitionsResult result = handler.add_partitions_req(request);
  assertThat(result, is(outbound));
  verify(primaryMapping, times(3)).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:22,代码来源:FederatedHMSHandlerTest.java


示例11: append_partition_with_environment_context

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void append_partition_with_environment_context()
  throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  EnvironmentContext environmentContext = new EnvironmentContext();
  Partition inbound = new Partition();
  Partition outbound = new Partition();
  List<String> partVals = Lists.newArrayList();
  when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound");
  when(primaryClient.append_partition_with_environment_context("inbound", "table1", partVals, environmentContext))
      .thenReturn(inbound);
  when(primaryMapping.transformOutboundPartition(inbound)).thenReturn(outbound);
  Partition result = handler.append_partition_with_environment_context(DB_P, "table1", partVals, environmentContext);
  assertThat(result, is(outbound));
  verify(primaryMapping).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:16,代码来源:FederatedHMSHandlerTest.java


示例12: append_partition_by_name

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void append_partition_by_name()
  throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  Partition inbound = new Partition();
  Partition outbound = new Partition();
  when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound");
  when(primaryClient.append_partition_by_name("inbound", "table1", "partName")).thenReturn(inbound);
  when(primaryMapping.transformOutboundPartition(inbound)).thenReturn(outbound);
  Partition result = handler.append_partition_by_name(DB_P, "table1", "partName");
  assertThat(result, is(outbound));
  verify(primaryMapping).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:13,代码来源:FederatedHMSHandlerTest.java


示例13: append_partition_by_name_with_environment_context

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void append_partition_by_name_with_environment_context()
  throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
  EnvironmentContext environmentContext = new EnvironmentContext();
  Partition inbound = new Partition();
  Partition outbound = new Partition();
  when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound");
  when(primaryClient.append_partition_by_name_with_environment_context("inbound", "table1", "partName",
      environmentContext)).thenReturn(inbound);
  when(primaryMapping.transformOutboundPartition(inbound)).thenReturn(outbound);
  Partition result = handler.append_partition_by_name_with_environment_context(DB_P, "table1", "partName",
      environmentContext);
  assertThat(result, is(outbound));
  verify(primaryMapping).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:16,代码来源:FederatedHMSHandlerTest.java


示例14: exchange_partition

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Test
public void exchange_partition()
  throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException, TException {
  Partition partition = new Partition();
  Partition outbound = new Partition();
  Map<String, String> specs = new HashMap<>();
  when(primaryMapping.transformInboundDatabaseName(DB_P)).thenReturn("inbound");
  when(primaryClient.exchange_partition(specs, "inbound", "soureTable", "inbound", "destTable"))
      .thenReturn(partition);
  when(primaryMapping.transformOutboundPartition(partition)).thenReturn(outbound);
  Partition result = handler.exchange_partition(specs, DB_P, "soureTable", DB_P, "destTable");
  assertThat(result, is(outbound));
  verify(primaryMapping, times(2)).checkWritePermissions(DB_P);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:15,代码来源:FederatedHMSHandlerTest.java


示例15: add_drop_partitions

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
/**
 * Adds and drops partitions in one transaction.
 *
 * @param databaseName database name
 * @param tableName    table name
 * @param addParts     list of partitions
 * @param dropParts    list of partition values
 * @param deleteData   if true, deletes the data
 * @return true if successful
 * @throws NoSuchObjectException Exception if table does not exists
 * @throws MetaException         Exception if
 * @throws TException            any internal exception
 */
@SuppressWarnings({"checkstyle:methodname"})
public boolean add_drop_partitions(final String databaseName,
                                   final String tableName, final List<Partition> addParts,
                                   final List<List<String>> dropParts, final boolean deleteData)
        throws NoSuchObjectException, MetaException, TException {
    startFunction("add_drop_partitions : db=" + databaseName + " tbl=" + tableName);
    if (addParts.size() == 0 && dropParts.size() == 0) {
        return true;
    }
    for (List<String> partVals : dropParts) {
        LOG.info("Drop Partition values:" + partVals);
    }
    for (Partition part : addParts) {
        LOG.info("Add Partition values:" + part);
    }

    boolean ret = false;
    Exception ex = null;
    try {
        ret = addDropPartitionsCore(getMS(), databaseName, tableName, addParts, dropParts, false, null);
    } catch (Exception e) {
        ex = e;
        if (e instanceof MetaException) {
            throw (MetaException) e;
        } else if (e instanceof InvalidObjectException) {
            throw (InvalidObjectException) e;
        } else if (e instanceof AlreadyExistsException) {
            throw (AlreadyExistsException) e;
        } else if (e instanceof NoSuchObjectException) {
            throw (NoSuchObjectException) e;
        } else {
            throw newMetaException(e);
        }
    } finally {
        endFunction("drop_partitions", ret, ex, tableName);
    }
    return ret;

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


示例16: addPartitionsCoreNoTxn

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
private List<Partition> addPartitionsCoreNoTxn(
        final RawStore ms, final Table tbl, final List<Partition> parts, final boolean ifNotExists,
        final Map<PartValEqWrapper, Boolean> addedPartitions, final List<Partition> existingParts)
        throws MetaException, InvalidObjectException, AlreadyExistsException, TException {
    logInfo("add_partitions");
    final String dbName = tbl.getDbName();
    final String tblName = tbl.getTableName();
    final List<Partition> result = new ArrayList<Partition>();
    for (Partition part : parts) {
        if (!part.getTableName().equals(tblName) || !part.getDbName().equals(dbName)) {
            throw new MetaException("Partition does not belong to target table "
                    + dbName + "." + tblName + ": " + part);
        }
        final boolean shouldAdd = startAddPartition(ms, part, ifNotExists);
        if (!shouldAdd) {
            existingParts.add(part);
            LOG.info("Not adding partition " + part + " as it already exists");
            continue;
        }
        final boolean madeDir = createLocationForAddedPartition(tbl, part);
        if (addedPartitions.put(new PartValEqWrapper(part), madeDir) != null) {
            // Technically, for ifNotExists case, we could insert one and discard the other
            // because the first one now "exists", but it seems better to report the problem
            // upstream as such a command doesn't make sense.
            throw new MetaException("Duplicate partitions in the list: " + part);
        }
        initializeAddedPartition(tbl, part, madeDir);
        result.add(part);
    }
    return result;
}
 
开发者ID:Netflix,项目名称:metacat,代码行数:32,代码来源:MetacatHMSHandler.java


示例17: add_partition

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
private void add_partition(HiveMetaStoreClient client, Table table,
	      List<String> vals, String location) throws InvalidObjectException,
	        AlreadyExistsException, MetaException, TException {

    Partition part = new Partition();
    part.setDbName(table.getDbName());
    part.setTableName(table.getTableName());
    part.setValues(vals);
    part.setParameters(new HashMap<String, String>());
    part.setSd(table.getSd());
    part.getSd().setSerdeInfo(table.getSd().getSerdeInfo());
    part.getSd().setLocation(table.getSd().getLocation() + location);

    client.add_partition(part);
}
 
开发者ID:Ctrip-DI,项目名称:Hue-Ctrip-DI,代码行数:16,代码来源:TestHiveCleanService.java


示例18: getPartitionsWithAuth

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Override
public List<Partition> getPartitionsWithAuth(String dbName, String tblName,
    short maxParts, String userName, List<String> groupNames)
    throws MetaException, NoSuchObjectException, InvalidObjectException {
  if (filterTables(dbName, Lists.newArrayList(tblName)).isEmpty()) {
    throw new MetaException(getNoAccessMessageForTable(dbName, tblName));
  }
  return super.getPartitionsWithAuth(dbName, tblName, maxParts, userName,
      groupNames);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:11,代码来源:AuthorizingObjectStore.java


示例19: listPartitionsPsWithAuth

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Override
public List<Partition> listPartitionsPsWithAuth(String dbName,
    String tblName, List<String> part_vals, short max_parts, String userName,
    List<String> groupNames) throws MetaException, InvalidObjectException,
    NoSuchObjectException {
  if (filterTables(dbName, Lists.newArrayList(tblName)).isEmpty()) {
    throw new MetaException(getNoAccessMessageForTable(dbName, tblName));
  }
  return super.listPartitionsPsWithAuth(dbName, tblName, part_vals,
      max_parts, userName, groupNames);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:12,代码来源:AuthorizingObjectStore.java


示例20: getPartitionWithAuth

import org.apache.hadoop.hive.metastore.api.InvalidObjectException; //导入依赖的package包/类
@Override
public Partition getPartitionWithAuth(String dbName, String tblName,
    List<String> partVals, String user_name, List<String> group_names)
    throws MetaException, NoSuchObjectException, InvalidObjectException {
  if (filterTables(dbName, Lists.newArrayList(tblName)).isEmpty()) {
    throw new MetaException(getNoAccessMessageForTable(dbName, tblName));
  }
  return super.getPartitionWithAuth(dbName, tblName, partVals, user_name,
      group_names);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:11,代码来源:AuthorizingObjectStoreV2.java



注:本文中的org.apache.hadoop.hive.metastore.api.InvalidObjectException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EnumJvmJITCompilerTimeMonitoring类代码示例发布时间:2022-05-22
下一篇:
Java Action类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap