Package com.linkedin.helix.tools.ClusterStateVerifier

Examples of com.linkedin.helix.tools.ClusterStateVerifier.MasterNbInExtViewVerifier


      participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR);
      participants[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              clusterName));
    Assert.assertTrue(result);

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
View Full Code Here


      participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR, null);
      participants[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              clusterName));
    Assert.assertTrue(result);

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
View Full Code Here

      participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR, null);
      participants[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              clusterName));
    Assert.assertTrue(result);

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
View Full Code Here

                                   ZK_ADDR,
                                   HelixControllerMain.STANDALONE);
    _startCMResultMap.put(controllerName, startResult);
   
    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
                                                                                 CLUSTER_NAME));
View Full Code Here

                              new DummyAlertsTransition());
      participants[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              clusterName));
    Assert.assertTrue(result);

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
View Full Code Here

      participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR, null);
      participants[i].syncStart();
    }

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              clusterName));
    Assert.assertTrue(result);

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
View Full Code Here

                                   ZK_ADDR,
                                   HelixControllerMain.STANDALONE);
    _startCMResultMap.put(controllerName, startResult);

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
                                                                                 CLUSTER_NAME));
View Full Code Here

    _startCMResultMap.get(instanceDead)._thread.interrupt();
   
    Thread.sleep(1000);
   
    boolean verifyResult =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));
    Assert.assertTrue(verifyResult);
    Builder kb = accessor.keyBuilder();
    ExternalView ev = accessor.getProperty(kb.externalView(TEST_DB));
    for(String partitionName : idealState.getPartitionSet())
    {
      List<String> prefList = idealState.getPreferenceList(partitionName);
      if(prefList.get(0).equals(instanceDead))
      {
        String last = prefList.get(prefList.size() - 1);
        Assert.assertTrue(ev.getStateMap(partitionName).get(last).equals("MASTER"));
      }
    }
   
    // Bring up the previous dead node, but as the SCN is the last for all the
    // master partitions on it, the master partitions should be still on the last if the prefList
    StartCMResult result =
        TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instanceDead);
    _startCMResultMap.put(instanceDead, result);

    Thread.sleep(1000);
    verifyResult =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));
    Assert.assertTrue(verifyResult);
    for(String partitionName : idealState.getPartitionSet())
    {
      List<String> prefList = idealState.getPreferenceList(partitionName);
      if(prefList.get(0).equals(instanceDead))
      {
        String last = prefList.get(prefList.size() - 1);
        Assert.assertTrue(ev.getStateMap(partitionName).get(last).equals("MASTER"));
      }
    }
    // Reset the scn of the partitions
    for(int j = 0; j < _PARTITIONS; j++)
    {
      String partition = TEST_DB + "_" + j;
      List<String> idealStatePrefList =
          idealState.getPreferenceList(partition);
      String idealStateMaster = idealStatePrefList.get(0);
      // Switch back the scn to the same
      if(idealStateMaster.equals(instanceDead))
      {
        for(int x = 0; x < idealStatePrefList.size(); x++)
        {
          String instance = idealStatePrefList.get(x);
          ZNRecord scnRecord = scnTableMap.get(instance);
          if(!scnRecord.getMapFields().containsKey(partition))
          {
            scnRecord.setMapField(partition, new HashMap<String, String>());
          }
          Map<String, String> scnDetails = scnRecord.getMapField(partition);
          scnDetails.put("gen", "4");
          scnDetails.put("seq", "100");
        }
      }
    }
    // set the scn to normal -- same order as the priority list
    for(String instanceName : scnTableMap.keySet())
    {
      kb = accessor.keyBuilder();
      accessor.setProperty(kb.healthReport(instanceName, "scnTable"), new HealthStat(scnTableMap.get(instanceName)));
    }
    Thread.sleep(1000);
    verifyResult =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));
    Assert.assertTrue(verifyResult);
    // should be reverted to normal
    ev = accessor.getProperty(kb.externalView(TEST_DB));
    for(String partitionName : idealState.getPartitionSet())
View Full Code Here

                                   ZK_ADDR,
                                   HelixControllerMain.STANDALONE);
    _startCMResultMap.put(controllerName, startResult);

    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));

    result =
        ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
                                                                                 CLUSTER_NAME));
View Full Code Here

                                   controllerName,
                                   ZK_ADDR,
                                   HelixControllerMain.STANDALONE);
    _startCMResultMap.put(controllerName, startResult);
    boolean result =
        ClusterStateVerifier.verifyByZkCallback(new MasterNbInExtViewVerifier(ZK_ADDR,
                                                                              CLUSTER_NAME));
    Assert.assertTrue(result);
    HelixDataAccessor accessor = participants[0].getManager().getHelixDataAccessor();
   
    Builder kb = accessor.keyBuilder();
View Full Code Here

TOP

Related Classes of com.linkedin.helix.tools.ClusterStateVerifier.MasterNbInExtViewVerifier

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.