Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.TableExistsException


  private synchronized void createTable(final HRegionInfo [] newRegions,
      boolean sync)
  throws IOException {
    String tableName = newRegions[0].getTableDesc().getNameAsString();
    if(MetaReader.tableExists(catalogTracker, tableName)) {
      throw new TableExistsException(tableName);
    }
    for(HRegionInfo newRegion : newRegions) {

      // 1. Set table enabling flag up in zk.
      try {
View Full Code Here


  private synchronized void createTable(final HRegionInfo [] newRegions,
      final boolean sync)
  throws IOException {
    String tableName = newRegions[0].getTableDesc().getNameAsString();
    if(MetaReader.tableExists(catalogTracker, tableName)) {
      throw new TableExistsException(tableName);
    }
    for (HRegionInfo newRegion : newRegions) {
      // 1. Set table enabling flag up in zk.
      try {
        assignmentManager.getZKTable().setEnabledTable(tableName);
View Full Code Here

   * @throws IllegalArgumentException if the specified table has not a valid name
   */
  public void cloneSnapshot(final String snapshotName, final TableName tableName)
      throws IOException, TableExistsException, RestoreSnapshotException, InterruptedException {
    if (tableExists(tableName)) {
      throw new TableExistsException(tableName);
    }
    internalRestoreSnapshot(snapshotName, tableName);
    waitUntilTableIsEnabled(tableName);
  }
View Full Code Here

    this.tableLock.acquire();
    boolean success = false;
    try {
      TableName tableName = this.hTableDescriptor.getTableName();
      if (MetaReader.tableExists(catalogTracker, tableName)) {
        throw new TableExistsException(tableName);
      }

      // If we have multiple client threads trying to create the table at the
      // same time, given the async nature of the operation, the table
      // could be in a state where hbase:meta table hasn't been updated yet in
      // the process() function.
      // Use enabling state to tell if there is already a request for the same
      // table in progress. This will introduce a new zookeeper call. Given
      // createTable isn't a frequent operation, that should be ok.
      //TODO: now that we have table locks, re-evaluate above
      try {
        if (!this.assignmentManager.getZKTable().checkAndSetEnablingTable(tableName)) {
          throw new TableExistsException(tableName);
        }
      } catch (KeeperException e) {
        throw new IOException("Unable to ensure that the table will be" +
          " enabling because of a ZooKeeper issue", e);
      }
View Full Code Here

   * @throws IllegalArgumentException if the specified table has not a valid name
   */
  public void cloneSnapshot(final String snapshotName, final TableName tableName)
      throws IOException, TableExistsException, RestoreSnapshotException, InterruptedException {
    if (tableExists(tableName)) {
      throw new TableExistsException(tableName);
    }
    internalRestoreSnapshot(snapshotName, tableName);
    waitUntilTableIsEnabled(tableName);
  }
View Full Code Here

    this.tableLock.acquire();
    boolean success = false;
    try {
      TableName tableName = this.hTableDescriptor.getTableName();
      if (MetaReader.tableExists(catalogTracker, tableName)) {
        throw new TableExistsException(tableName);
      }

      // If we have multiple client threads trying to create the table at the
      // same time, given the async nature of the operation, the table
      // could be in a state where hbase:meta table hasn't been updated yet in
      // the process() function.
      // Use enabling state to tell if there is already a request for the same
      // table in progress. This will introduce a new zookeeper call. Given
      // createTable isn't a frequent operation, that should be ok.
      //TODO: now that we have table locks, re-evaluate above
      try {
        if (!this.assignmentManager.getZKTable().checkAndSetEnablingTable(tableName)) {
          throw new TableExistsException(tableName);
        }
      } catch (KeeperException e) {
        throw new IOException("Unable to ensure that the table will be" +
          " enabling because of a ZooKeeper issue", e);
      }
View Full Code Here

      throw new IOException(e);
    }

    String tableName = this.hTableDescriptor.getNameAsString();
    if (MetaReader.tableExists(catalogTracker, tableName)) {
      throw new TableExistsException(tableName);
    }

    // If we have multiple client threads trying to create the table at the
    // same time, given the async nature of the operation, the table
    // could be in a state where .META. table hasn't been updated yet in
    // the process() function.
    // Use enabling state to tell if there is already a request for the same
    // table in progress. This will introduce a new zookeeper call. Given
    // createTable isn't a frequent operation, that should be ok.
    try {
      if (!this.assignmentManager.getZKTable().checkAndSetEnablingTable(
        tableName))
        throw new TableExistsException(tableName);
    } catch (KeeperException e) {
      throw new IOException("Unable to ensure that the table will be" +
        " enabling because of a ZooKeeper issue", e);
    }
  }
View Full Code Here

   * @throws IllegalArgumentException if the specified table has not a valid name
   */
  public void cloneSnapshot(final String snapshotName, final String tableName)
      throws IOException, TableExistsException, RestoreSnapshotException, InterruptedException {
    if (tableExists(tableName)) {
      throw new TableExistsException("Table '" + tableName + " already exists");
    }
    internalRestoreSnapshot(snapshotName, tableName);
    waitUntilTableIsEnabled(Bytes.toBytes(tableName));
  }
View Full Code Here

      RowResult data = srvr.next(scannerid);
      if (data != null && data.size() > 0) {
        HRegionInfo info = Writables.getHRegionInfo(data.get(COL_REGIONINFO));
        if (Bytes.equals(info.getTableDesc().getName(), tableName)) {
          // A region for this table already exists. Ergo table exists.
          throw new TableExistsException(Bytes.toString(tableName));
        }
      }
    } finally {
      srvr.close(scannerid);
    }
View Full Code Here

  private synchronized void createTable(final HRegionInfo [] newRegions,
      boolean sync)
  throws IOException {
    String tableName = newRegions[0].getTableDesc().getNameAsString();
    if(MetaReader.tableExists(catalogTracker, tableName)) {
      throw new TableExistsException(tableName);
    }
    for(HRegionInfo newRegion : newRegions) {

      // 1. Set table enabling flag up in zk.
      try {
View Full Code Here

TOP

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

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.