Examples of InvalidPartitionException


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

    return tbl;
  }

  private String getPartitionStr(Table tbl, Map<String,String> partName) throws InvalidPartitionException{
    if(tbl.getPartitionKeysSize() != partName.size()){
      throw new InvalidPartitionException("Number of partition columns in table: "+ tbl.getPartitionKeysSize() +
          " doesn't match with number of supplied partition values: "+partName.size());
    }
    final List<String> storedVals = new ArrayList<String>(tbl.getPartitionKeysSize());
    for(FieldSchema partKey : tbl.getPartitionKeys()){
      String partVal = partName.get(partKey.getName());
      if(null == partVal) {
        throw new InvalidPartitionException("No value found for partition column: "+partKey.getName());
      }
      storedVals.add(partVal);
    }
    return join(storedVals,',');
  }
View Full Code Here

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

    return tbl;
  }

  private String getPartitionStr(Table tbl, Map<String,String> partName) throws InvalidPartitionException{
    if(tbl.getPartitionKeysSize() != partName.size()){
      throw new InvalidPartitionException("Number of partition columns in table: "+ tbl.getPartitionKeysSize() +
          " doesn't match with number of supplied partition values: "+partName.size());
    }
    final List<String> storedVals = new ArrayList<String>(tbl.getPartitionKeysSize());
    for(FieldSchema partKey : tbl.getPartitionKeys()){
      String partVal = partName.get(partKey.getName());
      if(null == partVal) {
        throw new InvalidPartitionException("No value found for partition column: "+partKey.getName());
      }
      storedVals.add(partVal);
    }
    return join(storedVals,',');
  }
View Full Code Here

Examples of org.apache.stratos.autoscaler.exception.InvalidPartitionException

  /*
   * Deploy a new partition to Auto Scaler.
   */
    public boolean addNewPartition(Partition partition) throws InvalidPartitionException {
        if (StringUtils.isEmpty(partition.getId())){
            throw new InvalidPartitionException("Partition id can not be empty");
        }
        if (this.partitionExist(partition.getId())) {
            throw new InvalidPartitionException(String.format("Partition already exist in partition manager: [id] %s", partition.getId()));
        }
        if (null == partition.getProvider()) {
            throw new InvalidPartitionException("Mandatory field provider has not be set for partition " + partition.getId());
        }
        try {
            validatePartitionViaCloudController(partition);
            RegistryManager.getInstance().persistPartition(partition);
            addPartitionToInformationModel(partition);
            if (log.isInfoEnabled()) {
                log.info(String.format("Partition is deployed successfully: [id] %s", partition.getId()));
            }
            return true;
        } catch (Exception e) {
            throw new InvalidPartitionException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.apache.stratos.autoscaler.exception.InvalidPartitionException

        for (Partition partition : deploymentPolicy.getAllPartitions()) {
            String partitionId = partition.getId();
            if ((partitionId == null) || (!partitionMgr.partitionExist(partitionId))) {
                String msg = "Could not find partition: [id] " + partitionId + ". " +
                        "Please deploy the partitions before deploying the deployment policies.";               
                throw new InvalidPartitionException(msg);
            }
           
            fillPartition(partition, PartitionManager.getInstance().getPartitionById(partitionId));
        }
    }
View Full Code Here

Examples of org.apache.stratos.cloud.controller.exception.InvalidPartitionException

                    String msg =
                                 "Invalid Partition Detected : " + partitionId +
                                         " - Cause: Invalid Region: " + region;
                    log.error(msg);
                    throw new InvalidPartitionException(msg);
                }
               
                iaas.isValidRegion(region);
               
                IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
               
                Iaas updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
                updatedIaas.setIaasProvider(updatedIaasProvider);
               
                if (properties.containsKey(Scope.zone.toString())) {
                    String zone = properties.getProperty(Scope.zone.toString());
                    iaas.isValidZone(region, zone);
                    updatedIaasProvider.setProperty(CloudControllerConstants.AVAILABILITY_ZONE, zone);
                    updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
                    updatedIaas.setIaasProvider(updatedIaasProvider);
                }
               
                return updatedIaasProvider;
               
            } else {
               
                return iaasProvider;
            }
        } catch (Exception ex) {
            String msg = "Invalid Partition Detected : "+partitionId+". Cause: "+ex.getMessage();
            log.error(msg, ex);
            throw new InvalidPartitionException(msg, ex);
        }
       
    }
View Full Code Here

Examples of org.apache.stratos.cloud.controller.exception.InvalidPartitionException

                    String msg =
                                 "Invalid Partition Detected : " + partitionId +
                                         " - Cause: Invalid Region: " + region;
                    log.error(msg);
                    throw new InvalidPartitionException(msg);
                }
               
                iaas.isValidRegion(region);
               
                IaasProvider updatedIaasProvider = new IaasProvider(iaasProvider);
                Iaas updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
                updatedIaas.setIaasProvider(updatedIaasProvider);
               
                if (properties.containsKey(Scope.zone.toString())) {
                    String zone = properties.getProperty(Scope.zone.toString());
                    iaas.isValidZone(region, zone);
                   
                    updatedIaasProvider.setProperty(CloudControllerConstants.AVAILABILITY_ZONE, zone);
                    updatedIaas = CloudControllerUtil.getIaas(updatedIaasProvider);
                    updatedIaas.setIaasProvider(updatedIaasProvider);
                }
               
                return updatedIaasProvider;
               
               
            } else {

                return iaasProvider;
            }
        } catch (Exception ex) {
            String msg = "Invalid Partition Detected : "+partitionId+". Cause: "+ex.getMessage();
            log.error(msg, ex);
            throw new InvalidPartitionException(msg, ex);
        }
    }
View Full Code Here

Examples of org.apache.stratos.cloud.controller.exception.InvalidPartitionException

        if (iaasProvider == null) {
            String msg =
                         "Invalid Partition - " + partition.toString() +
                                 ". Cause: Iaas Provider is null for Provider: " + provider;
            log.error(msg);
            throw new InvalidPartitionException(msg);
        }

        Iaas iaas = iaasProvider.getIaas();
       
        if (iaas == null) {
           
            try {
                iaas = CloudControllerUtil.getIaas(iaasProvider);
            } catch (InvalidIaasProviderException e) {
                String msg =
                        "Invalid Partition - " + partition.toString() +
                        ". Cause: Unable to build Iaas of this IaasProvider [Provider] : " + provider+". "+e.getMessage();
                log.error(msg, e);
                throw new InvalidPartitionException(msg, e);
            }
           
        }
       
        PartitionValidator validator = iaas.getPartitionValidator();
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.