Package com.alibaba.wasp

Examples of com.alibaba.wasp.WaspTestingUtility


  private static final byte[] GOOD_SPLIT_ROW = new byte[] { 'd', 'd', 'd' };
  public static final String TABLE_NAME = "table";

  @BeforeClass
  public static void before() throws Exception {
    TEST_UTIL = new WaspTestingUtility();
    TEST_UTIL.getConfiguration().set(FConstants.REDO_IMPL,
        "com.alibaba.wasp.fserver.redo.MemRedoLog");
    TEST_UTIL.startMiniCluster(1);
  }
View Full Code Here


    final int NUM_MASTERS = 3;
    final int NUM_RS = 3;

    // Start the cluster
    WaspTestingUtility TEST_UTIL = new WaspTestingUtility(conf);
    TEST_UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
    MiniWaspCluster cluster = TEST_UTIL.getWaspCluster();

    // get all the master threads
    List<MasterThread> masterThreads = cluster.getMasterThreads();

    // wait for each to come online
    for (MasterThread mt : masterThreads) {
      assertTrue(mt.isAlive());
    }

    // find the active master
    FMaster active = null;
    for (int i = 0; i < masterThreads.size(); i++) {
      if (masterThreads.get(i).getMaster().isActiveMaster()) {
        active = masterThreads.get(i).getMaster();
        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) {
      cluster.waitOnMaster(i);
    }
    // make sure all the masters properly shutdown
    assertEquals(0, masterThreads.size());

    TEST_UTIL.shutdownMiniCluster();
  }
View Full Code Here

  private final int NUM_FServer = 1;
  private ZooKeeperWatcher zkw;

  @Before
  public void setUp() throws Exception {
    TEST_UTIL = new WaspTestingUtility();
    TEST_UTIL.getConfiguration().setClass(FConstants.REDO_IMPL,
        MemRedoLog.class, Redo.class);
  }
View Full Code Here

  @After
  public void tearDown() throws Exception {
    // Stop the cluster
    TEST_UTIL.shutdownMiniCluster();
    TEST_UTIL = new WaspTestingUtility();
  }
View Full Code Here

public class TestWaspRPCException {

  @Test
  public void testRPCException() throws Exception {
    WaspTestingUtility TEST_UTIL = new WaspTestingUtility();
    TEST_UTIL.getHBaseTestingUtility().startMiniZKCluster();
    Configuration conf = TEST_UTIL.getConfiguration();
    conf.set(FConstants.MASTER_PORT, "0");
    TEST_UTIL.getConfiguration().set(FConstants.ZOOKEEPER_QUORUM,
        TEST_UTIL.getConfiguration().get(HConstants.ZOOKEEPER_QUORUM));
    TEST_UTIL.getConfiguration().set(FConstants.ZOOKEEPER_CLIENT_PORT,
        TEST_UTIL.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT));
    FMaster hm = new FMaster(conf);

    ServerName sm = hm.getServerName();
    InetSocketAddress isa = new InetSocketAddress(sm.getHostname(),
        sm.getPort());
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.WaspTestingUtility

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.