Package org.apache.accumulo.core.client

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


  }

  public static String getNamespaceId(Instance instance, String namespace) throws NamespaceNotFoundException {
    String id = getNameToIdMap(instance).get(namespace);
    if (id == null)
      throw new NamespaceNotFoundException(null, namespace, "getNamespaceId() failed to find namespace");
    return id;
  }
View Full Code Here


  }

  public static String getNamespaceName(Instance instance, String namespaceId) throws NamespaceNotFoundException {
    String namespaceName = getIdToNameMap(instance).get(namespaceId);
    if (namespaceName == null)
      throw new NamespaceNotFoundException(namespaceId, null, "getNamespaceName() failed to find namespace");
    return namespaceName;
  }
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

      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

      if (tableId == null) {
        String namespace = qualify(tableName).getFirst();
        if (Namespaces.getNameToIdMap(instance).containsKey(namespace))
          throw new TableNotFoundException(null, tableName, null);
        else
          throw new NamespaceNotFoundException(null, namespace, null);
      }
    }
    return tableId;
  }
View Full Code Here

  @Override
  public Iterable<Entry<String,String>> getProperties(String tableName) throws TableNotFoundException {
    String namespace = Tables.qualify(tableName).getFirst();
    if (!exists(tableName)) {
      if (!namespaceExists(namespace))
        throw new TableNotFoundException(tableName, new NamespaceNotFoundException(null, namespace, null));
      throw new TableNotFoundException(null, tableName, null);
    }

    Set<Entry<String,String>> props = new HashSet<Entry<String,String>>(acu.namespaces.get(namespace).settings.entrySet());
View Full Code Here

    if (tableName != null && !shellState.getConnector().tableOperations().exists(tableName)) {
      throw new TableNotFoundException(null, tableName, null);
    }
    final String namespace = cl.getOptionValue(namespaceOpt.getOpt());
    if (namespace != null && !shellState.getConnector().namespaceOperations().exists(namespace)) {
      throw new NamespaceNotFoundException(null, namespace, null);
    }
    if (cl.hasOption(deleteOpt.getOpt())) {
      // delete property from table
      String property = cl.getOptionValue(deleteOpt.getOpt());
      if (property.contains("=")) {
View Full Code Here

          log.warn("Unhandled InterruptedException, failing closed for namespace permission check", e);
          return false;
        } catch (KeeperException ex) {
          // not there, throw an informative exception
          if (e.code() == Code.NONODE) {
            throw new NamespaceNotFoundException(null, namespace, "while checking permissions");
          }
          log.warn("Unhandled InterruptedException, failing closed for table permission check", e);
        }
        return false;
      }
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.