Package org.apache.accumulo.core.client

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


  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

          throw new AccumuloSecurityException(e.user, e.code, tableInfo, e);
      }
    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case EXISTS:
          throw new TableExistsException(e);
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case NAMESPACE_EXISTS:
          throw new NamespaceExistsException(e);
        case NAMESPACE_NOTFOUND:
View Full Code Here

      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

    String namespace = Tables.qualify(tableName).getFirst();
    if (!tableName.matches(Tables.VALID_NAME_REGEX)) {
      throw new IllegalArgumentException();
    }
    if (exists(tableName))
      throw new TableExistsException(tableName, tableName, "");

    if (!namespaceExists(namespace)) {
      throw new IllegalArgumentException("Namespace (" + namespace + ") does not exist, create it first");
    }
    acu.createTable(username, tableName, versioningIter, timeType);
View Full Code Here

  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);
    String namespace = Tables.qualify(newTableName).getFirst();
    MockNamespace n = acu.namespaces.get(namespace);
    if (n == null) {
      n = new MockNamespace();
View Full Code Here

          return;
      }
      throw new AccumuloException("Got unexpected ae error code", ae);
    } catch (TableNotFoundException tnfe) {
      if (tableExists)
        throw new TableExistsException(null, oldName, "Got a TableNotFoundException but it should exist", tnfe);
      else
        return;
    }
    WalkingSecurity.get(state).setTableName(newName);
    if (!hasPermission)
View Full Code Here

          return;
      }
      throw new AccumuloException("Got unexpected ae error code", ae);
    } catch (TableNotFoundException tnfe) {
      if (exists)
        throw new TableExistsException(null, tableName, "Got a TableNotFOundException but it should have existed", tnfe);
      else
        return;
    }
    WalkingSecurity.get(state).cleanTablePermissions(tableName);
    if (!hasPermission)
View Full Code Here

        }
      } else
        throw new AccumuloException("Got unexpected error", ae);
    } catch (TableExistsException tee) {
      if (!exists)
        throw new TableExistsException(null, tableName, "Got a TableExistsException but it shouldn't have existed", tee);
      else
        return;
    }
    WalkingSecurity.get(state).initTable(tableName);
    for (TablePermission tp : TablePermission.values())
View Full Code Here

    } 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

TOP

Related Classes of org.apache.accumulo.core.client.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.