Examples of AlreadyExistsException


Examples of org.apache.cassandra.exceptions.AlreadyExistsException

    public static void announceNewKeyspace(KSMetaData ksm, long timestamp) throws ConfigurationException
    {
        ksm.validate();

        if (Schema.instance.getTableDefinition(ksm.name) != null)
            throw new AlreadyExistsException(ksm.name);

        logger.info(String.format("Create new Keyspace: %s", ksm));
        announce(ksm.toSchema(timestamp));
    }
View Full Code Here

Examples of org.apache.cassandra.exceptions.AlreadyExistsException

        KSMetaData ksm = Schema.instance.getTableDefinition(cfm.ksName);
        if (ksm == null)
            throw new ConfigurationException(String.format("Cannot add column family '%s' to non existing keyspace '%s'.", cfm.cfName, cfm.ksName));
        else if (ksm.cfMetaData().containsKey(cfm.cfName))
            throw new AlreadyExistsException(cfm.ksName, cfm.cfName);

        logger.info(String.format("Create new ColumnFamily: %s", cfm));
        announce(cfm.toSchema(FBUtilities.timestampMicros()));
    }
View Full Code Here

Examples of org.apache.cxf.aegis.inheritance.ws2.common.exception.AlreadyExistsException

    }

    public synchronized void putParentBean(ParentBean parentBean) throws AlreadyExistsException {
        String id = parentBean.getId();
        if (map.containsKey(id)) {
            throw new AlreadyExistsException(id);
        }
        map.put(id, parentBean);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

                       + db.getLocationUri() + " "
                       + db.getDescription());
      try {
        try {
          if(null != get_database(db.getName())) {
            throw new AlreadyExistsException("Database " + db.getName() + " already exists");
          }
        } catch (NoSuchObjectException e) {
          // expected
        }
        executeWithRetry(new Command<Boolean>() {
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

      boolean success = false;
      try {
        ms.openTransaction();
        if (is_type_exists(ms, type.getName())) {
          throw new AlreadyExistsException("Type " + type.getName() + " already exists");
        }
        ms.createType(type);
        success = ms.commitTransaction();
      } finally {
        if (!success) {
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

      try {
        ms.openTransaction();

        // get_table checks whether database exists, it should be moved here
        if (is_table_exists(ms, tbl.getDbName(), tbl.getTableName())) {
          throw new AlreadyExistsException("Table " + tbl.getTableName()
              + " already exists");
        }

        if (!TableType.VIRTUAL_VIEW.toString().equals(tbl.getTableType())) {
          if (tbl.getSd().getLocation() == null
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

        } catch (NoSuchObjectException e) {
          // this means there is no existing partition
          old_part = null;
        }
        if (old_part != null) {
          throw new AlreadyExistsException("Partition already exists:" + part);
        }

        if (!wh.isDir(partLocation)) {
          if (!wh.mkdirs(partLocation)) {
            throw new MetaException(partLocation
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

        } catch(NoSuchObjectException e) {
          // this means there is no existing partition
          old_part = null;
        }
        if (old_part != null) {
          throw new AlreadyExistsException("Partition already exists:" + part);
        }
        Table tbl = ms.getTable(part.getDbName(), part.getTableName());
        if (tbl == null) {
          throw new InvalidObjectException(
              "Unable to add partition because table or database do not exist");
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

          old_index = get_index_by_name(index.getDbName(), index
              .getOrigTableName(), index.getIndexName());
        } catch (Exception e) {
        }
        if (old_index != null) {
          throw new AlreadyExistsException("Index already exists:" + index);
        }
        Table origTbl = ms.getTable(index.getDbName(), index.getOrigTableName());
        if (origTbl == null) {
          throw new InvalidObjectException(
              "Unable to add index because database or the orginal table do not exist");
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.AlreadyExistsException

      public boolean create_type(Type type) throws AlreadyExistsException, MetaException, InvalidObjectException {
        this.incrementCounter("create_type");
        logStartFunction("create_type: " + type.getName());
        // check whether type already exists
        if(get_type(type.getName()) != null) {
          throw new AlreadyExistsException("Type " + type.getName() + " already exists");
        }

        //TODO:pc Validation of types should be done by clients or here????
        return getMS().createType(type);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.