Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.CoordinatedStateManager


    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


  @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

    destServers.add(SERVERNAME_A);
    Mockito.when(this.serverManager.createDestinationServersList()).thenReturn(destServers);
    // To avoid cast exception in DisableTableHandler process.
    HTU.getConfiguration().setInt(HConstants.MASTER_PORT, 0);

    CoordinatedStateManager csm = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      HTU.getConfiguration());
    Server server = new HMaster(HTU.getConfiguration(), csm);
    AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(server,
        this.serverManager);
View Full Code Here

    List<ServerName> destServers = new ArrayList<ServerName>(1);
    destServers.add(SERVERNAME_A);
    Mockito.when(this.serverManager.createDestinationServersList()).thenReturn(destServers);
    Mockito.when(this.serverManager.isServerOnline(SERVERNAME_A)).thenReturn(true);
    HTU.getConfiguration().setInt(HConstants.MASTER_PORT, 0);
    CoordinatedStateManager csm = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      HTU.getConfiguration());
    Server server = new HMaster(HTU.getConfiguration(), csm);
    Whitebox.setInternalState(server, "serverManager", this.serverManager);
    AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(server,
        this.serverManager);
View Full Code Here

    List<ServerName> destServers = new ArrayList<ServerName>(1);
    destServers.add(SERVERNAME_A);
    Mockito.when(this.serverManager.createDestinationServersList()).thenReturn(destServers);
    Mockito.when(this.serverManager.isServerOnline(SERVERNAME_A)).thenReturn(true);
    HTU.getConfiguration().setInt(HConstants.MASTER_PORT, 0);
    CoordinatedStateManager csm = CoordinatedStateManagerFactory.getCoordinatedStateManager(
      HTU.getConfiguration());
    Server server = new HMaster(HTU.getConfiguration(), csm);
    Whitebox.setInternalState(server, "serverManager", this.serverManager);
    AssignmentManagerWithExtrasForTesting am = setUpMockedAssignmentManager(server,
        this.serverManager);
View Full Code Here

  public void testRPCException() throws Exception {
    HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
    TEST_UTIL.startMiniZKCluster();
    Configuration conf = TEST_UTIL.getConfiguration();
    conf.set(HConstants.MASTER_PORT, "0");
    CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
    HMaster hm = new HMaster(conf, cp);
    ServerName sm = hm.getServerName();
    RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
    try {
      int i = 0;
View Full Code Here

        ((LocalHMaster)cluster.getMaster(0)).setZKCluster(zooKeeperCluster);
        cluster.startup();
        waitOnMasterThreads(cluster);
      } else {
        logProcessInfo(getConf());
        CoordinatedStateManager csm =
          CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
        HMaster master = HMaster.constructMaster(masterClass, conf, csm);
        if (master.isStopped()) {
          LOG.info("Won't bring the Master up as a shutdown is requested");
          return 1;
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.