Examples of HostEntity


Examples of org.apache.ambari.server.orm.entities.HostEntity

    }
  }
 
  @Transactional
  void mapHostClusterEntities(String hostName, Long clusterId) {
    HostEntity hostEntity = hostDAO.findByName(hostName);
    ClusterEntity clusterEntity = clusterDAO.findById(clusterId);

    hostEntity.getClusterEntities().add(clusterEntity);
    clusterEntity.getHostEntities().add(hostEntity);

    clusterDAO.merge(clusterEntity);
    hostDAO.merge(hostEntity);
  }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

   
  }
 
  @Transactional
  private void unmapHostClusterEntities(String hostName, long clusterId) {
    HostEntity hostEntity = hostDAO.findByName(hostName);
    ClusterEntity clusterEntity = clusterDAO.findById(clusterId);

    hostEntity.getClusterEntities().remove(clusterEntity);
    clusterEntity.getHostEntities().remove(hostEntity);

    configGroupHostMappingDAO.removeAllByHost(hostName);
   
    hostDAO.merge(hostEntity);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

      return;
   
    w.lock();

    try {
      HostEntity entity = hostDAO.findByName(hostname);
      hostDAO.refresh(entity);
      hostDAO.remove(entity);
      hosts.remove(hostname);
      // Remove Config group mapping
      configGroupHostMappingDAO.removeAllByHost(hostname);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

      configGroupEntity.getConfigGroupHostMappingEntities().clear();
    }

    if (hosts != null && !hosts.isEmpty()) {
      for (Host host : hosts.values()) {
        HostEntity hostEntity = hostDAO.findByName(host.getHostName());
        if (hostEntity != null) {
          ConfigGroupHostMappingEntity hostMappingEntity = new
            ConfigGroupHostMappingEntity();
          hostMappingEntity.setHostname(host.getHostName());
          hostMappingEntity.setHostEntity(hostEntity);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

  public ClusterEntity createDummyData() {
    ClusterEntity clusterEntity = new ClusterEntity();
    clusterEntity.setClusterName("test_cluster1");
    clusterEntity.setClusterInfo("test_cluster_info1");

    HostEntity host1 = new HostEntity();
    HostEntity host2 = new HostEntity();
    HostEntity host3 = new HostEntity();

    host1.setHostName("test_host1");
    host2.setHostName("test_host2");
    host3.setHostName("test_host3");
    host1.setIpv4("192.168.0.1");
    host2.setIpv4("192.168.0.2");
    host3.setIpv4("192.168.0.3");

    List<HostEntity> hostEntities = new ArrayList<HostEntity>();
    hostEntities.add(host1);
    hostEntities.add(host2);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

    scheduleEntity.setDaysOfMonth("*");
    scheduleEntity.setYear("*");

    requestScheduleDAO.create(scheduleEntity);

    HostEntity hostEntity = new HostEntity();
    hostEntity.setHostName("h1");
    hostEntity.setOsType("centOS");
    hostDAO.create(hostEntity);

    RequestScheduleBatchRequestEntity batchRequestEntity = new
      RequestScheduleBatchRequestEntity();

View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

      throw new AmbariException(duplicateMessage);
    }
    r.lock();

    try {
      HostEntity hostEntity = new HostEntity();
      hostEntity.setHostName(hostname);
      hostEntity.setClusterEntities(new ArrayList<ClusterEntity>());
      //not stored to DB
      Host host = hostFactory.create(hostEntity, false);
      host.setAgentVersion(new AgentVersion(""));
      List<DiskInfo> emptyDiskList = new ArrayList<DiskInfo>();
      host.setDisksInfo(emptyDiskList);
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

    }
  }
 
  @Transactional
  void mapHostClusterEntities(String hostName, Long clusterId) {
    HostEntity hostEntity = hostDAO.findByName(hostName);
    ClusterEntity clusterEntity = clusterDAO.findById(clusterId);

    hostEntity.getClusterEntities().add(clusterEntity);
    clusterEntity.getHostEntities().add(hostEntity);

    clusterDAO.merge(clusterEntity);
    hostDAO.merge(hostEntity);
  }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

   
  }
 
  @Transactional
  private void unmapHostClusterEntities(String hostName, long clusterId) {
    HostEntity hostEntity = hostDAO.findByName(hostName);
    ClusterEntity clusterEntity = clusterDAO.findById(clusterId);

    hostEntity.getClusterEntities().remove(clusterEntity);
    clusterEntity.getHostEntities().remove(hostEntity);

    hostDAO.merge(hostEntity);
    clusterDAO.merge(clusterEntity);
  }
View Full Code Here

Examples of org.apache.ambari.server.orm.entities.HostEntity

      return;
   
    w.lock();

    try {
      HostEntity entity = hostDAO.findByName(hostname);
      hostDAO.refresh(entity);
      hostDAO.remove(entity);
      hosts.remove(hostname);
      deleteConfigGroupHostMapping(hostname);
    } catch (Exception e) {
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.