Examples of ClusterStatus


Examples of com.alibaba.wasp.ClusterStatus

  {
    // 35, 1
   
Collection<ServerName> backupMasters = null;
if (master.isActiveMaster()) {
    ClusterStatus status = master.getClusterStatus();
    backupMasters = status.getBackupMasters();
}

    // 43, 1
    jamonWriter.write("<table class=\"table table-striped\">\n");
    // 44, 1
View Full Code Here

Examples of com.alibaba.wasp.ClusterStatus

      public int compare(ServerName s1, ServerName s2) {
        return s1.getServerName().compareTo(s2.getServerName());
      }
    });

    return new ClusterStatus(getClusterId().toString(),
        this.serverManager.getOnlineServers(),
        this.serverManager.getDeadServers(), this.serverName, backupMasters,
        this.assignmentManager.getEntityGroupStates()
            .getEntityGroupsInTransition(),
        this.loadBalancerTracker.isBalancerOn());
View Full Code Here

Examples of com.alibaba.wasp.ClusterStatus

    assertTrue(rs.next());
    assertTrue(rs.getLong("user_id") == 5);

    egis =  admin.getTableEntityGroups(Bytes.toBytes("user123"));

    ClusterStatus status = admin.getClusterStatus();
    List<ServerName> serverNames = new ArrayList<ServerName>(status.getServers());

    egis = admin.getOnlineEntityGroups(serverNames.get(0));

    admin.move(egis.get(0).getEncodedNameAsBytes(), Bytes.toBytes(serverNames.get(1).getServerName()));
View Full Code Here

