Examples of TableExistsException


Examples of com.alibaba.wasp.TableExistsException

      if(waspSqlCreateTableStatement.isIfNotExiists()) {
        context.setPlan(new NotingTodoPlan());
        LOG.debug("table " + tableName + " exits , isIfNotExiists is true, ignore");
        return;
      } else {
        throw new TableExistsException(tableName + " is already exists!");
      }
    }

    // Table category.
    WaspSqlCreateTableStatement.TableCategory category = waspSqlCreateTableStatement.getCategory();
View Full Code Here

Examples of com.alibaba.wasp.TableExistsException

    this.assignmentManager = assignmentManager;
    String tableName = this.table.getTableName();
    this.conf = server.getConfiguration();
    // Check if table exists
    if (FMetaReader.tableExists(conf, 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 {
      this.tableLockManager = fMasterServices.getTableLockManager();
      if (tableLockManager.lockTable(tableName)) {
        LOG.info("lock table '" + tableName + "' by CreateIndexHandler");
      } else {
        throw new TableLockedException(tableName + " has been locked. ");
      }
      try {
        if (!this.assignmentManager.getZKTable().checkAndSetEnablingTable(
            tableName))
          throw new TableExistsException(tableName);
      } catch (KeeperException e) {
        tableLockManager.unlockTable(tableName);
        throw new IOException("Unable to ensure that the table will be"
            + " enabling because of a ZooKeeper issue", e);
      }
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

  public void create(String tableName, boolean versioningIter, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException {
    if (!tableName.matches(Constants.VALID_TABLE_NAME_REGEX)) {
      throw new IllegalArgumentException();
    }
    if (exists(tableName))
      throw new TableExistsException(tableName, tableName, "");
    acu.createTable(username, tableName, versioningIter, timeType);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

  public void rename(String oldTableName, String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException,
      TableExistsException {
    if (!exists(oldTableName))
      throw new TableNotFoundException(oldTableName, oldTableName, "");
    if (exists(newTableName))
      throw new TableExistsException(newTableName, newTableName, "");
    MockTable t = acu.tables.remove(oldTableName);
    acu.tables.put(newTableName, t);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

  public void create(String tableName, boolean versioningIter, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException {
    if (!tableName.matches(Constants.VALID_TABLE_NAME_REGEX)) {
      throw new IllegalArgumentException();
    }
    if (exists(tableName))
      throw new TableExistsException(tableName, tableName, "");
    acu.createTable(username, tableName, versioningIter, timeType);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

  public void rename(String oldTableName, String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException,
      TableExistsException {
    if (!exists(oldTableName))
      throw new TableNotFoundException(oldTableName, oldTableName, "");
    if (exists(newTableName))
      throw new TableExistsException(newTableName, newTableName, "");
    MockTable t = acu.tables.remove(oldTableName);
    acu.tables.put(newTableName, t);
  }
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

      throw new IllegalArgumentException();
    }
   
    final String tableName = cl.getArgs()[0];
    if (shellState.getConnector().tableOperations().exists(tableName)) {
      throw new TableExistsException(null, tableName, null);
    }
    final SortedSet<Text> partitions = new TreeSet<Text>();
    final boolean decode = cl.hasOption(base64Opt.getOpt());
   
    if (cl.hasOption(createTableOptSplit.getOpt())) {
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

    } catch (ThriftSecurityException e) {
      throw new AccumuloSecurityException(e.user, e.code, e);
    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case EXISTS:
          throw new TableExistsException(e);
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case OFFLINE:
          throw new TableOfflineException(instance, null);
        case OTHER:
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

    } catch (ThriftSecurityException e) {
      throw new AccumuloSecurityException(e.user, e.code, e);
    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case EXISTS:
          throw new TableExistsException(e);
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case OFFLINE:
          throw new TableOfflineException(instance, null);
        case OTHER:
View Full Code Here

Examples of org.apache.accumulo.core.client.TableExistsException

      throw new IllegalArgumentException();
    }
   
    String tableName = cl.getArgs()[0];
    if (shellState.getConnector().tableOperations().exists(tableName))
      throw new TableExistsException(null, tableName, null);
   
    SortedSet<Text> partitions = new TreeSet<Text>();
    List<PerColumnIteratorConfig> aggregators = new ArrayList<PerColumnIteratorConfig>();
    boolean decode = cl.hasOption(base64Opt.getOpt());
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.