Package org.apache.accumulo.core.client

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


      AccumuloSecurityException {
    String namespace = null;
    if (cl.hasOption(Shell.namespaceOption)) {
      namespace = cl.getOptionValue(Shell.namespaceOption);
      if (!shellState.getConnector().namespaceOperations().exists(namespace)) {
        throw new NamespaceNotFoundException(namespace, namespace, "specified namespace that doesn't exist");
      }
    } else {
      throw new NamespaceNotFoundException(null, null, "no namespace specified");
    }
    return namespace;
  }
View Full Code Here


      String tableName = ByteBufferUtil.toString(args.get(0));
      switch (e.getCode()) {
        case TABLE_DOESNT_EXIST:
          throw new TableNotFoundException(null, tableName, "Target table does not exist");
        case NAMESPACE_DOESNT_EXIST:
          throw new NamespaceNotFoundException(null, tableName, "Target namespace does not exist");
        default:
          String tableInfo = Tables.getPrintableTableInfoFromName(instance, tableName);
          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:
          throw new NamespaceNotFoundException(e);
        case OFFLINE:
          throw new TableOfflineException(instance, null);
        default:
          throw new AccumuloException(e.description, e);
      }
View Full Code Here

    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case NAMESPACE_NOTFOUND:
          throw new TableNotFoundException(tableName, new NamespaceNotFoundException(e));
        default:
          throw new AccumuloException(e.description, e);
      }
    } catch (AccumuloException e) {
      throw e;
View Full Code Here

      } catch (ThriftTableOperationException e) {
        switch (e.getType()) {
          case NOTFOUND:
            throw new TableNotFoundException(e);
          case NAMESPACE_NOTFOUND:
            throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e));
          default:
            throw new AccumuloException(e.description, e);
        }
      } catch (ThriftSecurityException e) {
        throw new AccumuloSecurityException(e.getUser(), e.getCode());
View Full Code Here

    } catch (ThriftTableOperationException e) {
      switch (e.getType()) {
        case NOTFOUND:
          throw new TableNotFoundException(e);
        case NAMESPACE_NOTFOUND:
          throw new TableNotFoundException(tableName, new NamespaceNotFoundException(e));
        default:
          throw new AccumuloException(e.description, e);
      }
    } catch (ThriftSecurityException e) {
      throw new AccumuloSecurityException(e.user, e.code, e);
View Full Code Here

  protected void doTableOp(final Shell shellState, final String namespace, boolean force) throws Exception {
    boolean resetContext = false;
    String currentTable = shellState.getTableName();
    if (!Namespaces.getNameToIdMap(shellState.getInstance()).containsKey(namespace)) {
      throw new NamespaceNotFoundException(null, namespace, null);
    }

    String namespaceId = Namespaces.getNamespaceId(shellState.getInstance(), namespace);
    List<String> tables = Namespaces.getTableNames(shellState.getInstance(), namespaceId);
    resetContext = tables.contains(currentTable);
View Full Code Here

  @Override
  public void removeIterator(String namespace, String name, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
      NamespaceNotFoundException {
    if (!exists(namespace))
      throw new NamespaceNotFoundException(null, namespace, null);
    Map<String,String> copy = new TreeMap<String,String>();
    for (Entry<String,String> property : this.getProperties(namespace)) {
      copy.put(property.getKey(), property.getValue());
    }
    for (IteratorScope scope : scopes) {
View Full Code Here

  @Override
  public IteratorSetting getIteratorSetting(String namespace, String name, IteratorScope scope) throws AccumuloSecurityException, AccumuloException,
      NamespaceNotFoundException {
    if (!exists(namespace))
      throw new NamespaceNotFoundException(null, namespace, null);
    int priority = -1;
    String classname = null;
    Map<String,String> settings = new HashMap<String,String>();

    String root = String.format("%s%s.%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase(), name);
View Full Code Here

  }

  @Override
  public Map<String,EnumSet<IteratorScope>> listIterators(String namespace) throws AccumuloSecurityException, AccumuloException, NamespaceNotFoundException {
    if (!exists(namespace))
      throw new NamespaceNotFoundException(null, namespace, null);
    Map<String,EnumSet<IteratorScope>> result = new TreeMap<String,EnumSet<IteratorScope>>();
    for (Entry<String,String> property : this.getProperties(namespace)) {
      String name = property.getKey();
      String[] parts = name.split("\\.");
      if (parts.length == 4) {
View Full Code Here

  @Override
  public void checkIteratorConflicts(String namespace, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException,
      NamespaceNotFoundException, AccumuloSecurityException {
    if (!exists(namespace))
      throw new NamespaceNotFoundException(null, namespace, null);
    for (IteratorScope scope : scopes) {
      String scopeStr = String.format("%s%s", Property.TABLE_ITERATOR_PREFIX, scope.name().toLowerCase());
      String nameStr = String.format("%s.%s", scopeStr, setting.getName());
      String optStr = String.format("%s.opt.", nameStr);
      Map<String,String> optionConflicts = new TreeMap<String,String>();
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.NamespaceNotFoundException

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.