Package org.apache.ambari.server

Examples of org.apache.ambari.server.ClusterNotFoundException


    loadClustersAndHosts();
    r.lock();
    try {
      if (!clusters.containsKey(clusterName)) {
        throw new ClusterNotFoundException(clusterName);
      }
      Cluster cluster = clusters.get(clusterName);
      cluster.setCurrentStackVersion(stackId);
    } finally {
      r.unlock();
View Full Code Here


    r.lock();
    try {
      for (String c : clusterSet) {
        if (c != null) {
          if (!clusters.containsKey(c))
            throw new ClusterNotFoundException(c);
          else
            clusterMap.put(c, clusters.get(c));
        }
      }
    } finally {
View Full Code Here

    // constructor init
    injector.injectMembers(capture(controllerCapture));
    expect(injector.getInstance(Gson.class)).andReturn(null);

    // getCluster
    expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));

    // replay mocks
    replay(injector, clusters);

    //test
View Full Code Here

    // constructor init
    injector.injectMembers(capture(controllerCapture));
    expect(injector.getInstance(Gson.class)).andReturn(null);

    // getCluster
    expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));
    expect(clusters.getCluster("cluster2")).andReturn(cluster);
    expect(clusters.getCluster("cluster3")).andReturn(cluster2);
    expect(clusters.getCluster("cluster4")).andThrow(new ClusterNotFoundException("cluster4"));

    expect(cluster.convertToResponse()).andReturn(response);
    expect(cluster2.convertToResponse()).andReturn(response2);
    // replay mocks
    replay(injector, clusters, cluster, cluster2, response, response2);
View Full Code Here

    // constructor init
    injector.injectMembers(capture(controllerCapture));
    expect(injector.getInstance(Gson.class)).andReturn(null);

    // getHostComponent
    expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));

    // replay mocks
    replay(injector, clusters, stack, metaInfo);

    //test
View Full Code Here

      throws AmbariException {
    loadClustersAndHosts();
    r.lock();
    try {
      if (!clusters.containsKey(clusterName)) {
        throw new ClusterNotFoundException(clusterName);
      }
      return clusters.get(clusterName);
    } finally {
      r.unlock();
    }
View Full Code Here

  public Cluster getClusterById(long id) throws AmbariException {
    loadClustersAndHosts();
    r.lock();
    try {
      if (!clustersById.containsKey(id)) {
        throw new ClusterNotFoundException("clusterID=" + id);
      }
      return clustersById.get(id);
    } finally {
      r.unlock();
    }
View Full Code Here

    loadClustersAndHosts();
    r.lock();
    try {
      if (!clusters.containsKey(clusterName)) {
        throw new ClusterNotFoundException(clusterName);
      }
      Cluster cluster = clusters.get(clusterName);
      cluster.setCurrentStackVersion(stackId);
    } finally {
      r.unlock();
View Full Code Here

    r.lock();
    try {
      for (String c : clusterSet) {
        if (c != null) {
          if (!clusters.containsKey(c))
            throw new ClusterNotFoundException(c);
          else
            clusterMap.put(c, clusters.get(c));
        }
      }
    } finally {
View Full Code Here

    // constructor init
    injector.injectMembers(capture(controllerCapture));
    expect(injector.getInstance(Gson.class)).andReturn(null);

    // getCluster
    expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));

    // replay mocks
    replay(injector, clusters);

    //test
View Full Code Here

TOP

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

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.