Examples of merge()


Examples of org.apache.accumulo.core.client.admin.TableOperations.merge()

    Connector connector = instance.getConnector("root", new PasswordToken(secret));
    TableOperations opts = connector.tableOperations();
    for (int i = 1; i <= 10; i++) {
      opts.create("" + i);
    }
    opts.merge(Constants.METADATA_TABLE_NAME, new Text("01"), new Text("02"));
    assertEquals(2, opts.listSplits(Constants.METADATA_TABLE_NAME).size());
    addSplits(opts, "4 5 6 7 8".split(" "));
    assertEquals(7, opts.listSplits(Constants.METADATA_TABLE_NAME).size());
    opts.merge(Constants.METADATA_TABLE_NAME, new Text("6"), new Text("9"));
    assertEquals(5, opts.listSplits(Constants.METADATA_TABLE_NAME).size());
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterDAO.merge()

      for (ClusterEntity entity : clusterEntities) {
        clusterIds.add(entity.getClusterId());
        String stackIdString = entity.getDesiredStackVersion();
        entity.setDesiredStackVersion(getStackIdString(stackIdString,
          stackName, stackVersion));
        clusterDAO.merge(entity);
      }
    }

    ClusterStateDAO clusterStateDAO = injector.getInstance(ClusterStateDAO.class);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterServiceDAO.merge()

    hostEntity.getHostComponentStateEntities().add(hostComponentStateEntity);
    hostEntity.getHostComponentDesiredStateEntities().add(hostComponentDesiredStateEntity);
    clusterServiceEntity.getServiceComponentDesiredStateEntities().add(componentDesiredStateEntity);
   
    ClusterServiceDAO clusterServiceDAO = injector.getInstance(ClusterServiceDAO.class);
    clusterServiceDAO.merge(clusterServiceEntity);
  }
 
  protected void executeInTransaction(Runnable func) {
    EntityManager entityManager = injector.getProvider(EntityManager.class).get();
    if (entityManager.getTransaction().isActive()) { //already started, reuse
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ClusterStateDAO.merge()

    for (Long clusterId : clusterIds) {
      ClusterStateEntity clusterStateEntity = clusterStateDAO.findByPK(clusterId);
      String currentStackVersion = clusterStateEntity.getCurrentStackVersion();
      clusterStateEntity.setCurrentStackVersion(getStackIdString
        (currentStackVersion, stackName, stackVersion));
      clusterStateDAO.merge(clusterStateEntity);
    }

    HostComponentStateDAO hostComponentStateDAO = injector.getInstance
      (HostComponentStateDAO.class);
    List<HostComponentStateEntity> hcEntities = hostComponentStateDAO.findAll();
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.HostComponentDesiredStateDAO.merge()

    if (hcdEntities != null) {
      for (HostComponentDesiredStateEntity hcd : hcdEntities) {
        String desiredStackVersion = hcd.getDesiredStackVersion();
        hcd.setDesiredStackVersion(getStackIdString(desiredStackVersion,
          stackName, stackVersion));
        hostComponentDesiredStateDAO.merge(hcd);
      }
    }

    ServiceComponentDesiredStateDAO serviceComponentDesiredStateDAO =
      injector.getInstance(ServiceComponentDesiredStateDAO.class);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.HostComponentStateDAO.merge()

    if (hcEntities != null) {
      for (HostComponentStateEntity hc : hcEntities) {
        String currentStackVersion = hc.getCurrentStackVersion();
        hc.setCurrentStackVersion(getStackIdString(currentStackVersion,
          stackName, stackVersion));
        hostComponentStateDAO.merge(hc);
      }
    }

    HostComponentDesiredStateDAO hostComponentDesiredStateDAO =
      injector.getInstance(HostComponentDesiredStateDAO.class);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.HostDAO.merge()

    hostComponentStateDAO.create(stateEntity);
    hostComponentDesiredStateDAO.create(desiredStateEntity);

    serviceComponentDesiredStateDAO.create(serviceComponentDesiredStateEntity);
    hostDAO.merge(hostEntity);
  }

  protected void addMissingLog4jConfigs() {

    final String log4jConfigTypeContains = "log4j";
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.HostRoleCommandDAO.merge()

        HostRoleCommandDAO hostRoleCommandDAO = injector.getInstance(HostRoleCommandDAO.class);
        if (r2 != null && !r2.isEmpty()) {
          for (HostRoleCommandEntity entity : r2) {
            entity.setStatus(HostRoleStatus.ABORTED);
            hostRoleCommandDAO.merge(entity);
          }
        }
      }
    });
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.MetainfoDAO.merge()

      MetainfoEntity versionEntity = metainfoDAO.findByKey("version");

      if (versionEntity != null) {
        versionEntity.setMetainfoValue(version);
        metainfoDAO.merge(versionEntity);
      } else {
        versionEntity = new MetainfoEntity();
        versionEntity.setMetainfoName("version");
        versionEntity.setMetainfoValue(version);
        metainfoDAO.create(versionEntity);
View Full Code Here

Examples of org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO.merge()

    if (scdEntities != null) {
      for (ServiceComponentDesiredStateEntity scd : scdEntities) {
        String desiredStackVersion = scd.getDesiredStackVersion();
        scd.setDesiredStackVersion(getStackIdString(desiredStackVersion,
          stackName, stackVersion));
        serviceComponentDesiredStateDAO.merge(scd);
      }
    }

    ServiceDesiredStateDAO serviceDesiredStateDAO = injector.getInstance(ServiceDesiredStateDAO.class);
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.