Package org.apache.ambari.server

Examples of org.apache.ambari.server.DuplicateResourceException


      if (duplicates.size() == 1) {
        msg = "Attempted to create a host_component which already exists: ";
      } else {
        msg = "Attempted to create host_component's which already exist: ";
      }
      throw new DuplicateResourceException(msg + names.toString());
    }

    // set restartRequired flag for  monitoring services
    setMonitoringServicesRestartRequired(requests);
    // now doing actual work
View Full Code Here


    readWriteLock.writeLock().lock();
    try {
      if (hosts != null && !hosts.isEmpty()) {
        for (Host h : hosts.values()) {
          if (h.getHostName().equals(host.getHostName())) {
            throw new DuplicateResourceException("Host " + h.getHostName() +
              "is already associated with Config Group " +
              configGroupEntity.getGroupName());
          }
        }
        hosts.put(host.getHostName(), host);
View Full Code Here

    try {
      if (configurations != null && !configurations.isEmpty()) {
        for (Config c : configurations.values()) {
          if (c.getType().equals(config.getType()) && c.getVersionTag().equals
            (config.getVersionTag())) {
            throw new DuplicateResourceException("Config " + config.getType() +
              " with tag " + config.getVersionTag() + " is already associated " +
              "with Config Group " + configGroupEntity.getGroupName());
          }
        }
        configurations.put(config.getType(), config);
View Full Code Here

            + ", clusterName=" + clusterName  + " serviceName=" + svcNames.toString();
      } else {
        msg = "Attempted to create services which already exist: "
            + ", clusterName=" + clusterName  + " serviceNames=" + svcNames.toString();
      }
      throw new DuplicateResourceException(msg);
    }

    // now to the real work
    for (ServiceRequest request : requests) {
      Cluster cluster = clusters.getCluster(request.getClusterName());
View Full Code Here

      if (duplicates.size() == 1) {
        msg = "Attempted to create a component which already exists: ";
      } else {
        msg = "Attempted to create components which already exist: ";
      }
      throw new DuplicateResourceException(msg + names.toString());
    }


    // now doing actual work
    for (ServiceComponentRequest request : requests) {
View Full Code Here

      if (duplicates.size() == 1) {
        msg = "Attempted to create a host_component which already exists: ";
      } else {
        msg = "Attempted to create host_component's which already exist: ";
      }
      throw new DuplicateResourceException(msg + names.toString());
    }

    // now doing actual work
    for (ServiceComponentHostRequest request : requests) {
      Cluster cluster = clusters.getCluster(request.getClusterName());
View Full Code Here

  public void addCluster(String clusterName)
      throws AmbariException {
    loadClustersAndHosts();

    if (clusters.containsKey(clusterName)) {
      throw new DuplicateResourceException("Attempted to create a Cluster which already exists"
          + ", clusterName=" + clusterName);
    }

    w.lock();
    try {
      if (clusters.containsKey(clusterName)) {
        throw new DuplicateResourceException("Attempted to create a Cluster which already exists"
            + ", clusterName=" + clusterName);
      }
      // retrieve new cluster id
      // add cluster id -> cluster mapping into clustersById
      ClusterEntity clusterEntity = new ClusterEntity();
View Full Code Here

      Host host = getHost(hostname);
      Cluster cluster = getCluster(clusterName);

      for (Cluster c : hostClusterMap.get(hostname)) {
        if (c.getClusterName().equals(clusterName)) {
          throw new DuplicateResourceException("Attempted to create a host which already exists: clusterName=" +
              clusterName + ", hostName=" + hostname);
        }
      }

      if (!isOsSupportedByClusterStack(cluster, host)) {
View Full Code Here

      if (duplicates.size() == 1) {
        msg = "Attempted to create a host_component which already exists: ";
      } else {
        msg = "Attempted to create host_component's which already exist: ";
      }
      throw new DuplicateResourceException(msg + names.toString());
    }

    // set restartRequired flag for  monitoring services
    setMonitoringServicesRestartRequired(requests);
    // now doing actual work
View Full Code Here

      @Override
      public Void invoke() throws AmbariException {
        BlueprintEntity blueprint = toBlueprintEntity(properties);

        if (dao.findByName(blueprint.getBlueprintName()) != null) {
          throw new DuplicateResourceException(
              "Attempted to create a Blueprint which already exists, blueprint_name=" +
              blueprint.getBlueprintName());
        }

        Map<String, Map<String, Collection<String>>> missingProperties = blueprint.validateConfigurations(
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.DuplicateResourceException

Copyright © 2018 www.massapicom. 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.