Package org.apache.hadoop.hbase.zookeeper

Examples of org.apache.hadoop.hbase.zookeeper.MetaTableLocator


      thenThrow(new ServiceException(ex));

    long timeout = UTIL.getConfiguration().
            getLong("hbase.catalog.verification.timeout", 1000);
    MetaTableLocator.setMetaLocation(this.watcher, SN, RegionState.State.OPENING);
    assertFalse(new MetaTableLocator().verifyMetaRegionLocation(
      connection, watcher, timeout));

    MetaTableLocator.setMetaLocation(this.watcher, SN, RegionState.State.OPEN);
    assertFalse(new MetaTableLocator().verifyMetaRegionLocation(
            connection, watcher, timeout));
  }
View Full Code Here


    ServerName sn = ServerName.valueOf("example.com", 1234, System.currentTimeMillis());
    MetaTableLocator.setMetaLocation(this.watcher,
            sn,
            RegionState.State.OPENING);
    assertFalse(new MetaTableLocator().verifyMetaRegionLocation(connection, watcher, 100));
    MetaTableLocator.setMetaLocation(this.watcher, sn, RegionState.State.OPEN);
    assertFalse(new MetaTableLocator().verifyMetaRegionLocation(connection, watcher, 100));
  }
View Full Code Here

  }

  @Test (expected = NotAllMetaRegionsOnlineException.class)
  public void testTimeoutWaitForMeta()
  throws IOException, InterruptedException {
    new MetaTableLocator().waitMetaRegionLocation(watcher, 100);
  }
View Full Code Here

   * @throws InterruptedException
   * @throws KeeperException
   */
  @Test public void testNoTimeoutWaitForMeta()
  throws IOException, InterruptedException, KeeperException {
    final MetaTableLocator mtl = new MetaTableLocator();
    ServerName hsa = mtl.getMetaRegionLocation(watcher);
    assertNull(hsa);

    // Now test waiting on meta location getting set.
    Thread t = new WaitOnMetaThread();
    startWaitAliveThenWaitItLives(t, 1);
    // Set a meta location.
    MetaTableLocator.setMetaLocation(this.watcher, SN, RegionState.State.OPEN);
    hsa = SN;
    // Join the thread... should exit shortly.
    t.join();
    // Now meta is available.
    assertTrue(mtl.getMetaRegionLocation(watcher).equals(hsa));
  }
View Full Code Here

      LOG.info("Exiting " + getName());
    }

    void doWaiting() throws InterruptedException {
      try {
        while (new MetaTableLocator().waitMetaRegionLocation(watcher, 10000) == null);
      } catch (NotAllMetaRegionsOnlineException e) {
        //Ignore
      }
    }
View Full Code Here

   */
  public Pair<Integer, Integer> getReopenStatus(TableName tableName)
      throws IOException {
    List<HRegionInfo> hris;
    if (TableName.META_TABLE_NAME.equals(tableName)) {
      hris = new MetaTableLocator().getMetaRegions(server.getZooKeeper());
    } else {
      hris = MetaTableAccessor.getTableRegions(server.getShortCircuitConnection(), tableName, true);
    }

    Integer pending = 0;
View Full Code Here

    // Each region server will get its own online regions for the table.
    // We may still miss regions that need to be flushed.
    List<Pair<HRegionInfo, ServerName>> regionsAndLocations;
    try {
      if (TableName.META_TABLE_NAME.equals(tableName)) {
        regionsAndLocations = new MetaTableLocator().getMetaRegionsAndLocations(
          master.getZooKeeper());
      } else {
        regionsAndLocations = MetaTableAccessor.getTableRegionsAndLocations(
          master.getShortCircuitConnection(), tableName, false);
      }
View Full Code Here

    ServerManager serverManager = ((HMaster)this.server).getServerManager();
    // Get the regions of this table. We're done when all listed
    // tables are onlined.
    List<Pair<HRegionInfo, ServerName>> tableRegionsAndLocations;
    if (TableName.META_TABLE_NAME.equals(tableName)) {
      tableRegionsAndLocations = new MetaTableLocator().getMetaRegionsAndLocations(
        server.getZooKeeper());
    } else {
      tableRegionsAndLocations = MetaTableAccessor.getTableRegionsAndLocations(
        server.getShortCircuitConnection(), tableName, true);
    }
View Full Code Here

    tmpl.render(response.getWriter(),
          master, admin);
  }

  private ServerName getMetaLocationOrNull(HMaster master) {
    MetaTableLocator metaTableLocator = master.getMetaTableLocator();
    return metaTableLocator == null ? null :
      metaTableLocator.getMetaRegionLocation(master.getZooKeeper());
  }
View Full Code Here

      LOG.info("Handling table operation " + eventType + " on table " +
          tableName);

      List<HRegionInfo> hris;
      if (TableName.META_TABLE_NAME.equals(tableName)) {
        hris = new MetaTableLocator().getMetaRegions(server.getZooKeeper());
      } else {
        hris = MetaTableAccessor.getTableRegions(server.getShortCircuitConnection(), tableName);
      }
      handleTableOperation(hris);
      if (eventType.isOnlineSchemaChangeSupported() && this.masterServices.
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.zookeeper.MetaTableLocator

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.