Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.CoordinatedStateManager


  public void testClusterId() throws Exception  {
    TEST_UTIL.startMiniZKCluster();
    TEST_UTIL.startMiniDFSCluster(1);

    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
    //start region server, needs to be separate
    //so we get an unset clusterId
    rst = JVMClusterUtil.createRegionServerThread(conf,cp,
        HRegionServer.class, 0);
    rst.start();
View Full Code Here


   * @throws InterruptedException
   */
  @Test (timeout=30000)
  public void testStopDuringStart()
  throws IOException, KeeperException, InterruptedException {
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      TESTUTIL.getConfiguration());
    HMaster master = new HMaster(TESTUTIL.getConfiguration(), cp);
    master.start();
    // Immediately have it stop.  We used hang in assigning meta.
    master.stopMaster();
View Full Code Here

    // Create master.  Subclass to override a few methods so we can insert mocks
    // and get notification on transitions.  We need to fake out any rpcs the
    // master does opening/closing regions.  Also need to fake out the address
    // of the 'remote' mocked up regionservers.
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      TESTUTIL.getConfiguration());
    HMaster master = new HMaster(conf, cp) {
      InetAddress getRemoteInetAddress(final int port, final long serverStartCode)
      throws UnknownHostException {
        // Return different address dependent on port passed.
View Full Code Here

    final Configuration conf = TESTUTIL.getConfiguration();
    final ServerName newServer = ServerName.valueOf("test.sample", 1, 101);
    final ServerName deadServer = ServerName.valueOf("test.sample", 1, 100);
    final MockRegionServer rs0 = new MockRegionServer(conf, newServer);

    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      TESTUTIL.getConfiguration());
    HMaster master = new HMaster(conf, cp) {
      @Override
      void assignMeta(MonitoredTask status, Set<ServerName> previouslyFailedMeatRSs) {
      }
View Full Code Here

  @Before
  public void setup() {
    Configuration conf = HBaseConfiguration.create();
    conf.setBoolean("hbase.testing.nocluster", true); // No need to do ZK
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
    regionServer = HRegionServer.constructRegionServer(HRegionServer.class, conf, cp);
    priority = regionServer.rpcServices.getPriority();
  }
View Full Code Here

  public void testClusterId() throws Exception  {
    TEST_UTIL.startMiniZKCluster();
    TEST_UTIL.startMiniDFSCluster(1);

    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
    //start region server, needs to be separate
    //so we get an unset clusterId
    rst = JVMClusterUtil.createRegionServerThread(conf,cp,
        HRegionServer.class, 0);
    rst.start();
View Full Code Here

    return USAGE;
  }

  private int start() throws Exception {
    Configuration conf = getConf();
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
    try {
      // If 'local', don't start a region server here. Defer to
      // LocalHBaseCluster. It manages 'local' clusters.
      if (LocalHBaseCluster.isLocal(conf)) {
        LOG.warn("Not starting a distinct region server because "
View Full Code Here

    // Start transaction.
    RegionMergeTransaction mt = prepareOnGoodRegions();

    // Run the execute. Look at what it returns.
    TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_PORT, 0);
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      TEST_UTIL.getConfiguration());
    Server mockServer = new HRegionServer(TEST_UTIL.getConfiguration(), cp);
    HRegion mergedRegion = mt.execute(mockServer, null);
    // Do some assertions about execution.
    assertTrue(this.fs.exists(mt.getMergesDir()));
View Full Code Here

        new MockedFailedMergedRegionCreation());

    // Run the execute. Look at what it returns.
    boolean expectedException = false;
    TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_PORT, 0);
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      TEST_UTIL.getConfiguration());
    Server mockServer = new HRegionServer(TEST_UTIL.getConfiguration(), cp);
    try {
      mt.execute(mockServer, null);
    } catch (MockedFailedMergedRegionCreation e) {
View Full Code Here

            (HRegion) Mockito.anyObject());

    // Run the execute. Look at what it returns.
    boolean expectedException = false;
    TEST_UTIL.getConfiguration().setInt(HConstants.REGIONSERVER_PORT, 0);
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      TEST_UTIL.getConfiguration());
    Server mockServer = new HRegionServer(TEST_UTIL.getConfiguration(), cp);
    try {
      mt.execute(mockServer, null);
    } catch (MockedFailedMergedRegionOpen e) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.CoordinatedStateManager

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.