Examples of com.alibaba.wasp.ClusterStatus

        break;
      }
    }
    assertNotNull(active);
    // make sure the other two are backup masters
    ClusterStatus status = active.getClusterStatus();
    assertEquals(2, status.getBackupMastersSize());
    assertEquals(2, status.getBackupMasters().size());

    // tell the active master to shutdown the cluster
    active.shutdown();

    for (int i = NUM_MASTERS - 1; i >= 0; --i) {
View Full Code Here

Examples of com.vmware.bdd.apitypes.ClusterStatus

         softwareManagerCollector
               .getSoftwareManager(cluster.getAppManager());

      ValidationUtils.validateVersion(clusterEntityMgr, clusterName);

      ClusterStatus oldStatus = cluster.getStatus();

      if (!oldStatus.isActiveServiceStatus()) {
         throw ClusterHealServiceException.NOT_SUPPORTED(clusterName,
               "The cluster status must be RUNNING");
      }

      List<NodeGroupEntity> nodeGroups;
View Full Code Here

Examples of lcmc.crm.domain.ClusterStatus

        boolean createOrd = false;
        for (final ServiceInfo serviceInfo : servicesAll) {
            final boolean isFrom = servicesFrom.contains(serviceInfo);
            final String idToAdd = serviceInfo.getService().getCrmId();
            if (colocation) {
                final ClusterStatus clStatus = getBrowser().getClusterStatus();
                /* colocation */
                if (colId == null) {
                    final List<String> rscIds = new ArrayList<String>();
                    rscIds.add(idToAdd);
                    int colIdInt = Integer.parseInt(getService().getId());
                    colId = "c" + colIdInt;
                    while (clStatus.getRscSetsCol(colId) != null) {
                        colIdInt++;
                        colId = "c" + colIdInt;
                    }
                    createCol = true;
                    if (isFrom) {
                        /* require all for col is noop in pcmk 1.1.7 */
                        colRscSet2 = new CrmXml.RscSet(colId,
                                                       new ArrayList<String>(),
                                                       "false",
                                                       requireAll,
                                                       null,
                                                       null);
                        colRscSet1 = new CrmXml.RscSet(colId,
                                                       rscIds,
                                                       "false",
                                                       CrmXml.REQUIRE_ALL_TRUE_VALUE.getValueForConfig(),
                                                       null,
                                                       null);
                        outColRscSet1 = colRscSet1;
                    } else {
                        colRscSet2 = new CrmXml.RscSet(colId,
                                                       rscIds,
                                                       "false",
                                                       CrmXml.REQUIRE_ALL_TRUE_VALUE.getValueForConfig(),
                                                       null,
                                                       null);
                        colRscSet1 = new CrmXml.RscSet(colId,
                                                       new ArrayList<String>(),
                                                       "false",
                                                       requireAll,
                                                       null,
                                                       null);
                        outColRscSet2 = colRscSet2;
                    }
                } else {
                    final CrmXml.RscSet toRscSet;
                    if (isFrom) {
                        if (outColRscSet1 == null) {
                            toRscSet = colRscSet1;
                        } else {
                            toRscSet = outColRscSet1;
                        }
                    } else {
                        if (outColRscSet2 == null) {
                            toRscSet = colRscSet2;
                        } else {
                            toRscSet = outColRscSet2;
                        }
                    }
                    final List<CrmXml.RscSet> rscSetsColList = clStatus.getRscSetsCol(colId);
                    boolean colRscSetAdded = false;
                    if (rscSetsColList != null) {
                        for (final CrmXml.RscSet rscSet : rscSetsColList) {
                            if (rscSet.equals(toRscSet)) {
                                final List<String> newRscIds = new ArrayList<String>();
                                newRscIds.addAll(rscSet.getRscIds());

                                newRscIds.add(0, idToAdd);
                                final CrmXml.RscSet newRscSet = new CrmXml.RscSet(rscSet.getId(),
                                                                                  newRscIds,
                                                                                  rscSet.getSequential(),
                                                                                  rscSet.getRequireAll(),
                                                                                  rscSet.getOrderAction(),
                                                                                  rscSet.getColocationRole());
                                if (isFrom) {
                                    outColRscSet1 = newRscSet;
                                } else {
                                    outColRscSet2 = newRscSet;
                                }
                                colRscSetAdded = true;
                            } else {
                                if (isFrom) {
                                    outColRscSet2 = rscSet;
                                } else {
                                    outColRscSet1 = rscSet;
                                }
                            }
                        }
                    }
                    if (!colRscSetAdded) {
                        final List<String> newRscIds = new ArrayList<String>();
                        final CrmXml.RscSet newRscSet;
                        if (toRscSet == null) {
                            newRscSet = new CrmXml.RscSet(colId, newRscIds, "false", requireAll, null, null);
                        } else {
                            newRscIds.addAll(toRscSet.getRscIds());
                            newRscSet = new CrmXml.RscSet(toRscSet.getId(),
                                                          newRscIds,
                                                          toRscSet.getSequential(),
                                                          toRscSet.getRequireAll(),
                                                          toRscSet.getOrderAction(),
                                                          toRscSet.getColocationRole());
                        }
                        newRscSet.addRscId(idToAdd);
                        if (isFrom) {
                            outColRscSet1 = newRscSet;
                        } else {
                            outColRscSet2 = newRscSet;
                        }
                    }
                }
            }

            if (order) {
                /* order */
                final ClusterStatus clStatus = getBrowser().getClusterStatus();
                if (ordId == null) {
                    final List<String> rscIds = new ArrayList<String>();
                    rscIds.add(idToAdd);
                    int ordIdInt = Integer.parseInt(getService().getId());
                    ordId = "o" + ordIdInt;
                    while (clStatus.getRscSetsOrd(ordId) != null) {
                        ordIdInt++;
                        ordId = "o" + ordIdInt;
                    }
                    createOrd = true;
                    if (isFrom) {
                        ordRscSet1 = new CrmXml.RscSet(ordId,
                                                       rscIds,
                                                       "false",
                                                       CrmXml.REQUIRE_ALL_TRUE_VALUE.getValueForConfig(),
                                                       null,
                                                       null);
                        ordRscSet2 = new CrmXml.RscSet(ordId,
                                                       new ArrayList<String>(),
                                                       "false",
                                                       requireAll,
                                                       null,
                                                       null);
                        outOrdRscSet1 = ordRscSet1;
                    } else {
                        ordRscSet1 = new CrmXml.RscSet(ordId,
                                                       new ArrayList<String>(),
                                                       "false",
                                                       requireAll,
                                                       null,
                                                       null);
                        ordRscSet2 = new CrmXml.RscSet(ordId,
                                                       rscIds,
                                                       "false",
                                                       CrmXml.REQUIRE_ALL_TRUE_VALUE.getValueForConfig(),
                                                       null,
                                                       null);
                        outOrdRscSet2 = ordRscSet2;
                    }
                } else {
                    final CrmXml.RscSet toRscSet;
                    if (isFrom) {
                        if (outOrdRscSet1 == null) {
                            toRscSet = ordRscSet1;
                        } else {
                            toRscSet = outOrdRscSet1;
                        }
                    } else {
                        if (outOrdRscSet2 == null) {
                            toRscSet = ordRscSet2;
                        } else {
                            toRscSet = outOrdRscSet2;
                        }
                    }
                    final List<CrmXml.RscSet> rscSetsOrdList = clStatus.getRscSetsOrd(ordId);
                    boolean ordRscSetAdded = false;
                    if (rscSetsOrdList != null) {
                        for (final CrmXml.RscSet rscSet : rscSetsOrdList) {
                            if (rscSet.equals(toRscSet)) {
                                final List<String> newRscIds = new ArrayList<String>();
View Full Code Here

Examples of org.apache.blur.manager.clusterstatus.ClusterStatus

    indexManager = new IndexManager();
    indexManager.setStatusCleanupTimerDelay(1000);
    indexManager.setIndexServer(server);
    indexManager.setThreadCount(1);
    indexManager.setClusterStatus(new ClusterStatus() {

      @Override
      public void removeTable(String cluster, String table, boolean deleteIndexFiles) {
        throw new RuntimeException("Not impl");
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.ClusterStatus

    Collections.sort(backupMasters, new Comparator<ServerName>() {
      public int compare(ServerName s1, ServerName s2) {
        return s1.getServerName().compareTo(s2.getServerName());
      }});

    return new ClusterStatus(VersionInfo.getVersion(),
      this.fileSystemManager.getClusterId(),
      this.serverManager.getOnlineServers(),
      this.serverManager.getDeadServers(),
      this.serverName,
      backupMasters,
View Full Code Here

Examples of org.apache.hadoop.hbase.ClusterStatus

    assertEquals(NUM_MASTERS, masterThreads.size());
    LOG.info("Active master " + activeName);

    // Check that ClusterStatus reports the correct active and backup masters
    assertNotNull(active);
    ClusterStatus status = active.getClusterStatus();
    assertTrue(status.getMaster().equals(activeName));
    assertEquals(2, status.getBackupMastersSize());
    assertEquals(2, status.getBackupMasters().size());

    // attempt to stop one of the inactive masters
    int backupIndex = (activeIndex == 0 ? 1 : activeIndex - 1);
    HMaster master = cluster.getMaster(backupIndex);
    LOG.debug("\n\nStopping a backup master: " + master.getServerName() + "\n");
    cluster.stopMaster(backupIndex, false);
    cluster.waitOnMaster(backupIndex);

    // Verify still one active master and it's the same
    for (int i = 0; i < masterThreads.size(); i++) {
      if (masterThreads.get(i).getMaster().isActiveMaster()) {
        assertTrue(activeName.equals(masterThreads.get(i).getMaster().getServerName()));
        activeIndex = i;
        active = masterThreads.get(activeIndex).getMaster();
      }
    }
    assertEquals(1, numActive);
    assertEquals(2, masterThreads.size());
    int rsCount = masterThreads.get(activeIndex).getMaster().getClusterStatus().getServersSize();
    LOG.info("Active master " + active.getServerName() + " managing " + rsCount +  " regions servers");
    assertEquals(3, rsCount);

    // Check that ClusterStatus reports the correct active and backup masters
    assertNotNull(active);
    status = active.getClusterStatus();
    assertTrue(status.getMaster().equals(activeName));
    assertEquals(1, status.getBackupMastersSize());
    assertEquals(1, status.getBackupMasters().size());

    // kill the active master
    LOG.debug("\n\nStopping the active master " + active.getServerName() + "\n");
    cluster.stopMaster(activeIndex, false);
    cluster.waitOnMaster(activeIndex);

    // wait for an active master to show up and be ready
    assertTrue(cluster.waitForActiveAndReadyMaster());

    LOG.debug("\n\nVerifying backup master is now active\n");
    // should only have one master now
    assertEquals(1, masterThreads.size());

    // and he should be active
    active = masterThreads.get(0).getMaster();
    assertNotNull(active);
    status = active.getClusterStatus();
    ServerName mastername = status.getMaster();
    assertTrue(mastername.equals(active.getServerName()));
    assertTrue(active.isActiveMaster());
    assertEquals(0, status.getBackupMastersSize());
    assertEquals(0, status.getBackupMasters().size());
    int rss = status.getServersSize();
    LOG.info("Active master " + mastername.getServerName() + " managing " +
      rss +  " region servers");
    assertEquals(3, rss);

    // Stop the cluster
View Full Code Here

Examples of org.apache.hadoop.hbase.ClusterStatus

  /**
   * Get region info from local cluster.
   */
  Map<ServerName, List<String>> getDeployedHRIs(HBaseAdmin admin)
    throws IOException {
    ClusterStatus status = admin.getMaster().getClusterStatus();
    Collection<ServerName> regionServers = status.getServers();
    Map<ServerName, List<String>> mm =
        new HashMap<ServerName, List<String>>();
    HConnection connection = admin.getConnection();
    for (ServerName hsi : regionServers) {
      HRegionInterface server =
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.