Examples of ClusterImpl


Examples of org.apache.ambari.server.state.cluster.ClusterImpl

              + ", serviceName=" + service.getName()
              + ", serviceComponentName=" + getName()
              + ", hostname=" + hostComponent.getHostName());
        }
        // FIXME need a better approach of caching components by host
        ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
        clusterImpl.addServiceComponentHost(hostComponent);
        this.hostComponents.put(hostComponent.getHostName(), hostComponent);
      } finally {
        readWriteLock.writeLock().unlock();
      }
    } finally {
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

              + ", hostname=" + hostName);
        }
        ServiceComponentHost hostComponent =
            serviceComponentHostFactory.createNew(this, hostName, this.isClientComponent());
        // FIXME need a better approach of caching components by host
        ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
        clusterImpl.addServiceComponentHost(hostComponent);

        this.hostComponents.put(hostComponent.getHostName(), hostComponent);

        return hostComponent;
      } finally {
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

        }
        sch.delete();
        hostComponents.remove(hostname);

        // FIXME need a better approach of caching components by host
        ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
        clusterImpl.removeServiceComponentHost(sch);
      } finally {
        readWriteLock.writeLock().unlock();
      }
    } finally {
      clusterGlobalLock.writeLock().unlock();
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

          + ", serviceName=" + service.getName()
          + ", serviceComponentName=" + getName()
          + ", hostname=" + hostComponent.getHostName());
    }
    // FIXME need a better approach of caching components by host
    ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
    clusterImpl.addServiceComponentHost(hostComponent);
    this.hostComponents.put(hostComponent.getHostName(), hostComponent);
  }
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

          + ", hostname=" + hostName);
    }
    ServiceComponentHost hostComponent =
        serviceComponentHostFactory.createNew(this, hostName, true);
    // FIXME need a better approach of caching components by host
    ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
    clusterImpl.addServiceComponentHost(hostComponent);

    this.hostComponents.put(hostComponent.getHostName(), hostComponent);

    return hostComponent;
  }
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

          + ", serviceName=" + service.getName()
          + ", serviceComponentName=" + getName()
          + ", hostname=" + hostComponent.getHostName());
    }
    // FIXME need a better approach of caching components by host
    ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
    clusterImpl.addServiceComponentHost(hostComponent);
    this.hostComponents.put(hostComponent.getHostName(), hostComponent);
  }
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

          + ", hostname=" + hostName);
    }
    ServiceComponentHost hostComponent =
        serviceComponentHostFactory.createNew(this, hostName, true);
    // FIXME need a better approach of caching components by host
    ClusterImpl clusterImpl = (ClusterImpl) service.getCluster();
    clusterImpl.addServiceComponentHost(hostComponent);

    this.hostComponents.put(hostComponent.getHostName(), hostComponent);

    return hostComponent;
  }
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

   */
  @Test
  public void testInitializeAtHCFSCluster() throws AmbariException {

    RoleCommandOrder rco = injector.getInstance(RoleCommandOrder.class);
    ClusterImpl cluster = createMock(ClusterImpl.class);
    Service service = createMock(Service.class);
    expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.0.6"));
    expect(cluster.getService("HCFS")).andReturn(service);
    expect(cluster.getService("HDFS")).andReturn(null);
    replay(cluster);

    Map<RoleCommandPair, Set<RoleCommandPair>> deps = rco.getDependencies();
    assertTrue("Dependencies are empty before initialization", deps.size() == 0);
    rco.initialize(cluster);
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

   */
  @Test
  public void testInitializeAtHDFSCluster() throws AmbariException {

    RoleCommandOrder rco = injector.getInstance(RoleCommandOrder.class);
    ClusterImpl cluster = createMock(ClusterImpl.class);
    expect(cluster.getService("HCFS")).andReturn(null);

    Service hdfsService = createMock(Service.class);

    expect(cluster.getService("HDFS")).andReturn(hdfsService).atLeastOnce();
    expect(hdfsService.getServiceComponent("JOURNALNODE")).andReturn(null);
    expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.0.6"));

    replay(cluster);
    replay(hdfsService);

    Map<RoleCommandPair, Set<RoleCommandPair>> deps = rco.getDependencies();
View Full Code Here

Examples of org.apache.ambari.server.state.cluster.ClusterImpl

   * dependency mapping file (role_command_order.json)
   */
  @Test
  public void testInitializeAtHaHDFSCluster() throws AmbariException {
    RoleCommandOrder rco = injector.getInstance(RoleCommandOrder.class);
    ClusterImpl cluster = createMock(ClusterImpl.class);
    expect(cluster.getService("HCFS")).andReturn(null);

    Service hdfsService = createMock(Service.class);
    ServiceComponent journalnodeSC = createMock(ServiceComponent.class);

    expect(cluster.getService("HDFS")).andReturn(hdfsService).atLeastOnce();
    expect(hdfsService.getServiceComponent("JOURNALNODE")).andReturn(journalnodeSC);
    expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.0.6"));

    replay(cluster);
    replay(hdfsService);

    Map<RoleCommandPair, Set<RoleCommandPair>> deps = rco.getDependencies();
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.