Package org.apache.accumulo.core.util.shell

Examples of org.apache.accumulo.core.util.shell.ShellCommandException


      if (className.indexOf('.') < 0) {
        msg.append("; did you use a fully qualified package name?");
      } else {
        msg.append("; class not found.");
      }
      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, msg.toString());
    } catch (InstantiationException e) {
      throw new IllegalArgumentException(e.getMessage());
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException(e.getMessage());
    } catch (ClassCastException e) {
      StringBuilder msg = new StringBuilder(50);
      msg.append(className).append(" loaded successfully but does not implement SortedKeyValueIterator.");
      msg.append(" This class cannot be used with this command.");
      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, msg.toString());
    }

    @SuppressWarnings("unchecked")
    SortedKeyValueIterator<Key,Value> skvi = (SortedKeyValueIterator<Key,Value>) untypedInstance;
    OptionDescriber iterOptions = null;
View Full Code Here


    switch (OptUtil.getAldOpt(cl)) {
      case ADD:
        for (String constraint : cl.getArgs()) {
          if (namespace != null) {
            if (!shellState.getConnector().namespaceOperations().testClassLoad(namespace, constraint, Constraint.class.getName())) {
              throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Servers are unable to load " + constraint + " as type "
                  + Constraint.class.getName());
            }
            i = shellState.getConnector().namespaceOperations().addConstraint(namespace, constraint);
            shellState.getReader().println("Added constraint " + constraint + " to namespace " + namespace + " with number " + i);
          } else if (tableName != null && !tableName.isEmpty()) {
            if (!shellState.getConnector().tableOperations().testClassLoad(tableName, constraint, Constraint.class.getName())) {
              throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Servers are unable to load " + constraint + " as type "
                  + Constraint.class.getName());
            }
            i = shellState.getConnector().tableOperations().addConstraint(tableName, constraint);
            shellState.getReader().println("Added constraint " + constraint + " to table " + tableName + " with number " + i);
          } else {
View Full Code Here

      shellState.getReader().beep();
      shellState.getReader().printNewline();
      shellState.getReader().printString("Sortacus lives!\n");
      shellState.getReader().printNewline();
    } else
      throw new ShellCommandException(ErrorCode.UNRECOGNIZED_COMMAND, getName());
   
    return 0;
  }
View Full Code Here

      classname = VersioningIterator.class.getName();
    else if (cl.hasOption(reqvisTypeOpt.getOpt()))
      classname = ReqVisFilter.class.getName();
   
    if (!shellState.getConnector().instanceOperations().testClassLoad(classname, SortedKeyValueIterator.class.getName()))
      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Servers are unable to load " + classname + " as type "
          + SortedKeyValueIterator.class.getName());
   
    String name = cl.getOptionValue(nameOpt.getOpt(), setUpOptions(shellState.getReader(), classname, options));
   
    String aggregatorClass = options.get("aggregatorClass");
    if (aggregatorClass != null && !shellState.getConnector().instanceOperations().testClassLoad(aggregatorClass, Aggregator.class.getName()))
      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Servers are unable to load " + aggregatorClass + " as type "
          + Aggregator.class.getName());
   
    setTableProperties(cl, shellState, tableName, priority, options, classname, name);
   
    return 0;
View Full Code Here

    } catch (InstantiationException e) {
      throw new IllegalArgumentException(e.getMessage());
    } catch (IllegalAccessException e) {
      throw new IllegalArgumentException(e.getMessage());
    } catch (ClassCastException e) {
      throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Unable to load " + className + " as type " + OptionDescriber.class.getName()
          + "; configure with 'config' instead");
    }
   
    IteratorOptions itopts = skvi.describeOptions();
    if (itopts.getName() == null)
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.util.shell.ShellCommandException

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.